replicas-engine 0.1.1381 → 0.1.1382

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.
@@ -8,12 +8,12 @@ import {
8
8
  listRunningCodexModels,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-MIIZPFTJ.js";
12
- import "./chunk-TBGHIV3Z.js";
13
- import "./chunk-X6FE4J3D.js";
14
- import "./chunk-NRCJOGAV.js";
11
+ } from "./chunk-OU5KG7T5.js";
12
+ import "./chunk-QAB7ES7V.js";
13
+ import "./chunk-HVXTTLCG.js";
14
+ import "./chunk-S2SWUWDJ.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-NKAEG323.js";
16
+ import "./chunk-L6URHRUV.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -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-NRCJOGAV.js";
6
+ } from "./chunk-S2SWUWDJ.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-NKAEG323.js";
9
+ } from "./chunk-L6URHRUV.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.1380";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1381";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -11672,13 +11672,55 @@ var reorderCredentialPoolSchema = z14.object({
11672
11672
  });
11673
11673
 
11674
11674
  // ../shared/src/mothership-events.ts
11675
- import { z as z22 } from "zod";
11675
+ import { z as z23 } from "zod";
11676
11676
 
11677
11677
  // ../shared/src/replicas-mcp.ts
11678
- import { z as z18 } from "zod";
11678
+ import { z as z19 } from "zod";
11679
11679
 
11680
- // ../shared/src/automations/trigger-schemas.ts
11680
+ // ../shared/src/routes/linear.ts
11681
11681
  import { z as z15 } from "zod";
11682
+ var linearSessionMetadataSchema = z15.object({
11683
+ via_mothership: z15.boolean().optional(),
11684
+ attached: z15.boolean().optional(),
11685
+ issue_id: z15.string(),
11686
+ issue_identifier: z15.string(),
11687
+ issue_title: z15.string(),
11688
+ issue_description: z15.string(),
11689
+ issue_url: z15.string(),
11690
+ comment_id: z15.string(),
11691
+ comment_body: z15.string(),
11692
+ triggered_by_id: z15.string().optional(),
11693
+ triggered_by_name: z15.string().optional(),
11694
+ triggered_by_email: z15.string().optional(),
11695
+ linear_workspace_id: z15.string().optional(),
11696
+ creator_id: z15.string().optional(),
11697
+ creator_name: z15.string().optional(),
11698
+ creator_email: z15.string().optional(),
11699
+ assignee_id: z15.string().optional(),
11700
+ assignee_name: z15.string().optional(),
11701
+ assignee_email: z15.string().optional(),
11702
+ issue_state: z15.string().optional(),
11703
+ parent_issue: z15.object({
11704
+ id: z15.string(),
11705
+ identifier: z15.string(),
11706
+ title: z15.string(),
11707
+ description: z15.string().nullable()
11708
+ }).optional(),
11709
+ workspace: z15.object({
11710
+ id: z15.string(),
11711
+ coding_agent: z15.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
11712
+ task_description: z15.string(),
11713
+ created_at: z15.string()
11714
+ }).optional()
11715
+ });
11716
+ var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
11717
+
11718
+ // ../shared/src/automations/linear/index.ts
11719
+ var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
11720
+ var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
11721
+
11722
+ // ../shared/src/automations/trigger-schemas.ts
11723
+ import { z as z16 } from "zod";
11682
11724
 
11683
11725
  // ../shared/src/uuid.ts
11684
11726
  function createUuidFromHex(value) {
@@ -11695,29 +11737,31 @@ function getReviewerLoginsError(event, logins) {
11695
11737
  if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
11696
11738
  return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
11697
11739
  }
11698
- var repositoryTriggerConfigSchema = z15.object({
11699
- event: z15.string(),
11700
- repository_ids: z15.array(z15.string().regex(UUID_RE, "must be a repository id")).optional(),
11701
- group_pr_events: z15.boolean().optional(),
11702
- excluded_actors: z15.array(z15.string()).optional(),
11703
- reviewer_logins: z15.array(z15.string()).optional()
11740
+ var repositoryTriggerConfigSchema = z16.object({
11741
+ event: z16.string(),
11742
+ repository_ids: z16.array(z16.string().regex(UUID_RE, "must be a repository id")).optional(),
11743
+ group_pr_events: z16.boolean().optional(),
11744
+ excluded_actors: z16.array(z16.string()).optional(),
11745
+ reviewer_logins: z16.array(z16.string()).optional()
11704
11746
  });
11705
- var cronTriggerSchema = z15.object({ type: z15.literal("cron"), config: z15.object({ schedule: z15.string(), timezone: z15.string().optional() }) });
11706
- var githubTriggerSchema = z15.object({
11707
- type: z15.literal("github"),
11747
+ var cronTriggerSchema = z16.object({ type: z16.literal("cron"), config: z16.object({ schedule: z16.string(), timezone: z16.string().optional() }) });
11748
+ var githubTriggerSchema = z16.object({
11749
+ type: z16.literal("github"),
11708
11750
  config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
11709
11751
  const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
11710
11752
  if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
11711
11753
  })
11712
11754
  });
11713
- var gitlabTriggerSchema = z15.object({ type: z15.literal("gitlab"), config: repositoryTriggerConfigSchema });
11714
- var automationTriggerSchema = z15.discriminatedUnion("type", [
11755
+ var gitlabTriggerSchema = z16.object({ type: z16.literal("gitlab"), config: repositoryTriggerConfigSchema });
11756
+ var linearTriggerConfigSchema = z16.object({ event: z16.string(), team_ids: z16.array(z16.string()).optional(), state_types: z16.array(z16.enum(LINEAR_STATE_TYPES)).optional() });
11757
+ var automationTriggerSchema = z16.discriminatedUnion("type", [
11715
11758
  cronTriggerSchema,
11716
11759
  githubTriggerSchema,
11717
11760
  gitlabTriggerSchema,
11718
- z15.object({ type: z15.literal("slack"), config: z15.object({ event: z15.string(), channel_ids: z15.array(z15.string()).optional(), group_thread_replies: z15.boolean().optional() }) }),
11719
- z15.object({ type: z15.literal("sentry"), config: z15.object({ event: z15.string(), project_slugs: z15.array(z15.string()).optional(), min_level: z15.string().optional() }) }),
11720
- z15.object({ type: z15.literal("custom"), config: z15.object({}) })
11761
+ z16.object({ type: z16.literal("slack"), config: z16.object({ event: z16.string(), channel_ids: z16.array(z16.string()).optional(), group_thread_replies: z16.boolean().optional() }) }),
11762
+ z16.object({ type: z16.literal("sentry"), config: z16.object({ event: z16.string(), project_slugs: z16.array(z16.string()).optional(), min_level: z16.string().optional() }) }),
11763
+ z16.object({ type: z16.literal("linear"), config: linearTriggerConfigSchema }),
11764
+ z16.object({ type: z16.literal("custom"), config: z16.object({}) })
11721
11765
  ]);
11722
11766
 
11723
11767
  // ../shared/src/automations/types.ts
@@ -11727,40 +11771,40 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
11727
11771
  var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
11728
11772
 
11729
11773
  // ../shared/src/routes/environment.ts
11730
- import { z as z16 } from "zod";
11774
+ import { z as z17 } from "zod";
11731
11775
  var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
11732
- var stringMap = z16.record(z16.string(), z16.string());
11733
- var createEnvironmentMcpRequestSchema = z16.object({
11734
- name: z16.string(),
11735
- transport: z16.enum(ENVIRONMENT_MCP_TRANSPORTS),
11736
- config: z16.union([
11737
- z16.object({ command: z16.string().min(1), args: z16.array(z16.string()).optional(), env: stringMap.optional() }),
11738
- z16.object({ url: z16.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
11776
+ var stringMap = z17.record(z17.string(), z17.string());
11777
+ var createEnvironmentMcpRequestSchema = z17.object({
11778
+ name: z17.string(),
11779
+ transport: z17.enum(ENVIRONMENT_MCP_TRANSPORTS),
11780
+ config: z17.union([
11781
+ z17.object({ command: z17.string().min(1), args: z17.array(z17.string()).optional(), env: stringMap.optional() }),
11782
+ z17.object({ url: z17.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
11739
11783
  ]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
11740
11784
  });
11741
11785
  var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
11742
- var screenPasswordSchema = z16.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11743
- var createEnvironmentDeviceRequestSchema = z16.object({
11744
- name: z16.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11745
- host: z16.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address").describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address."),
11746
- port: z16.number().int().min(1).max(65535).optional().describe("SSH port. Defaults to 22."),
11747
- username: z16.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11786
+ var screenPasswordSchema = z17.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11787
+ var createEnvironmentDeviceRequestSchema = z17.object({
11788
+ name: z17.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11789
+ host: z17.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address").describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address."),
11790
+ port: z17.number().int().min(1).max(65535).optional().describe("SSH port. Defaults to 22."),
11791
+ username: z17.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11748
11792
  screen_password: screenPasswordSchema.optional()
11749
11793
  });
11750
11794
  var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
11751
- screen_password: z16.union([screenPasswordSchema, z16.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11795
+ screen_password: z17.union([screenPasswordSchema, z17.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11752
11796
  });
11753
- var provisionedDeviceSchema = z16.object({
11754
- name: z16.string(),
11755
- host: z16.string(),
11756
- port: z16.number(),
11757
- username: z16.string(),
11758
- private_key: z16.string(),
11759
- screen_password: z16.string().optional()
11797
+ var provisionedDeviceSchema = z17.object({
11798
+ name: z17.string(),
11799
+ host: z17.string(),
11800
+ port: z17.number(),
11801
+ username: z17.string(),
11802
+ private_key: z17.string(),
11803
+ screen_password: z17.string().optional()
11760
11804
  });
11761
11805
 
11762
11806
  // ../shared/src/routes/workspaces.ts
11763
- import { z as z17 } from "zod";
11807
+ import { z as z18 } from "zod";
11764
11808
  var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
11765
11809
  var SUPPORT_EMAIL = "founders@replicas.dev";
11766
11810
  var WORKSPACE_SANDBOX_LOST_MESSAGE = `This workspace can't be resumed because its sandbox was lost on our side. That shouldn't happen, and we're sorry. Please start a new workspace, and email ${SUPPORT_EMAIL} so we can look into it.`;
@@ -11773,16 +11817,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
11773
11817
  activity: "any"
11774
11818
  };
11775
11819
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
11776
- var workspaceExecRequestSchema = z17.object({
11777
- command: z17.string().regex(/\S/, "command is required"),
11778
- timeout_seconds: z17.number().int().min(1).max(50).optional().describe("Default: 30")
11820
+ var workspaceExecRequestSchema = z18.object({
11821
+ command: z18.string().regex(/\S/, "command is required"),
11822
+ timeout_seconds: z18.number().int().min(1).max(50).optional().describe("Default: 30")
11779
11823
  });
11780
- var terminalRtcCandidateSchema = z17.object({ type: z17.literal("rtc-candidate"), candidate: z17.string(), mid: z17.string() });
11781
- var terminalSocketServerMessageSchema = z17.discriminatedUnion("type", [
11782
- z17.object({ type: z17.literal("output"), data: z17.string() }),
11783
- z17.object({ type: z17.literal("rtc-answer"), sdp: z17.string() }),
11824
+ var terminalRtcCandidateSchema = z18.object({ type: z18.literal("rtc-candidate"), candidate: z18.string(), mid: z18.string() });
11825
+ var terminalSocketServerMessageSchema = z18.discriminatedUnion("type", [
11826
+ z18.object({ type: z18.literal("output"), data: z18.string() }),
11827
+ z18.object({ type: z18.literal("rtc-answer"), sdp: z18.string() }),
11784
11828
  terminalRtcCandidateSchema,
11785
- z17.object({ type: z17.literal("rtc-switch") })
11829
+ z18.object({ type: z18.literal("rtc-switch") })
11786
11830
  ]);
11787
11831
  var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
11788
11832
 
@@ -11833,47 +11877,47 @@ var REPLICAS_MCP_TOOLS = {
11833
11877
  deleteChat: "delete_chat",
11834
11878
  listRepositories: "list_repositories"
11835
11879
  };
11836
- var automationToolInputSchema = z18.object({
11837
- name: z18.string().describe("Short automation name."),
11838
- prompt: z18.string().describe("Prompt each automation run starts with."),
11839
- environment_id: z18.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
11840
- triggers: z18.array(automationTriggerSchema).min(1).describe(
11841
- 'One or more triggers. Cron: `{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }`. GitHub: `{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }`.'
11880
+ var automationToolInputSchema = z19.object({
11881
+ name: z19.string().describe("Short automation name."),
11882
+ prompt: z19.string().describe("Prompt each automation run starts with."),
11883
+ environment_id: z19.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
11884
+ triggers: z19.array(automationTriggerSchema).min(1).describe(
11885
+ `One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
11842
11886
  ),
11843
- description: z18.string().optional().describe("One-line summary shown in the dashboard."),
11844
- plan_mode: z18.boolean().optional(),
11845
- goal_mode: z18.boolean().optional(),
11846
- fast_mode: z18.boolean().optional(),
11847
- workspace_lifecycle_policy: z18.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
11887
+ description: z19.string().optional().describe("One-line summary shown in the dashboard."),
11888
+ plan_mode: z19.boolean().optional(),
11889
+ goal_mode: z19.boolean().optional(),
11890
+ fast_mode: z19.boolean().optional(),
11891
+ workspace_lifecycle_policy: z19.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
11848
11892
  "What happens to a run's workspace when the agent finishes. `delete_when_done` (default) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
11849
11893
  )
11850
11894
  });
11851
11895
  var automationCreateToolInputSchema = automationToolInputSchema.extend({
11852
- scope: z18.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
11896
+ scope: z19.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
11853
11897
  });
11854
11898
  var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
11855
- automation_id: z18.string().describe("Automation ID"),
11856
- enabled: z18.boolean().optional(),
11857
- agent_provider: z18.enum(AGENT).nullable().optional(),
11858
- model: z18.string().nullable().optional(),
11859
- thinking_level: z18.enum(VALID_THINKING_LEVELS).nullable().optional(),
11860
- workspace_size: z18.enum(WORKSPACE_SIZES).optional(),
11861
- scope: z18.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
11899
+ automation_id: z19.string().describe("Automation ID"),
11900
+ enabled: z19.boolean().optional(),
11901
+ agent_provider: z19.enum(AGENT).nullable().optional(),
11902
+ model: z19.string().nullable().optional(),
11903
+ thinking_level: z19.enum(VALID_THINKING_LEVELS).nullable().optional(),
11904
+ workspace_size: z19.enum(WORKSPACE_SIZES).optional(),
11905
+ scope: z19.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
11862
11906
  });
11863
- var chatPath = { id: z18.string().describe("Workspace ID"), chat_id: z18.string().describe("Chat ID") };
11907
+ var chatPath = { id: z19.string().describe("Workspace ID"), chat_id: z19.string().describe("Chat ID") };
11864
11908
  var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
11865
- var createChatToolInputSchema = z18.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
11866
- var forkChatToolInputSchema = z18.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
11867
- var renameChatToolInputSchema = z18.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
11868
- var runCommandToolInputSchema = z18.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
11869
- var environmentMcpPath = { environment_id: z18.string().describe("Environment ID") };
11870
- var createEnvironmentMcpToolInputSchema = z18.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
11871
- var updateEnvironmentMcpToolInputSchema = z18.object({
11909
+ var createChatToolInputSchema = z19.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
11910
+ var forkChatToolInputSchema = z19.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
11911
+ var renameChatToolInputSchema = z19.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
11912
+ var runCommandToolInputSchema = z19.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
11913
+ var environmentMcpPath = { environment_id: z19.string().describe("Environment ID") };
11914
+ var createEnvironmentMcpToolInputSchema = z19.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
11915
+ var updateEnvironmentMcpToolInputSchema = z19.object({
11872
11916
  ...environmentMcpPath,
11873
- mcp_id: z18.string().describe("MCP ID"),
11917
+ mcp_id: z19.string().describe("MCP ID"),
11874
11918
  ...updateEnvironmentMcpRequestSchema.shape
11875
11919
  });
11876
- var createEnvironmentDeviceToolInputSchema = z18.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
11920
+ var createEnvironmentDeviceToolInputSchema = z19.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
11877
11921
 
11878
11922
  // ../shared/src/scout.ts
11879
11923
  var SCOUT_SOURCE_TYPES = ["slack", "linear"];
@@ -11909,50 +11953,50 @@ var SCOUT_PRESET_ICONS = [
11909
11953
  ];
11910
11954
 
11911
11955
  // ../shared/src/routes/push.ts
11912
- import { z as z19 } from "zod";
11956
+ import { z as z20 } from "zod";
11913
11957
 
11914
11958
  // ../shared/src/workspace-attention.ts
11915
11959
  var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup"];
11916
11960
  var CHAT_ATTENTION_REASONS = ["question", "blocked"];
11917
11961
 
11918
11962
  // ../shared/src/routes/push.ts
11919
- var registerPushDeviceRequestSchema = z19.discriminatedUnion("platform", [
11920
- z19.object({
11921
- platform: z19.literal("ios"),
11922
- token: z19.string().regex(/^[0-9a-f]{64,200}$/i),
11923
- appId: z19.string().min(1).max(255),
11924
- apnsEnvironment: z19.enum(["sandbox", "production"])
11963
+ var registerPushDeviceRequestSchema = z20.discriminatedUnion("platform", [
11964
+ z20.object({
11965
+ platform: z20.literal("ios"),
11966
+ token: z20.string().regex(/^[0-9a-f]{64,200}$/i),
11967
+ appId: z20.string().min(1).max(255),
11968
+ apnsEnvironment: z20.enum(["sandbox", "production"])
11925
11969
  }),
11926
- z19.object({
11927
- platform: z19.literal("android"),
11928
- token: z19.string().min(1).max(4096),
11929
- appId: z19.string().min(1).max(255)
11970
+ z20.object({
11971
+ platform: z20.literal("android"),
11972
+ token: z20.string().min(1).max(4096),
11973
+ appId: z20.string().min(1).max(255)
11930
11974
  })
11931
11975
  ]);
11932
11976
  var PUSH_HOLD_MINUTES = 5;
11933
- var recordPushActivityRequestSchema = z19.object({
11934
- organizationId: z19.string().uuid(),
11977
+ var recordPushActivityRequestSchema = z20.object({
11978
+ organizationId: z20.string().uuid(),
11935
11979
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
11936
- idleSeconds: z19.number().min(0).optional(),
11937
- seenWorkspaceIds: z19.array(z19.string().uuid()).max(20)
11980
+ idleSeconds: z20.number().min(0).optional(),
11981
+ seenWorkspaceIds: z20.array(z20.string().uuid()).max(20)
11938
11982
  });
11939
11983
  var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
11940
- var pushQuestionSchema = z19.object({ id: z19.string().max(64), options: z19.array(z19.object({ id: z19.string().max(64), label: z19.string().min(1).max(60) })).min(1).max(4) });
11941
- var pushNotificationDataSchema = z19.object({
11942
- organizationId: z19.string(),
11943
- workspaceId: z19.string(),
11944
- chatId: z19.string().nullable(),
11945
- kind: z19.enum(PUSH_NOTIFICATION_KINDS),
11946
- completedAt: z19.string(),
11947
- toolRequestId: z19.string().optional(),
11984
+ var pushQuestionSchema = z20.object({ id: z20.string().max(64), options: z20.array(z20.object({ id: z20.string().max(64), label: z20.string().min(1).max(60) })).min(1).max(4) });
11985
+ var pushNotificationDataSchema = z20.object({
11986
+ organizationId: z20.string(),
11987
+ workspaceId: z20.string(),
11988
+ chatId: z20.string().nullable(),
11989
+ kind: z20.enum(PUSH_NOTIFICATION_KINDS),
11990
+ completedAt: z20.string(),
11991
+ toolRequestId: z20.string().optional(),
11948
11992
  question: pushQuestionSchema.optional()
11949
11993
  });
11950
- var registerLiveActivityRequestSchema = z19.object({
11951
- deviceId: z19.string().uuid(),
11952
- workspaceId: z19.string().uuid(),
11953
- chatId: z19.string().min(1).max(100),
11994
+ var registerLiveActivityRequestSchema = z20.object({
11995
+ deviceId: z20.string().uuid(),
11996
+ workspaceId: z20.string().uuid(),
11997
+ chatId: z20.string().min(1).max(100),
11954
11998
  /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
11955
- pushToken: z19.string().regex(/^[0-9a-f]{64,400}$/i).optional()
11999
+ pushToken: z20.string().regex(/^[0-9a-f]{64,400}$/i).optional()
11956
12000
  });
11957
12001
 
11958
12002
  // ../shared/src/default-skills/replicas-agent/abilities/computer.ts
@@ -12234,7 +12278,7 @@ var DOCKER_ABILITY = {
12234
12278
  };
12235
12279
 
12236
12280
  // ../shared/src/routes/environment-setups.ts
12237
- import { z as z20 } from "zod";
12281
+ import { z as z21 } from "zod";
12238
12282
  var ENVIRONMENT_SETUP_STEPS = [
12239
12283
  { key: "understand", label: "Understand the codebase" },
12240
12284
  { key: "install", label: "Install dependencies and run the app" },
@@ -12267,17 +12311,17 @@ var ENVIRONMENT_SETUP_LIMITS = {
12267
12311
  repositories: 20
12268
12312
  };
12269
12313
  var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
12270
- var text2 = (max) => max === void 0 ? z20.string().trim() : z20.string().trim().max(max);
12314
+ var text2 = (max) => max === void 0 ? z21.string().trim() : z21.string().trim().max(max);
12271
12315
  var requiredText = (max) => text2(max).min(1, "must not be empty");
12272
12316
  var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
12273
12317
  var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
12274
- var list = (item, max) => max === void 0 ? z20.array(item) : z20.array(item).max(max);
12318
+ var list = (item, max) => max === void 0 ? z21.array(item) : z21.array(item).max(max);
12275
12319
  var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
12276
12320
  function isEnvironmentSetupAuthoredTriggerType(type) {
12277
12321
  return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
12278
12322
  }
12279
- var proposalTriggerSchema = z20.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
12280
- var existingTriggerSchema = z20.custom(
12323
+ var proposalTriggerSchema = z21.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
12324
+ var existingTriggerSchema = z21.custom(
12281
12325
  (value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
12282
12326
  "must be an automation trigger"
12283
12327
  );
@@ -12285,17 +12329,17 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
12285
12329
  (trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
12286
12330
  );
12287
12331
  function automationSchema(limits) {
12288
- const authored = z20.object({
12332
+ const authored = z21.object({
12289
12333
  name: text2(limits.nameChars),
12290
12334
  description: text2(limits.descriptionChars),
12291
12335
  prompt: text2(limits.automationPromptChars),
12292
12336
  triggers: list(proposalTriggerSchema, limits.automationTriggers)
12293
12337
  });
12294
- const updated = authored.extend({ triggers: list(z20.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
12295
- return z20.object({
12338
+ const updated = authored.extend({ triggers: list(z21.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
12339
+ return z21.object({
12296
12340
  key: requiredText(limits.automationKeyChars),
12297
- action: z20.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
12298
- automation_id: z20.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
12341
+ action: z21.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
12342
+ automation_id: z21.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
12299
12343
  name: text2().default(""),
12300
12344
  description: optionalText2().transform((value) => value ?? ""),
12301
12345
  prompt: text2().default(""),
@@ -12318,7 +12362,7 @@ function automationSchema(limits) {
12318
12362
  const content = (automation.action === "update" ? updated : authored).safeParse(automation);
12319
12363
  if (content.success) return { ...automation, ...content.data };
12320
12364
  for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
12321
- return z20.NEVER;
12365
+ return z21.NEVER;
12322
12366
  });
12323
12367
  }
12324
12368
  function automationListSchema(limits) {
@@ -12336,7 +12380,7 @@ function automationListSchema(limits) {
12336
12380
  });
12337
12381
  }
12338
12382
  function environmentSchema(limits) {
12339
- return z20.object({
12383
+ return z21.object({
12340
12384
  name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
12341
12385
  description: clearableText(limits.descriptionChars),
12342
12386
  system_prompt: clearableText(limits.systemPromptChars),
@@ -12345,41 +12389,41 @@ function environmentSchema(limits) {
12345
12389
  });
12346
12390
  }
12347
12391
  function proposalSchema(limits) {
12348
- return z20.object({
12392
+ return z21.object({
12349
12393
  summary: requiredText(limits.summaryChars),
12350
12394
  stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
12351
12395
  environment: environmentSchema(limits),
12352
- variables: list(z20.object({
12353
- key: z20.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
12396
+ variables: list(z21.object({
12397
+ key: z21.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
12354
12398
  description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
12355
- required: z20.boolean().default(false)
12399
+ required: z21.boolean().default(false)
12356
12400
  }), limits.variables).default([]),
12357
12401
  automations: automationListSchema(limits),
12358
- verification: list(z20.object({
12402
+ verification: list(z21.object({
12359
12403
  label: requiredText(limits.nameChars),
12360
- status: z20.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
12404
+ status: z21.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
12361
12405
  detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
12362
12406
  }), limits.verificationItems).default([]),
12363
- media: list(z20.object({
12364
- media_id: z20.string().regex(UUID_RE, "must be a media id"),
12407
+ media: list(z21.object({
12408
+ media_id: z21.string().regex(UUID_RE, "must be a media id"),
12365
12409
  title: requiredText(limits.nameChars)
12366
12410
  }), limits.mediaItems).default([])
12367
12411
  });
12368
12412
  }
12369
12413
  var environmentSetupProposalSchema = proposalSchema({});
12370
12414
  var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
12371
- var environmentSetupRunStateSchema = z20.object({
12372
- status: z20.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
12373
- steps: z20.partialRecord(z20.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z20.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
12415
+ var environmentSetupRunStateSchema = z21.object({
12416
+ status: z21.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
12417
+ steps: z21.partialRecord(z21.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z21.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
12374
12418
  proposal: environmentSetupProposalSchema.nullable().default(null),
12375
- applied: z20.object({
12376
- applied_at: z20.string(),
12377
- automation_ids: z20.array(z20.string())
12419
+ applied: z21.object({
12420
+ applied_at: z21.string(),
12421
+ automation_ids: z21.array(z21.string())
12378
12422
  }).nullable().default(null)
12379
12423
  });
12380
- var applyEnvironmentSetupRequestSchema = z20.object({
12424
+ var applyEnvironmentSetupRequestSchema = z21.object({
12381
12425
  environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
12382
- variables: list(z20.object({ key: z20.string().regex(VARIABLE_KEY_RE), value: z20.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
12426
+ variables: list(z21.object({ key: z21.string().regex(VARIABLE_KEY_RE), value: z21.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
12383
12427
  automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
12384
12428
  });
12385
12429
 
@@ -12854,7 +12898,7 @@ var GITLAB_ABILITY = {
12854
12898
  };
12855
12899
 
12856
12900
  // ../shared/src/routes/compute.ts
12857
- import { z as z21 } from "zod";
12901
+ import { z as z22 } from "zod";
12858
12902
  var COMPUTE_SANDBOX_KINDS = ["gpu"];
12859
12903
  var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
12860
12904
  var DEFAULT_GPU_TYPE = "L4";
@@ -12871,27 +12915,27 @@ var COMPUTE_SANDBOX_LIMITS = {
12871
12915
  maxIdleTimeoutMinutes: 60,
12872
12916
  maxTransferBytes: 1024 ** 3
12873
12917
  };
12874
- var computeEnvSchema = z21.record(z21.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z21.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
12875
- var createComputeSandboxRequestSchema = z21.object({
12876
- kind: z21.enum(COMPUTE_SANDBOX_KINDS),
12877
- gpu: z21.string().trim().optional(),
12878
- image: z21.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
12879
- timeoutMinutes: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
12880
- idleTimeoutMinutes: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
12881
- ports: z21.array(z21.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
12918
+ var computeEnvSchema = z22.record(z22.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z22.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
12919
+ var createComputeSandboxRequestSchema = z22.object({
12920
+ kind: z22.enum(COMPUTE_SANDBOX_KINDS),
12921
+ gpu: z22.string().trim().optional(),
12922
+ image: z22.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
12923
+ timeoutMinutes: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
12924
+ idleTimeoutMinutes: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
12925
+ ports: z22.array(z22.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
12882
12926
  env: computeEnvSchema.optional()
12883
12927
  });
12884
- var computeExecRequestSchema = z21.object({
12885
- command: z21.string().min(1).max(1e5),
12886
- workdir: z21.string().min(1).max(4096).optional(),
12928
+ var computeExecRequestSchema = z22.object({
12929
+ command: z22.string().min(1).max(1e5),
12930
+ workdir: z22.string().min(1).max(4096).optional(),
12887
12931
  env: computeEnvSchema.optional(),
12888
- detach: z21.boolean().optional()
12932
+ detach: z22.boolean().optional()
12889
12933
  });
12890
- var computeUploadRequestSchema = z21.object({
12891
- size: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
12934
+ var computeUploadRequestSchema = z22.object({
12935
+ size: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
12892
12936
  });
12893
- var computeTransferPathSchema = z21.object({
12894
- path: z21.string().min(1).max(4096).optional()
12937
+ var computeTransferPathSchema = z22.object({
12938
+ path: z22.string().min(1).max(4096).optional()
12895
12939
  });
12896
12940
 
12897
12941
  // ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
@@ -14575,18 +14619,18 @@ var MOTHERSHIP_EVENT_KINDS = ["finished", "ready", "needs_attention", "approved"
14575
14619
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
14576
14620
  var MOTHERSHIP_EVENT_TYPE = "multitask-event";
14577
14621
  var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
14578
- var mothershipEventSchema = z22.object({
14579
- id: z22.string(),
14580
- at: z22.string(),
14581
- kind: z22.enum(MOTHERSHIP_EVENT_KINDS),
14582
- agentId: z22.string(),
14583
- agentName: z22.string(),
14584
- summary: z22.string(),
14585
- detail: z22.string().optional(),
14622
+ var mothershipEventSchema = z23.object({
14623
+ id: z23.string(),
14624
+ at: z23.string(),
14625
+ kind: z23.enum(MOTHERSHIP_EVENT_KINDS),
14626
+ agentId: z23.string(),
14627
+ agentName: z23.string(),
14628
+ summary: z23.string(),
14629
+ detail: z23.string().optional(),
14586
14630
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
14587
- chatId: z22.string().optional(),
14631
+ chatId: z23.string().optional(),
14588
14632
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
14589
- noticed: z22.boolean().optional()
14633
+ noticed: z23.boolean().optional()
14590
14634
  });
14591
14635
  var TAG = "multitask_event";
14592
14636
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
@@ -15604,7 +15648,7 @@ function subagentChatId(message2) {
15604
15648
  }
15605
15649
 
15606
15650
  // ../shared/src/learned-skills.ts
15607
- import { z as z23 } from "zod";
15651
+ import { z as z24 } from "zod";
15608
15652
 
15609
15653
  // ../shared/src/frontmatter.ts
15610
15654
  import { parse as parseYaml } from "yaml";
@@ -15627,20 +15671,20 @@ function parseFrontmatter(content) {
15627
15671
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
15628
15672
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
15629
15673
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
15630
- var learnedSkillsManifestSchema = z23.object({
15631
- skills: z23.array(z23.object({ name: z23.string(), sha256: z23.string() }))
15674
+ var learnedSkillsManifestSchema = z24.object({
15675
+ skills: z24.array(z24.object({ name: z24.string(), sha256: z24.string() }))
15632
15676
  });
15633
- var dreamVerdictChecksSchema = z23.object({
15634
- repeatable: z23.boolean(),
15635
- realInstruction: z23.boolean(),
15636
- noContradiction: z23.boolean(),
15637
- formatExact: z23.boolean(),
15638
- humanOnly: z23.boolean(),
15639
- actionable: z23.boolean(),
15640
- durable: z23.boolean()
15677
+ var dreamVerdictChecksSchema = z24.object({
15678
+ repeatable: z24.boolean(),
15679
+ realInstruction: z24.boolean(),
15680
+ noContradiction: z24.boolean(),
15681
+ formatExact: z24.boolean(),
15682
+ humanOnly: z24.boolean(),
15683
+ actionable: z24.boolean(),
15684
+ durable: z24.boolean()
15641
15685
  });
15642
15686
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
15643
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z23.boolean(), reason: z23.string() });
15687
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z24.boolean(), reason: z24.string() });
15644
15688
  var learnedSkillFormatInstruction = (speaker) => `Write a SKILL.md whose frontmatter has a kebab-case \`name\` and a short \`description\` that starts with "Use when" and names the situations it applies to; the body records only what ${speaker} actually said, restated as a direct instruction, usually one to three lines. Every line of a learning is loaded into future sessions, so leave out anything an agent could infer on its own: no headings, explanations, rules, or examples unless ${speaker} stated those specifics themselves. For "from now on, use Conventional Commits", the body is just "Use Conventional Commits for every commit message and PR title."`;
15645
15689
 
15646
15690
  // ../shared/src/user-message-matching.ts
@@ -19241,10 +19285,10 @@ function hasChatStarted(chat) {
19241
19285
  }
19242
19286
 
19243
19287
  // ../shared/src/routes/billing.ts
19244
- import { z as z24 } from "zod";
19288
+ import { z as z25 } from "zod";
19245
19289
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
19246
- var usageLimitCentsSchema = z24.number().int().min(100).max(1e8);
19247
- var sourceLimitsCentsSchema = z24.partialRecord(z24.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19290
+ var usageLimitCentsSchema = z25.number().int().min(100).max(1e8);
19291
+ var sourceLimitsCentsSchema = z25.partialRecord(z25.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19248
19292
 
19249
19293
  // ../shared/src/routes/codex.ts
19250
19294
  var CODEX_AUTH_ENV_KEYS = [
@@ -19398,7 +19442,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
19398
19442
  };
19399
19443
 
19400
19444
  // ../shared/src/routes/command-protection.ts
19401
- import { z as z25 } from "zod";
19445
+ import { z as z26 } from "zod";
19402
19446
 
19403
19447
  // ../shared/src/git-invocations.ts
19404
19448
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -19489,27 +19533,27 @@ function findCheckoutTarget(args) {
19489
19533
  }
19490
19534
 
19491
19535
  // ../shared/src/routes/command-protection.ts
19492
- var commandProtectionRepoStateSchema = z25.object({
19493
- branch: z25.string().nullable(),
19494
- defaultBranch: z25.string().nullable(),
19495
- pushBranch: z25.string().nullable(),
19496
- pushConfig: z25.string().nullable(),
19497
- headMessage: z25.string().nullable(),
19498
- mergeInProgress: z25.boolean().optional()
19536
+ var commandProtectionRepoStateSchema = z26.object({
19537
+ branch: z26.string().nullable(),
19538
+ defaultBranch: z26.string().nullable(),
19539
+ pushBranch: z26.string().nullable(),
19540
+ pushConfig: z26.string().nullable(),
19541
+ headMessage: z26.string().nullable(),
19542
+ mergeInProgress: z26.boolean().optional()
19499
19543
  });
19500
- var commandProtectionEvaluateRequestSchema = z25.object({
19501
- provider: z25.enum(["claude", "codex", "cursor", "opencode", "pi"]),
19502
- source: z25.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
19503
- toolName: z25.string(),
19504
- toolInput: z25.unknown(),
19505
- command: z25.string().nullish(),
19506
- cwd: z25.string().nullish(),
19507
- toolUseId: z25.string().nullish(),
19544
+ var commandProtectionEvaluateRequestSchema = z26.object({
19545
+ provider: z26.enum(["claude", "codex", "cursor", "opencode", "pi"]),
19546
+ source: z26.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
19547
+ toolName: z26.string(),
19548
+ toolInput: z26.unknown(),
19549
+ command: z26.string().nullish(),
19550
+ cwd: z26.string().nullish(),
19551
+ toolUseId: z26.string().nullish(),
19508
19552
  // Read by the engine before the command runs, keyed by absolute path, so the
19509
19553
  // policy can see branches and commit messages the command text only references.
19510
- gitContext: z25.object({
19511
- repos: z25.record(z25.string(), commandProtectionRepoStateSchema),
19512
- messageFiles: z25.record(z25.string(), z25.string())
19554
+ gitContext: z26.object({
19555
+ repos: z26.record(z26.string(), commandProtectionRepoStateSchema),
19556
+ messageFiles: z26.record(z26.string(), z26.string())
19513
19557
  }).optional()
19514
19558
  });
19515
19559
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -19728,43 +19772,6 @@ function shouldRefreshPullRequests(toolName, toolInput) {
19728
19772
  ].some((pattern) => pattern.test(command)) || /\b(?:gh\s+api|glab\s+api|curl)\b/.test(command) && /(?:-x|--method|--request)[\s=]+['"]?post\b/.test(command) && /\/(?:pulls|merge_requests)\b/.test(command);
19729
19773
  }
19730
19774
 
19731
- // ../shared/src/routes/linear.ts
19732
- import { z as z26 } from "zod";
19733
- var linearSessionMetadataSchema = z26.object({
19734
- via_mothership: z26.boolean().optional(),
19735
- attached: z26.boolean().optional(),
19736
- issue_id: z26.string(),
19737
- issue_identifier: z26.string(),
19738
- issue_title: z26.string(),
19739
- issue_description: z26.string(),
19740
- issue_url: z26.string(),
19741
- comment_id: z26.string(),
19742
- comment_body: z26.string(),
19743
- triggered_by_id: z26.string().optional(),
19744
- triggered_by_name: z26.string().optional(),
19745
- triggered_by_email: z26.string().optional(),
19746
- linear_workspace_id: z26.string().optional(),
19747
- creator_id: z26.string().optional(),
19748
- creator_name: z26.string().optional(),
19749
- creator_email: z26.string().optional(),
19750
- assignee_id: z26.string().optional(),
19751
- assignee_name: z26.string().optional(),
19752
- assignee_email: z26.string().optional(),
19753
- issue_state: z26.string().optional(),
19754
- parent_issue: z26.object({
19755
- id: z26.string(),
19756
- identifier: z26.string(),
19757
- title: z26.string(),
19758
- description: z26.string().nullable()
19759
- }).optional(),
19760
- workspace: z26.object({
19761
- id: z26.string(),
19762
- coding_agent: z26.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
19763
- task_description: z26.string(),
19764
- created_at: z26.string()
19765
- }).optional()
19766
- });
19767
-
19768
19775
  // ../shared/src/routes/scout.ts
19769
19776
  import { z as z27 } from "zod";
19770
19777
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
@@ -6,7 +6,7 @@ import {
6
6
  getOriginDefaultBranch,
7
7
  monolithRequest,
8
8
  runGitCommand
9
- } from "./chunk-TBGHIV3Z.js";
9
+ } from "./chunk-QAB7ES7V.js";
10
10
  import {
11
11
  extractCommandProtectionCommandText,
12
12
  findCommandProtectionGitLookups,
@@ -14,7 +14,7 @@ import {
14
14
  findPrMergeSignals,
15
15
  findScoutRepoWriteSignals,
16
16
  parseCommandProtectionRequest
17
- } from "./chunk-NKAEG323.js";
17
+ } from "./chunk-L6URHRUV.js";
18
18
 
19
19
  // src/services/command-protection-service.ts
20
20
  import { readFile, stat } from "fs/promises";
@@ -10,15 +10,15 @@ import {
10
10
  resolveDiffBase,
11
11
  runGitCommand,
12
12
  setAgentCredentialSnapshot
13
- } from "./chunk-TBGHIV3Z.js";
13
+ } from "./chunk-QAB7ES7V.js";
14
14
  import {
15
15
  AppServerProcess,
16
16
  buildCodexAgentEnv
17
- } from "./chunk-X6FE4J3D.js";
17
+ } from "./chunk-HVXTTLCG.js";
18
18
  import {
19
19
  SUBPROCESS_MAX_BUFFER,
20
20
  execFileAsync
21
- } from "./chunk-NRCJOGAV.js";
21
+ } from "./chunk-S2SWUWDJ.js";
22
22
  import {
23
23
  isRecord
24
24
  } from "./chunk-UZSNFLDQ.js";
@@ -56,7 +56,7 @@ import {
56
56
  resolveOpenAICompatibleModelsUrl,
57
57
  splitMothershipInstructions,
58
58
  withTimeout
59
- } from "./chunk-NKAEG323.js";
59
+ } from "./chunk-L6URHRUV.js";
60
60
 
61
61
  // src/managers/codex-token-manager.ts
62
62
  import { promises as fs } from "fs";
@@ -319,7 +319,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
319
319
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
320
320
  await this.applyCredentialsResponse(data);
321
321
  setAgentCredentialSnapshot("codex", data);
322
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WKL27NNV.js");
322
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-6WFOKJ54.js");
323
323
  await restartCodexAspHostIfRunning2();
324
324
  });
325
325
  await this.start(true);
@@ -341,7 +341,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
341
341
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
342
342
  await this.applyCredentialsResponse(data);
343
343
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
344
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WKL27NNV.js");
344
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-6WFOKJ54.js");
345
345
  await restartCodexAspHostIfRunning2();
346
346
  }
347
347
  setAgentCredentialSnapshot("codex", data);
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-NRCJOGAV.js";
7
+ } from "./chunk-S2SWUWDJ.js";
8
8
  import {
9
9
  isRecord as isRecord2
10
10
  } from "./chunk-UZSNFLDQ.js";
@@ -21,7 +21,7 @@ import {
21
21
  provisionedDeviceSchema,
22
22
  readReplicasRuntimeEnv,
23
23
  serializePosixEnvFile
24
- } from "./chunk-NKAEG323.js";
24
+ } from "./chunk-L6URHRUV.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -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-NKAEG323.js";
6
+ } from "./chunk-L6URHRUV.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -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-X6FE4J3D.js";
6
+ } from "./chunk-HVXTTLCG.js";
7
7
  import {
8
8
  ASTER_BASE_URL,
9
9
  ASTER_PROVIDER,
@@ -15,7 +15,7 @@ import {
15
15
  isRecord,
16
16
  readOllamaAuthEnv,
17
17
  readOpenAICompatibleAuthEnv
18
- } from "./chunk-NKAEG323.js";
18
+ } from "./chunk-L6URHRUV.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-NKAEG323.js";
8
+ } from "./chunk-L6URHRUV.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -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-S5THBALD.js";
7
- import "./chunk-TBGHIV3Z.js";
8
- import "./chunk-NRCJOGAV.js";
6
+ } from "./chunk-LCDGWVEY.js";
7
+ import "./chunk-QAB7ES7V.js";
8
+ import "./chunk-S2SWUWDJ.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-NKAEG323.js";
12
+ import "./chunk-L6URHRUV.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -14,12 +14,12 @@ import {
14
14
  recoverCompletedTurn,
15
15
  spawnMuseMsp,
16
16
  startMuseSession
17
- } from "./chunk-PKLS5ZRA.js";
17
+ } from "./chunk-S643QUYK.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-X6FE4J3D.js";
22
- import "./chunk-NRCJOGAV.js";
21
+ } from "./chunk-HVXTTLCG.js";
22
+ import "./chunk-S2SWUWDJ.js";
23
23
  import {
24
24
  AGENT,
25
25
  OPENCODE_GO_PROVIDER,
@@ -29,7 +29,7 @@ import {
29
29
  headlessAgentUsagePath,
30
30
  isRecord,
31
31
  withTimeout
32
- } from "./chunk-NKAEG323.js";
32
+ } from "./chunk-L6URHRUV.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // 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-S5THBALD.js";
30
+ } from "./chunk-LCDGWVEY.js";
31
31
  import {
32
32
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
33
33
  AGENT_MESSAGE_DELTA_METHOD,
@@ -65,10 +65,10 @@ import {
65
65
  spawnMuseMsp,
66
66
  startMuseSession,
67
67
  uuidV7
68
- } from "./chunk-PKLS5ZRA.js";
68
+ } from "./chunk-S643QUYK.js";
69
69
  import {
70
70
  publishedPullRequestUrls
71
- } from "./chunk-O6GASNB3.js";
71
+ } from "./chunk-YYICSSFI.js";
72
72
  import {
73
73
  ACCOUNT_RATE_LIMITS_READ_METHOD,
74
74
  AsyncLock,
@@ -143,7 +143,7 @@ import {
143
143
  timestampFromSeconds,
144
144
  upsertCredentialFileLines,
145
145
  writeSecureCredentialFile
146
- } from "./chunk-MIIZPFTJ.js";
146
+ } from "./chunk-OU5KG7T5.js";
147
147
  import {
148
148
  ENGINE_ENV,
149
149
  monolithRequest,
@@ -153,15 +153,15 @@ import {
153
153
  resolveDiffBase,
154
154
  setAgentCredentialSnapshot,
155
155
  setLinearSessionId
156
- } from "./chunk-TBGHIV3Z.js";
156
+ } from "./chunk-QAB7ES7V.js";
157
157
  import {
158
158
  getCodexModelProvider
159
- } from "./chunk-X6FE4J3D.js";
159
+ } from "./chunk-HVXTTLCG.js";
160
160
  import {
161
161
  SUBPROCESS_MAX_BUFFER,
162
162
  execAsync,
163
163
  execFileAsync
164
- } from "./chunk-NRCJOGAV.js";
164
+ } from "./chunk-S2SWUWDJ.js";
165
165
  import {
166
166
  isRecord as isRecord2
167
167
  } from "./chunk-UZSNFLDQ.js";
@@ -423,7 +423,7 @@ import {
423
423
  workspaceTokenRequestSchema,
424
424
  workspaceTokenResponseSchema,
425
425
  wrapInTag
426
- } from "./chunk-NKAEG323.js";
426
+ } from "./chunk-L6URHRUV.js";
427
427
  import {
428
428
  cloneMcpConfig,
429
429
  ensureCompatibilityImports,
@@ -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-O6GASNB3.js";
6
+ } from "./chunk-YYICSSFI.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-NKAEG323.js";
12
+ } from "./chunk-L6URHRUV.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -11,7 +11,7 @@ import {
11
11
  spawnSubagentRequestSchema,
12
12
  subagentResponseSchema,
13
13
  waitSubagentRequestSchema
14
- } from "./chunk-NKAEG323.js";
14
+ } from "./chunk-L6URHRUV.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1381",
3
+ "version": "0.1.1382",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",