replicas-engine 0.1.1372 → 0.1.1374
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-2GEOYD4J.js → asp-host-O43ZGDII.js} +5 -5
- package/dist/src/{chunk-ZDD76UIZ.js → chunk-5ZFK4NQS.js} +1 -1
- package/dist/src/{chunk-OBKIRWWN.js → chunk-AVI4QYDL.js} +1 -1
- package/dist/src/{chunk-7KM3ZXVX.js → chunk-FZPSFJQL.js} +6 -6
- package/dist/src/{chunk-5IYWSQXM.js → chunk-MFEFG24O.js} +3 -3
- package/dist/src/{chunk-TQKWK7JJ.js → chunk-NOHCO22T.js} +614 -588
- package/dist/src/{chunk-AQ6GLMWE.js → chunk-O3PYQIRJ.js} +2 -2
- package/dist/src/{chunk-ATL32BCH.js → chunk-Z2KNJBXZ.js} +2 -2
- package/dist/src/{chunk-K7OYSY2J.js → chunk-ZEJ33EH4.js} +2 -2
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +161 -15
- 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 z32 = 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
|
+
z32 = offsetZ;
|
|
1127
1127
|
this.dt = dt;
|
|
1128
1128
|
} else {
|
|
1129
|
-
|
|
1129
|
+
z32 = "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
|
+
z32 = dt.zone.name;
|
|
1140
1140
|
} else {
|
|
1141
|
-
|
|
1141
|
+
z32 = "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 || z32;
|
|
1151
1151
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1152
1152
|
}
|
|
1153
1153
|
format() {
|
|
@@ -9386,6 +9386,9 @@ function withCamelCaseKeys(body) {
|
|
|
9386
9386
|
return aliases.length ? { ...body, ...Object.fromEntries(aliases.map(([key, entry]) => [toCamel(key), entry])) } : body;
|
|
9387
9387
|
}
|
|
9388
9388
|
|
|
9389
|
+
// ../shared/src/engine/types.ts
|
|
9390
|
+
import { z as z3 } from "zod";
|
|
9391
|
+
|
|
9389
9392
|
// ../shared/src/aster.ts
|
|
9390
9393
|
var ASTER_PROVIDER = "aster";
|
|
9391
9394
|
var ASTER_BASE_URL = "https://api.asterlab.ai/v1";
|
|
@@ -9970,6 +9973,28 @@ var MODEL_LABELS = {
|
|
|
9970
9973
|
"kimi-k2.5": "Kimi K2.5"
|
|
9971
9974
|
};
|
|
9972
9975
|
var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
9976
|
+
var resourcePressure = z3.number().min(0).max(100).nullable();
|
|
9977
|
+
var sandboxResourceMinuteSchema = z3.object({
|
|
9978
|
+
minute: z3.iso.datetime(),
|
|
9979
|
+
samples: z3.number().int().min(1).max(255),
|
|
9980
|
+
cpuCount: z3.number().int().min(1),
|
|
9981
|
+
memoryTotalMb: z3.number().min(0),
|
|
9982
|
+
cpuBusyAvg: z3.number().min(0),
|
|
9983
|
+
cpuBusyMax: z3.number().min(0),
|
|
9984
|
+
memoryUsedAvgMb: z3.number().min(0),
|
|
9985
|
+
memoryUsedMaxMb: z3.number().min(0),
|
|
9986
|
+
memoryCacheAvgMb: z3.number().min(0),
|
|
9987
|
+
memoryAvailableMinMb: z3.number().min(0),
|
|
9988
|
+
cpuPressureSomeMax: resourcePressure,
|
|
9989
|
+
cpuPressureFullMax: resourcePressure,
|
|
9990
|
+
memoryPressureSomeMax: resourcePressure,
|
|
9991
|
+
memoryPressureFullMax: resourcePressure,
|
|
9992
|
+
ioPressureSomeMax: resourcePressure,
|
|
9993
|
+
ioPressureFullMax: resourcePressure,
|
|
9994
|
+
oomKills: z3.number().int().min(0)
|
|
9995
|
+
});
|
|
9996
|
+
var MAX_PENDING_RESOURCE_MINUTES = 120;
|
|
9997
|
+
var sandboxResourceMinutesSchema = z3.array(sandboxResourceMinuteSchema).max(MAX_PENDING_RESOURCE_MINUTES);
|
|
9973
9998
|
var MAX_CANVAS_FILE_BYTES = 100 * 1024 * 1024;
|
|
9974
9999
|
var MAX_CANVAS_PREVIEW_BYTES = 5 * 1024 * 1024;
|
|
9975
10000
|
function isCanvasTextKind(kind) {
|
|
@@ -10102,7 +10127,7 @@ function detectAgentQuotaLimit(text3) {
|
|
|
10102
10127
|
}
|
|
10103
10128
|
|
|
10104
10129
|
// ../shared/src/analytics/types.ts
|
|
10105
|
-
import { z as
|
|
10130
|
+
import { z as z4 } from "zod";
|
|
10106
10131
|
|
|
10107
10132
|
// ../shared/src/external-api-host.ts
|
|
10108
10133
|
function validateExternalApiHost(url, providerLabel) {
|
|
@@ -10546,19 +10571,19 @@ function hasAgentChatActivityFields(value) {
|
|
|
10546
10571
|
function isAgentChatActivityRecord(value) {
|
|
10547
10572
|
return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
|
|
10548
10573
|
}
|
|
10549
|
-
var credentialAccountSchema =
|
|
10550
|
-
ownerName:
|
|
10551
|
-
email:
|
|
10574
|
+
var credentialAccountSchema = z4.object({
|
|
10575
|
+
ownerName: z4.string().optional(),
|
|
10576
|
+
email: z4.string().optional(),
|
|
10552
10577
|
/** 1-based place in the owner's account pool, set only when the pool holds several accounts. */
|
|
10553
|
-
ordinal:
|
|
10578
|
+
ordinal: z4.number().int().positive().optional()
|
|
10554
10579
|
});
|
|
10555
|
-
var agentCredentialSnapshotSchema =
|
|
10556
|
-
method:
|
|
10557
|
-
scope:
|
|
10558
|
-
revision:
|
|
10580
|
+
var agentCredentialSnapshotSchema = z4.object({
|
|
10581
|
+
method: z4.enum(CREDENTIAL_METHOD),
|
|
10582
|
+
scope: z4.enum(CREDENTIAL_SCOPE),
|
|
10583
|
+
revision: z4.string().optional(),
|
|
10559
10584
|
account: credentialAccountSchema.optional(),
|
|
10560
10585
|
/** The `credentials` row, which tells apart accounts pooled under one method and scope. */
|
|
10561
|
-
credentialId:
|
|
10586
|
+
credentialId: z4.string().optional()
|
|
10562
10587
|
});
|
|
10563
10588
|
function isSameCredential(a, b) {
|
|
10564
10589
|
return a.method === b.method && a.scope === b.scope && a.credentialId === b.credentialId;
|
|
@@ -10713,7 +10738,7 @@ function parseCodexTurnRetryPayload(payload) {
|
|
|
10713
10738
|
var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
|
|
10714
10739
|
|
|
10715
10740
|
// ../shared/src/engine/v1.ts
|
|
10716
|
-
import { z as
|
|
10741
|
+
import { z as z5 } from "zod";
|
|
10717
10742
|
var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
10718
10743
|
var ENGINE_STREAM_LAST_EVENT_ID_HEADER = "Last-Event-ID";
|
|
10719
10744
|
var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
|
|
@@ -10721,107 +10746,107 @@ var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
|
|
|
10721
10746
|
var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
|
|
10722
10747
|
var ENGINE_ACTIVATE_PATH = "/lifecycle/activate";
|
|
10723
10748
|
var ENGINE_SLEEP_PATH = "/lifecycle/sleep";
|
|
10724
|
-
var updateChatDisplayNameRequestSchema =
|
|
10725
|
-
displayName:
|
|
10749
|
+
var updateChatDisplayNameRequestSchema = z5.object({
|
|
10750
|
+
displayName: z5.string().trim().min(1).max(100)
|
|
10726
10751
|
});
|
|
10727
|
-
var createChatRequestSchema =
|
|
10728
|
-
id:
|
|
10729
|
-
createdAt:
|
|
10730
|
-
provider:
|
|
10731
|
-
title:
|
|
10732
|
-
parentChatId:
|
|
10733
|
-
forkSourceChatId:
|
|
10734
|
-
pullRequestNotesPath:
|
|
10735
|
-
kind:
|
|
10736
|
-
sideChat:
|
|
10737
|
-
clientRequestId:
|
|
10752
|
+
var createChatRequestSchema = z5.object({
|
|
10753
|
+
id: z5.string().uuid().optional(),
|
|
10754
|
+
createdAt: z5.string().datetime().optional(),
|
|
10755
|
+
provider: z5.enum(VALID_AGENT_PROVIDERS),
|
|
10756
|
+
title: z5.string().min(1).optional(),
|
|
10757
|
+
parentChatId: z5.string().uuid().optional(),
|
|
10758
|
+
forkSourceChatId: z5.string().uuid().optional(),
|
|
10759
|
+
pullRequestNotesPath: z5.string().min(1).optional(),
|
|
10760
|
+
kind: z5.enum(CHAT_KINDS).optional(),
|
|
10761
|
+
sideChat: z5.boolean().optional(),
|
|
10762
|
+
clientRequestId: z5.string().min(1).max(128).optional()
|
|
10738
10763
|
}).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
|
|
10739
10764
|
message: "A side chat must fork its parent chat"
|
|
10740
10765
|
});
|
|
10741
|
-
var spawnSubagentRequestSchema =
|
|
10742
|
-
provider:
|
|
10743
|
-
prompt:
|
|
10744
|
-
forkTurns:
|
|
10766
|
+
var spawnSubagentRequestSchema = z5.object({
|
|
10767
|
+
provider: z5.enum(VALID_AGENT_PROVIDERS),
|
|
10768
|
+
prompt: z5.string().min(1),
|
|
10769
|
+
forkTurns: z5.string().regex(/^(all|none|[1-9]\d*)$/).refine(
|
|
10745
10770
|
(value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
|
|
10746
10771
|
"Expected all, none, or a positive safe integer string"
|
|
10747
10772
|
).default("all"),
|
|
10748
|
-
model:
|
|
10749
|
-
thinkingLevel:
|
|
10750
|
-
fastMode:
|
|
10751
|
-
ultrafastMode:
|
|
10752
|
-
title:
|
|
10773
|
+
model: z5.string().min(1).optional(),
|
|
10774
|
+
thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional(),
|
|
10775
|
+
fastMode: z5.boolean().optional(),
|
|
10776
|
+
ultrafastMode: z5.boolean().optional(),
|
|
10777
|
+
title: z5.string().min(1).optional()
|
|
10753
10778
|
});
|
|
10754
|
-
var messageSubagentRequestSchema =
|
|
10755
|
-
message:
|
|
10756
|
-
model:
|
|
10757
|
-
thinkingLevel:
|
|
10758
|
-
fastMode:
|
|
10759
|
-
ultrafastMode:
|
|
10779
|
+
var messageSubagentRequestSchema = z5.object({
|
|
10780
|
+
message: z5.string().min(1),
|
|
10781
|
+
model: z5.string().min(1).optional(),
|
|
10782
|
+
thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional(),
|
|
10783
|
+
fastMode: z5.boolean().optional(),
|
|
10784
|
+
ultrafastMode: z5.boolean().optional()
|
|
10760
10785
|
});
|
|
10761
|
-
var waitSubagentRequestSchema =
|
|
10762
|
-
timeoutMinutes:
|
|
10786
|
+
var waitSubagentRequestSchema = z5.object({
|
|
10787
|
+
timeoutMinutes: z5.coerce.number().positive().max(1440).optional()
|
|
10763
10788
|
});
|
|
10764
|
-
var subagentResponseSchema =
|
|
10765
|
-
chatId:
|
|
10766
|
-
status:
|
|
10767
|
-
response:
|
|
10768
|
-
timedOut:
|
|
10769
|
-
interruptedByUserMessage:
|
|
10789
|
+
var subagentResponseSchema = z5.object({
|
|
10790
|
+
chatId: z5.string().uuid(),
|
|
10791
|
+
status: z5.enum(["working", "completed"]),
|
|
10792
|
+
response: z5.string().optional(),
|
|
10793
|
+
timedOut: z5.literal(true).optional(),
|
|
10794
|
+
interruptedByUserMessage: z5.literal(true).optional()
|
|
10770
10795
|
});
|
|
10771
|
-
var integrationErrorNotificationTargetSchema =
|
|
10772
|
-
|
|
10773
|
-
type:
|
|
10774
|
-
conversation:
|
|
10775
|
-
channelId:
|
|
10776
|
-
threadTs:
|
|
10796
|
+
var integrationErrorNotificationTargetSchema = z5.discriminatedUnion("type", [
|
|
10797
|
+
z5.object({
|
|
10798
|
+
type: z5.literal("slack"),
|
|
10799
|
+
conversation: z5.object({
|
|
10800
|
+
channelId: z5.string().min(1),
|
|
10801
|
+
threadTs: z5.string().min(1)
|
|
10777
10802
|
}).optional()
|
|
10778
10803
|
}),
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
type:
|
|
10782
|
-
provider:
|
|
10783
|
-
resource:
|
|
10784
|
-
repositoryId:
|
|
10785
|
-
resourceNumber:
|
|
10804
|
+
z5.object({ type: z5.literal("linear"), sessionId: z5.string().min(1) }),
|
|
10805
|
+
z5.object({
|
|
10806
|
+
type: z5.literal("code_host"),
|
|
10807
|
+
provider: z5.enum(["github", "gitlab"]),
|
|
10808
|
+
resource: z5.enum(["issue", "pull_request"]),
|
|
10809
|
+
repositoryId: z5.string().min(1),
|
|
10810
|
+
resourceNumber: z5.number().int().positive()
|
|
10786
10811
|
}),
|
|
10787
|
-
|
|
10812
|
+
z5.object({ type: z5.literal("automation"), executionId: z5.string().min(1) })
|
|
10788
10813
|
]);
|
|
10789
|
-
var sendChatMessageRequestSchema =
|
|
10790
|
-
messageId:
|
|
10791
|
-
submittedAt:
|
|
10792
|
-
message:
|
|
10793
|
-
provider:
|
|
10794
|
-
model:
|
|
10795
|
-
customInstructions:
|
|
10796
|
-
planMode:
|
|
10797
|
-
images:
|
|
10798
|
-
type:
|
|
10799
|
-
source:
|
|
10800
|
-
|
|
10801
|
-
|
|
10814
|
+
var sendChatMessageRequestSchema = z5.object({
|
|
10815
|
+
messageId: z5.string().min(1).optional(),
|
|
10816
|
+
submittedAt: z5.string().datetime().optional(),
|
|
10817
|
+
message: z5.string().min(1),
|
|
10818
|
+
provider: z5.enum(VALID_AGENT_PROVIDERS).optional(),
|
|
10819
|
+
model: z5.string().optional(),
|
|
10820
|
+
customInstructions: z5.string().optional(),
|
|
10821
|
+
planMode: z5.boolean().optional(),
|
|
10822
|
+
images: z5.array(z5.object({
|
|
10823
|
+
type: z5.literal("image"),
|
|
10824
|
+
source: z5.discriminatedUnion("type", [
|
|
10825
|
+
z5.object({ type: z5.literal("base64"), media_type: z5.enum(IMAGE_MEDIA_TYPES), data: z5.string().min(1) }),
|
|
10826
|
+
z5.object({ type: z5.literal("url"), url: z5.string().url() })
|
|
10802
10827
|
])
|
|
10803
10828
|
})).optional(),
|
|
10804
|
-
canvasUploadIds:
|
|
10805
|
-
thinkingLevel:
|
|
10806
|
-
inheritThinkingLevel:
|
|
10807
|
-
goalMode:
|
|
10808
|
-
fastMode:
|
|
10809
|
-
ultrafastMode:
|
|
10810
|
-
source:
|
|
10811
|
-
enableInteractiveTools:
|
|
10812
|
-
type:
|
|
10813
|
-
merge:
|
|
10814
|
-
idempotencyKey:
|
|
10815
|
-
automationId:
|
|
10816
|
-
environmentId:
|
|
10817
|
-
senderUserId:
|
|
10818
|
-
senderEmail:
|
|
10819
|
-
senderDisplayName:
|
|
10820
|
-
senderAvatarUrl:
|
|
10829
|
+
canvasUploadIds: z5.array(z5.string().min(1)).optional(),
|
|
10830
|
+
thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional(),
|
|
10831
|
+
inheritThinkingLevel: z5.boolean().optional(),
|
|
10832
|
+
goalMode: z5.boolean().optional(),
|
|
10833
|
+
fastMode: z5.boolean().optional(),
|
|
10834
|
+
ultrafastMode: z5.boolean().optional(),
|
|
10835
|
+
source: z5.enum(MESSAGE_SOURCES).optional(),
|
|
10836
|
+
enableInteractiveTools: z5.boolean().optional(),
|
|
10837
|
+
type: z5.string().min(1).optional(),
|
|
10838
|
+
merge: z5.boolean().optional(),
|
|
10839
|
+
idempotencyKey: z5.string().min(1).max(128).optional(),
|
|
10840
|
+
automationId: z5.string().optional(),
|
|
10841
|
+
environmentId: z5.string().min(1).optional(),
|
|
10842
|
+
senderUserId: z5.string().optional(),
|
|
10843
|
+
senderEmail: z5.string().optional(),
|
|
10844
|
+
senderDisplayName: z5.string().optional(),
|
|
10845
|
+
senderAvatarUrl: z5.string().optional(),
|
|
10821
10846
|
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
|
|
10822
|
-
errorNotificationTargets:
|
|
10823
|
-
replacesMessageId:
|
|
10824
|
-
steer:
|
|
10847
|
+
errorNotificationTargets: z5.array(integrationErrorNotificationTargetSchema).optional(),
|
|
10848
|
+
replacesMessageId: z5.string().min(1).max(256).optional(),
|
|
10849
|
+
steer: z5.union([z5.boolean(), z5.literal("alone")]).optional()
|
|
10825
10850
|
}).passthrough();
|
|
10826
10851
|
function isChatMessageSender(value) {
|
|
10827
10852
|
return isRecord(value) && (value.messageId === void 0 || typeof value.messageId === "string") && typeof value.senderUserId === "string" && typeof value.senderEmail === "string" && typeof value.recordedAt === "string";
|
|
@@ -11012,16 +11037,16 @@ async function steerQueuedInOrder(queue, messageId, steer) {
|
|
|
11012
11037
|
}
|
|
11013
11038
|
return true;
|
|
11014
11039
|
}
|
|
11015
|
-
var sendChatMessageResponseSchema =
|
|
11016
|
-
messageId:
|
|
11017
|
-
queued:
|
|
11018
|
-
position:
|
|
11019
|
-
chatId:
|
|
11020
|
-
steered:
|
|
11040
|
+
var sendChatMessageResponseSchema = z5.object({
|
|
11041
|
+
messageId: z5.string(),
|
|
11042
|
+
queued: z5.boolean(),
|
|
11043
|
+
position: z5.number(),
|
|
11044
|
+
chatId: z5.string().optional(),
|
|
11045
|
+
steered: z5.boolean().optional()
|
|
11021
11046
|
});
|
|
11022
|
-
var respondToolInputRequestSchema =
|
|
11023
|
-
requestId:
|
|
11024
|
-
selectionId:
|
|
11047
|
+
var respondToolInputRequestSchema = z5.object({
|
|
11048
|
+
requestId: z5.string().min(1),
|
|
11049
|
+
selectionId: z5.string().min(1)
|
|
11025
11050
|
});
|
|
11026
11051
|
function isLatestChatHistoryPage(params) {
|
|
11027
11052
|
return params.beforeCursor === void 0 && params.beforeEvent === void 0 && params.beforeTurn === void 0;
|
|
@@ -11099,100 +11124,100 @@ function isSubagentMcpServerName(server) {
|
|
|
11099
11124
|
}
|
|
11100
11125
|
|
|
11101
11126
|
// ../shared/src/workspace-identity.ts
|
|
11102
|
-
import { z as
|
|
11127
|
+
import { z as z6 } from "zod";
|
|
11103
11128
|
var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
|
|
11104
11129
|
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
11105
11130
|
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
11106
11131
|
var IDENTITY_PROXY_PORT = 17323;
|
|
11107
11132
|
var IDENTITY_TOKEN_PATH = "/token";
|
|
11108
|
-
var workspaceAudienceSchema =
|
|
11109
|
-
var workspaceTokenRequestSchema =
|
|
11133
|
+
var workspaceAudienceSchema = z6.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
|
|
11134
|
+
var workspaceTokenRequestSchema = z6.object({
|
|
11110
11135
|
audience: workspaceAudienceSchema.optional(),
|
|
11111
|
-
aws_source_identity:
|
|
11136
|
+
aws_source_identity: z6.boolean().optional()
|
|
11112
11137
|
});
|
|
11113
|
-
var workspaceTokenClaimsSchema =
|
|
11114
|
-
iss:
|
|
11115
|
-
sub:
|
|
11116
|
-
aud:
|
|
11117
|
-
iat:
|
|
11118
|
-
nbf:
|
|
11119
|
-
exp:
|
|
11120
|
-
jti:
|
|
11121
|
-
organization_id:
|
|
11122
|
-
workspace_id:
|
|
11123
|
-
environment_id:
|
|
11124
|
-
creator_id:
|
|
11125
|
-
creator_email:
|
|
11126
|
-
[AWS_SOURCE_IDENTITY_CLAIM]:
|
|
11138
|
+
var workspaceTokenClaimsSchema = z6.object({
|
|
11139
|
+
iss: z6.string(),
|
|
11140
|
+
sub: z6.string(),
|
|
11141
|
+
aud: z6.string(),
|
|
11142
|
+
iat: z6.number().int(),
|
|
11143
|
+
nbf: z6.number().int(),
|
|
11144
|
+
exp: z6.number().int(),
|
|
11145
|
+
jti: z6.string(),
|
|
11146
|
+
organization_id: z6.string().uuid(),
|
|
11147
|
+
workspace_id: z6.string().uuid(),
|
|
11148
|
+
environment_id: z6.string().uuid(),
|
|
11149
|
+
creator_id: z6.string().uuid().nullable(),
|
|
11150
|
+
creator_email: z6.string().nullable().default(null),
|
|
11151
|
+
[AWS_SOURCE_IDENTITY_CLAIM]: z6.string().uuid().optional()
|
|
11127
11152
|
}).passthrough();
|
|
11128
|
-
var workspaceTokenResponseSchema =
|
|
11129
|
-
issuer:
|
|
11130
|
-
audience:
|
|
11131
|
-
token:
|
|
11132
|
-
expires_at:
|
|
11153
|
+
var workspaceTokenResponseSchema = z6.object({
|
|
11154
|
+
issuer: z6.string(),
|
|
11155
|
+
audience: z6.string(),
|
|
11156
|
+
token: z6.string(),
|
|
11157
|
+
expires_at: z6.string()
|
|
11133
11158
|
});
|
|
11134
|
-
var legacyWorkspaceTokenBundleSchema =
|
|
11135
|
-
version:
|
|
11136
|
-
issuer:
|
|
11137
|
-
default_audience:
|
|
11138
|
-
tokens:
|
|
11159
|
+
var legacyWorkspaceTokenBundleSchema = z6.object({
|
|
11160
|
+
version: z6.literal(1),
|
|
11161
|
+
issuer: z6.string(),
|
|
11162
|
+
default_audience: z6.string(),
|
|
11163
|
+
tokens: z6.record(z6.string(), z6.object({ token: z6.string(), expires_at: z6.string() }))
|
|
11139
11164
|
});
|
|
11140
|
-
var mcpWorkloadAuthSchema =
|
|
11141
|
-
type:
|
|
11165
|
+
var mcpWorkloadAuthSchema = z6.strictObject({
|
|
11166
|
+
type: z6.literal("workspace_identity"),
|
|
11142
11167
|
audience: workspaceAudienceSchema
|
|
11143
11168
|
});
|
|
11144
|
-
var mcpAuthSchema =
|
|
11169
|
+
var mcpAuthSchema = z6.discriminatedUnion("type", [
|
|
11145
11170
|
mcpWorkloadAuthSchema,
|
|
11146
|
-
|
|
11171
|
+
z6.strictObject({ type: z6.literal("oauth") })
|
|
11147
11172
|
]);
|
|
11148
|
-
var engineMcpOAuthTokenRequestSchema =
|
|
11149
|
-
environment_mcp_id:
|
|
11150
|
-
force_refresh:
|
|
11173
|
+
var engineMcpOAuthTokenRequestSchema = z6.object({
|
|
11174
|
+
environment_mcp_id: z6.string().uuid(),
|
|
11175
|
+
force_refresh: z6.boolean().optional()
|
|
11151
11176
|
});
|
|
11152
|
-
var engineMcpOAuthTokenResponseSchema =
|
|
11153
|
-
url:
|
|
11154
|
-
access_token:
|
|
11155
|
-
expires_at:
|
|
11177
|
+
var engineMcpOAuthTokenResponseSchema = z6.object({
|
|
11178
|
+
url: z6.string(),
|
|
11179
|
+
access_token: z6.string(),
|
|
11180
|
+
expires_at: z6.string().nullable()
|
|
11156
11181
|
});
|
|
11157
11182
|
|
|
11158
11183
|
// ../shared/src/routes/mothership.ts
|
|
11159
|
-
import { z as
|
|
11184
|
+
import { z as z8 } from "zod";
|
|
11160
11185
|
|
|
11161
11186
|
// ../shared/src/routes/pull-requests.ts
|
|
11162
|
-
import { z as
|
|
11187
|
+
import { z as z7 } from "zod";
|
|
11163
11188
|
var PULL_REQUEST_MERGE_METHODS = ["merge", "squash", "rebase"];
|
|
11164
11189
|
var DEPLOY_START_WINDOW_MS = 30 * 6e4;
|
|
11165
|
-
var mergePullRequestRequestSchema =
|
|
11166
|
-
mergeMethod:
|
|
11167
|
-
bypassRules:
|
|
11190
|
+
var mergePullRequestRequestSchema = z7.object({
|
|
11191
|
+
mergeMethod: z7.enum(PULL_REQUEST_MERGE_METHODS).optional(),
|
|
11192
|
+
bypassRules: z7.boolean().optional()
|
|
11168
11193
|
});
|
|
11169
11194
|
|
|
11170
11195
|
// ../shared/src/routes/mothership.ts
|
|
11171
|
-
var linearRuleFields =
|
|
11172
|
-
team_id:
|
|
11173
|
-
current_cycle:
|
|
11174
|
-
label_ids:
|
|
11175
|
-
project_id:
|
|
11176
|
-
assignee_id:
|
|
11196
|
+
var linearRuleFields = z8.object({
|
|
11197
|
+
team_id: z8.string().min(1),
|
|
11198
|
+
current_cycle: z8.boolean().optional(),
|
|
11199
|
+
label_ids: z8.array(z8.string().min(1)).min(1).optional(),
|
|
11200
|
+
project_id: z8.string().min(1).optional(),
|
|
11201
|
+
assignee_id: z8.string().min(1).optional()
|
|
11177
11202
|
}).strict();
|
|
11178
11203
|
var withLabelIds = (value) => {
|
|
11179
11204
|
if (!isRecord(value) || typeof value.label_id !== "string") return value;
|
|
11180
11205
|
const { label_id, ...rest } = value;
|
|
11181
11206
|
return { ...rest, label_ids: [label_id] };
|
|
11182
11207
|
};
|
|
11183
|
-
var mothershipLinearRuleSchema =
|
|
11184
|
-
var storedMothershipLinearRuleSchema =
|
|
11208
|
+
var mothershipLinearRuleSchema = z8.preprocess(withLabelIds, linearRuleFields);
|
|
11209
|
+
var storedMothershipLinearRuleSchema = z8.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: z8.string() }));
|
|
11185
11210
|
var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
|
|
11186
11211
|
function serviceTierRequestFields(tier) {
|
|
11187
11212
|
return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
|
|
11188
11213
|
}
|
|
11189
|
-
var mothershipSubagentSettingsSchema =
|
|
11190
|
-
coding_agent:
|
|
11191
|
-
model:
|
|
11192
|
-
thinking_level:
|
|
11193
|
-
service_tier:
|
|
11194
|
-
goal_mode:
|
|
11195
|
-
plan_mode:
|
|
11214
|
+
var mothershipSubagentSettingsSchema = z8.object({
|
|
11215
|
+
coding_agent: z8.enum(VALID_AGENT_PROVIDERS),
|
|
11216
|
+
model: z8.string().nullable(),
|
|
11217
|
+
thinking_level: z8.enum(VALID_THINKING_LEVELS).nullable(),
|
|
11218
|
+
service_tier: z8.enum(SUBAGENT_SERVICE_TIERS),
|
|
11219
|
+
goal_mode: z8.boolean(),
|
|
11220
|
+
plan_mode: z8.boolean()
|
|
11196
11221
|
});
|
|
11197
11222
|
var QUEUE_SECTIONS = [
|
|
11198
11223
|
{ label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
|
|
@@ -11422,19 +11447,19 @@ function gitIdentityConfigCommands(identity, scope = "global") {
|
|
|
11422
11447
|
}
|
|
11423
11448
|
|
|
11424
11449
|
// ../shared/src/headless-agent.ts
|
|
11425
|
-
import { z as
|
|
11426
|
-
var headlessAgentRequestSchema =
|
|
11427
|
-
mode:
|
|
11428
|
-
agent:
|
|
11450
|
+
import { z as z9 } from "zod";
|
|
11451
|
+
var headlessAgentRequestSchema = z9.object({
|
|
11452
|
+
mode: z9.literal("structured"),
|
|
11453
|
+
agent: z9.custom(
|
|
11429
11454
|
(value) => typeof value === "string" && isValidAgentProvider(value)
|
|
11430
11455
|
),
|
|
11431
|
-
model:
|
|
11432
|
-
prompt:
|
|
11433
|
-
workingDirectory:
|
|
11434
|
-
timeoutSeconds:
|
|
11435
|
-
thinkingLevel:
|
|
11436
|
-
codexOauthTokens:
|
|
11437
|
-
outputSchema:
|
|
11456
|
+
model: z9.string().min(1),
|
|
11457
|
+
prompt: z9.string(),
|
|
11458
|
+
workingDirectory: z9.string().min(1),
|
|
11459
|
+
timeoutSeconds: z9.number().int().min(1).max(1800).default(300),
|
|
11460
|
+
thinkingLevel: z9.enum(STANDARD_THINKING_LEVELS).optional(),
|
|
11461
|
+
codexOauthTokens: z9.object({ accessToken: z9.string(), accountId: z9.string() }).optional(),
|
|
11462
|
+
outputSchema: z9.record(z9.string(), z9.json())
|
|
11438
11463
|
});
|
|
11439
11464
|
var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
|
|
11440
11465
|
|
|
@@ -11513,12 +11538,12 @@ function describeAuthFallback(payload) {
|
|
|
11513
11538
|
}
|
|
11514
11539
|
|
|
11515
11540
|
// ../shared/src/workspace-credentials.ts
|
|
11516
|
-
import { z as
|
|
11541
|
+
import { z as z10 } from "zod";
|
|
11517
11542
|
var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
|
|
11518
|
-
var workspaceCredentialProviderSchema =
|
|
11543
|
+
var workspaceCredentialProviderSchema = z10.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
11519
11544
|
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
11520
11545
|
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11521
|
-
provider:
|
|
11546
|
+
provider: z10.enum(VALID_AGENT_PROVIDERS)
|
|
11522
11547
|
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11523
11548
|
message: "This inference provider is not supported by this agent"
|
|
11524
11549
|
});
|
|
@@ -11529,62 +11554,62 @@ var switchWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend(
|
|
|
11529
11554
|
});
|
|
11530
11555
|
|
|
11531
11556
|
// ../shared/src/chat-fork.ts
|
|
11532
|
-
import { z as
|
|
11557
|
+
import { z as z12 } from "zod";
|
|
11533
11558
|
|
|
11534
11559
|
// ../shared/src/fallback-chains.ts
|
|
11535
|
-
import { z as
|
|
11536
|
-
var fallbackHarnessStepSchema =
|
|
11537
|
-
kind:
|
|
11538
|
-
provider:
|
|
11539
|
-
model:
|
|
11540
|
-
thinkingLevel:
|
|
11560
|
+
import { z as z11 } from "zod";
|
|
11561
|
+
var fallbackHarnessStepSchema = z11.object({
|
|
11562
|
+
kind: z11.literal("harness"),
|
|
11563
|
+
provider: z11.enum(VALID_AGENT_PROVIDERS),
|
|
11564
|
+
model: z11.string().min(1),
|
|
11565
|
+
thinkingLevel: z11.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
|
|
11541
11566
|
});
|
|
11542
|
-
var fallbackPlanStepSchema =
|
|
11543
|
-
|
|
11544
|
-
kind:
|
|
11567
|
+
var fallbackPlanStepSchema = z11.discriminatedUnion("kind", [
|
|
11568
|
+
z11.object({
|
|
11569
|
+
kind: z11.literal("credentials"),
|
|
11545
11570
|
// An empty list would allow every method.
|
|
11546
|
-
methods:
|
|
11547
|
-
models:
|
|
11571
|
+
methods: z11.array(z11.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
|
|
11572
|
+
models: z11.record(z11.string(), z11.string().min(1)).optional()
|
|
11548
11573
|
}),
|
|
11549
11574
|
fallbackHarnessStepSchema
|
|
11550
11575
|
]);
|
|
11551
|
-
var fallbackPlanResponseSchema =
|
|
11552
|
-
steps:
|
|
11576
|
+
var fallbackPlanResponseSchema = z11.object({
|
|
11577
|
+
steps: z11.array(z11.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
|
|
11553
11578
|
});
|
|
11554
11579
|
|
|
11555
11580
|
// ../shared/src/chat-fork.ts
|
|
11556
|
-
var fallbackReasonSchema =
|
|
11557
|
-
var chatForkInfoSchema =
|
|
11558
|
-
source:
|
|
11559
|
-
chatId:
|
|
11560
|
-
provider:
|
|
11561
|
-
title:
|
|
11581
|
+
var fallbackReasonSchema = z12.enum(AGENT_FALLBACK_REASONS);
|
|
11582
|
+
var chatForkInfoSchema = z12.object({
|
|
11583
|
+
source: z12.object({
|
|
11584
|
+
chatId: z12.string().min(1),
|
|
11585
|
+
provider: z12.enum(VALID_AGENT_PROVIDERS),
|
|
11586
|
+
title: z12.string()
|
|
11562
11587
|
}),
|
|
11563
|
-
trigger:
|
|
11588
|
+
trigger: z12.enum(["manual", "auto", "side", "switch"]),
|
|
11564
11589
|
reason: fallbackReasonSchema.optional(),
|
|
11565
|
-
state:
|
|
11566
|
-
error:
|
|
11567
|
-
startedAt:
|
|
11568
|
-
completedAt:
|
|
11590
|
+
state: z12.enum(["preparing", "ready", "failed"]),
|
|
11591
|
+
error: z12.string().optional(),
|
|
11592
|
+
startedAt: z12.string(),
|
|
11593
|
+
completedAt: z12.string().optional()
|
|
11569
11594
|
});
|
|
11570
11595
|
function coerceChatForkInfo(value) {
|
|
11571
11596
|
const parsed = chatForkInfoSchema.safeParse(value);
|
|
11572
11597
|
return parsed.success ? parsed.data : null;
|
|
11573
11598
|
}
|
|
11574
|
-
var forkChatRequestSchema =
|
|
11575
|
-
provider:
|
|
11576
|
-
model:
|
|
11577
|
-
thinkingLevel:
|
|
11578
|
-
title:
|
|
11579
|
-
message:
|
|
11580
|
-
id:
|
|
11581
|
-
clientRequestId:
|
|
11582
|
-
enableInteractiveTools:
|
|
11599
|
+
var forkChatRequestSchema = z12.object({
|
|
11600
|
+
provider: z12.enum(VALID_AGENT_PROVIDERS),
|
|
11601
|
+
model: z12.string().min(1).optional(),
|
|
11602
|
+
thinkingLevel: z12.enum(VALID_THINKING_LEVELS).optional(),
|
|
11603
|
+
title: z12.string().min(1).max(200).optional(),
|
|
11604
|
+
message: z12.string().trim().optional(),
|
|
11605
|
+
id: z12.string().uuid().optional(),
|
|
11606
|
+
clientRequestId: z12.string().min(1).max(128).optional(),
|
|
11607
|
+
enableInteractiveTools: z12.boolean().optional(),
|
|
11583
11608
|
// Server-injected by the monolith from the authenticated request; never trusted from clients.
|
|
11584
|
-
senderUserId:
|
|
11585
|
-
senderEmail:
|
|
11586
|
-
senderDisplayName:
|
|
11587
|
-
senderAvatarUrl:
|
|
11609
|
+
senderUserId: z12.string().optional(),
|
|
11610
|
+
senderEmail: z12.string().optional(),
|
|
11611
|
+
senderDisplayName: z12.string().optional(),
|
|
11612
|
+
senderAvatarUrl: z12.string().optional()
|
|
11588
11613
|
});
|
|
11589
11614
|
function describeQuotaLimit(reason) {
|
|
11590
11615
|
if (reason === "auth_failed") return "could not authenticate";
|
|
@@ -11596,10 +11621,10 @@ function describeChatForkReason(reason, provider2) {
|
|
|
11596
11621
|
return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
|
|
11597
11622
|
}
|
|
11598
11623
|
var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
|
|
11599
|
-
var agentQuotaExhaustedPayloadSchema =
|
|
11600
|
-
provider:
|
|
11624
|
+
var agentQuotaExhaustedPayloadSchema = z12.object({
|
|
11625
|
+
provider: z12.enum(VALID_AGENT_PROVIDERS),
|
|
11601
11626
|
reason: fallbackReasonSchema,
|
|
11602
|
-
detail:
|
|
11627
|
+
detail: z12.string().optional(),
|
|
11603
11628
|
forkTo: fallbackHarnessStepSchema.optional()
|
|
11604
11629
|
});
|
|
11605
11630
|
function defaultForkChatTitle(source, provider2) {
|
|
@@ -11631,27 +11656,27 @@ function getChatThreadSources(chats, chat) {
|
|
|
11631
11656
|
}
|
|
11632
11657
|
|
|
11633
11658
|
// ../shared/src/credential-refresh.ts
|
|
11634
|
-
import { z as
|
|
11635
|
-
var engineCredentialRefreshFailureSchema =
|
|
11636
|
-
code:
|
|
11659
|
+
import { z as z13 } from "zod";
|
|
11660
|
+
var engineCredentialRefreshFailureSchema = z13.object({
|
|
11661
|
+
code: z13.string(),
|
|
11637
11662
|
credential: workspaceCredentialSelectionSchema.optional()
|
|
11638
11663
|
});
|
|
11639
11664
|
|
|
11640
11665
|
// ../shared/src/credential-pool.ts
|
|
11641
|
-
import { z as
|
|
11666
|
+
import { z as z14 } from "zod";
|
|
11642
11667
|
var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
|
|
11643
|
-
var reorderCredentialPoolSchema =
|
|
11644
|
-
credential_ids:
|
|
11668
|
+
var reorderCredentialPoolSchema = z14.object({
|
|
11669
|
+
credential_ids: z14.array(z14.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
11645
11670
|
});
|
|
11646
11671
|
|
|
11647
11672
|
// ../shared/src/mothership-events.ts
|
|
11648
|
-
import { z as
|
|
11673
|
+
import { z as z22 } from "zod";
|
|
11649
11674
|
|
|
11650
11675
|
// ../shared/src/replicas-mcp.ts
|
|
11651
|
-
import { z as
|
|
11676
|
+
import { z as z18 } from "zod";
|
|
11652
11677
|
|
|
11653
11678
|
// ../shared/src/automations/trigger-schemas.ts
|
|
11654
|
-
import { z as
|
|
11679
|
+
import { z as z15 } from "zod";
|
|
11655
11680
|
|
|
11656
11681
|
// ../shared/src/uuid.ts
|
|
11657
11682
|
function createUuidFromHex(value) {
|
|
@@ -11668,29 +11693,29 @@ function getReviewerLoginsError(event, logins) {
|
|
|
11668
11693
|
if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
|
|
11669
11694
|
return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
|
|
11670
11695
|
}
|
|
11671
|
-
var repositoryTriggerConfigSchema =
|
|
11672
|
-
event:
|
|
11673
|
-
repository_ids:
|
|
11674
|
-
group_pr_events:
|
|
11675
|
-
excluded_actors:
|
|
11676
|
-
reviewer_logins:
|
|
11696
|
+
var repositoryTriggerConfigSchema = z15.object({
|
|
11697
|
+
event: z15.string(),
|
|
11698
|
+
repository_ids: z15.array(z15.string().regex(UUID_RE, "must be a repository id")).optional(),
|
|
11699
|
+
group_pr_events: z15.boolean().optional(),
|
|
11700
|
+
excluded_actors: z15.array(z15.string()).optional(),
|
|
11701
|
+
reviewer_logins: z15.array(z15.string()).optional()
|
|
11677
11702
|
});
|
|
11678
|
-
var cronTriggerSchema =
|
|
11679
|
-
var githubTriggerSchema =
|
|
11680
|
-
type:
|
|
11703
|
+
var cronTriggerSchema = z15.object({ type: z15.literal("cron"), config: z15.object({ schedule: z15.string(), timezone: z15.string().optional() }) });
|
|
11704
|
+
var githubTriggerSchema = z15.object({
|
|
11705
|
+
type: z15.literal("github"),
|
|
11681
11706
|
config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
|
|
11682
11707
|
const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
|
|
11683
11708
|
if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
|
|
11684
11709
|
})
|
|
11685
11710
|
});
|
|
11686
|
-
var gitlabTriggerSchema =
|
|
11687
|
-
var automationTriggerSchema =
|
|
11711
|
+
var gitlabTriggerSchema = z15.object({ type: z15.literal("gitlab"), config: repositoryTriggerConfigSchema });
|
|
11712
|
+
var automationTriggerSchema = z15.discriminatedUnion("type", [
|
|
11688
11713
|
cronTriggerSchema,
|
|
11689
11714
|
githubTriggerSchema,
|
|
11690
11715
|
gitlabTriggerSchema,
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11716
|
+
z15.object({ type: z15.literal("slack"), config: z15.object({ event: z15.string(), channel_ids: z15.array(z15.string()).optional(), group_thread_replies: z15.boolean().optional() }) }),
|
|
11717
|
+
z15.object({ type: z15.literal("sentry"), config: z15.object({ event: z15.string(), project_slugs: z15.array(z15.string()).optional(), min_level: z15.string().optional() }) }),
|
|
11718
|
+
z15.object({ type: z15.literal("custom"), config: z15.object({}) })
|
|
11694
11719
|
]);
|
|
11695
11720
|
|
|
11696
11721
|
// ../shared/src/automations/types.ts
|
|
@@ -11700,40 +11725,40 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
|
|
|
11700
11725
|
var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
|
|
11701
11726
|
|
|
11702
11727
|
// ../shared/src/routes/environment.ts
|
|
11703
|
-
import { z as
|
|
11728
|
+
import { z as z16 } from "zod";
|
|
11704
11729
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
11705
|
-
var stringMap =
|
|
11706
|
-
var createEnvironmentMcpRequestSchema =
|
|
11707
|
-
name:
|
|
11708
|
-
transport:
|
|
11709
|
-
config:
|
|
11710
|
-
|
|
11711
|
-
|
|
11730
|
+
var stringMap = z16.record(z16.string(), z16.string());
|
|
11731
|
+
var createEnvironmentMcpRequestSchema = z16.object({
|
|
11732
|
+
name: z16.string(),
|
|
11733
|
+
transport: z16.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
11734
|
+
config: z16.union([
|
|
11735
|
+
z16.object({ command: z16.string().min(1), args: z16.array(z16.string()).optional(), env: stringMap.optional() }),
|
|
11736
|
+
z16.object({ url: z16.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
|
|
11712
11737
|
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
11713
11738
|
});
|
|
11714
11739
|
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
11715
|
-
var screenPasswordSchema =
|
|
11716
|
-
var createEnvironmentDeviceRequestSchema =
|
|
11717
|
-
name:
|
|
11718
|
-
host:
|
|
11719
|
-
port:
|
|
11720
|
-
username:
|
|
11740
|
+
var screenPasswordSchema = z16.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
|
|
11741
|
+
var createEnvironmentDeviceRequestSchema = z16.object({
|
|
11742
|
+
name: z16.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
|
|
11743
|
+
host: z16.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address").describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address."),
|
|
11744
|
+
port: z16.number().int().min(1).max(65535).optional().describe("SSH port. Defaults to 22."),
|
|
11745
|
+
username: z16.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
|
|
11721
11746
|
screen_password: screenPasswordSchema.optional()
|
|
11722
11747
|
});
|
|
11723
11748
|
var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
|
|
11724
|
-
screen_password:
|
|
11749
|
+
screen_password: z16.union([screenPasswordSchema, z16.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
|
|
11725
11750
|
});
|
|
11726
|
-
var provisionedDeviceSchema =
|
|
11727
|
-
name:
|
|
11728
|
-
host:
|
|
11729
|
-
port:
|
|
11730
|
-
username:
|
|
11731
|
-
private_key:
|
|
11732
|
-
screen_password:
|
|
11751
|
+
var provisionedDeviceSchema = z16.object({
|
|
11752
|
+
name: z16.string(),
|
|
11753
|
+
host: z16.string(),
|
|
11754
|
+
port: z16.number(),
|
|
11755
|
+
username: z16.string(),
|
|
11756
|
+
private_key: z16.string(),
|
|
11757
|
+
screen_password: z16.string().optional()
|
|
11733
11758
|
});
|
|
11734
11759
|
|
|
11735
11760
|
// ../shared/src/routes/workspaces.ts
|
|
11736
|
-
import { z as
|
|
11761
|
+
import { z as z17 } from "zod";
|
|
11737
11762
|
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
11738
11763
|
var SUPPORT_EMAIL = "founders@replicas.dev";
|
|
11739
11764
|
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.`;
|
|
@@ -11746,16 +11771,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
|
|
|
11746
11771
|
activity: "any"
|
|
11747
11772
|
};
|
|
11748
11773
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11749
|
-
var workspaceExecRequestSchema =
|
|
11750
|
-
command:
|
|
11751
|
-
timeout_seconds:
|
|
11774
|
+
var workspaceExecRequestSchema = z17.object({
|
|
11775
|
+
command: z17.string().regex(/\S/, "command is required"),
|
|
11776
|
+
timeout_seconds: z17.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
11752
11777
|
});
|
|
11753
|
-
var terminalRtcCandidateSchema =
|
|
11754
|
-
var terminalSocketServerMessageSchema =
|
|
11755
|
-
|
|
11756
|
-
|
|
11778
|
+
var terminalRtcCandidateSchema = z17.object({ type: z17.literal("rtc-candidate"), candidate: z17.string(), mid: z17.string() });
|
|
11779
|
+
var terminalSocketServerMessageSchema = z17.discriminatedUnion("type", [
|
|
11780
|
+
z17.object({ type: z17.literal("output"), data: z17.string() }),
|
|
11781
|
+
z17.object({ type: z17.literal("rtc-answer"), sdp: z17.string() }),
|
|
11757
11782
|
terminalRtcCandidateSchema,
|
|
11758
|
-
|
|
11783
|
+
z17.object({ type: z17.literal("rtc-switch") })
|
|
11759
11784
|
]);
|
|
11760
11785
|
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
11761
11786
|
|
|
@@ -11805,47 +11830,47 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
11805
11830
|
deleteChat: "delete_chat",
|
|
11806
11831
|
listRepositories: "list_repositories"
|
|
11807
11832
|
};
|
|
11808
|
-
var automationToolInputSchema =
|
|
11809
|
-
name:
|
|
11810
|
-
prompt:
|
|
11811
|
-
environment_id:
|
|
11812
|
-
triggers:
|
|
11833
|
+
var automationToolInputSchema = z18.object({
|
|
11834
|
+
name: z18.string().describe("Short automation name."),
|
|
11835
|
+
prompt: z18.string().describe("Prompt each automation run starts with."),
|
|
11836
|
+
environment_id: z18.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
11837
|
+
triggers: z18.array(automationTriggerSchema).min(1).describe(
|
|
11813
11838
|
'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>"] } }`.'
|
|
11814
11839
|
),
|
|
11815
|
-
description:
|
|
11816
|
-
plan_mode:
|
|
11817
|
-
goal_mode:
|
|
11818
|
-
fast_mode:
|
|
11819
|
-
workspace_lifecycle_policy:
|
|
11840
|
+
description: z18.string().optional().describe("One-line summary shown in the dashboard."),
|
|
11841
|
+
plan_mode: z18.boolean().optional(),
|
|
11842
|
+
goal_mode: z18.boolean().optional(),
|
|
11843
|
+
fast_mode: z18.boolean().optional(),
|
|
11844
|
+
workspace_lifecycle_policy: z18.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
11820
11845
|
"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."
|
|
11821
11846
|
)
|
|
11822
11847
|
});
|
|
11823
11848
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
11824
|
-
scope:
|
|
11849
|
+
scope: z18.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
11825
11850
|
});
|
|
11826
11851
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
11827
|
-
automation_id:
|
|
11828
|
-
enabled:
|
|
11829
|
-
agent_provider:
|
|
11830
|
-
model:
|
|
11831
|
-
thinking_level:
|
|
11832
|
-
workspace_size:
|
|
11833
|
-
scope:
|
|
11852
|
+
automation_id: z18.string().describe("Automation ID"),
|
|
11853
|
+
enabled: z18.boolean().optional(),
|
|
11854
|
+
agent_provider: z18.enum(AGENT).nullable().optional(),
|
|
11855
|
+
model: z18.string().nullable().optional(),
|
|
11856
|
+
thinking_level: z18.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
11857
|
+
workspace_size: z18.enum(WORKSPACE_SIZES).optional(),
|
|
11858
|
+
scope: z18.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
11834
11859
|
});
|
|
11835
|
-
var chatPath = { id:
|
|
11860
|
+
var chatPath = { id: z18.string().describe("Workspace ID"), chat_id: z18.string().describe("Chat ID") };
|
|
11836
11861
|
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
11837
|
-
var createChatToolInputSchema =
|
|
11838
|
-
var forkChatToolInputSchema =
|
|
11839
|
-
var renameChatToolInputSchema =
|
|
11840
|
-
var runCommandToolInputSchema =
|
|
11841
|
-
var environmentMcpPath = { environment_id:
|
|
11842
|
-
var createEnvironmentMcpToolInputSchema =
|
|
11843
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
11862
|
+
var createChatToolInputSchema = z18.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
11863
|
+
var forkChatToolInputSchema = z18.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
|
|
11864
|
+
var renameChatToolInputSchema = z18.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
|
|
11865
|
+
var runCommandToolInputSchema = z18.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
11866
|
+
var environmentMcpPath = { environment_id: z18.string().describe("Environment ID") };
|
|
11867
|
+
var createEnvironmentMcpToolInputSchema = z18.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
11868
|
+
var updateEnvironmentMcpToolInputSchema = z18.object({
|
|
11844
11869
|
...environmentMcpPath,
|
|
11845
|
-
mcp_id:
|
|
11870
|
+
mcp_id: z18.string().describe("MCP ID"),
|
|
11846
11871
|
...updateEnvironmentMcpRequestSchema.shape
|
|
11847
11872
|
});
|
|
11848
|
-
var createEnvironmentDeviceToolInputSchema =
|
|
11873
|
+
var createEnvironmentDeviceToolInputSchema = z18.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
|
|
11849
11874
|
|
|
11850
11875
|
// ../shared/src/scout.ts
|
|
11851
11876
|
var SCOUT_SOURCE_TYPES = ["slack", "linear"];
|
|
@@ -11880,50 +11905,50 @@ var SCOUT_PRESET_ICONS = [
|
|
|
11880
11905
|
];
|
|
11881
11906
|
|
|
11882
11907
|
// ../shared/src/routes/push.ts
|
|
11883
|
-
import { z as
|
|
11908
|
+
import { z as z19 } from "zod";
|
|
11884
11909
|
|
|
11885
11910
|
// ../shared/src/workspace-attention.ts
|
|
11886
11911
|
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup"];
|
|
11887
11912
|
var CHAT_ATTENTION_REASONS = ["question", "blocked"];
|
|
11888
11913
|
|
|
11889
11914
|
// ../shared/src/routes/push.ts
|
|
11890
|
-
var registerPushDeviceRequestSchema =
|
|
11891
|
-
|
|
11892
|
-
platform:
|
|
11893
|
-
token:
|
|
11894
|
-
appId:
|
|
11895
|
-
apnsEnvironment:
|
|
11915
|
+
var registerPushDeviceRequestSchema = z19.discriminatedUnion("platform", [
|
|
11916
|
+
z19.object({
|
|
11917
|
+
platform: z19.literal("ios"),
|
|
11918
|
+
token: z19.string().regex(/^[0-9a-f]{64,200}$/i),
|
|
11919
|
+
appId: z19.string().min(1).max(255),
|
|
11920
|
+
apnsEnvironment: z19.enum(["sandbox", "production"])
|
|
11896
11921
|
}),
|
|
11897
|
-
|
|
11898
|
-
platform:
|
|
11899
|
-
token:
|
|
11900
|
-
appId:
|
|
11922
|
+
z19.object({
|
|
11923
|
+
platform: z19.literal("android"),
|
|
11924
|
+
token: z19.string().min(1).max(4096),
|
|
11925
|
+
appId: z19.string().min(1).max(255)
|
|
11901
11926
|
})
|
|
11902
11927
|
]);
|
|
11903
11928
|
var PUSH_HOLD_MINUTES = 5;
|
|
11904
|
-
var recordPushActivityRequestSchema =
|
|
11905
|
-
organizationId:
|
|
11929
|
+
var recordPushActivityRequestSchema = z19.object({
|
|
11930
|
+
organizationId: z19.string().uuid(),
|
|
11906
11931
|
/** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
|
|
11907
|
-
idleSeconds:
|
|
11908
|
-
seenWorkspaceIds:
|
|
11932
|
+
idleSeconds: z19.number().min(0).optional(),
|
|
11933
|
+
seenWorkspaceIds: z19.array(z19.string().uuid()).max(20)
|
|
11909
11934
|
});
|
|
11910
11935
|
var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
|
|
11911
|
-
var pushQuestionSchema =
|
|
11912
|
-
var pushNotificationDataSchema =
|
|
11913
|
-
organizationId:
|
|
11914
|
-
workspaceId:
|
|
11915
|
-
chatId:
|
|
11916
|
-
kind:
|
|
11917
|
-
completedAt:
|
|
11918
|
-
toolRequestId:
|
|
11936
|
+
var pushQuestionSchema = z19.object({ id: z19.string().max(64), options: z19.array(z19.object({ id: z19.string().max(64), label: z19.string().min(1).max(60) })).min(1).max(4) });
|
|
11937
|
+
var pushNotificationDataSchema = z19.object({
|
|
11938
|
+
organizationId: z19.string(),
|
|
11939
|
+
workspaceId: z19.string(),
|
|
11940
|
+
chatId: z19.string().nullable(),
|
|
11941
|
+
kind: z19.enum(PUSH_NOTIFICATION_KINDS),
|
|
11942
|
+
completedAt: z19.string(),
|
|
11943
|
+
toolRequestId: z19.string().optional(),
|
|
11919
11944
|
question: pushQuestionSchema.optional()
|
|
11920
11945
|
});
|
|
11921
|
-
var registerLiveActivityRequestSchema =
|
|
11922
|
-
deviceId:
|
|
11923
|
-
workspaceId:
|
|
11924
|
-
chatId:
|
|
11946
|
+
var registerLiveActivityRequestSchema = z19.object({
|
|
11947
|
+
deviceId: z19.string().uuid(),
|
|
11948
|
+
workspaceId: z19.string().uuid(),
|
|
11949
|
+
chatId: z19.string().min(1).max(100),
|
|
11925
11950
|
/** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
|
|
11926
|
-
pushToken:
|
|
11951
|
+
pushToken: z19.string().regex(/^[0-9a-f]{64,400}$/i).optional()
|
|
11927
11952
|
});
|
|
11928
11953
|
|
|
11929
11954
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
@@ -12205,7 +12230,7 @@ var DOCKER_ABILITY = {
|
|
|
12205
12230
|
};
|
|
12206
12231
|
|
|
12207
12232
|
// ../shared/src/routes/environment-setups.ts
|
|
12208
|
-
import { z as
|
|
12233
|
+
import { z as z20 } from "zod";
|
|
12209
12234
|
var ENVIRONMENT_SETUP_STEPS = [
|
|
12210
12235
|
{ key: "understand", label: "Understand the codebase" },
|
|
12211
12236
|
{ key: "install", label: "Install dependencies and run the app" },
|
|
@@ -12238,17 +12263,17 @@ var ENVIRONMENT_SETUP_LIMITS = {
|
|
|
12238
12263
|
repositories: 20
|
|
12239
12264
|
};
|
|
12240
12265
|
var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
12241
|
-
var text2 = (max) => max === void 0 ?
|
|
12266
|
+
var text2 = (max) => max === void 0 ? z20.string().trim() : z20.string().trim().max(max);
|
|
12242
12267
|
var requiredText = (max) => text2(max).min(1, "must not be empty");
|
|
12243
12268
|
var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
|
|
12244
12269
|
var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
|
|
12245
|
-
var list = (item, max) => max === void 0 ?
|
|
12270
|
+
var list = (item, max) => max === void 0 ? z20.array(item) : z20.array(item).max(max);
|
|
12246
12271
|
var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
|
|
12247
12272
|
function isEnvironmentSetupAuthoredTriggerType(type) {
|
|
12248
12273
|
return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
|
|
12249
12274
|
}
|
|
12250
|
-
var proposalTriggerSchema =
|
|
12251
|
-
var existingTriggerSchema =
|
|
12275
|
+
var proposalTriggerSchema = z20.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
|
|
12276
|
+
var existingTriggerSchema = z20.custom(
|
|
12252
12277
|
(value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
|
|
12253
12278
|
"must be an automation trigger"
|
|
12254
12279
|
);
|
|
@@ -12256,17 +12281,17 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
|
|
|
12256
12281
|
(trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
|
|
12257
12282
|
);
|
|
12258
12283
|
function automationSchema(limits) {
|
|
12259
|
-
const authored =
|
|
12284
|
+
const authored = z20.object({
|
|
12260
12285
|
name: text2(limits.nameChars),
|
|
12261
12286
|
description: text2(limits.descriptionChars),
|
|
12262
12287
|
prompt: text2(limits.automationPromptChars),
|
|
12263
12288
|
triggers: list(proposalTriggerSchema, limits.automationTriggers)
|
|
12264
12289
|
});
|
|
12265
|
-
const updated = authored.extend({ triggers: list(
|
|
12266
|
-
return
|
|
12290
|
+
const updated = authored.extend({ triggers: list(z20.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
|
|
12291
|
+
return z20.object({
|
|
12267
12292
|
key: requiredText(limits.automationKeyChars),
|
|
12268
|
-
action:
|
|
12269
|
-
automation_id:
|
|
12293
|
+
action: z20.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
|
|
12294
|
+
automation_id: z20.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
|
|
12270
12295
|
name: text2().default(""),
|
|
12271
12296
|
description: optionalText2().transform((value) => value ?? ""),
|
|
12272
12297
|
prompt: text2().default(""),
|
|
@@ -12289,7 +12314,7 @@ function automationSchema(limits) {
|
|
|
12289
12314
|
const content = (automation.action === "update" ? updated : authored).safeParse(automation);
|
|
12290
12315
|
if (content.success) return { ...automation, ...content.data };
|
|
12291
12316
|
for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
|
|
12292
|
-
return
|
|
12317
|
+
return z20.NEVER;
|
|
12293
12318
|
});
|
|
12294
12319
|
}
|
|
12295
12320
|
function automationListSchema(limits) {
|
|
@@ -12307,7 +12332,7 @@ function automationListSchema(limits) {
|
|
|
12307
12332
|
});
|
|
12308
12333
|
}
|
|
12309
12334
|
function environmentSchema(limits) {
|
|
12310
|
-
return
|
|
12335
|
+
return z20.object({
|
|
12311
12336
|
name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
|
|
12312
12337
|
description: clearableText(limits.descriptionChars),
|
|
12313
12338
|
system_prompt: clearableText(limits.systemPromptChars),
|
|
@@ -12316,41 +12341,41 @@ function environmentSchema(limits) {
|
|
|
12316
12341
|
});
|
|
12317
12342
|
}
|
|
12318
12343
|
function proposalSchema(limits) {
|
|
12319
|
-
return
|
|
12344
|
+
return z20.object({
|
|
12320
12345
|
summary: requiredText(limits.summaryChars),
|
|
12321
12346
|
stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
|
|
12322
12347
|
environment: environmentSchema(limits),
|
|
12323
|
-
variables: list(
|
|
12324
|
-
key:
|
|
12348
|
+
variables: list(z20.object({
|
|
12349
|
+
key: z20.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
|
|
12325
12350
|
description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
|
|
12326
|
-
required:
|
|
12351
|
+
required: z20.boolean().default(false)
|
|
12327
12352
|
}), limits.variables).default([]),
|
|
12328
12353
|
automations: automationListSchema(limits),
|
|
12329
|
-
verification: list(
|
|
12354
|
+
verification: list(z20.object({
|
|
12330
12355
|
label: requiredText(limits.nameChars),
|
|
12331
|
-
status:
|
|
12356
|
+
status: z20.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
|
|
12332
12357
|
detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
|
|
12333
12358
|
}), limits.verificationItems).default([]),
|
|
12334
|
-
media: list(
|
|
12335
|
-
media_id:
|
|
12359
|
+
media: list(z20.object({
|
|
12360
|
+
media_id: z20.string().regex(UUID_RE, "must be a media id"),
|
|
12336
12361
|
title: requiredText(limits.nameChars)
|
|
12337
12362
|
}), limits.mediaItems).default([])
|
|
12338
12363
|
});
|
|
12339
12364
|
}
|
|
12340
12365
|
var environmentSetupProposalSchema = proposalSchema({});
|
|
12341
12366
|
var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
|
|
12342
|
-
var environmentSetupRunStateSchema =
|
|
12343
|
-
status:
|
|
12344
|
-
steps:
|
|
12367
|
+
var environmentSetupRunStateSchema = z20.object({
|
|
12368
|
+
status: z20.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
|
|
12369
|
+
steps: z20.partialRecord(z20.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z20.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
|
|
12345
12370
|
proposal: environmentSetupProposalSchema.nullable().default(null),
|
|
12346
|
-
applied:
|
|
12347
|
-
applied_at:
|
|
12348
|
-
automation_ids:
|
|
12371
|
+
applied: z20.object({
|
|
12372
|
+
applied_at: z20.string(),
|
|
12373
|
+
automation_ids: z20.array(z20.string())
|
|
12349
12374
|
}).nullable().default(null)
|
|
12350
12375
|
});
|
|
12351
|
-
var applyEnvironmentSetupRequestSchema =
|
|
12376
|
+
var applyEnvironmentSetupRequestSchema = z20.object({
|
|
12352
12377
|
environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
|
|
12353
|
-
variables: list(
|
|
12378
|
+
variables: list(z20.object({ key: z20.string().regex(VARIABLE_KEY_RE), value: z20.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
|
|
12354
12379
|
automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
|
|
12355
12380
|
});
|
|
12356
12381
|
|
|
@@ -12825,7 +12850,7 @@ var GITLAB_ABILITY = {
|
|
|
12825
12850
|
};
|
|
12826
12851
|
|
|
12827
12852
|
// ../shared/src/routes/compute.ts
|
|
12828
|
-
import { z as
|
|
12853
|
+
import { z as z21 } from "zod";
|
|
12829
12854
|
var COMPUTE_SANDBOX_KINDS = ["gpu"];
|
|
12830
12855
|
var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
|
|
12831
12856
|
var DEFAULT_GPU_TYPE = "L4";
|
|
@@ -12842,27 +12867,27 @@ var COMPUTE_SANDBOX_LIMITS = {
|
|
|
12842
12867
|
maxIdleTimeoutMinutes: 60,
|
|
12843
12868
|
maxTransferBytes: 1024 ** 3
|
|
12844
12869
|
};
|
|
12845
|
-
var computeEnvSchema =
|
|
12846
|
-
var createComputeSandboxRequestSchema =
|
|
12847
|
-
kind:
|
|
12848
|
-
gpu:
|
|
12849
|
-
image:
|
|
12850
|
-
timeoutMinutes:
|
|
12851
|
-
idleTimeoutMinutes:
|
|
12852
|
-
ports:
|
|
12870
|
+
var computeEnvSchema = z21.record(z21.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z21.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
|
|
12871
|
+
var createComputeSandboxRequestSchema = z21.object({
|
|
12872
|
+
kind: z21.enum(COMPUTE_SANDBOX_KINDS),
|
|
12873
|
+
gpu: z21.string().trim().optional(),
|
|
12874
|
+
image: z21.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
|
|
12875
|
+
timeoutMinutes: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
|
|
12876
|
+
idleTimeoutMinutes: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
|
|
12877
|
+
ports: z21.array(z21.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
|
|
12853
12878
|
env: computeEnvSchema.optional()
|
|
12854
12879
|
});
|
|
12855
|
-
var computeExecRequestSchema =
|
|
12856
|
-
command:
|
|
12857
|
-
workdir:
|
|
12880
|
+
var computeExecRequestSchema = z21.object({
|
|
12881
|
+
command: z21.string().min(1).max(1e5),
|
|
12882
|
+
workdir: z21.string().min(1).max(4096).optional(),
|
|
12858
12883
|
env: computeEnvSchema.optional(),
|
|
12859
|
-
detach:
|
|
12884
|
+
detach: z21.boolean().optional()
|
|
12860
12885
|
});
|
|
12861
|
-
var computeUploadRequestSchema =
|
|
12862
|
-
size:
|
|
12886
|
+
var computeUploadRequestSchema = z21.object({
|
|
12887
|
+
size: z21.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
12863
12888
|
});
|
|
12864
|
-
var computeTransferPathSchema =
|
|
12865
|
-
path:
|
|
12889
|
+
var computeTransferPathSchema = z21.object({
|
|
12890
|
+
path: z21.string().min(1).max(4096).optional()
|
|
12866
12891
|
});
|
|
12867
12892
|
|
|
12868
12893
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
@@ -14545,18 +14570,18 @@ var MOTHERSHIP_EVENT_KINDS = ["finished", "ready", "needs_attention", "merged",
|
|
|
14545
14570
|
var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
14546
14571
|
var MOTHERSHIP_EVENT_TYPE = "multitask-event";
|
|
14547
14572
|
var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
14548
|
-
var mothershipEventSchema =
|
|
14549
|
-
id:
|
|
14550
|
-
at:
|
|
14551
|
-
kind:
|
|
14552
|
-
agentId:
|
|
14553
|
-
agentName:
|
|
14554
|
-
summary:
|
|
14555
|
-
detail:
|
|
14573
|
+
var mothershipEventSchema = z22.object({
|
|
14574
|
+
id: z22.string(),
|
|
14575
|
+
at: z22.string(),
|
|
14576
|
+
kind: z22.enum(MOTHERSHIP_EVENT_KINDS),
|
|
14577
|
+
agentId: z22.string(),
|
|
14578
|
+
agentName: z22.string(),
|
|
14579
|
+
summary: z22.string(),
|
|
14580
|
+
detail: z22.string().optional(),
|
|
14556
14581
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
14557
|
-
chatId:
|
|
14582
|
+
chatId: z22.string().optional(),
|
|
14558
14583
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
14559
|
-
noticed:
|
|
14584
|
+
noticed: z22.boolean().optional()
|
|
14560
14585
|
});
|
|
14561
14586
|
var TAG = "multitask_event";
|
|
14562
14587
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
@@ -15574,7 +15599,7 @@ function subagentChatId(message2) {
|
|
|
15574
15599
|
}
|
|
15575
15600
|
|
|
15576
15601
|
// ../shared/src/learned-skills.ts
|
|
15577
|
-
import { z as
|
|
15602
|
+
import { z as z23 } from "zod";
|
|
15578
15603
|
|
|
15579
15604
|
// ../shared/src/frontmatter.ts
|
|
15580
15605
|
import { parse as parseYaml } from "yaml";
|
|
@@ -15597,20 +15622,20 @@ function parseFrontmatter(content) {
|
|
|
15597
15622
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
15598
15623
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
15599
15624
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
15600
|
-
var learnedSkillsManifestSchema =
|
|
15601
|
-
skills:
|
|
15625
|
+
var learnedSkillsManifestSchema = z23.object({
|
|
15626
|
+
skills: z23.array(z23.object({ name: z23.string(), sha256: z23.string() }))
|
|
15602
15627
|
});
|
|
15603
|
-
var dreamVerdictChecksSchema =
|
|
15604
|
-
repeatable:
|
|
15605
|
-
realInstruction:
|
|
15606
|
-
noContradiction:
|
|
15607
|
-
formatExact:
|
|
15608
|
-
humanOnly:
|
|
15609
|
-
actionable:
|
|
15610
|
-
durable:
|
|
15628
|
+
var dreamVerdictChecksSchema = z23.object({
|
|
15629
|
+
repeatable: z23.boolean(),
|
|
15630
|
+
realInstruction: z23.boolean(),
|
|
15631
|
+
noContradiction: z23.boolean(),
|
|
15632
|
+
formatExact: z23.boolean(),
|
|
15633
|
+
humanOnly: z23.boolean(),
|
|
15634
|
+
actionable: z23.boolean(),
|
|
15635
|
+
durable: z23.boolean()
|
|
15611
15636
|
});
|
|
15612
15637
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
15613
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
15638
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z23.boolean(), reason: z23.string() });
|
|
15614
15639
|
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."`;
|
|
15615
15640
|
|
|
15616
15641
|
// ../shared/src/user-message-matching.ts
|
|
@@ -19362,7 +19387,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
19362
19387
|
};
|
|
19363
19388
|
|
|
19364
19389
|
// ../shared/src/routes/command-protection.ts
|
|
19365
|
-
import { z as
|
|
19390
|
+
import { z as z24 } from "zod";
|
|
19366
19391
|
|
|
19367
19392
|
// ../shared/src/git-invocations.ts
|
|
19368
19393
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -19453,27 +19478,27 @@ function findCheckoutTarget(args) {
|
|
|
19453
19478
|
}
|
|
19454
19479
|
|
|
19455
19480
|
// ../shared/src/routes/command-protection.ts
|
|
19456
|
-
var commandProtectionRepoStateSchema =
|
|
19457
|
-
branch:
|
|
19458
|
-
defaultBranch:
|
|
19459
|
-
pushBranch:
|
|
19460
|
-
pushConfig:
|
|
19461
|
-
headMessage:
|
|
19462
|
-
mergeInProgress:
|
|
19481
|
+
var commandProtectionRepoStateSchema = z24.object({
|
|
19482
|
+
branch: z24.string().nullable(),
|
|
19483
|
+
defaultBranch: z24.string().nullable(),
|
|
19484
|
+
pushBranch: z24.string().nullable(),
|
|
19485
|
+
pushConfig: z24.string().nullable(),
|
|
19486
|
+
headMessage: z24.string().nullable(),
|
|
19487
|
+
mergeInProgress: z24.boolean().optional()
|
|
19463
19488
|
});
|
|
19464
|
-
var commandProtectionEvaluateRequestSchema =
|
|
19465
|
-
provider:
|
|
19466
|
-
source:
|
|
19467
|
-
toolName:
|
|
19468
|
-
toolInput:
|
|
19469
|
-
command:
|
|
19470
|
-
cwd:
|
|
19471
|
-
toolUseId:
|
|
19489
|
+
var commandProtectionEvaluateRequestSchema = z24.object({
|
|
19490
|
+
provider: z24.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
19491
|
+
source: z24.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
19492
|
+
toolName: z24.string(),
|
|
19493
|
+
toolInput: z24.unknown(),
|
|
19494
|
+
command: z24.string().nullish(),
|
|
19495
|
+
cwd: z24.string().nullish(),
|
|
19496
|
+
toolUseId: z24.string().nullish(),
|
|
19472
19497
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
19473
19498
|
// policy can see branches and commit messages the command text only references.
|
|
19474
|
-
gitContext:
|
|
19475
|
-
repos:
|
|
19476
|
-
messageFiles:
|
|
19499
|
+
gitContext: z24.object({
|
|
19500
|
+
repos: z24.record(z24.string(), commandProtectionRepoStateSchema),
|
|
19501
|
+
messageFiles: z24.record(z24.string(), z24.string())
|
|
19477
19502
|
}).optional()
|
|
19478
19503
|
});
|
|
19479
19504
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -19693,133 +19718,133 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
19693
19718
|
}
|
|
19694
19719
|
|
|
19695
19720
|
// ../shared/src/routes/linear.ts
|
|
19696
|
-
import { z as
|
|
19697
|
-
var linearSessionMetadataSchema =
|
|
19698
|
-
via_mothership:
|
|
19699
|
-
attached:
|
|
19700
|
-
issue_id:
|
|
19701
|
-
issue_identifier:
|
|
19702
|
-
issue_title:
|
|
19703
|
-
issue_description:
|
|
19704
|
-
issue_url:
|
|
19705
|
-
comment_id:
|
|
19706
|
-
comment_body:
|
|
19707
|
-
triggered_by_id:
|
|
19708
|
-
triggered_by_name:
|
|
19709
|
-
triggered_by_email:
|
|
19710
|
-
linear_workspace_id:
|
|
19711
|
-
creator_id:
|
|
19712
|
-
creator_name:
|
|
19713
|
-
creator_email:
|
|
19714
|
-
assignee_id:
|
|
19715
|
-
assignee_name:
|
|
19716
|
-
assignee_email:
|
|
19717
|
-
issue_state:
|
|
19718
|
-
parent_issue:
|
|
19719
|
-
id:
|
|
19720
|
-
identifier:
|
|
19721
|
-
title:
|
|
19722
|
-
description:
|
|
19721
|
+
import { z as z25 } from "zod";
|
|
19722
|
+
var linearSessionMetadataSchema = z25.object({
|
|
19723
|
+
via_mothership: z25.boolean().optional(),
|
|
19724
|
+
attached: z25.boolean().optional(),
|
|
19725
|
+
issue_id: z25.string(),
|
|
19726
|
+
issue_identifier: z25.string(),
|
|
19727
|
+
issue_title: z25.string(),
|
|
19728
|
+
issue_description: z25.string(),
|
|
19729
|
+
issue_url: z25.string(),
|
|
19730
|
+
comment_id: z25.string(),
|
|
19731
|
+
comment_body: z25.string(),
|
|
19732
|
+
triggered_by_id: z25.string().optional(),
|
|
19733
|
+
triggered_by_name: z25.string().optional(),
|
|
19734
|
+
triggered_by_email: z25.string().optional(),
|
|
19735
|
+
linear_workspace_id: z25.string().optional(),
|
|
19736
|
+
creator_id: z25.string().optional(),
|
|
19737
|
+
creator_name: z25.string().optional(),
|
|
19738
|
+
creator_email: z25.string().optional(),
|
|
19739
|
+
assignee_id: z25.string().optional(),
|
|
19740
|
+
assignee_name: z25.string().optional(),
|
|
19741
|
+
assignee_email: z25.string().optional(),
|
|
19742
|
+
issue_state: z25.string().optional(),
|
|
19743
|
+
parent_issue: z25.object({
|
|
19744
|
+
id: z25.string(),
|
|
19745
|
+
identifier: z25.string(),
|
|
19746
|
+
title: z25.string(),
|
|
19747
|
+
description: z25.string().nullable()
|
|
19723
19748
|
}).optional(),
|
|
19724
|
-
workspace:
|
|
19725
|
-
id:
|
|
19726
|
-
coding_agent:
|
|
19727
|
-
task_description:
|
|
19728
|
-
created_at:
|
|
19749
|
+
workspace: z25.object({
|
|
19750
|
+
id: z25.string(),
|
|
19751
|
+
coding_agent: z25.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
19752
|
+
task_description: z25.string(),
|
|
19753
|
+
created_at: z25.string()
|
|
19729
19754
|
}).optional()
|
|
19730
19755
|
});
|
|
19731
19756
|
|
|
19732
19757
|
// ../shared/src/routes/scout.ts
|
|
19733
|
-
import { z as
|
|
19758
|
+
import { z as z26 } from "zod";
|
|
19734
19759
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
19735
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
19736
|
-
comment_id:
|
|
19737
|
-
action:
|
|
19760
|
+
var scoutLinearSessionIntentRequestSchema = z26.object({
|
|
19761
|
+
comment_id: z26.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
19762
|
+
action: z26.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
19738
19763
|
});
|
|
19739
|
-
var scoutLinearStartRequestSchema =
|
|
19740
|
-
issue_id:
|
|
19741
|
-
agent_session_id:
|
|
19742
|
-
prompt:
|
|
19764
|
+
var scoutLinearStartRequestSchema = z26.object({
|
|
19765
|
+
issue_id: z26.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
19766
|
+
agent_session_id: z26.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
19767
|
+
prompt: z26.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
19743
19768
|
});
|
|
19744
|
-
var slackChannelIdSchema =
|
|
19745
|
-
var slackThreadTsSchema =
|
|
19746
|
-
var scoutSlackSpawnRequestSchema =
|
|
19769
|
+
var slackChannelIdSchema = z26.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
19770
|
+
var slackThreadTsSchema = z26.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
19771
|
+
var scoutSlackSpawnRequestSchema = z26.object({
|
|
19747
19772
|
channel_id: slackChannelIdSchema,
|
|
19748
19773
|
thread_ts: slackThreadTsSchema,
|
|
19749
|
-
message_ts:
|
|
19750
|
-
user_id:
|
|
19751
|
-
prompt:
|
|
19752
|
-
acknowledgement_ts:
|
|
19753
|
-
environment_id:
|
|
19774
|
+
message_ts: z26.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."),
|
|
19775
|
+
user_id: z26.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
19776
|
+
prompt: z26.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."),
|
|
19777
|
+
acknowledgement_ts: z26.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."),
|
|
19778
|
+
environment_id: z26.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.`)
|
|
19754
19779
|
});
|
|
19755
19780
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
19756
|
-
title:
|
|
19757
|
-
prompt:
|
|
19758
|
-
acknowledgement_ts:
|
|
19781
|
+
title: z26.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
19782
|
+
prompt: z26.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."),
|
|
19783
|
+
acknowledgement_ts: z26.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.")
|
|
19759
19784
|
});
|
|
19760
|
-
var scoutSlackRelayRequestSchema =
|
|
19785
|
+
var scoutSlackRelayRequestSchema = z26.object({
|
|
19761
19786
|
channel_id: slackChannelIdSchema,
|
|
19762
19787
|
thread_ts: slackThreadTsSchema,
|
|
19763
|
-
message:
|
|
19764
|
-
user_id:
|
|
19765
|
-
queue:
|
|
19766
|
-
workspace_id:
|
|
19767
|
-
message_ts:
|
|
19788
|
+
message: z26.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."),
|
|
19789
|
+
user_id: z26.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`."),
|
|
19790
|
+
queue: z26.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."),
|
|
19791
|
+
workspace_id: z26.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. A Mothership gets the person's own Slack message and the thread instead of \`message\`. Omit to relay into the thread's own workspace.`),
|
|
19792
|
+
message_ts: z26.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.")
|
|
19768
19793
|
});
|
|
19769
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
19794
|
+
var scoutSlackSetThreadMutedRequestSchema = z26.object({
|
|
19770
19795
|
channel_id: slackChannelIdSchema,
|
|
19771
19796
|
thread_ts: slackThreadTsSchema,
|
|
19772
|
-
muted:
|
|
19797
|
+
muted: z26.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
19773
19798
|
});
|
|
19774
|
-
var scoutListWorkspacesRequestSchema =
|
|
19799
|
+
var scoutListWorkspacesRequestSchema = z26.object({
|
|
19775
19800
|
channel_id: slackChannelIdSchema,
|
|
19776
19801
|
thread_ts: slackThreadTsSchema,
|
|
19777
|
-
message_ts:
|
|
19778
|
-
user_id:
|
|
19779
|
-
query:
|
|
19802
|
+
message_ts: z26.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
19803
|
+
user_id: z26.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
19804
|
+
query: z26.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
|
|
19780
19805
|
});
|
|
19781
|
-
var scoutSlackConfirmationSchema =
|
|
19782
|
-
confirmation_channel_id:
|
|
19783
|
-
confirmation_thread_ts:
|
|
19784
|
-
confirmation_message_ts:
|
|
19785
|
-
confirmation_user_id:
|
|
19806
|
+
var scoutSlackConfirmationSchema = z26.object({
|
|
19807
|
+
confirmation_channel_id: z26.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
19808
|
+
confirmation_thread_ts: z26.string().describe("`thread_ts` from that message's envelope."),
|
|
19809
|
+
confirmation_message_ts: z26.string().describe("`message_ts` from that message's envelope."),
|
|
19810
|
+
confirmation_user_id: z26.string().describe("`user_id` from that message's envelope.")
|
|
19786
19811
|
});
|
|
19787
19812
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
19788
19813
|
var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
19789
|
-
preset_id:
|
|
19790
|
-
name:
|
|
19791
|
-
description:
|
|
19792
|
-
icon:
|
|
19793
|
-
instructions:
|
|
19814
|
+
preset_id: z26.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
19815
|
+
name: z26.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
19816
|
+
description: z26.string().optional().describe("One-line summary shown in settings."),
|
|
19817
|
+
icon: z26.enum(SCOUT_PRESET_ICONS).optional(),
|
|
19818
|
+
instructions: z26.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
19794
19819
|
});
|
|
19795
19820
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
19796
|
-
source:
|
|
19797
|
-
external_id:
|
|
19798
|
-
monitored:
|
|
19799
|
-
preset_id:
|
|
19800
|
-
instructions:
|
|
19801
|
-
proactivity:
|
|
19821
|
+
source: z26.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
19822
|
+
external_id: z26.string().describe("Slack channel id or Linear team id."),
|
|
19823
|
+
monitored: z26.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."),
|
|
19824
|
+
preset_id: z26.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
19825
|
+
instructions: z26.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
|
|
19826
|
+
proactivity: z26.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.")
|
|
19802
19827
|
});
|
|
19803
19828
|
var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
19804
|
-
proactivity:
|
|
19829
|
+
proactivity: z26.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 stay `tagged`.")
|
|
19805
19830
|
});
|
|
19806
19831
|
var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
19807
|
-
preset_id:
|
|
19832
|
+
preset_id: z26.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
19808
19833
|
});
|
|
19809
19834
|
var RESET_TO_DEFAULT = "default";
|
|
19810
|
-
var resettable = (schema, description) =>
|
|
19835
|
+
var resettable = (schema, description) => z26.union([schema, z26.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
|
|
19811
19836
|
var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
19812
|
-
agent_provider: resettable(
|
|
19813
|
-
model: resettable(
|
|
19814
|
-
thinking_level: resettable(
|
|
19815
|
-
goal_mode: resettable(
|
|
19816
|
-
fast_mode: resettable(
|
|
19837
|
+
agent_provider: resettable(z26.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
|
|
19838
|
+
model: resettable(z26.string(), "Model id for that agent; the default is the agent's own."),
|
|
19839
|
+
thinking_level: resettable(z26.enum(VALID_THINKING_LEVELS), "Thinking level."),
|
|
19840
|
+
goal_mode: resettable(z26.boolean(), "Goal mode."),
|
|
19841
|
+
fast_mode: resettable(z26.boolean(), "Fast mode.")
|
|
19817
19842
|
});
|
|
19818
|
-
var scoutClaimSettingsOfferToolInputSchema =
|
|
19843
|
+
var scoutClaimSettingsOfferToolInputSchema = z26.object({
|
|
19819
19844
|
channel_id: slackChannelIdSchema,
|
|
19820
|
-
kind:
|
|
19821
|
-
user_id:
|
|
19822
|
-
declined:
|
|
19845
|
+
kind: z26.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `instructions`: offering channel instructions or a preset. `organization_proactivity`: offering to lower the workspace default; only decline it, the server claims it for you."),
|
|
19846
|
+
user_id: z26.string().optional().describe("The envelope's `user_id`. Required for `proactivity`, so the server can say whether they are an organization admin."),
|
|
19847
|
+
declined: z26.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
|
|
19823
19848
|
});
|
|
19824
19849
|
|
|
19825
19850
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -20181,11 +20206,11 @@ var PLUGIN_CATALOG = [
|
|
|
20181
20206
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
20182
20207
|
|
|
20183
20208
|
// ../shared/src/routes/web-auth.ts
|
|
20184
|
-
import { z as
|
|
20185
|
-
var webAuthRedeemResponseSchema =
|
|
20186
|
-
path:
|
|
20187
|
-
organizationId:
|
|
20188
|
-
session:
|
|
20209
|
+
import { z as z27 } from "zod";
|
|
20210
|
+
var webAuthRedeemResponseSchema = z27.object({
|
|
20211
|
+
path: z27.string(),
|
|
20212
|
+
organizationId: z27.string().nullable(),
|
|
20213
|
+
session: z27.object({ access_token: z27.string(), refresh_token: z27.string(), user: z27.object({ id: z27.string(), email: z27.string() }) }).nullable()
|
|
20189
20214
|
});
|
|
20190
20215
|
|
|
20191
20216
|
// ../shared/src/routes/client-state.ts
|
|
@@ -20208,81 +20233,81 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
|
|
|
20208
20233
|
var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
|
|
20209
20234
|
|
|
20210
20235
|
// ../shared/src/routes/workspace-events.ts
|
|
20211
|
-
import { z as
|
|
20212
|
-
var workspaceTurnCompletionSchema =
|
|
20213
|
-
workspaceName:
|
|
20214
|
-
completedAt:
|
|
20215
|
-
processing:
|
|
20216
|
-
pullRequestFeedback:
|
|
20217
|
-
attention:
|
|
20236
|
+
import { z as z28 } from "zod";
|
|
20237
|
+
var workspaceTurnCompletionSchema = z28.object({
|
|
20238
|
+
workspaceName: z28.string(),
|
|
20239
|
+
completedAt: z28.string(),
|
|
20240
|
+
processing: z28.boolean().optional(),
|
|
20241
|
+
pullRequestFeedback: z28.boolean().optional(),
|
|
20242
|
+
attention: z28.object({ reason: z28.enum(CHAT_ATTENTION_REASONS), userId: z28.string() }).optional()
|
|
20218
20243
|
});
|
|
20219
|
-
var workspaceChangedEventSchema =
|
|
20220
|
-
|
|
20221
|
-
type:
|
|
20222
|
-
workspaceId:
|
|
20223
|
-
workspace:
|
|
20244
|
+
var workspaceChangedEventSchema = z28.discriminatedUnion("type", [
|
|
20245
|
+
z28.object({
|
|
20246
|
+
type: z28.literal("workspace.changed"),
|
|
20247
|
+
workspaceId: z28.string(),
|
|
20248
|
+
workspace: z28.object({ status: z28.enum(WORKSPACE_STATUSES), last_activity_at: z28.string().nullable() }).optional(),
|
|
20224
20249
|
completion: workspaceTurnCompletionSchema.optional(),
|
|
20225
|
-
ts:
|
|
20250
|
+
ts: z28.string()
|
|
20226
20251
|
}),
|
|
20227
|
-
|
|
20228
|
-
type:
|
|
20229
|
-
workspaceId:
|
|
20230
|
-
chatId:
|
|
20231
|
-
ts:
|
|
20252
|
+
z28.object({
|
|
20253
|
+
type: z28.literal("workspace.chat.changed"),
|
|
20254
|
+
workspaceId: z28.string(),
|
|
20255
|
+
chatId: z28.string(),
|
|
20256
|
+
ts: z28.string()
|
|
20232
20257
|
}),
|
|
20233
|
-
|
|
20234
|
-
type:
|
|
20235
|
-
workspaceId:
|
|
20236
|
-
chatId:
|
|
20237
|
-
afterCursor:
|
|
20238
|
-
processing:
|
|
20239
|
-
ts:
|
|
20258
|
+
z28.object({
|
|
20259
|
+
type: z28.literal("workspace.chat.advanced"),
|
|
20260
|
+
workspaceId: z28.string(),
|
|
20261
|
+
chatId: z28.string(),
|
|
20262
|
+
afterCursor: z28.string().optional(),
|
|
20263
|
+
processing: z28.boolean(),
|
|
20264
|
+
ts: z28.string()
|
|
20240
20265
|
}),
|
|
20241
|
-
|
|
20242
|
-
|
|
20243
|
-
type:
|
|
20244
|
-
workspaceId:
|
|
20245
|
-
ts:
|
|
20266
|
+
z28.object({ type: z28.literal("presence.changed"), ts: z28.string() }),
|
|
20267
|
+
z28.object({
|
|
20268
|
+
type: z28.literal("mobile-testing.changed"),
|
|
20269
|
+
workspaceId: z28.string(),
|
|
20270
|
+
ts: z28.string()
|
|
20246
20271
|
}),
|
|
20247
|
-
|
|
20248
|
-
type:
|
|
20249
|
-
workspaceId:
|
|
20250
|
-
ts:
|
|
20272
|
+
z28.object({
|
|
20273
|
+
type: z28.literal("variable-request.changed"),
|
|
20274
|
+
workspaceId: z28.string(),
|
|
20275
|
+
ts: z28.string()
|
|
20251
20276
|
}),
|
|
20252
|
-
|
|
20253
|
-
type:
|
|
20254
|
-
prUrl:
|
|
20255
|
-
ts:
|
|
20277
|
+
z28.object({
|
|
20278
|
+
type: z28.literal("pull-request.changed"),
|
|
20279
|
+
prUrl: z28.string(),
|
|
20280
|
+
ts: z28.string()
|
|
20256
20281
|
}),
|
|
20257
|
-
|
|
20258
|
-
type:
|
|
20259
|
-
workspaceId:
|
|
20260
|
-
subagent:
|
|
20261
|
-
ts:
|
|
20282
|
+
z28.object({
|
|
20283
|
+
type: z28.literal("mothership.subagent.changed"),
|
|
20284
|
+
workspaceId: z28.string(),
|
|
20285
|
+
subagent: z28.object({ id: z28.string(), name: z28.string(), prUrl: z28.string().nullable() }),
|
|
20286
|
+
ts: z28.string()
|
|
20262
20287
|
}),
|
|
20263
|
-
|
|
20288
|
+
z28.object({ type: z28.literal("needs-you.changed"), workspaceId: z28.string().nullable(), ts: z28.string() })
|
|
20264
20289
|
]);
|
|
20265
20290
|
|
|
20266
20291
|
// ../shared/src/routes/presence.ts
|
|
20267
|
-
import { z as
|
|
20268
|
-
var presenceStatusSchema =
|
|
20269
|
-
var presenceLocationSchema =
|
|
20270
|
-
workspaceId:
|
|
20292
|
+
import { z as z29 } from "zod";
|
|
20293
|
+
var presenceStatusSchema = z29.enum(["online", "typing"]);
|
|
20294
|
+
var presenceLocationSchema = z29.object({
|
|
20295
|
+
workspaceId: z29.string().optional()
|
|
20271
20296
|
});
|
|
20272
|
-
var presenceEntrySchema =
|
|
20273
|
-
userId:
|
|
20297
|
+
var presenceEntrySchema = z29.object({
|
|
20298
|
+
userId: z29.string(),
|
|
20274
20299
|
status: presenceStatusSchema,
|
|
20275
20300
|
location: presenceLocationSchema,
|
|
20276
|
-
ts:
|
|
20301
|
+
ts: z29.string()
|
|
20277
20302
|
});
|
|
20278
|
-
var updatePresenceRequestSchema =
|
|
20303
|
+
var updatePresenceRequestSchema = z29.object({
|
|
20279
20304
|
status: presenceStatusSchema,
|
|
20280
20305
|
location: presenceLocationSchema.optional()
|
|
20281
20306
|
});
|
|
20282
20307
|
|
|
20283
20308
|
// ../shared/src/routes/review-messages.ts
|
|
20284
|
-
import { z as
|
|
20285
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
20309
|
+
import { z as z30 } from "zod";
|
|
20310
|
+
var sendPullRequestReviewMessageRequestSchema = z30.object({
|
|
20286
20311
|
...sendChatMessageRequestSchema.pick({
|
|
20287
20312
|
message: true,
|
|
20288
20313
|
messageId: true,
|
|
@@ -20295,8 +20320,8 @@ var sendPullRequestReviewMessageRequestSchema = z29.object({
|
|
|
20295
20320
|
ultrafastMode: true
|
|
20296
20321
|
}).shape,
|
|
20297
20322
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
20298
|
-
newChat:
|
|
20299
|
-
provider:
|
|
20323
|
+
newChat: z30.boolean().optional(),
|
|
20324
|
+
provider: z30.enum(VALID_AGENT_PROVIDERS).optional()
|
|
20300
20325
|
});
|
|
20301
20326
|
|
|
20302
20327
|
// ../shared/src/audit-log.ts
|
|
@@ -20517,30 +20542,30 @@ function isSkillRegistryManifest(value) {
|
|
|
20517
20542
|
}
|
|
20518
20543
|
|
|
20519
20544
|
// ../shared/src/routes/variable-requests.ts
|
|
20520
|
-
import { z as
|
|
20545
|
+
import { z as z31 } from "zod";
|
|
20521
20546
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
20522
20547
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
20523
|
-
var requestedVariableSchema =
|
|
20524
|
-
key:
|
|
20525
|
-
required:
|
|
20526
|
-
replace:
|
|
20548
|
+
var requestedVariableSchema = z31.object({
|
|
20549
|
+
key: z31.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
20550
|
+
required: z31.boolean(),
|
|
20551
|
+
replace: z31.boolean().optional()
|
|
20527
20552
|
});
|
|
20528
|
-
var requestedVariablesSchema =
|
|
20529
|
-
var createVariableRequestSchema =
|
|
20553
|
+
var requestedVariablesSchema = z31.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");
|
|
20554
|
+
var createVariableRequestSchema = z31.object({
|
|
20530
20555
|
variables: requestedVariablesSchema,
|
|
20531
|
-
reason:
|
|
20532
|
-
wait:
|
|
20556
|
+
reason: z31.string().trim().max(500).nullish().transform((value) => value || null),
|
|
20557
|
+
wait: z31.boolean().default(true)
|
|
20533
20558
|
});
|
|
20534
|
-
var respondVariableRequestSchema =
|
|
20535
|
-
|
|
20536
|
-
action:
|
|
20537
|
-
destination:
|
|
20559
|
+
var respondVariableRequestSchema = z31.discriminatedUnion("action", [
|
|
20560
|
+
z31.object({
|
|
20561
|
+
action: z31.literal("provide"),
|
|
20562
|
+
destination: z31.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
20538
20563
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
20539
|
-
environment_ids:
|
|
20540
|
-
overwrite:
|
|
20541
|
-
values:
|
|
20564
|
+
environment_ids: z31.array(z31.string().uuid()).optional(),
|
|
20565
|
+
overwrite: z31.boolean().optional(),
|
|
20566
|
+
values: z31.record(z31.string().regex(VARIABLE_KEY_RE), z31.string())
|
|
20542
20567
|
}),
|
|
20543
|
-
|
|
20568
|
+
z31.object({ action: z31.literal("skip") })
|
|
20544
20569
|
]);
|
|
20545
20570
|
|
|
20546
20571
|
export {
|
|
@@ -20626,6 +20651,7 @@ export {
|
|
|
20626
20651
|
canUseClaudeFastMode,
|
|
20627
20652
|
AGENT_MODELS,
|
|
20628
20653
|
IMAGE_MEDIA_TYPES,
|
|
20654
|
+
MAX_PENDING_RESOURCE_MINUTES,
|
|
20629
20655
|
MAX_CANVAS_FILE_BYTES,
|
|
20630
20656
|
MAX_CANVAS_PREVIEW_BYTES,
|
|
20631
20657
|
isCanvasTextKind,
|