replicas-engine 0.1.1381 → 0.1.1383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/{asp-host-WKL27NNV.js → asp-host-T7MT6V7M.js} +5 -5
- package/dist/src/{chunk-X6FE4J3D.js → chunk-2OI7NWKG.js} +3 -3
- package/dist/src/{chunk-PKLS5ZRA.js → chunk-FASCQRLF.js} +2 -2
- package/dist/src/{chunk-NKAEG323.js → chunk-L6URHRUV.js} +238 -231
- package/dist/src/{chunk-S5THBALD.js → chunk-LCDGWVEY.js} +2 -2
- package/dist/src/{chunk-MIIZPFTJ.js → chunk-LWTNMRAC.js} +6 -6
- package/dist/src/{chunk-TBGHIV3Z.js → chunk-QAB7ES7V.js} +2 -2
- package/dist/src/{chunk-NRCJOGAV.js → chunk-S2SWUWDJ.js} +1 -1
- package/dist/src/{chunk-O6GASNB3.js → chunk-YYICSSFI.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +8 -8
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-LWTNMRAC.js";
|
|
12
|
+
import "./chunk-QAB7ES7V.js";
|
|
13
|
+
import "./chunk-2OI7NWKG.js";
|
|
14
|
+
import "./chunk-S2SWUWDJ.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
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-
|
|
6
|
+
} from "./chunk-S2SWUWDJ.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
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.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1383";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-2OI7NWKG.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-
|
|
18
|
+
} from "./chunk-L6URHRUV.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -11672,13 +11672,55 @@ var reorderCredentialPoolSchema = z14.object({
|
|
|
11672
11672
|
});
|
|
11673
11673
|
|
|
11674
11674
|
// ../shared/src/mothership-events.ts
|
|
11675
|
-
import { z as
|
|
11675
|
+
import { z as z23 } from "zod";
|
|
11676
11676
|
|
|
11677
11677
|
// ../shared/src/replicas-mcp.ts
|
|
11678
|
-
import { z as
|
|
11678
|
+
import { z as z19 } from "zod";
|
|
11679
11679
|
|
|
11680
|
-
// ../shared/src/
|
|
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 =
|
|
11699
|
-
event:
|
|
11700
|
-
repository_ids:
|
|
11701
|
-
group_pr_events:
|
|
11702
|
-
excluded_actors:
|
|
11703
|
-
reviewer_logins:
|
|
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 =
|
|
11706
|
-
var githubTriggerSchema =
|
|
11707
|
-
type:
|
|
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 =
|
|
11714
|
-
var
|
|
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
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
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
|
|
11774
|
+
import { z as z17 } from "zod";
|
|
11731
11775
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
11732
|
-
var stringMap =
|
|
11733
|
-
var createEnvironmentMcpRequestSchema =
|
|
11734
|
-
name:
|
|
11735
|
-
transport:
|
|
11736
|
-
config:
|
|
11737
|
-
|
|
11738
|
-
|
|
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 =
|
|
11743
|
-
var createEnvironmentDeviceRequestSchema =
|
|
11744
|
-
name:
|
|
11745
|
-
host:
|
|
11746
|
-
port:
|
|
11747
|
-
username:
|
|
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:
|
|
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 =
|
|
11754
|
-
name:
|
|
11755
|
-
host:
|
|
11756
|
-
port:
|
|
11757
|
-
username:
|
|
11758
|
-
private_key:
|
|
11759
|
-
screen_password:
|
|
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
|
|
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 =
|
|
11777
|
-
command:
|
|
11778
|
-
timeout_seconds:
|
|
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 =
|
|
11781
|
-
var terminalSocketServerMessageSchema =
|
|
11782
|
-
|
|
11783
|
-
|
|
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
|
-
|
|
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 =
|
|
11837
|
-
name:
|
|
11838
|
-
prompt:
|
|
11839
|
-
environment_id:
|
|
11840
|
-
triggers:
|
|
11841
|
-
|
|
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:
|
|
11844
|
-
plan_mode:
|
|
11845
|
-
goal_mode:
|
|
11846
|
-
fast_mode:
|
|
11847
|
-
workspace_lifecycle_policy:
|
|
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:
|
|
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:
|
|
11856
|
-
enabled:
|
|
11857
|
-
agent_provider:
|
|
11858
|
-
model:
|
|
11859
|
-
thinking_level:
|
|
11860
|
-
workspace_size:
|
|
11861
|
-
scope:
|
|
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:
|
|
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 =
|
|
11866
|
-
var forkChatToolInputSchema =
|
|
11867
|
-
var renameChatToolInputSchema =
|
|
11868
|
-
var runCommandToolInputSchema =
|
|
11869
|
-
var environmentMcpPath = { environment_id:
|
|
11870
|
-
var createEnvironmentMcpToolInputSchema =
|
|
11871
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
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:
|
|
11917
|
+
mcp_id: z19.string().describe("MCP ID"),
|
|
11874
11918
|
...updateEnvironmentMcpRequestSchema.shape
|
|
11875
11919
|
});
|
|
11876
|
-
var createEnvironmentDeviceToolInputSchema =
|
|
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
|
|
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 =
|
|
11920
|
-
|
|
11921
|
-
platform:
|
|
11922
|
-
token:
|
|
11923
|
-
appId:
|
|
11924
|
-
apnsEnvironment:
|
|
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
|
-
|
|
11927
|
-
platform:
|
|
11928
|
-
token:
|
|
11929
|
-
appId:
|
|
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 =
|
|
11934
|
-
organizationId:
|
|
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:
|
|
11937
|
-
seenWorkspaceIds:
|
|
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 =
|
|
11941
|
-
var pushNotificationDataSchema =
|
|
11942
|
-
organizationId:
|
|
11943
|
-
workspaceId:
|
|
11944
|
-
chatId:
|
|
11945
|
-
kind:
|
|
11946
|
-
completedAt:
|
|
11947
|
-
toolRequestId:
|
|
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 =
|
|
11951
|
-
deviceId:
|
|
11952
|
-
workspaceId:
|
|
11953
|
-
chatId:
|
|
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:
|
|
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
|
|
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 ?
|
|
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 ?
|
|
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 =
|
|
12280
|
-
var existingTriggerSchema =
|
|
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 =
|
|
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(
|
|
12295
|
-
return
|
|
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:
|
|
12298
|
-
automation_id:
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
12353
|
-
key:
|
|
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:
|
|
12399
|
+
required: z21.boolean().default(false)
|
|
12356
12400
|
}), limits.variables).default([]),
|
|
12357
12401
|
automations: automationListSchema(limits),
|
|
12358
|
-
verification: list(
|
|
12402
|
+
verification: list(z21.object({
|
|
12359
12403
|
label: requiredText(limits.nameChars),
|
|
12360
|
-
status:
|
|
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(
|
|
12364
|
-
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 =
|
|
12372
|
-
status:
|
|
12373
|
-
steps:
|
|
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:
|
|
12376
|
-
applied_at:
|
|
12377
|
-
automation_ids:
|
|
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 =
|
|
12424
|
+
var applyEnvironmentSetupRequestSchema = z21.object({
|
|
12381
12425
|
environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
|
|
12382
|
-
variables: list(
|
|
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
|
|
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 =
|
|
12875
|
-
var createComputeSandboxRequestSchema =
|
|
12876
|
-
kind:
|
|
12877
|
-
gpu:
|
|
12878
|
-
image:
|
|
12879
|
-
timeoutMinutes:
|
|
12880
|
-
idleTimeoutMinutes:
|
|
12881
|
-
ports:
|
|
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 =
|
|
12885
|
-
command:
|
|
12886
|
-
workdir:
|
|
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:
|
|
12932
|
+
detach: z22.boolean().optional()
|
|
12889
12933
|
});
|
|
12890
|
-
var computeUploadRequestSchema =
|
|
12891
|
-
size:
|
|
12934
|
+
var computeUploadRequestSchema = z22.object({
|
|
12935
|
+
size: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
12892
12936
|
});
|
|
12893
|
-
var computeTransferPathSchema =
|
|
12894
|
-
path:
|
|
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 =
|
|
14579
|
-
id:
|
|
14580
|
-
at:
|
|
14581
|
-
kind:
|
|
14582
|
-
agentId:
|
|
14583
|
-
agentName:
|
|
14584
|
-
summary:
|
|
14585
|
-
detail:
|
|
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:
|
|
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:
|
|
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
|
|
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 =
|
|
15631
|
-
skills:
|
|
15674
|
+
var learnedSkillsManifestSchema = z24.object({
|
|
15675
|
+
skills: z24.array(z24.object({ name: z24.string(), sha256: z24.string() }))
|
|
15632
15676
|
});
|
|
15633
|
-
var dreamVerdictChecksSchema =
|
|
15634
|
-
repeatable:
|
|
15635
|
-
realInstruction:
|
|
15636
|
-
noContradiction:
|
|
15637
|
-
formatExact:
|
|
15638
|
-
humanOnly:
|
|
15639
|
-
actionable:
|
|
15640
|
-
durable:
|
|
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:
|
|
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
|
|
19288
|
+
import { z as z25 } from "zod";
|
|
19245
19289
|
var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
|
|
19246
|
-
var usageLimitCentsSchema =
|
|
19247
|
-
var sourceLimitsCentsSchema =
|
|
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
|
|
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 =
|
|
19493
|
-
branch:
|
|
19494
|
-
defaultBranch:
|
|
19495
|
-
pushBranch:
|
|
19496
|
-
pushConfig:
|
|
19497
|
-
headMessage:
|
|
19498
|
-
mergeInProgress:
|
|
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 =
|
|
19501
|
-
provider:
|
|
19502
|
-
source:
|
|
19503
|
-
toolName:
|
|
19504
|
-
toolInput:
|
|
19505
|
-
command:
|
|
19506
|
-
cwd:
|
|
19507
|
-
toolUseId:
|
|
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:
|
|
19511
|
-
repos:
|
|
19512
|
-
messageFiles:
|
|
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-
|
|
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-
|
|
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-
|
|
13
|
+
} from "./chunk-QAB7ES7V.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2OI7NWKG.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
21
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
322
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-T7MT6V7M.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-
|
|
344
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-T7MT6V7M.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-
|
|
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-
|
|
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-
|
|
6
|
+
} from "./chunk-L6URHRUV.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-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-
|
|
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-
|
|
17
|
+
} from "./chunk-FASCQRLF.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-2OI7NWKG.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-
|
|
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-
|
|
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-
|
|
68
|
+
} from "./chunk-FASCQRLF.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
|
-
} from "./chunk-
|
|
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-
|
|
146
|
+
} from "./chunk-LWTNMRAC.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-
|
|
156
|
+
} from "./chunk-QAB7ES7V.js";
|
|
157
157
|
import {
|
|
158
158
|
getCodexModelProvider
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-2OI7NWKG.js";
|
|
160
160
|
import {
|
|
161
161
|
SUBPROCESS_MAX_BUFFER,
|
|
162
162
|
execAsync,
|
|
163
163
|
execFileAsync
|
|
164
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
12
|
+
} from "./chunk-L6URHRUV.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED