replicas-engine 0.1.1587 → 0.1.1588
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-47LQ5HGG.js → asp-host-AGBWUQMD.js} +5 -5
- package/dist/src/{chunk-EPXKLPHV.js → chunk-3BFBWNAQ.js} +2 -2
- package/dist/src/{chunk-S4HGSY5Z.js → chunk-7MJCUMQR.js} +2 -2
- package/dist/src/{chunk-DGDRZKY6.js → chunk-CBTYCMFF.js} +573 -448
- package/dist/src/{chunk-7HOFVL7D.js → chunk-OZH37ZP5.js} +1 -1
- package/dist/src/{chunk-XRXQ7NIX.js → chunk-T6OPQGDD.js} +6 -6
- package/dist/src/{chunk-5HCIPJAY.js → chunk-TKVNHQ6W.js} +2 -2
- package/dist/src/{chunk-AXGVGBIT.js → chunk-TWV26MTQ.js} +1 -1
- package/dist/src/{chunk-XMXK5XQD.js → chunk-TZN36XJ4.js} +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +800 -443
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -1116,17 +1116,17 @@ var require_luxon = __commonJS({
|
|
|
1116
1116
|
constructor(dt, intl, opts) {
|
|
1117
1117
|
this.opts = opts;
|
|
1118
1118
|
this.originalZone = void 0;
|
|
1119
|
-
let
|
|
1119
|
+
let z42 = void 0;
|
|
1120
1120
|
if (this.opts.timeZone) {
|
|
1121
1121
|
this.dt = dt;
|
|
1122
1122
|
} else if (dt.zone.type === "fixed") {
|
|
1123
1123
|
const gmtOffset = -1 * (dt.offset / 60);
|
|
1124
1124
|
const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
|
|
1125
1125
|
if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
|
|
1126
|
-
|
|
1126
|
+
z42 = offsetZ;
|
|
1127
1127
|
this.dt = dt;
|
|
1128
1128
|
} else {
|
|
1129
|
-
|
|
1129
|
+
z42 = "UTC";
|
|
1130
1130
|
this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({
|
|
1131
1131
|
minutes: dt.offset
|
|
1132
1132
|
});
|
|
@@ -1136,9 +1136,9 @@ var require_luxon = __commonJS({
|
|
|
1136
1136
|
this.dt = dt;
|
|
1137
1137
|
} else if (dt.zone.type === "iana") {
|
|
1138
1138
|
this.dt = dt;
|
|
1139
|
-
|
|
1139
|
+
z42 = dt.zone.name;
|
|
1140
1140
|
} else {
|
|
1141
|
-
|
|
1141
|
+
z42 = "UTC";
|
|
1142
1142
|
this.dt = dt.setZone("UTC").plus({
|
|
1143
1143
|
minutes: dt.offset
|
|
1144
1144
|
});
|
|
@@ -1147,7 +1147,7 @@ var require_luxon = __commonJS({
|
|
|
1147
1147
|
const intlOpts = {
|
|
1148
1148
|
...this.opts
|
|
1149
1149
|
};
|
|
1150
|
-
intlOpts.timeZone = intlOpts.timeZone ||
|
|
1150
|
+
intlOpts.timeZone = intlOpts.timeZone || z42;
|
|
1151
1151
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1152
1152
|
}
|
|
1153
1153
|
format() {
|
|
@@ -11865,6 +11865,114 @@ var headlessAgentRequestSchema = z14.object({
|
|
|
11865
11865
|
});
|
|
11866
11866
|
var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
|
|
11867
11867
|
|
|
11868
|
+
// ../shared/src/engine/exec-protocol.ts
|
|
11869
|
+
import { z as z15 } from "zod";
|
|
11870
|
+
var EXEC_SOCKET_PATH = "/v1/exec/ws";
|
|
11871
|
+
var EXEC_PROTOCOL_VERSION = 1;
|
|
11872
|
+
var EXEC_PING_INTERVAL_MS = 5e3;
|
|
11873
|
+
var EXEC_SILENCE_TIMEOUT_MS = 2e4;
|
|
11874
|
+
var EXEC_MAX_FRAME_BYTES = 16 * 1024 * 1024;
|
|
11875
|
+
var EXEC_DEFAULT_READ_BYTES = 8 * 1024 * 1024;
|
|
11876
|
+
var EXEC_PROCESS_BUFFER_BYTES = 2 * 1024 * 1024;
|
|
11877
|
+
var EXEC_DEFAULT_IDLE_TTL_MS = 30 * 6e4;
|
|
11878
|
+
var EXEC_MAX_IDLE_TTL_MS = 24 * 60 * 6e4;
|
|
11879
|
+
var EXEC_FRAME = { request: 1, result: 2, error: 3, event: 4, cancel: 5, ping: 6 };
|
|
11880
|
+
var HEADER_BYTES = 9;
|
|
11881
|
+
var encoder = new TextEncoder();
|
|
11882
|
+
var decoder = new TextDecoder();
|
|
11883
|
+
function encodeExecFrame(type, id, json = {}, payload) {
|
|
11884
|
+
const body = encoder.encode(JSON.stringify(json));
|
|
11885
|
+
const frame = new Uint8Array(HEADER_BYTES + body.length + (payload?.length ?? 0));
|
|
11886
|
+
const view = new DataView(frame.buffer);
|
|
11887
|
+
view.setUint8(0, type);
|
|
11888
|
+
view.setUint32(1, id);
|
|
11889
|
+
view.setUint32(5, body.length);
|
|
11890
|
+
frame.set(body, HEADER_BYTES);
|
|
11891
|
+
if (payload) frame.set(payload, HEADER_BYTES + body.length);
|
|
11892
|
+
return frame;
|
|
11893
|
+
}
|
|
11894
|
+
function decodeExecFrame(data) {
|
|
11895
|
+
if (data.length < HEADER_BYTES) return null;
|
|
11896
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
11897
|
+
const type = view.getUint8(0);
|
|
11898
|
+
const jsonLength = view.getUint32(5);
|
|
11899
|
+
if (type < EXEC_FRAME.request || type > EXEC_FRAME.ping || HEADER_BYTES + jsonLength > data.length) return null;
|
|
11900
|
+
try {
|
|
11901
|
+
const json = JSON.parse(decoder.decode(data.subarray(HEADER_BYTES, HEADER_BYTES + jsonLength)));
|
|
11902
|
+
if (typeof json !== "object" || json === null || Array.isArray(json)) return null;
|
|
11903
|
+
return { type, id: view.getUint32(1), json, payload: data.subarray(HEADER_BYTES + jsonLength) };
|
|
11904
|
+
} catch {
|
|
11905
|
+
return null;
|
|
11906
|
+
}
|
|
11907
|
+
}
|
|
11908
|
+
var EXEC_ERROR_CODES = [
|
|
11909
|
+
"ENOENT",
|
|
11910
|
+
"EISDIR",
|
|
11911
|
+
"ENOTDIR",
|
|
11912
|
+
"EACCES",
|
|
11913
|
+
"EEXIST",
|
|
11914
|
+
"EINVAL",
|
|
11915
|
+
"EFBIG",
|
|
11916
|
+
"ESRCH",
|
|
11917
|
+
"ENOTSUP",
|
|
11918
|
+
"spawn_error",
|
|
11919
|
+
"aborted",
|
|
11920
|
+
"lost",
|
|
11921
|
+
"unknown"
|
|
11922
|
+
];
|
|
11923
|
+
var execRequestSchema = z15.object({
|
|
11924
|
+
/** The thread that owns the process; ending the thread kills its processes. */
|
|
11925
|
+
threadId: z15.string().min(1),
|
|
11926
|
+
label: z15.string().max(200).optional(),
|
|
11927
|
+
/** Run through bash; `login` (default true) sources the login profile like Codex's `bash -lc`. */
|
|
11928
|
+
command: z15.string().min(1).optional(),
|
|
11929
|
+
argv: z15.array(z15.string()).min(1).optional(),
|
|
11930
|
+
login: z15.boolean().optional(),
|
|
11931
|
+
cwd: z15.string().min(1).optional(),
|
|
11932
|
+
env: z15.record(z15.string(), z15.string()).optional(),
|
|
11933
|
+
/** Kill after this long, whoever is attached. */
|
|
11934
|
+
timeoutMs: z15.number().int().positive().optional(),
|
|
11935
|
+
/** Kill after this long with nobody attached. */
|
|
11936
|
+
idleTtlMs: z15.number().int().positive().max(EXEC_MAX_IDLE_TTL_MS).optional()
|
|
11937
|
+
}).refine((body) => body.command === void 0 !== (body.argv === void 0), { message: "Pass exactly one of command or argv" });
|
|
11938
|
+
var execStartedSchema = z15.object({ processId: z15.string(), pid: z15.number() });
|
|
11939
|
+
var execExitSchema = z15.object({ exitCode: z15.number(), signal: z15.string().nullable(), reason: z15.enum(["exit", "timeout", "killed", "idle"]) });
|
|
11940
|
+
var execReplySchemas = {
|
|
11941
|
+
hello: z15.object({
|
|
11942
|
+
protocol: z15.number(),
|
|
11943
|
+
version: z15.string(),
|
|
11944
|
+
os: z15.string(),
|
|
11945
|
+
arch: z15.string(),
|
|
11946
|
+
home: z15.string(),
|
|
11947
|
+
root: z15.string(),
|
|
11948
|
+
bootId: z15.string(),
|
|
11949
|
+
features: z15.array(z15.string())
|
|
11950
|
+
}),
|
|
11951
|
+
stat: z15.object({ kind: z15.enum(["file", "directory", "symlink", "other"]), size: z15.number(), mtimeMs: z15.number() }),
|
|
11952
|
+
read: z15.object({ size: z15.number() }),
|
|
11953
|
+
write: z15.object({ bytes: z15.number() }),
|
|
11954
|
+
exit: execExitSchema,
|
|
11955
|
+
kill: z15.object({}).strip(),
|
|
11956
|
+
killThread: z15.object({ killed: z15.number() }),
|
|
11957
|
+
list: z15.object({
|
|
11958
|
+
processes: z15.array(execStartedSchema.extend({
|
|
11959
|
+
threadId: z15.string(),
|
|
11960
|
+
label: z15.string().nullable(),
|
|
11961
|
+
command: z15.string(),
|
|
11962
|
+
startedAt: z15.string(),
|
|
11963
|
+
outputBytes: z15.number(),
|
|
11964
|
+
bufferStart: z15.number(),
|
|
11965
|
+
exit: execExitSchema.nullable()
|
|
11966
|
+
}))
|
|
11967
|
+
})
|
|
11968
|
+
};
|
|
11969
|
+
var execEventSchema = z15.discriminatedUnion("kind", [
|
|
11970
|
+
execStartedSchema.extend({ kind: z15.literal("started") }),
|
|
11971
|
+
z15.object({ kind: z15.literal("output"), stream: z15.enum(["stdout", "stderr"]), offset: z15.number() }),
|
|
11972
|
+
z15.object({ kind: z15.literal("skipped"), offset: z15.number(), bytes: z15.number() })
|
|
11973
|
+
]);
|
|
11974
|
+
var execErrorBodySchema = z15.object({ code: z15.enum(EXEC_ERROR_CODES), message: z15.string(), path: z15.string().optional() });
|
|
11975
|
+
|
|
11868
11976
|
// ../shared/src/sse.ts
|
|
11869
11977
|
function parseSseChunk(chunk) {
|
|
11870
11978
|
let data = "";
|
|
@@ -11882,14 +11990,14 @@ function parseSseChunk(chunk) {
|
|
|
11882
11990
|
}
|
|
11883
11991
|
async function* iterateSseStream(body, onChunk) {
|
|
11884
11992
|
const reader = body.getReader();
|
|
11885
|
-
const
|
|
11993
|
+
const decoder3 = new TextDecoder();
|
|
11886
11994
|
let buffer = "";
|
|
11887
11995
|
let searchFrom = 0;
|
|
11888
11996
|
while (true) {
|
|
11889
11997
|
const { done, value } = await reader.read();
|
|
11890
11998
|
if (done) break;
|
|
11891
11999
|
onChunk?.();
|
|
11892
|
-
buffer +=
|
|
12000
|
+
buffer += decoder3.decode(value, { stream: true });
|
|
11893
12001
|
let end = buffer.indexOf("\n\n", searchFrom);
|
|
11894
12002
|
while (end >= 0) {
|
|
11895
12003
|
const event = parseSseChunk(buffer.slice(0, end));
|
|
@@ -11949,15 +12057,15 @@ var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
|
|
|
11949
12057
|
var PICK_WINDOW_MS = 21 * DAY_MS;
|
|
11950
12058
|
|
|
11951
12059
|
// ../shared/src/routes/workspaces.ts
|
|
11952
|
-
import { z as
|
|
12060
|
+
import { z as z17 } from "zod";
|
|
11953
12061
|
|
|
11954
12062
|
// ../shared/src/workspace-credentials.ts
|
|
11955
|
-
import { z as
|
|
12063
|
+
import { z as z16 } from "zod";
|
|
11956
12064
|
var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
|
|
11957
|
-
var workspaceCredentialProviderSchema =
|
|
12065
|
+
var workspaceCredentialProviderSchema = z16.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
11958
12066
|
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
11959
12067
|
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11960
|
-
provider:
|
|
12068
|
+
provider: z16.enum(VALID_AGENT_PROVIDERS)
|
|
11961
12069
|
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11962
12070
|
message: "This inference provider is not supported by this agent"
|
|
11963
12071
|
});
|
|
@@ -11991,16 +12099,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
|
|
|
11991
12099
|
activity: "any"
|
|
11992
12100
|
};
|
|
11993
12101
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11994
|
-
var workspaceExecRequestSchema =
|
|
11995
|
-
command:
|
|
11996
|
-
timeout_seconds:
|
|
12102
|
+
var workspaceExecRequestSchema = z17.object({
|
|
12103
|
+
command: z17.string().regex(/\S/, "command is required"),
|
|
12104
|
+
timeout_seconds: z17.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
11997
12105
|
});
|
|
11998
|
-
var terminalRtcCandidateSchema =
|
|
11999
|
-
var terminalSocketServerMessageSchema =
|
|
12000
|
-
|
|
12001
|
-
|
|
12106
|
+
var terminalRtcCandidateSchema = z17.object({ type: z17.literal("rtc-candidate"), candidate: z17.string(), mid: z17.string() });
|
|
12107
|
+
var terminalSocketServerMessageSchema = z17.discriminatedUnion("type", [
|
|
12108
|
+
z17.object({ type: z17.literal("output"), data: z17.string() }),
|
|
12109
|
+
z17.object({ type: z17.literal("rtc-answer"), sdp: z17.string() }),
|
|
12002
12110
|
terminalRtcCandidateSchema,
|
|
12003
|
-
|
|
12111
|
+
z17.object({ type: z17.literal("rtc-switch") })
|
|
12004
12112
|
]);
|
|
12005
12113
|
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
12006
12114
|
|
|
@@ -12047,62 +12155,62 @@ function describeAuthFallback(payload) {
|
|
|
12047
12155
|
}
|
|
12048
12156
|
|
|
12049
12157
|
// ../shared/src/chat-fork.ts
|
|
12050
|
-
import { z as
|
|
12158
|
+
import { z as z19 } from "zod";
|
|
12051
12159
|
|
|
12052
12160
|
// ../shared/src/fallback-chains.ts
|
|
12053
|
-
import { z as
|
|
12054
|
-
var fallbackHarnessStepSchema =
|
|
12055
|
-
kind:
|
|
12056
|
-
provider:
|
|
12057
|
-
model:
|
|
12058
|
-
thinkingLevel:
|
|
12161
|
+
import { z as z18 } from "zod";
|
|
12162
|
+
var fallbackHarnessStepSchema = z18.object({
|
|
12163
|
+
kind: z18.literal("harness"),
|
|
12164
|
+
provider: z18.enum(VALID_AGENT_PROVIDERS),
|
|
12165
|
+
model: z18.string().min(1),
|
|
12166
|
+
thinkingLevel: z18.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
|
|
12059
12167
|
});
|
|
12060
|
-
var fallbackPlanStepSchema =
|
|
12061
|
-
|
|
12062
|
-
kind:
|
|
12168
|
+
var fallbackPlanStepSchema = z18.discriminatedUnion("kind", [
|
|
12169
|
+
z18.object({
|
|
12170
|
+
kind: z18.literal("credentials"),
|
|
12063
12171
|
// An empty list would allow every method.
|
|
12064
|
-
methods:
|
|
12065
|
-
models:
|
|
12172
|
+
methods: z18.array(z18.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
|
|
12173
|
+
models: z18.record(z18.string(), z18.string().min(1)).optional()
|
|
12066
12174
|
}),
|
|
12067
12175
|
fallbackHarnessStepSchema
|
|
12068
12176
|
]);
|
|
12069
|
-
var fallbackPlanResponseSchema =
|
|
12070
|
-
steps:
|
|
12177
|
+
var fallbackPlanResponseSchema = z18.object({
|
|
12178
|
+
steps: z18.array(z18.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
|
|
12071
12179
|
});
|
|
12072
12180
|
|
|
12073
12181
|
// ../shared/src/chat-fork.ts
|
|
12074
|
-
var fallbackReasonSchema =
|
|
12075
|
-
var chatForkInfoSchema =
|
|
12076
|
-
source:
|
|
12077
|
-
chatId:
|
|
12078
|
-
provider:
|
|
12079
|
-
title:
|
|
12182
|
+
var fallbackReasonSchema = z19.enum(AGENT_FALLBACK_REASONS);
|
|
12183
|
+
var chatForkInfoSchema = z19.object({
|
|
12184
|
+
source: z19.object({
|
|
12185
|
+
chatId: z19.string().min(1),
|
|
12186
|
+
provider: z19.enum(VALID_AGENT_PROVIDERS),
|
|
12187
|
+
title: z19.string()
|
|
12080
12188
|
}),
|
|
12081
|
-
trigger:
|
|
12189
|
+
trigger: z19.enum(["manual", "auto", "side", "switch"]),
|
|
12082
12190
|
reason: fallbackReasonSchema.optional(),
|
|
12083
|
-
state:
|
|
12084
|
-
error:
|
|
12085
|
-
startedAt:
|
|
12086
|
-
completedAt:
|
|
12191
|
+
state: z19.enum(["preparing", "ready", "failed"]),
|
|
12192
|
+
error: z19.string().optional(),
|
|
12193
|
+
startedAt: z19.string(),
|
|
12194
|
+
completedAt: z19.string().optional()
|
|
12087
12195
|
});
|
|
12088
12196
|
function coerceChatForkInfo(value) {
|
|
12089
12197
|
const parsed = chatForkInfoSchema.safeParse(value);
|
|
12090
12198
|
return parsed.success ? parsed.data : null;
|
|
12091
12199
|
}
|
|
12092
|
-
var forkChatRequestSchema =
|
|
12093
|
-
provider:
|
|
12094
|
-
model:
|
|
12095
|
-
thinkingLevel:
|
|
12096
|
-
title:
|
|
12097
|
-
message:
|
|
12098
|
-
id:
|
|
12099
|
-
clientRequestId:
|
|
12100
|
-
enableInteractiveTools:
|
|
12200
|
+
var forkChatRequestSchema = z19.object({
|
|
12201
|
+
provider: z19.enum(VALID_AGENT_PROVIDERS),
|
|
12202
|
+
model: z19.string().min(1).optional(),
|
|
12203
|
+
thinkingLevel: z19.enum(VALID_THINKING_LEVELS).optional(),
|
|
12204
|
+
title: z19.string().min(1).max(200).optional(),
|
|
12205
|
+
message: z19.string().trim().optional(),
|
|
12206
|
+
id: z19.string().uuid().optional(),
|
|
12207
|
+
clientRequestId: z19.string().min(1).max(128).optional(),
|
|
12208
|
+
enableInteractiveTools: z19.boolean().optional(),
|
|
12101
12209
|
// Server-injected by the monolith from the authenticated request; never trusted from clients.
|
|
12102
|
-
senderUserId:
|
|
12103
|
-
senderEmail:
|
|
12104
|
-
senderDisplayName:
|
|
12105
|
-
senderAvatarUrl:
|
|
12210
|
+
senderUserId: z19.string().optional(),
|
|
12211
|
+
senderEmail: z19.string().optional(),
|
|
12212
|
+
senderDisplayName: z19.string().optional(),
|
|
12213
|
+
senderAvatarUrl: z19.string().optional()
|
|
12106
12214
|
});
|
|
12107
12215
|
function describeQuotaLimit(reason) {
|
|
12108
12216
|
if (reason === "auth_failed") return "could not authenticate";
|
|
@@ -12114,10 +12222,10 @@ function describeChatForkReason(reason, provider2) {
|
|
|
12114
12222
|
return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
|
|
12115
12223
|
}
|
|
12116
12224
|
var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
|
|
12117
|
-
var agentQuotaExhaustedPayloadSchema =
|
|
12118
|
-
provider:
|
|
12225
|
+
var agentQuotaExhaustedPayloadSchema = z19.object({
|
|
12226
|
+
provider: z19.enum(VALID_AGENT_PROVIDERS),
|
|
12119
12227
|
reason: fallbackReasonSchema,
|
|
12120
|
-
detail:
|
|
12228
|
+
detail: z19.string().optional(),
|
|
12121
12229
|
forkTo: fallbackHarnessStepSchema.optional()
|
|
12122
12230
|
});
|
|
12123
12231
|
function defaultForkChatTitle(source, provider2) {
|
|
@@ -12152,21 +12260,21 @@ function getChatThreadSources(chats, chat) {
|
|
|
12152
12260
|
}
|
|
12153
12261
|
|
|
12154
12262
|
// ../shared/src/credential-refresh.ts
|
|
12155
|
-
import { z as
|
|
12156
|
-
var engineCredentialRefreshFailureSchema =
|
|
12157
|
-
code:
|
|
12263
|
+
import { z as z20 } from "zod";
|
|
12264
|
+
var engineCredentialRefreshFailureSchema = z20.object({
|
|
12265
|
+
code: z20.string(),
|
|
12158
12266
|
credential: workspaceCredentialSelectionSchema.optional()
|
|
12159
12267
|
});
|
|
12160
12268
|
|
|
12161
12269
|
// ../shared/src/credential-pool.ts
|
|
12162
|
-
import { z as
|
|
12270
|
+
import { z as z21 } from "zod";
|
|
12163
12271
|
var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
|
|
12164
|
-
var reorderCredentialPoolSchema =
|
|
12165
|
-
credential_ids:
|
|
12272
|
+
var reorderCredentialPoolSchema = z21.object({
|
|
12273
|
+
credential_ids: z21.array(z21.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
12166
12274
|
});
|
|
12167
12275
|
|
|
12168
12276
|
// ../shared/src/mothership-events.ts
|
|
12169
|
-
import { z as
|
|
12277
|
+
import { z as z27 } from "zod";
|
|
12170
12278
|
|
|
12171
12279
|
// ../shared/src/design-tokens.ts
|
|
12172
12280
|
var plain = {
|
|
@@ -12333,7 +12441,7 @@ var LINEAR_ICON_DEFINITION = {
|
|
|
12333
12441
|
};
|
|
12334
12442
|
|
|
12335
12443
|
// ../shared/src/replicas-mcp.ts
|
|
12336
|
-
import { z as
|
|
12444
|
+
import { z as z23 } from "zod";
|
|
12337
12445
|
|
|
12338
12446
|
// ../shared/src/automations/types.ts
|
|
12339
12447
|
var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
|
|
@@ -12354,11 +12462,11 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
|
|
|
12354
12462
|
var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
|
|
12355
12463
|
|
|
12356
12464
|
// ../shared/src/routes/environment-config-source.ts
|
|
12357
|
-
import { z as
|
|
12358
|
-
var previewEnvironmentConfigSourceRequestSchema =
|
|
12465
|
+
import { z as z22 } from "zod";
|
|
12466
|
+
var previewEnvironmentConfigSourceRequestSchema = z22.strictObject({ repository_id: z22.string().min(1).optional() });
|
|
12359
12467
|
var applyEnvironmentConfigSourceRequestSchema = previewEnvironmentConfigSourceRequestSchema.extend({
|
|
12360
|
-
commit_sha:
|
|
12361
|
-
fingerprint:
|
|
12468
|
+
commit_sha: z22.string().min(1),
|
|
12469
|
+
fingerprint: z22.string().min(1)
|
|
12362
12470
|
});
|
|
12363
12471
|
|
|
12364
12472
|
// ../shared/src/replicas-mcp.ts
|
|
@@ -12422,57 +12530,57 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12422
12530
|
deleteChat: "delete_chat",
|
|
12423
12531
|
listRepositories: "list_repositories"
|
|
12424
12532
|
};
|
|
12425
|
-
var automationToolInputSchema =
|
|
12426
|
-
name:
|
|
12427
|
-
prompt:
|
|
12428
|
-
environment_id:
|
|
12429
|
-
triggers:
|
|
12533
|
+
var automationToolInputSchema = z23.object({
|
|
12534
|
+
name: z23.string().describe("Short automation name."),
|
|
12535
|
+
prompt: z23.string().describe("Prompt each automation run starts with."),
|
|
12536
|
+
environment_id: z23.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
12537
|
+
triggers: z23.array(automationTriggerSchema).min(1).describe(
|
|
12430
12538
|
`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"] } }\`.`
|
|
12431
12539
|
),
|
|
12432
|
-
description:
|
|
12433
|
-
plan_mode:
|
|
12434
|
-
goal_mode:
|
|
12435
|
-
fast_mode:
|
|
12436
|
-
workspace_lifecycle_policy:
|
|
12540
|
+
description: z23.string().optional().describe("One-line summary shown in the dashboard."),
|
|
12541
|
+
plan_mode: z23.boolean().optional(),
|
|
12542
|
+
goal_mode: z23.boolean().optional(),
|
|
12543
|
+
fast_mode: z23.boolean().optional(),
|
|
12544
|
+
workspace_lifecycle_policy: z23.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
12437
12545
|
"What happens to a run's workspace when the agent finishes. `delete_when_done` (default, except one-time runs, which default to `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."
|
|
12438
12546
|
)
|
|
12439
12547
|
});
|
|
12440
12548
|
var credentialUserIdDescription = `Organization automations only: the user ID (see \`${REPLICAS_MCP_TOOLS.whoami}\`) of the member whose coding agent credentials, such as their Claude subscription, runs use before the organization's. Only your workspace's owner, or whoever's credentials this workspace runs on.`;
|
|
12441
|
-
var automationBackgroundSchema =
|
|
12549
|
+
var automationBackgroundSchema = z23.boolean().optional().describe(
|
|
12442
12550
|
"Marks this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list."
|
|
12443
12551
|
);
|
|
12444
12552
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
12445
|
-
credential_user_id:
|
|
12553
|
+
credential_user_id: z23.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
|
|
12446
12554
|
background: automationBackgroundSchema,
|
|
12447
|
-
scope:
|
|
12555
|
+
scope: z23.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
12448
12556
|
});
|
|
12449
12557
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
12450
|
-
automation_id:
|
|
12451
|
-
enabled:
|
|
12452
|
-
agent_provider:
|
|
12453
|
-
model:
|
|
12454
|
-
thinking_level:
|
|
12455
|
-
workspace_size:
|
|
12456
|
-
credential_user_id:
|
|
12558
|
+
automation_id: z23.string().describe("Automation ID"),
|
|
12559
|
+
enabled: z23.boolean().optional(),
|
|
12560
|
+
agent_provider: z23.enum(AGENT).nullable().optional(),
|
|
12561
|
+
model: z23.string().nullable().optional(),
|
|
12562
|
+
thinking_level: z23.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
12563
|
+
workspace_size: z23.enum(WORKSPACE_SIZES).optional(),
|
|
12564
|
+
credential_user_id: z23.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
|
|
12457
12565
|
background: automationBackgroundSchema,
|
|
12458
|
-
scope:
|
|
12566
|
+
scope: z23.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
12459
12567
|
});
|
|
12460
|
-
var chatPath = { id:
|
|
12568
|
+
var chatPath = { id: z23.string().describe("Workspace ID"), chat_id: z23.string().describe("Chat ID") };
|
|
12461
12569
|
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
12462
|
-
var createChatToolInputSchema =
|
|
12463
|
-
var forkChatToolInputSchema =
|
|
12464
|
-
var renameChatToolInputSchema =
|
|
12465
|
-
var runCommandToolInputSchema =
|
|
12466
|
-
var environmentMcpPath = { environment_id:
|
|
12467
|
-
var createEnvironmentMcpToolInputSchema =
|
|
12468
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
12570
|
+
var createChatToolInputSchema = z23.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
12571
|
+
var forkChatToolInputSchema = z23.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
|
|
12572
|
+
var renameChatToolInputSchema = z23.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
|
|
12573
|
+
var runCommandToolInputSchema = z23.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
12574
|
+
var environmentMcpPath = { environment_id: z23.string().describe("Environment ID") };
|
|
12575
|
+
var createEnvironmentMcpToolInputSchema = z23.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
12576
|
+
var updateEnvironmentMcpToolInputSchema = z23.object({
|
|
12469
12577
|
...environmentMcpPath,
|
|
12470
|
-
mcp_id:
|
|
12578
|
+
mcp_id: z23.string().describe("MCP ID"),
|
|
12471
12579
|
...updateEnvironmentMcpRequestSchema.shape
|
|
12472
12580
|
});
|
|
12473
|
-
var createEnvironmentDeviceToolInputSchema =
|
|
12474
|
-
var previewEnvironmentConfigSourceToolInputSchema =
|
|
12475
|
-
var applyEnvironmentConfigSourceToolInputSchema =
|
|
12581
|
+
var createEnvironmentDeviceToolInputSchema = z23.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
|
|
12582
|
+
var previewEnvironmentConfigSourceToolInputSchema = z23.object({ ...environmentMcpPath, ...previewEnvironmentConfigSourceRequestSchema.shape });
|
|
12583
|
+
var applyEnvironmentConfigSourceToolInputSchema = z23.object({ ...environmentMcpPath, ...applyEnvironmentConfigSourceRequestSchema.shape });
|
|
12476
12584
|
|
|
12477
12585
|
// ../shared/src/scout.ts
|
|
12478
12586
|
var SCOUT_SOURCE_TYPES = ["slack", "linear"];
|
|
@@ -12566,63 +12674,63 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
|
|
|
12566
12674
|
`;
|
|
12567
12675
|
|
|
12568
12676
|
// ../shared/src/routes/preferences.ts
|
|
12569
|
-
import { z as
|
|
12677
|
+
import { z as z26 } from "zod";
|
|
12570
12678
|
|
|
12571
12679
|
// ../shared/src/routes/push.ts
|
|
12572
|
-
import { z as
|
|
12680
|
+
import { z as z24 } from "zod";
|
|
12573
12681
|
|
|
12574
12682
|
// ../shared/src/workspace-attention.ts
|
|
12575
12683
|
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
|
|
12576
12684
|
var CHAT_ATTENTION_REASONS = ["question", "blocked"];
|
|
12577
12685
|
|
|
12578
12686
|
// ../shared/src/routes/push.ts
|
|
12579
|
-
var registerPushDeviceRequestSchema =
|
|
12580
|
-
|
|
12581
|
-
platform:
|
|
12582
|
-
token:
|
|
12583
|
-
appId:
|
|
12584
|
-
apnsEnvironment:
|
|
12687
|
+
var registerPushDeviceRequestSchema = z24.discriminatedUnion("platform", [
|
|
12688
|
+
z24.object({
|
|
12689
|
+
platform: z24.literal("ios"),
|
|
12690
|
+
token: z24.string().regex(/^[0-9a-f]{64,200}$/i),
|
|
12691
|
+
appId: z24.string().min(1).max(255),
|
|
12692
|
+
apnsEnvironment: z24.enum(["sandbox", "production"])
|
|
12585
12693
|
}),
|
|
12586
|
-
|
|
12587
|
-
platform:
|
|
12588
|
-
token:
|
|
12589
|
-
appId:
|
|
12694
|
+
z24.object({
|
|
12695
|
+
platform: z24.literal("android"),
|
|
12696
|
+
token: z24.string().min(1).max(4096),
|
|
12697
|
+
appId: z24.string().min(1).max(255)
|
|
12590
12698
|
})
|
|
12591
12699
|
]);
|
|
12592
12700
|
var PUSH_HOLD_MINUTES = 5;
|
|
12593
|
-
var chatRefSchema =
|
|
12594
|
-
var recordPushActivityRequestSchema =
|
|
12595
|
-
organizationId:
|
|
12701
|
+
var chatRefSchema = z24.object({ workspaceId: z24.string().uuid(), chatId: z24.string().min(1).max(100) });
|
|
12702
|
+
var recordPushActivityRequestSchema = z24.object({
|
|
12703
|
+
organizationId: z24.string().uuid(),
|
|
12596
12704
|
/** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
|
|
12597
|
-
idleSeconds:
|
|
12598
|
-
seenWorkspaceIds:
|
|
12599
|
-
seenChats:
|
|
12705
|
+
idleSeconds: z24.number().min(0).optional(),
|
|
12706
|
+
seenWorkspaceIds: z24.array(z24.string().uuid()).max(20),
|
|
12707
|
+
seenChats: z24.array(chatRefSchema).max(20).optional()
|
|
12600
12708
|
});
|
|
12601
12709
|
var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
|
|
12602
12710
|
var PUSH_OPTION_LABEL_MAX = 60;
|
|
12603
12711
|
var PUSH_OPTIONS_MAX = 4;
|
|
12604
|
-
var pushQuestionSchema =
|
|
12605
|
-
var pushNotificationDataSchema =
|
|
12606
|
-
organizationId:
|
|
12607
|
-
workspaceId:
|
|
12608
|
-
chatId:
|
|
12609
|
-
kind:
|
|
12610
|
-
completedAt:
|
|
12611
|
-
toolRequestId:
|
|
12712
|
+
var pushQuestionSchema = z24.object({ id: z24.string().max(64), allowCustom: z24.boolean().optional(), options: z24.array(z24.object({ id: z24.string().max(64), label: z24.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
|
|
12713
|
+
var pushNotificationDataSchema = z24.object({
|
|
12714
|
+
organizationId: z24.string(),
|
|
12715
|
+
workspaceId: z24.string(),
|
|
12716
|
+
chatId: z24.string().nullable(),
|
|
12717
|
+
kind: z24.enum(PUSH_NOTIFICATION_KINDS),
|
|
12718
|
+
completedAt: z24.string(),
|
|
12719
|
+
toolRequestId: z24.string().optional(),
|
|
12612
12720
|
question: pushQuestionSchema.optional()
|
|
12613
12721
|
});
|
|
12614
|
-
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind:
|
|
12722
|
+
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z24.literal("shared") });
|
|
12615
12723
|
var registerLiveActivityRequestSchema = chatRefSchema.extend({
|
|
12616
|
-
deviceId:
|
|
12724
|
+
deviceId: z24.string().uuid(),
|
|
12617
12725
|
/** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
|
|
12618
|
-
pushToken:
|
|
12726
|
+
pushToken: z24.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
|
|
12619
12727
|
/** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
|
|
12620
|
-
startedAt:
|
|
12728
|
+
startedAt: z24.number().positive().optional()
|
|
12621
12729
|
});
|
|
12622
|
-
var syncLiveActivitiesRequestSchema =
|
|
12623
|
-
activities:
|
|
12730
|
+
var syncLiveActivitiesRequestSchema = z24.object({
|
|
12731
|
+
activities: z24.array(chatRefSchema).max(100)
|
|
12624
12732
|
});
|
|
12625
|
-
var setLiveActivityStartTokenRequestSchema =
|
|
12733
|
+
var setLiveActivityStartTokenRequestSchema = z24.object({ token: z24.string().regex(/^[0-9a-f]{64,400}$/i) });
|
|
12626
12734
|
|
|
12627
12735
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
12628
12736
|
var SECTION = `### Computer use (Linux desktop control)
|
|
@@ -13374,7 +13482,7 @@ var GITLAB_ABILITY = {
|
|
|
13374
13482
|
};
|
|
13375
13483
|
|
|
13376
13484
|
// ../shared/src/routes/compute.ts
|
|
13377
|
-
import { z as
|
|
13485
|
+
import { z as z25 } from "zod";
|
|
13378
13486
|
var COMPUTE_SANDBOX_KINDS = ["gpu"];
|
|
13379
13487
|
var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
|
|
13380
13488
|
var DEFAULT_GPU_TYPE = "L4";
|
|
@@ -13391,27 +13499,27 @@ var COMPUTE_SANDBOX_LIMITS = {
|
|
|
13391
13499
|
maxIdleTimeoutMinutes: 60,
|
|
13392
13500
|
maxTransferBytes: 1024 ** 3
|
|
13393
13501
|
};
|
|
13394
|
-
var computeEnvSchema =
|
|
13395
|
-
var createComputeSandboxRequestSchema =
|
|
13396
|
-
kind:
|
|
13397
|
-
gpu:
|
|
13398
|
-
image:
|
|
13399
|
-
timeoutMinutes:
|
|
13400
|
-
idleTimeoutMinutes:
|
|
13401
|
-
ports:
|
|
13502
|
+
var computeEnvSchema = z25.record(z25.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z25.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
|
|
13503
|
+
var createComputeSandboxRequestSchema = z25.object({
|
|
13504
|
+
kind: z25.enum(COMPUTE_SANDBOX_KINDS),
|
|
13505
|
+
gpu: z25.string().trim().optional(),
|
|
13506
|
+
image: z25.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
|
|
13507
|
+
timeoutMinutes: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
|
|
13508
|
+
idleTimeoutMinutes: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
|
|
13509
|
+
ports: z25.array(z25.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
|
|
13402
13510
|
env: computeEnvSchema.optional()
|
|
13403
13511
|
});
|
|
13404
|
-
var computeExecRequestSchema =
|
|
13405
|
-
command:
|
|
13406
|
-
workdir:
|
|
13512
|
+
var computeExecRequestSchema = z25.object({
|
|
13513
|
+
command: z25.string().min(1).max(1e5),
|
|
13514
|
+
workdir: z25.string().min(1).max(4096).optional(),
|
|
13407
13515
|
env: computeEnvSchema.optional(),
|
|
13408
|
-
detach:
|
|
13516
|
+
detach: z25.boolean().optional()
|
|
13409
13517
|
});
|
|
13410
|
-
var computeUploadRequestSchema =
|
|
13411
|
-
size:
|
|
13518
|
+
var computeUploadRequestSchema = z25.object({
|
|
13519
|
+
size: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
13412
13520
|
});
|
|
13413
|
-
var computeTransferPathSchema =
|
|
13414
|
-
path:
|
|
13521
|
+
var computeTransferPathSchema = z25.object({
|
|
13522
|
+
path: z25.string().min(1).max(4096).optional()
|
|
13415
13523
|
});
|
|
13416
13524
|
|
|
13417
13525
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
@@ -15163,9 +15271,9 @@ var DEFAULT_DEFAULT_SKILLS = {
|
|
|
15163
15271
|
}
|
|
15164
15272
|
};
|
|
15165
15273
|
var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
|
|
15166
|
-
var linearRoutingSkillSchema =
|
|
15167
|
-
|
|
15168
|
-
|
|
15274
|
+
var linearRoutingSkillSchema = z26.union([
|
|
15275
|
+
z26.object({ name: z26.string().min(1), content: z26.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
|
|
15276
|
+
z26.object({ name: z26.string().min(1), repository_id: z26.string().regex(UUID_RE), path: z26.string().min(1) })
|
|
15169
15277
|
]);
|
|
15170
15278
|
|
|
15171
15279
|
// ../shared/src/prompts.ts
|
|
@@ -15346,19 +15454,19 @@ var UNKNOWN_EVENT_KIND = "update";
|
|
|
15346
15454
|
var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
15347
15455
|
var MOTHERSHIP_EVENT_TYPE = "multitask-event";
|
|
15348
15456
|
var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
15349
|
-
var mothershipEventSchema =
|
|
15350
|
-
id:
|
|
15351
|
-
at:
|
|
15352
|
-
kind:
|
|
15353
|
-
agentId:
|
|
15354
|
-
agentName:
|
|
15355
|
-
summary:
|
|
15356
|
-
detail:
|
|
15457
|
+
var mothershipEventSchema = z27.object({
|
|
15458
|
+
id: z27.string(),
|
|
15459
|
+
at: z27.string(),
|
|
15460
|
+
kind: z27.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
|
|
15461
|
+
agentId: z27.string(),
|
|
15462
|
+
agentName: z27.string(),
|
|
15463
|
+
summary: z27.string(),
|
|
15464
|
+
detail: z27.string().optional(),
|
|
15357
15465
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
15358
|
-
chatId:
|
|
15359
|
-
ticket:
|
|
15466
|
+
chatId: z27.string().optional(),
|
|
15467
|
+
ticket: z27.object({ id: z27.string(), title: z27.string() }).optional(),
|
|
15360
15468
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
15361
|
-
noticed:
|
|
15469
|
+
noticed: z27.boolean().optional()
|
|
15362
15470
|
});
|
|
15363
15471
|
var TAG = "multitask_event";
|
|
15364
15472
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
@@ -16403,7 +16511,7 @@ function subagentReport(output) {
|
|
|
16403
16511
|
}
|
|
16404
16512
|
|
|
16405
16513
|
// ../shared/src/learned-skills.ts
|
|
16406
|
-
import { z as
|
|
16514
|
+
import { z as z28 } from "zod";
|
|
16407
16515
|
|
|
16408
16516
|
// ../shared/src/frontmatter.ts
|
|
16409
16517
|
import { parse as parseYaml } from "yaml";
|
|
@@ -16426,20 +16534,20 @@ function parseFrontmatter(content) {
|
|
|
16426
16534
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
16427
16535
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
16428
16536
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
16429
|
-
var learnedSkillsManifestSchema =
|
|
16430
|
-
skills:
|
|
16537
|
+
var learnedSkillsManifestSchema = z28.object({
|
|
16538
|
+
skills: z28.array(z28.object({ name: z28.string(), sha256: z28.string() }))
|
|
16431
16539
|
});
|
|
16432
|
-
var dreamVerdictChecksSchema =
|
|
16433
|
-
repeatable:
|
|
16434
|
-
realInstruction:
|
|
16435
|
-
noContradiction:
|
|
16436
|
-
formatExact:
|
|
16437
|
-
humanOnly:
|
|
16438
|
-
actionable:
|
|
16439
|
-
durable:
|
|
16540
|
+
var dreamVerdictChecksSchema = z28.object({
|
|
16541
|
+
repeatable: z28.boolean(),
|
|
16542
|
+
realInstruction: z28.boolean(),
|
|
16543
|
+
noContradiction: z28.boolean(),
|
|
16544
|
+
formatExact: z28.boolean(),
|
|
16545
|
+
humanOnly: z28.boolean(),
|
|
16546
|
+
actionable: z28.boolean(),
|
|
16547
|
+
durable: z28.boolean()
|
|
16440
16548
|
});
|
|
16441
16549
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
16442
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
16550
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z28.boolean(), reason: z28.string() });
|
|
16443
16551
|
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."`;
|
|
16444
16552
|
|
|
16445
16553
|
// ../shared/src/terminal.ts
|
|
@@ -16470,7 +16578,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16470
16578
|
}
|
|
16471
16579
|
|
|
16472
16580
|
// ../shared/src/mothership-board.ts
|
|
16473
|
-
import { z as
|
|
16581
|
+
import { z as z29 } from "zod";
|
|
16474
16582
|
var MOTHERSHIP_TICKET_LIMITS = {
|
|
16475
16583
|
title: 80,
|
|
16476
16584
|
task: 1e3,
|
|
@@ -16490,78 +16598,78 @@ var MOTHERSHIP_TICKET_LIMITS = {
|
|
|
16490
16598
|
};
|
|
16491
16599
|
var L = MOTHERSHIP_TICKET_LIMITS;
|
|
16492
16600
|
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
16493
|
-
var text3 = (max) =>
|
|
16494
|
-
var clearable = (schema) =>
|
|
16495
|
-
var httpsUrl =
|
|
16601
|
+
var text3 = (max) => z29.string().trim().min(1).max(max, tooLong(max));
|
|
16602
|
+
var clearable = (schema) => z29.union([schema, z29.literal("")]).optional();
|
|
16603
|
+
var httpsUrl = z29.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
16496
16604
|
var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
|
|
16497
16605
|
var markdown = `${inlineMarkdown} and line breaks.`;
|
|
16498
|
-
var linearIdentifier =
|
|
16499
|
-
var mediaSchema =
|
|
16606
|
+
var linearIdentifier = z29.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
16607
|
+
var mediaSchema = z29.object({
|
|
16500
16608
|
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
16501
16609
|
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
16502
|
-
kind:
|
|
16610
|
+
kind: z29.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
16503
16611
|
});
|
|
16504
|
-
var questionSchema =
|
|
16612
|
+
var questionSchema = z29.object({
|
|
16505
16613
|
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
16506
|
-
options:
|
|
16614
|
+
options: z29.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
|
|
16507
16615
|
});
|
|
16508
16616
|
var mothershipTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Mothership channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
|
|
16509
16617
|
var mothershipTicketTaskSchema = text3(L.task);
|
|
16510
|
-
var mothershipTicketMediaSchema =
|
|
16511
|
-
var mothershipTicketQuestionsSchema =
|
|
16618
|
+
var mothershipTicketMediaSchema = z29.array(mediaSchema);
|
|
16619
|
+
var mothershipTicketQuestionsSchema = z29.array(questionSchema.extend({ id: z29.string() }));
|
|
16512
16620
|
var issueSchema = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
|
|
16513
16621
|
var fixSchema = clearable(text3(L.fix)).describe(`What was done or is being done about it, with pull requests as #number. Keep it current as the work goes on, and say how it ended once the pull requests land. ${markdown} At most ${L.fix} characters.`);
|
|
16514
|
-
var updateMothershipTicketRequestSchema =
|
|
16622
|
+
var updateMothershipTicketRequestSchema = z29.object({
|
|
16515
16623
|
title: mothershipTicketTitleSchema.optional(),
|
|
16516
16624
|
issue: issueSchema,
|
|
16517
16625
|
fix: fixSchema,
|
|
16518
|
-
media:
|
|
16519
|
-
questions:
|
|
16626
|
+
media: z29.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
|
|
16627
|
+
questions: z29.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
|
|
16520
16628
|
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
16521
16629
|
});
|
|
16522
|
-
var updateMothershipBoardRequestSchema =
|
|
16630
|
+
var updateMothershipBoardRequestSchema = z29.object({
|
|
16523
16631
|
overview: clearable(text3(L.overview)).describe(`One line at the top of the board on where the work as a whole stands. "" removes it. At most ${L.overview} characters.`),
|
|
16524
|
-
tickets:
|
|
16525
|
-
id:
|
|
16632
|
+
tickets: z29.array(z29.object({
|
|
16633
|
+
id: z29.uuid(),
|
|
16526
16634
|
title: mothershipTicketTitleSchema.optional(),
|
|
16527
16635
|
issue: issueSchema,
|
|
16528
16636
|
fix: fixSchema,
|
|
16529
|
-
pull_requests:
|
|
16637
|
+
pull_requests: z29.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
|
|
16530
16638
|
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
|
|
16531
16639
|
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
16532
|
-
archived:
|
|
16640
|
+
archived: z29.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
|
|
16533
16641
|
})).max(50).optional().describe("Changes to existing tickets."),
|
|
16534
|
-
order:
|
|
16535
|
-
create:
|
|
16642
|
+
order: z29.array(z29.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
16643
|
+
create: z29.array(z29.object({
|
|
16536
16644
|
title: mothershipTicketTitleSchema,
|
|
16537
16645
|
task: mothershipTicketTaskSchema.optional(),
|
|
16538
16646
|
issue: text3(L.issue).optional(),
|
|
16539
|
-
questions:
|
|
16647
|
+
questions: z29.array(questionSchema).max(L.questions).optional(),
|
|
16540
16648
|
note: text3(L.note).optional()
|
|
16541
16649
|
})).max(5).optional().describe("Tickets with no ship, for your own questions to the user or work no ship does. Their answers come to you.")
|
|
16542
16650
|
});
|
|
16543
|
-
var answerMothershipTicketRequestSchema =
|
|
16544
|
-
questionId:
|
|
16651
|
+
var answerMothershipTicketRequestSchema = z29.object({
|
|
16652
|
+
questionId: z29.string().min(1),
|
|
16545
16653
|
answer: text3(L.answer)
|
|
16546
16654
|
});
|
|
16547
|
-
var mothershipTicketAnswerRefSchema =
|
|
16548
|
-
var replyOnMothershipTicketRequestSchema =
|
|
16655
|
+
var mothershipTicketAnswerRefSchema = z29.object({ mothershipId: z29.uuid(), ticketId: z29.uuid(), questionId: z29.string().min(1) });
|
|
16656
|
+
var replyOnMothershipTicketRequestSchema = z29.object({
|
|
16549
16657
|
reply: text3(L.reply).describe(`Your answer to the user's latest message on the ticket, in a few sentences. ${markdown} Link a screenshot or recording uploaded with \`replicas media upload\` if it helps. At most ${L.reply} characters; keep longer detail in your chat.`),
|
|
16550
16658
|
question: questionSchema.optional().describe("A follow-up question only if you need the user to decide something. It shows on the ticket with its options, and their answer comes back to you.")
|
|
16551
16659
|
});
|
|
16552
|
-
var mothershipTicketReplyRefSchema =
|
|
16553
|
-
var mothershipTicketThreadSchema =
|
|
16554
|
-
id:
|
|
16555
|
-
from:
|
|
16556
|
-
name:
|
|
16557
|
-
ship_id:
|
|
16558
|
-
chat_id:
|
|
16559
|
-
text:
|
|
16560
|
-
at:
|
|
16561
|
-
nudge:
|
|
16660
|
+
var mothershipTicketReplyRefSchema = z29.object({ ticketId: z29.uuid(), text: text3(L.answer) });
|
|
16661
|
+
var mothershipTicketThreadSchema = z29.array(z29.object({
|
|
16662
|
+
id: z29.string(),
|
|
16663
|
+
from: z29.enum(["user", "ship"]),
|
|
16664
|
+
name: z29.string(),
|
|
16665
|
+
ship_id: z29.string(),
|
|
16666
|
+
chat_id: z29.string(),
|
|
16667
|
+
text: z29.string(),
|
|
16668
|
+
at: z29.string(),
|
|
16669
|
+
nudge: z29.enum(["sent", "missed"]).optional()
|
|
16562
16670
|
}));
|
|
16563
16671
|
var LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
16564
|
-
var linearIssueSummariesRequestSchema =
|
|
16672
|
+
var linearIssueSummariesRequestSchema = z29.object({ identifiers: z29.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
16565
16673
|
|
|
16566
16674
|
// ../shared/src/user-message-matching.ts
|
|
16567
16675
|
var parsedTimestamps = /* @__PURE__ */ new Map();
|
|
@@ -16931,10 +17039,10 @@ function currentStepLabel(messages, earlierPlainStep) {
|
|
|
16931
17039
|
}
|
|
16932
17040
|
|
|
16933
17041
|
// ../shared/src/user-message-attachments.ts
|
|
16934
|
-
import { z as
|
|
17042
|
+
import { z as z30 } from "zod";
|
|
16935
17043
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
16936
17044
|
var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
16937
|
-
var annotationLinesSchema =
|
|
17045
|
+
var annotationLinesSchema = z30.object({ path: z30.string(), start: z30.number(), end: z30.number() });
|
|
16938
17046
|
var ANNOTATIONS_NOTE_OPENING = '<replicas_annotations>\nThe user quoted these passages, some with a comment. Address each annotation, and when you do, refer to it as "Annotation N".';
|
|
16939
17047
|
var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
16940
17048
|
var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
|
|
@@ -19617,8 +19725,8 @@ function parseAgentEventJsonl(content, options = {}) {
|
|
|
19617
19725
|
}
|
|
19618
19726
|
|
|
19619
19727
|
// ../shared/src/chat-transcript-pages.ts
|
|
19620
|
-
var
|
|
19621
|
-
var
|
|
19728
|
+
var decoder2 = new TextDecoder("utf-8", { fatal: true });
|
|
19729
|
+
var encoder2 = new TextEncoder();
|
|
19622
19730
|
var MAX_SOURCE_PAGE_BYTES = 4 * 1024 * 1024;
|
|
19623
19731
|
var SOURCE_RANGE_BYTES = 256 * 1024;
|
|
19624
19732
|
var CHAT_HISTORY_PAGE_MAX_BYTES = 1024 * 1024;
|
|
@@ -19630,7 +19738,7 @@ async function readExactRange(readRange, startByte, endByte, error) {
|
|
|
19630
19738
|
function forEachJsonlRecord(bytes, lineStart, offset, visit) {
|
|
19631
19739
|
for (let lineEnd = bytes.indexOf(10, lineStart); lineEnd !== -1; lineEnd = bytes.indexOf(10, lineStart)) {
|
|
19632
19740
|
try {
|
|
19633
|
-
visit(JSON.parse(
|
|
19741
|
+
visit(JSON.parse(decoder2.decode(bytes.subarray(lineStart, lineEnd))), { offset: offset + lineStart, length: lineEnd - lineStart });
|
|
19634
19742
|
} catch {
|
|
19635
19743
|
}
|
|
19636
19744
|
lineStart = lineEnd + 1;
|
|
@@ -19682,7 +19790,7 @@ async function readJsonlPage(args) {
|
|
|
19682
19790
|
pageRecordStarts.push(record.offset);
|
|
19683
19791
|
const item = args.parse(value, record);
|
|
19684
19792
|
if (item === void 0) return;
|
|
19685
|
-
const itemSize = item === value ? record.length :
|
|
19793
|
+
const itemSize = item === value ? record.length : encoder2.encode(JSON.stringify(item)).byteLength;
|
|
19686
19794
|
page.push({ item, startByte: record.offset, bytes: itemSize });
|
|
19687
19795
|
itemBytes += itemSize;
|
|
19688
19796
|
const turnId = args.turns?.turnId(item);
|
|
@@ -19792,7 +19900,7 @@ async function readJsonlRecord(args) {
|
|
|
19792
19900
|
const bytes = await readExactRange(args.readRange, from, offset + length + 1, "Incomplete JSONL record read");
|
|
19793
19901
|
if (offset > 0 && bytes[0] !== 10 || bytes[bytes.length - 1] !== 10) return void 0;
|
|
19794
19902
|
try {
|
|
19795
|
-
return JSON.parse(
|
|
19903
|
+
return JSON.parse(decoder2.decode(bytes.subarray(offset - from, bytes.length - 1)));
|
|
19796
19904
|
} catch {
|
|
19797
19905
|
return void 0;
|
|
19798
19906
|
}
|
|
@@ -20231,7 +20339,7 @@ var VOICE_WAVEFORM = {
|
|
|
20231
20339
|
};
|
|
20232
20340
|
|
|
20233
20341
|
// ../shared/src/e2b.ts
|
|
20234
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-
|
|
20342
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v4";
|
|
20235
20343
|
|
|
20236
20344
|
// ../shared/src/e2b-retry.ts
|
|
20237
20345
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -20587,38 +20695,38 @@ function resolveWarmHookConfig(value) {
|
|
|
20587
20695
|
}
|
|
20588
20696
|
|
|
20589
20697
|
// ../shared/src/environment-config.ts
|
|
20590
|
-
import { z as
|
|
20591
|
-
var variableNameSchema =
|
|
20592
|
-
var mcpValueSchema =
|
|
20593
|
-
|
|
20698
|
+
import { z as z31 } from "zod";
|
|
20699
|
+
var variableNameSchema = z31.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
|
|
20700
|
+
var mcpValueSchema = z31.union([
|
|
20701
|
+
z31.string(),
|
|
20594
20702
|
environmentMcpVariableReferenceSchema
|
|
20595
20703
|
]);
|
|
20596
|
-
var mcpValuesSchema =
|
|
20704
|
+
var mcpValuesSchema = z31.record(z31.string(), mcpValueSchema);
|
|
20597
20705
|
var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
|
|
20598
20706
|
headers: mcpValuesSchema.default({})
|
|
20599
20707
|
}).strict();
|
|
20600
|
-
var replicasMcpDefinitionSchema =
|
|
20601
|
-
|
|
20602
|
-
transport:
|
|
20708
|
+
var replicasMcpDefinitionSchema = z31.discriminatedUnion("transport", [
|
|
20709
|
+
z31.strictObject({
|
|
20710
|
+
transport: z31.literal("stdio"),
|
|
20603
20711
|
config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
|
|
20604
20712
|
args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
|
|
20605
|
-
env:
|
|
20713
|
+
env: z31.record(variableNameSchema, mcpValueSchema).default({})
|
|
20606
20714
|
}).strict()
|
|
20607
20715
|
}),
|
|
20608
|
-
|
|
20609
|
-
|
|
20716
|
+
z31.strictObject({ transport: z31.literal("http"), config: httpConfigSchema }),
|
|
20717
|
+
z31.strictObject({ transport: z31.literal("sse"), config: httpConfigSchema })
|
|
20610
20718
|
]).superRefine((definition, context) => {
|
|
20611
20719
|
if (definition.transport === "stdio") return;
|
|
20612
20720
|
const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
|
|
20613
20721
|
if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
|
|
20614
20722
|
});
|
|
20615
|
-
var replicasEnvironmentConfigSchema =
|
|
20616
|
-
systemPrompt:
|
|
20617
|
-
warmHook:
|
|
20618
|
-
startHook:
|
|
20619
|
-
variables:
|
|
20620
|
-
requiredSecrets:
|
|
20621
|
-
mcps:
|
|
20723
|
+
var replicasEnvironmentConfigSchema = z31.strictObject({
|
|
20724
|
+
systemPrompt: z31.string().optional(),
|
|
20725
|
+
warmHook: z31.string().optional(),
|
|
20726
|
+
startHook: z31.string().optional(),
|
|
20727
|
+
variables: z31.record(variableNameSchema, z31.string()).optional(),
|
|
20728
|
+
requiredSecrets: z31.array(variableNameSchema).optional(),
|
|
20729
|
+
mcps: z31.record(z31.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
|
|
20622
20730
|
}).superRefine((config, context) => {
|
|
20623
20731
|
const names = /* @__PURE__ */ new Set();
|
|
20624
20732
|
for (const name of Object.keys(config.mcps ?? {})) {
|
|
@@ -20770,11 +20878,15 @@ function hasChatStarted(chat) {
|
|
|
20770
20878
|
return chat.processing || Boolean(chat.awaitingInput) || Boolean(chat.goal) || Boolean(chat.lastMessageText) || chat.updatedAt > chat.createdAt;
|
|
20771
20879
|
}
|
|
20772
20880
|
|
|
20881
|
+
// ../shared/src/engine/exec-client.ts
|
|
20882
|
+
var RECONNECT_GIVE_UP_MS = 2 * 6e4;
|
|
20883
|
+
var encoder3 = new TextEncoder();
|
|
20884
|
+
|
|
20773
20885
|
// ../shared/src/routes/billing.ts
|
|
20774
|
-
import { z as
|
|
20886
|
+
import { z as z32 } from "zod";
|
|
20775
20887
|
var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
|
|
20776
|
-
var usageLimitCentsSchema =
|
|
20777
|
-
var sourceLimitsCentsSchema =
|
|
20888
|
+
var usageLimitCentsSchema = z32.number().int().min(100).max(1e8);
|
|
20889
|
+
var sourceLimitsCentsSchema = z32.partialRecord(z32.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
|
|
20778
20890
|
|
|
20779
20891
|
// ../shared/src/routes/codex.ts
|
|
20780
20892
|
var CODEX_AUTH_ENV_KEYS = [
|
|
@@ -20928,7 +21040,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
20928
21040
|
};
|
|
20929
21041
|
|
|
20930
21042
|
// ../shared/src/routes/command-protection.ts
|
|
20931
|
-
import { z as
|
|
21043
|
+
import { z as z33 } from "zod";
|
|
20932
21044
|
|
|
20933
21045
|
// ../shared/src/git-invocations.ts
|
|
20934
21046
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -21019,27 +21131,27 @@ function findCheckoutTarget(args) {
|
|
|
21019
21131
|
}
|
|
21020
21132
|
|
|
21021
21133
|
// ../shared/src/routes/command-protection.ts
|
|
21022
|
-
var commandProtectionRepoStateSchema =
|
|
21023
|
-
branch:
|
|
21024
|
-
defaultBranch:
|
|
21025
|
-
pushBranch:
|
|
21026
|
-
pushConfig:
|
|
21027
|
-
headMessage:
|
|
21028
|
-
mergeInProgress:
|
|
21134
|
+
var commandProtectionRepoStateSchema = z33.object({
|
|
21135
|
+
branch: z33.string().nullable(),
|
|
21136
|
+
defaultBranch: z33.string().nullable(),
|
|
21137
|
+
pushBranch: z33.string().nullable(),
|
|
21138
|
+
pushConfig: z33.string().nullable(),
|
|
21139
|
+
headMessage: z33.string().nullable(),
|
|
21140
|
+
mergeInProgress: z33.boolean().optional()
|
|
21029
21141
|
});
|
|
21030
|
-
var commandProtectionEvaluateRequestSchema =
|
|
21031
|
-
provider:
|
|
21032
|
-
source:
|
|
21033
|
-
toolName:
|
|
21034
|
-
toolInput:
|
|
21035
|
-
command:
|
|
21036
|
-
cwd:
|
|
21037
|
-
toolUseId:
|
|
21142
|
+
var commandProtectionEvaluateRequestSchema = z33.object({
|
|
21143
|
+
provider: z33.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
21144
|
+
source: z33.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
21145
|
+
toolName: z33.string(),
|
|
21146
|
+
toolInput: z33.unknown(),
|
|
21147
|
+
command: z33.string().nullish(),
|
|
21148
|
+
cwd: z33.string().nullish(),
|
|
21149
|
+
toolUseId: z33.string().nullish(),
|
|
21038
21150
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
21039
21151
|
// policy can see branches and commit messages the command text only references.
|
|
21040
|
-
gitContext:
|
|
21041
|
-
repos:
|
|
21042
|
-
messageFiles:
|
|
21152
|
+
gitContext: z33.object({
|
|
21153
|
+
repos: z33.record(z33.string(), commandProtectionRepoStateSchema),
|
|
21154
|
+
messageFiles: z33.record(z33.string(), z33.string())
|
|
21043
21155
|
}).optional()
|
|
21044
21156
|
});
|
|
21045
21157
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -21260,125 +21372,125 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
21260
21372
|
}
|
|
21261
21373
|
|
|
21262
21374
|
// ../shared/src/routes/scout.ts
|
|
21263
|
-
import { z as
|
|
21375
|
+
import { z as z34 } from "zod";
|
|
21264
21376
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
21265
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
21266
|
-
comment_id:
|
|
21267
|
-
action:
|
|
21377
|
+
var scoutLinearSessionIntentRequestSchema = z34.object({
|
|
21378
|
+
comment_id: z34.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
21379
|
+
action: z34.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
21268
21380
|
});
|
|
21269
|
-
var scoutLinearStartRequestSchema =
|
|
21270
|
-
issue_id:
|
|
21271
|
-
agent_session_id:
|
|
21272
|
-
prompt:
|
|
21381
|
+
var scoutLinearStartRequestSchema = z34.object({
|
|
21382
|
+
issue_id: z34.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
21383
|
+
agent_session_id: z34.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
21384
|
+
prompt: z34.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
21273
21385
|
});
|
|
21274
|
-
var scoutRouteLinearTicketRequestSchema =
|
|
21275
|
-
agent_session_id:
|
|
21276
|
-
environment_id:
|
|
21277
|
-
mothership_id:
|
|
21386
|
+
var scoutRouteLinearTicketRequestSchema = z34.object({
|
|
21387
|
+
agent_session_id: z34.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
|
|
21388
|
+
environment_id: z34.string().trim().min(1).optional().describe("Start the ticket in this environment."),
|
|
21389
|
+
mothership_id: z34.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
|
|
21278
21390
|
}).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
|
|
21279
|
-
var slackChannelIdSchema =
|
|
21280
|
-
var slackThreadTsSchema =
|
|
21281
|
-
var scoutSlackMessageReferenceSchema =
|
|
21391
|
+
var slackChannelIdSchema = z34.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
21392
|
+
var slackThreadTsSchema = z34.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
21393
|
+
var scoutSlackMessageReferenceSchema = z34.object({
|
|
21282
21394
|
channel_id: slackChannelIdSchema,
|
|
21283
21395
|
thread_ts: slackThreadTsSchema,
|
|
21284
|
-
message_ts:
|
|
21285
|
-
user_id:
|
|
21396
|
+
message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
21397
|
+
user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
|
|
21286
21398
|
});
|
|
21287
|
-
var scoutSlackSpawnRequestSchema =
|
|
21399
|
+
var scoutSlackSpawnRequestSchema = z34.object({
|
|
21288
21400
|
channel_id: slackChannelIdSchema,
|
|
21289
21401
|
thread_ts: slackThreadTsSchema,
|
|
21290
|
-
message_ts:
|
|
21291
|
-
user_id:
|
|
21292
|
-
prompt:
|
|
21293
|
-
acknowledgement_ts:
|
|
21294
|
-
environment_id:
|
|
21402
|
+
message_ts: z34.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
|
|
21403
|
+
user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
21404
|
+
prompt: z34.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
|
|
21405
|
+
acknowledgement_ts: z34.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
|
|
21406
|
+
environment_id: z34.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
|
|
21295
21407
|
});
|
|
21296
21408
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
21297
|
-
title:
|
|
21298
|
-
prompt:
|
|
21299
|
-
acknowledgement_ts:
|
|
21409
|
+
title: z34.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
21410
|
+
prompt: z34.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
|
|
21411
|
+
acknowledgement_ts: z34.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
|
|
21300
21412
|
});
|
|
21301
|
-
var scoutSlackRelayRequestSchema =
|
|
21413
|
+
var scoutSlackRelayRequestSchema = z34.object({
|
|
21302
21414
|
channel_id: slackChannelIdSchema,
|
|
21303
21415
|
thread_ts: slackThreadTsSchema,
|
|
21304
|
-
message:
|
|
21305
|
-
user_id:
|
|
21306
|
-
queue:
|
|
21307
|
-
workspace_id:
|
|
21308
|
-
message_ts:
|
|
21416
|
+
message: z34.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
|
|
21417
|
+
user_id: z34.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
|
|
21418
|
+
queue: z34.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
|
|
21419
|
+
workspace_id: z34.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Mothership gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Mothership's channel, nothing is bound: the workspace or Mothership gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
|
|
21420
|
+
message_ts: z34.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
|
|
21309
21421
|
});
|
|
21310
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
21422
|
+
var scoutSlackSetThreadMutedRequestSchema = z34.object({
|
|
21311
21423
|
channel_id: slackChannelIdSchema,
|
|
21312
21424
|
thread_ts: slackThreadTsSchema,
|
|
21313
|
-
muted:
|
|
21425
|
+
muted: z34.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
21314
21426
|
});
|
|
21315
21427
|
var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
|
|
21316
|
-
archive:
|
|
21428
|
+
archive: z34.boolean().describe("true only when the person also asked to close or archive the workspace.")
|
|
21317
21429
|
});
|
|
21318
|
-
var scoutListWorkspacesRequestSchema =
|
|
21430
|
+
var scoutListWorkspacesRequestSchema = z34.object({
|
|
21319
21431
|
channel_id: slackChannelIdSchema,
|
|
21320
21432
|
thread_ts: slackThreadTsSchema,
|
|
21321
|
-
message_ts:
|
|
21322
|
-
user_id:
|
|
21323
|
-
query:
|
|
21433
|
+
message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
21434
|
+
user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
21435
|
+
query: z34.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
|
|
21324
21436
|
});
|
|
21325
|
-
var scoutSlackConfirmationSchema =
|
|
21326
|
-
confirmation_channel_id:
|
|
21327
|
-
confirmation_thread_ts:
|
|
21328
|
-
confirmation_message_ts:
|
|
21329
|
-
confirmation_user_id:
|
|
21437
|
+
var scoutSlackConfirmationSchema = z34.object({
|
|
21438
|
+
confirmation_channel_id: z34.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
21439
|
+
confirmation_thread_ts: z34.string().describe("`thread_ts` from that message's envelope."),
|
|
21440
|
+
confirmation_message_ts: z34.string().describe("`message_ts` from that message's envelope."),
|
|
21441
|
+
confirmation_user_id: z34.string().describe("`user_id` from that message's envelope.")
|
|
21330
21442
|
});
|
|
21331
21443
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
21332
21444
|
var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21333
|
-
preset_id:
|
|
21334
|
-
name:
|
|
21335
|
-
description:
|
|
21336
|
-
icon:
|
|
21337
|
-
instructions:
|
|
21445
|
+
preset_id: z34.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
21446
|
+
name: z34.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
21447
|
+
description: z34.string().optional().describe("One-line summary of what the preset is for."),
|
|
21448
|
+
icon: z34.enum(SCOUT_PRESET_ICONS).optional(),
|
|
21449
|
+
instructions: z34.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
21338
21450
|
});
|
|
21339
21451
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21340
|
-
source:
|
|
21341
|
-
external_id:
|
|
21342
|
-
monitored:
|
|
21343
|
-
preset_id:
|
|
21344
|
-
instructions:
|
|
21345
|
-
proactivity:
|
|
21346
|
-
silent:
|
|
21347
|
-
muted:
|
|
21452
|
+
source: z34.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
21453
|
+
external_id: z34.string().describe("Slack channel id or Linear team id."),
|
|
21454
|
+
monitored: z34.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
|
|
21455
|
+
preset_id: z34.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
21456
|
+
instructions: z34.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
|
|
21457
|
+
proactivity: z34.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
|
|
21458
|
+
silent: z34.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
|
|
21459
|
+
muted: z34.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
|
|
21348
21460
|
});
|
|
21349
21461
|
var mothershipSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21350
21462
|
proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Mothership's channel raises to at least `balanced`.")
|
|
21351
21463
|
});
|
|
21352
21464
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21353
|
-
muted:
|
|
21465
|
+
muted: z34.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
|
|
21354
21466
|
});
|
|
21355
21467
|
var scoutSetSlackConnectDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21356
|
-
silent:
|
|
21357
|
-
muted:
|
|
21358
|
-
preset_id:
|
|
21359
|
-
instructions:
|
|
21360
|
-
proactivity:
|
|
21468
|
+
silent: z34.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
|
|
21469
|
+
muted: z34.boolean().optional().describe("Kept for older callers; prefer `silent`."),
|
|
21470
|
+
preset_id: z34.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
|
|
21471
|
+
instructions: z34.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
|
|
21472
|
+
proactivity: z34.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
|
|
21361
21473
|
});
|
|
21362
21474
|
var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21363
|
-
proactivity:
|
|
21475
|
+
proactivity: z34.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
|
|
21364
21476
|
});
|
|
21365
21477
|
var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21366
|
-
preset_id:
|
|
21478
|
+
preset_id: z34.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
21367
21479
|
});
|
|
21368
21480
|
var RESET_TO_DEFAULT = "default";
|
|
21369
|
-
var resettable = (schema, description) =>
|
|
21481
|
+
var resettable = (schema, description) => z34.union([schema, z34.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
|
|
21370
21482
|
var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21371
|
-
agent_provider: resettable(
|
|
21372
|
-
model: resettable(
|
|
21373
|
-
thinking_level: resettable(
|
|
21374
|
-
goal_mode: resettable(
|
|
21375
|
-
fast_mode: resettable(
|
|
21483
|
+
agent_provider: resettable(z34.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
|
|
21484
|
+
model: resettable(z34.string(), "Model id for that agent; the default is the agent's own."),
|
|
21485
|
+
thinking_level: resettable(z34.enum(VALID_THINKING_LEVELS), "Thinking level."),
|
|
21486
|
+
goal_mode: resettable(z34.boolean(), "Goal mode."),
|
|
21487
|
+
fast_mode: resettable(z34.boolean(), "Fast mode.")
|
|
21376
21488
|
});
|
|
21377
|
-
var scoutClaimSettingsOfferToolInputSchema =
|
|
21489
|
+
var scoutClaimSettingsOfferToolInputSchema = z34.object({
|
|
21378
21490
|
channel_id: slackChannelIdSchema,
|
|
21379
|
-
kind:
|
|
21380
|
-
user_id:
|
|
21381
|
-
declined:
|
|
21491
|
+
kind: z34.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
|
|
21492
|
+
user_id: z34.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
|
|
21493
|
+
declined: z34.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
|
|
21382
21494
|
});
|
|
21383
21495
|
|
|
21384
21496
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -21736,22 +21848,22 @@ var PLUGIN_CATALOG = [
|
|
|
21736
21848
|
].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
|
|
21737
21849
|
|
|
21738
21850
|
// ../shared/src/routes/sentry.ts
|
|
21739
|
-
import { z as
|
|
21740
|
-
var sentrySelfHostedConnectRequestSchema =
|
|
21741
|
-
baseUrl:
|
|
21742
|
-
token:
|
|
21743
|
-
webhookSecret:
|
|
21851
|
+
import { z as z35 } from "zod";
|
|
21852
|
+
var sentrySelfHostedConnectRequestSchema = z35.object({
|
|
21853
|
+
baseUrl: z35.string().min(1),
|
|
21854
|
+
token: z35.string().trim().min(1),
|
|
21855
|
+
webhookSecret: z35.string().trim().optional()
|
|
21744
21856
|
});
|
|
21745
21857
|
|
|
21746
21858
|
// ../shared/src/routes/user.ts
|
|
21747
21859
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
21748
21860
|
|
|
21749
21861
|
// ../shared/src/routes/web-auth.ts
|
|
21750
|
-
import { z as
|
|
21751
|
-
var webAuthRedeemResponseSchema =
|
|
21752
|
-
path:
|
|
21753
|
-
organizationId:
|
|
21754
|
-
session:
|
|
21862
|
+
import { z as z36 } from "zod";
|
|
21863
|
+
var webAuthRedeemResponseSchema = z36.object({
|
|
21864
|
+
path: z36.string(),
|
|
21865
|
+
organizationId: z36.string().nullable(),
|
|
21866
|
+
session: z36.object({ access_token: z36.string(), refresh_token: z36.string(), user: z36.object({ id: z36.string(), email: z36.string() }) }).nullable()
|
|
21755
21867
|
});
|
|
21756
21868
|
|
|
21757
21869
|
// ../shared/src/routes/client-state.ts
|
|
@@ -21776,104 +21888,104 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
|
|
|
21776
21888
|
var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
|
|
21777
21889
|
|
|
21778
21890
|
// ../shared/src/routes/workspace-events.ts
|
|
21779
|
-
import { z as
|
|
21891
|
+
import { z as z38 } from "zod";
|
|
21780
21892
|
|
|
21781
21893
|
// ../shared/src/routes/presence.ts
|
|
21782
|
-
import { z as
|
|
21783
|
-
var presenceStatusSchema =
|
|
21784
|
-
var presenceLocationSchema =
|
|
21785
|
-
workspaceId:
|
|
21894
|
+
import { z as z37 } from "zod";
|
|
21895
|
+
var presenceStatusSchema = z37.enum(["online", "typing"]);
|
|
21896
|
+
var presenceLocationSchema = z37.object({
|
|
21897
|
+
workspaceId: z37.string().optional()
|
|
21786
21898
|
});
|
|
21787
|
-
var presenceEntrySchema =
|
|
21788
|
-
userId:
|
|
21899
|
+
var presenceEntrySchema = z37.object({
|
|
21900
|
+
userId: z37.string(),
|
|
21789
21901
|
status: presenceStatusSchema,
|
|
21790
21902
|
location: presenceLocationSchema,
|
|
21791
|
-
ts:
|
|
21903
|
+
ts: z37.string()
|
|
21792
21904
|
});
|
|
21793
|
-
var updatePresenceRequestSchema =
|
|
21905
|
+
var updatePresenceRequestSchema = z37.object({
|
|
21794
21906
|
status: presenceStatusSchema,
|
|
21795
21907
|
location: presenceLocationSchema.optional()
|
|
21796
21908
|
});
|
|
21797
21909
|
|
|
21798
21910
|
// ../shared/src/routes/workspace-events.ts
|
|
21799
|
-
var workspaceTurnCompletionSchema =
|
|
21800
|
-
workspaceName:
|
|
21801
|
-
completedAt:
|
|
21802
|
-
processing:
|
|
21803
|
-
pullRequestFeedback:
|
|
21804
|
-
attention:
|
|
21911
|
+
var workspaceTurnCompletionSchema = z38.object({
|
|
21912
|
+
workspaceName: z38.string(),
|
|
21913
|
+
completedAt: z38.string(),
|
|
21914
|
+
processing: z38.boolean().optional(),
|
|
21915
|
+
pullRequestFeedback: z38.boolean().optional(),
|
|
21916
|
+
attention: z38.object({ reason: z38.enum(CHAT_ATTENTION_REASONS), userId: z38.string() }).optional()
|
|
21805
21917
|
});
|
|
21806
|
-
var workspaceEventSchemaByType =
|
|
21807
|
-
|
|
21808
|
-
type:
|
|
21809
|
-
workspaceId:
|
|
21810
|
-
accessChangedFor:
|
|
21811
|
-
accessChangedForOrg:
|
|
21812
|
-
workspace:
|
|
21813
|
-
name:
|
|
21918
|
+
var workspaceEventSchemaByType = z38.discriminatedUnion("type", [
|
|
21919
|
+
z38.object({
|
|
21920
|
+
type: z38.literal("workspace.changed"),
|
|
21921
|
+
workspaceId: z38.string(),
|
|
21922
|
+
accessChangedFor: z38.string().optional(),
|
|
21923
|
+
accessChangedForOrg: z38.literal(true).optional(),
|
|
21924
|
+
workspace: z38.object({ status: z38.enum(WORKSPACE_STATUSES), last_activity_at: z38.string().nullable() }).optional(),
|
|
21925
|
+
name: z38.string().optional(),
|
|
21814
21926
|
completion: workspaceTurnCompletionSchema.optional(),
|
|
21815
|
-
ts:
|
|
21927
|
+
ts: z38.string()
|
|
21816
21928
|
}),
|
|
21817
|
-
|
|
21818
|
-
type:
|
|
21819
|
-
workspaceId:
|
|
21820
|
-
chatId:
|
|
21821
|
-
ts:
|
|
21929
|
+
z38.object({
|
|
21930
|
+
type: z38.literal("workspace.chat.changed"),
|
|
21931
|
+
workspaceId: z38.string(),
|
|
21932
|
+
chatId: z38.string(),
|
|
21933
|
+
ts: z38.string()
|
|
21822
21934
|
}),
|
|
21823
|
-
|
|
21824
|
-
type:
|
|
21825
|
-
workspaceId:
|
|
21826
|
-
chatId:
|
|
21827
|
-
afterCursor:
|
|
21828
|
-
processing:
|
|
21829
|
-
ts:
|
|
21935
|
+
z38.object({
|
|
21936
|
+
type: z38.literal("workspace.chat.advanced"),
|
|
21937
|
+
workspaceId: z38.string(),
|
|
21938
|
+
chatId: z38.string(),
|
|
21939
|
+
afterCursor: z38.string().optional(),
|
|
21940
|
+
processing: z38.boolean(),
|
|
21941
|
+
ts: z38.string()
|
|
21830
21942
|
}),
|
|
21831
|
-
|
|
21832
|
-
type:
|
|
21833
|
-
workspaceId:
|
|
21834
|
-
ts:
|
|
21943
|
+
z38.object({
|
|
21944
|
+
type: z38.literal("mobile-testing.changed"),
|
|
21945
|
+
workspaceId: z38.string(),
|
|
21946
|
+
ts: z38.string()
|
|
21835
21947
|
}),
|
|
21836
|
-
|
|
21837
|
-
type:
|
|
21838
|
-
workspaceId:
|
|
21839
|
-
ts:
|
|
21948
|
+
z38.object({
|
|
21949
|
+
type: z38.literal("variable-request.changed"),
|
|
21950
|
+
workspaceId: z38.string(),
|
|
21951
|
+
ts: z38.string()
|
|
21840
21952
|
}),
|
|
21841
|
-
|
|
21842
|
-
type:
|
|
21843
|
-
workspaceId:
|
|
21844
|
-
ts:
|
|
21953
|
+
z38.object({
|
|
21954
|
+
type: z38.literal("local-control-request.changed"),
|
|
21955
|
+
workspaceId: z38.string(),
|
|
21956
|
+
ts: z38.string()
|
|
21845
21957
|
}),
|
|
21846
|
-
|
|
21847
|
-
type:
|
|
21848
|
-
prUrl:
|
|
21849
|
-
ts:
|
|
21958
|
+
z38.object({
|
|
21959
|
+
type: z38.literal("pull-request.changed"),
|
|
21960
|
+
prUrl: z38.string(),
|
|
21961
|
+
ts: z38.string()
|
|
21850
21962
|
}),
|
|
21851
|
-
|
|
21852
|
-
type:
|
|
21853
|
-
workspaceId:
|
|
21854
|
-
subagent:
|
|
21855
|
-
ts:
|
|
21963
|
+
z38.object({
|
|
21964
|
+
type: z38.literal("mothership.subagent.changed"),
|
|
21965
|
+
workspaceId: z38.string(),
|
|
21966
|
+
subagent: z38.object({ id: z38.string(), name: z38.string(), prUrl: z38.string().nullable() }),
|
|
21967
|
+
ts: z38.string()
|
|
21856
21968
|
}),
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21860
|
-
type:
|
|
21861
|
-
workspaceId:
|
|
21862
|
-
workspaceName:
|
|
21863
|
-
sharedWithUserId:
|
|
21864
|
-
sharedByName:
|
|
21865
|
-
ts:
|
|
21969
|
+
z38.object({ type: z38.literal("mothership.board.changed"), workspaceId: z38.string(), ts: z38.string() }),
|
|
21970
|
+
z38.object({ type: z38.literal("needs-you.changed"), workspaceId: z38.string().nullable(), userId: z38.string().optional(), ts: z38.string() }),
|
|
21971
|
+
z38.object({
|
|
21972
|
+
type: z38.literal("workspace.shared"),
|
|
21973
|
+
workspaceId: z38.string(),
|
|
21974
|
+
workspaceName: z38.string(),
|
|
21975
|
+
sharedWithUserId: z38.string(),
|
|
21976
|
+
sharedByName: z38.string(),
|
|
21977
|
+
ts: z38.string()
|
|
21866
21978
|
})
|
|
21867
21979
|
]);
|
|
21868
|
-
var workspaceChangedEventSchema =
|
|
21980
|
+
var workspaceChangedEventSchema = z38.union([
|
|
21869
21981
|
workspaceEventSchemaByType,
|
|
21870
|
-
|
|
21871
|
-
|
|
21982
|
+
z38.object({ type: z38.literal("presence.changed"), userId: z38.string(), entry: presenceEntrySchema.nullable(), ts: z38.string() }),
|
|
21983
|
+
z38.object({ type: z38.literal("presence.changed"), ts: z38.string() })
|
|
21872
21984
|
]);
|
|
21873
21985
|
|
|
21874
21986
|
// ../shared/src/routes/review-messages.ts
|
|
21875
|
-
import { z as
|
|
21876
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
21987
|
+
import { z as z39 } from "zod";
|
|
21988
|
+
var sendPullRequestReviewMessageRequestSchema = z39.object({
|
|
21877
21989
|
...sendChatMessageRequestSchema.pick({
|
|
21878
21990
|
message: true,
|
|
21879
21991
|
messageId: true,
|
|
@@ -21886,8 +21998,8 @@ var sendPullRequestReviewMessageRequestSchema = z38.object({
|
|
|
21886
21998
|
ultrafastMode: true
|
|
21887
21999
|
}).shape,
|
|
21888
22000
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
21889
|
-
newChat:
|
|
21890
|
-
provider:
|
|
22001
|
+
newChat: z39.boolean().optional(),
|
|
22002
|
+
provider: z39.enum(VALID_AGENT_PROVIDERS).optional()
|
|
21891
22003
|
});
|
|
21892
22004
|
|
|
21893
22005
|
// ../shared/src/audit-log.ts
|
|
@@ -22550,40 +22662,40 @@ function isSkillRegistryManifest(value) {
|
|
|
22550
22662
|
}
|
|
22551
22663
|
|
|
22552
22664
|
// ../shared/src/routes/variable-requests.ts
|
|
22553
|
-
import { z as
|
|
22665
|
+
import { z as z40 } from "zod";
|
|
22554
22666
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
22555
22667
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
22556
|
-
var requestedVariableSchema =
|
|
22557
|
-
key:
|
|
22558
|
-
required:
|
|
22559
|
-
replace:
|
|
22668
|
+
var requestedVariableSchema = z40.object({
|
|
22669
|
+
key: z40.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
22670
|
+
required: z40.boolean(),
|
|
22671
|
+
replace: z40.boolean().optional()
|
|
22560
22672
|
});
|
|
22561
|
-
var requestedVariablesSchema =
|
|
22562
|
-
var createVariableRequestSchema =
|
|
22673
|
+
var requestedVariablesSchema = z40.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
|
|
22674
|
+
var createVariableRequestSchema = z40.object({
|
|
22563
22675
|
variables: requestedVariablesSchema,
|
|
22564
|
-
reason:
|
|
22565
|
-
wait:
|
|
22676
|
+
reason: z40.string().trim().max(500).nullish().transform((value) => value || null),
|
|
22677
|
+
wait: z40.boolean().default(true)
|
|
22566
22678
|
});
|
|
22567
|
-
var respondVariableRequestSchema =
|
|
22568
|
-
|
|
22569
|
-
action:
|
|
22570
|
-
destination:
|
|
22679
|
+
var respondVariableRequestSchema = z40.discriminatedUnion("action", [
|
|
22680
|
+
z40.object({
|
|
22681
|
+
action: z40.literal("provide"),
|
|
22682
|
+
destination: z40.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
22571
22683
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
22572
|
-
environment_ids:
|
|
22573
|
-
overwrite:
|
|
22574
|
-
values:
|
|
22684
|
+
environment_ids: z40.array(z40.string().uuid()).optional(),
|
|
22685
|
+
overwrite: z40.boolean().optional(),
|
|
22686
|
+
values: z40.record(z40.string().regex(VARIABLE_KEY_RE), z40.string())
|
|
22575
22687
|
}),
|
|
22576
|
-
|
|
22688
|
+
z40.object({ action: z40.literal("skip") })
|
|
22577
22689
|
]);
|
|
22578
22690
|
|
|
22579
22691
|
// ../shared/src/routes/local-control-requests.ts
|
|
22580
|
-
import { z as
|
|
22581
|
-
var createLocalControlRequestSchema =
|
|
22582
|
-
reason:
|
|
22583
|
-
wait:
|
|
22692
|
+
import { z as z41 } from "zod";
|
|
22693
|
+
var createLocalControlRequestSchema = z41.object({
|
|
22694
|
+
reason: z41.string().trim().max(500).optional().transform((value) => value || null),
|
|
22695
|
+
wait: z41.boolean().default(true)
|
|
22584
22696
|
});
|
|
22585
|
-
var respondLocalControlRequestSchema =
|
|
22586
|
-
var setLocalControlSchema =
|
|
22697
|
+
var respondLocalControlRequestSchema = z41.object({ action: z41.enum(["allow", "dismiss"]) });
|
|
22698
|
+
var setLocalControlSchema = z41.object({ enabled: z41.boolean() });
|
|
22587
22699
|
|
|
22588
22700
|
export {
|
|
22589
22701
|
ENGINE_SEND_MESSAGE_FAILED_ERROR,
|
|
@@ -22883,6 +22995,19 @@ export {
|
|
|
22883
22995
|
serializeMuseAuthFile,
|
|
22884
22996
|
isVersionBelow,
|
|
22885
22997
|
hasChatStarted,
|
|
22998
|
+
EXEC_SOCKET_PATH,
|
|
22999
|
+
EXEC_PROTOCOL_VERSION,
|
|
23000
|
+
EXEC_PING_INTERVAL_MS,
|
|
23001
|
+
EXEC_SILENCE_TIMEOUT_MS,
|
|
23002
|
+
EXEC_MAX_FRAME_BYTES,
|
|
23003
|
+
EXEC_DEFAULT_READ_BYTES,
|
|
23004
|
+
EXEC_PROCESS_BUFFER_BYTES,
|
|
23005
|
+
EXEC_DEFAULT_IDLE_TTL_MS,
|
|
23006
|
+
EXEC_FRAME,
|
|
23007
|
+
encodeExecFrame,
|
|
23008
|
+
decodeExecFrame,
|
|
23009
|
+
EXEC_ERROR_CODES,
|
|
23010
|
+
execRequestSchema,
|
|
22886
23011
|
CODEX_AUTH_ENV_KEYS,
|
|
22887
23012
|
codexAuthEnvFromResponse,
|
|
22888
23013
|
CODEX_AUTH_ENV_KEYS_BY_METHOD,
|