replicas-engine 0.1.1474 → 0.1.1476
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-ZFUTLUB2.js → asp-host-I4BKMYAK.js} +5 -5
- package/dist/src/{chunk-TM225THB.js → chunk-52KYESTT.js} +1 -1
- package/dist/src/{chunk-J3L7XM72.js → chunk-BANFDG4S.js} +6 -6
- package/dist/src/{chunk-QASHZ22U.js → chunk-F7T4AMIU.js} +2 -2
- package/dist/src/{chunk-GZZW6TAF.js → chunk-OOT2QJJY.js} +3 -3
- package/dist/src/{chunk-KY7AA7NJ.js → chunk-QNET2OSR.js} +2 -2
- package/dist/src/{chunk-XXET6BAY.js → chunk-TFMR22CJ.js} +1269 -734
- package/dist/src/{chunk-DGKAJKVP.js → chunk-WNWHZFW7.js} +2 -2
- package/dist/src/{chunk-USERDXZV.js → chunk-ZSQYVTJM.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +9 -9
- 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 z37 = 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
|
+
z37 = offsetZ;
|
|
1127
1127
|
this.dt = dt;
|
|
1128
1128
|
} else {
|
|
1129
|
-
|
|
1129
|
+
z37 = "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
|
+
z37 = dt.zone.name;
|
|
1140
1140
|
} else {
|
|
1141
|
-
|
|
1141
|
+
z37 = "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 || z37;
|
|
1151
1151
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1152
1152
|
}
|
|
1153
1153
|
format() {
|
|
@@ -9303,123 +9303,12 @@ function getProviderDisplayName(provider2, variant = "short") {
|
|
|
9303
9303
|
}
|
|
9304
9304
|
}
|
|
9305
9305
|
|
|
9306
|
-
// ../shared/src/
|
|
9307
|
-
import { z } from "zod";
|
|
9308
|
-
var MODELS_DEV_API_URL = "https://models.dev/api.json";
|
|
9309
|
-
var MODELS_DEV_CACHE_MS = 5 * 6e4;
|
|
9310
|
-
var MODELS_DEV_TIMEOUT_MS = 5e3;
|
|
9311
|
-
var modelsDevCatalogSchema = z.record(z.string(), z.object({
|
|
9312
|
-
models: z.record(z.string(), z.object({
|
|
9313
|
-
id: z.string().optional(),
|
|
9314
|
-
name: z.string(),
|
|
9315
|
-
description: z.string().optional(),
|
|
9316
|
-
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
|
9317
|
-
provider: z.object({ npm: z.string().optional() }).optional(),
|
|
9318
|
-
cost: z.object({
|
|
9319
|
-
input: z.number().finite().nonnegative().optional(),
|
|
9320
|
-
output: z.number().finite().nonnegative().optional(),
|
|
9321
|
-
cache_read: z.number().finite().nonnegative().optional(),
|
|
9322
|
-
cache_write: z.number().finite().nonnegative().optional()
|
|
9323
|
-
}).optional()
|
|
9324
|
-
}))
|
|
9325
|
-
}));
|
|
9326
|
-
var catalogCache;
|
|
9327
|
-
var catalogRequest;
|
|
9328
|
-
async function fetchModelsDevCatalog() {
|
|
9329
|
-
if (catalogCache && catalogCache.expiresAt > Date.now()) return catalogCache.catalog;
|
|
9330
|
-
catalogRequest ??= withTimeout((async () => {
|
|
9331
|
-
const response = await fetch(MODELS_DEV_API_URL, { signal: AbortSignal.timeout(MODELS_DEV_TIMEOUT_MS) });
|
|
9332
|
-
if (!response.ok) throw new Error(`Failed to load models.dev catalog (${response.status})`);
|
|
9333
|
-
return modelsDevCatalogSchema.parse(await response.json());
|
|
9334
|
-
})(), MODELS_DEV_TIMEOUT_MS, "Timed out loading models.dev catalog").then((catalog) => {
|
|
9335
|
-
catalogCache = { catalog, expiresAt: Date.now() + MODELS_DEV_CACHE_MS };
|
|
9336
|
-
return catalog;
|
|
9337
|
-
}).finally(() => {
|
|
9338
|
-
catalogRequest = void 0;
|
|
9339
|
-
});
|
|
9340
|
-
if (!catalogCache) return catalogRequest;
|
|
9341
|
-
catalogRequest.catch(() => void 0);
|
|
9342
|
-
return catalogCache.catalog;
|
|
9343
|
-
}
|
|
9344
|
-
|
|
9345
|
-
// ../shared/src/credentials/opencode-go.ts
|
|
9346
|
-
var OPENCODE_GO_PROVIDER = "opencode-go";
|
|
9347
|
-
var OPENCODE_ZEN_PROVIDER = "opencode";
|
|
9348
|
-
var OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
|
|
9349
|
-
var DEFAULT_OPENCODE_GO_MODEL = "glm-5.3";
|
|
9350
|
-
function isOpenCodeZenModel(model2) {
|
|
9351
|
-
return model2.startsWith(`${OPENCODE_ZEN_PROVIDER}/`);
|
|
9352
|
-
}
|
|
9353
|
-
async function fetchOpenCodeGoCatalog(agent, fallbackModelIds = [DEFAULT_OPENCODE_GO_MODEL]) {
|
|
9354
|
-
try {
|
|
9355
|
-
const catalog = await fetchModelsDevCatalog();
|
|
9356
|
-
const provider2 = catalog[OPENCODE_GO_PROVIDER];
|
|
9357
|
-
if (!provider2) throw new Error("OpenCode Go model catalog is unavailable");
|
|
9358
|
-
const zenFreeModels = agent === "opencode" ? Object.entries(catalog[OPENCODE_ZEN_PROVIDER]?.models ?? {}).filter(([, definition]) => definition.cost?.input === 0).map(([id, definition]) => [`${OPENCODE_ZEN_PROVIDER}/${id}`, definition]) : [];
|
|
9359
|
-
const models = Object.fromEntries(
|
|
9360
|
-
[...Object.entries(provider2.models), ...zenFreeModels].filter(([, definition]) => definition.status !== "deprecated" && definition.status !== "alpha").map(([id, definition]) => [id, {
|
|
9361
|
-
id: definition.id ?? id,
|
|
9362
|
-
name: definition.name,
|
|
9363
|
-
api: definition.provider?.npm === "@ai-sdk/anthropic" ? "anthropic-messages" : definition.provider?.npm === "@ai-sdk/openai" ? "openai-responses" : void 0,
|
|
9364
|
-
...definition.description ? { description: definition.description } : {},
|
|
9365
|
-
...definition.status ? { status: definition.status } : {}
|
|
9366
|
-
}])
|
|
9367
|
-
);
|
|
9368
|
-
if (Object.keys(models).length === 0) throw new Error("OpenCode Go model catalog is unavailable");
|
|
9369
|
-
return { models, authoritative: true };
|
|
9370
|
-
} catch {
|
|
9371
|
-
return {
|
|
9372
|
-
authoritative: false,
|
|
9373
|
-
models: Object.fromEntries(fallbackModelIds.filter((id) => agent === "opencode" || !isOpenCodeZenModel(id)).map((id) => [id, {
|
|
9374
|
-
id,
|
|
9375
|
-
name: id === DEFAULT_OPENCODE_GO_MODEL ? "GLM 5.3" : id
|
|
9376
|
-
}]))
|
|
9377
|
-
};
|
|
9378
|
-
}
|
|
9379
|
-
}
|
|
9380
|
-
|
|
9381
|
-
// ../shared/src/api-casing.ts
|
|
9382
|
-
var toCamel = (key) => key.replace(/_([a-z0-9])/g, (_, char) => char.toUpperCase());
|
|
9383
|
-
function withCamelCaseKeys(body) {
|
|
9384
|
-
if (!isRecord(body)) return body;
|
|
9385
|
-
const aliases = Object.entries(body).filter(([key]) => key.includes("_") && !(toCamel(key) in body));
|
|
9386
|
-
return aliases.length ? { ...body, ...Object.fromEntries(aliases.map(([key, entry]) => [toCamel(key), entry])) } : body;
|
|
9387
|
-
}
|
|
9388
|
-
|
|
9389
|
-
// ../shared/src/engine/types.ts
|
|
9390
|
-
import { z as z3 } from "zod";
|
|
9391
|
-
|
|
9392
|
-
// ../shared/src/aster.ts
|
|
9393
|
-
var ASTER_PROVIDER = "aster";
|
|
9394
|
-
var ASTER_BASE_URL = "https://api.asterlab.ai/v1";
|
|
9395
|
-
var ASTER_MODELS = [
|
|
9396
|
-
"kimi-k3",
|
|
9397
|
-
"glm-5.2",
|
|
9398
|
-
"gpt-oss-120b-fast",
|
|
9399
|
-
"gpt-oss-120b"
|
|
9400
|
-
];
|
|
9401
|
-
var DEFAULT_ASTER_MODEL = ASTER_MODELS[0];
|
|
9402
|
-
var ASTER_MODEL_LABELS = {
|
|
9403
|
-
"kimi-k3": "Kimi K3",
|
|
9404
|
-
"glm-5.2": "GLM 5.2",
|
|
9405
|
-
"gpt-oss-120b-fast": "GPT-OSS 120B Fast",
|
|
9406
|
-
"gpt-oss-120b": "GPT-OSS 120B"
|
|
9407
|
-
};
|
|
9408
|
-
|
|
9409
|
-
// ../shared/src/chat-kind.ts
|
|
9410
|
-
var CHAT_KINDS = ["standard", "pull_request_fixes", "pull_request_review", "pull_request_tour"];
|
|
9411
|
-
function isChatKind(value) {
|
|
9412
|
-
return CHAT_KINDS.some((kind) => kind === value);
|
|
9413
|
-
}
|
|
9414
|
-
function getChatKind(chat) {
|
|
9415
|
-
if (chat.kind !== void 0) return chat.kind;
|
|
9416
|
-
const purpose = /^(?:PR #|MR !)\d+ (fixes|review|tour)$/.exec(chat.title)?.[1];
|
|
9417
|
-
return CHAT_KINDS.find((kind) => kind === `pull_request_${purpose}`) ?? "standard";
|
|
9418
|
-
}
|
|
9419
|
-
|
|
9420
|
-
// ../shared/src/routes/reviews.ts
|
|
9306
|
+
// ../shared/src/routes/mothership.ts
|
|
9421
9307
|
import { z as z2 } from "zod";
|
|
9422
9308
|
|
|
9309
|
+
// ../shared/src/routes/pull-requests.ts
|
|
9310
|
+
import { z } from "zod";
|
|
9311
|
+
|
|
9423
9312
|
// ../shared/src/github/url.ts
|
|
9424
9313
|
var GITHUB_HOST_RE = /(^|@|\/\/)github\.com[:/]/;
|
|
9425
9314
|
var GITHUB_REPO_SLUG_RE = /github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?(?:[/?#]|$)/i;
|
|
@@ -9465,6 +9354,17 @@ var WEB_APP_PATHS = {
|
|
|
9465
9354
|
accountPreferences: `${DASHBOARD_PATH}/account/preferences`,
|
|
9466
9355
|
fullscreenWorkspaces: "/workspaces"
|
|
9467
9356
|
};
|
|
9357
|
+
var UUID_PATTERN = "????????-????-????-????-????????????";
|
|
9358
|
+
var APP_LINK_PATHS = [
|
|
9359
|
+
`${WEB_APP_PATHS.workspaces}/${UUID_PATTERN}`,
|
|
9360
|
+
`${WEB_APP_PATHS.fullscreenWorkspaces}/${UUID_PATTERN}`,
|
|
9361
|
+
WEB_APP_PATHS.review,
|
|
9362
|
+
`${WEB_APP_PATHS.review}/*/*/*`,
|
|
9363
|
+
`/invite/${UUID_PATTERN}`,
|
|
9364
|
+
WEB_APP_PATHS.automations,
|
|
9365
|
+
`${WEB_APP_PATHS.automations}/${UUID_PATTERN}`
|
|
9366
|
+
];
|
|
9367
|
+
var APP_LINK_PATTERNS = APP_LINK_PATHS.map((path) => new RegExp(`^${path.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\?/g, ".").replace(/\*/g, ".*")}$`));
|
|
9468
9368
|
var LEGACY_WEB_APP_PATHS = {
|
|
9469
9369
|
app: "/app",
|
|
9470
9370
|
home: "/home",
|
|
@@ -9544,40 +9444,198 @@ function buildCodeHostPrUrl(repoUrl, provider2, prNumber) {
|
|
|
9544
9444
|
return `${normalizedRepoUrl}/pull/${prNumber}`;
|
|
9545
9445
|
}
|
|
9546
9446
|
|
|
9447
|
+
// ../shared/src/routes/pull-requests.ts
|
|
9448
|
+
var PULL_REQUEST_MERGE_METHODS = ["merge", "squash", "rebase"];
|
|
9449
|
+
var DEPLOY_START_WINDOW_MS = 30 * 6e4;
|
|
9450
|
+
var mergePullRequestRequestSchema = z.object({
|
|
9451
|
+
mergeMethod: z.enum(PULL_REQUEST_MERGE_METHODS).optional(),
|
|
9452
|
+
bypassRules: z.boolean().optional()
|
|
9453
|
+
});
|
|
9454
|
+
|
|
9455
|
+
// ../shared/src/routes/mothership.ts
|
|
9456
|
+
var linearRuleFields = z2.object({
|
|
9457
|
+
team_id: z2.string().min(1),
|
|
9458
|
+
current_cycle: z2.boolean().optional(),
|
|
9459
|
+
label_ids: z2.array(z2.string().min(1)).min(1).optional(),
|
|
9460
|
+
project_id: z2.string().min(1).optional(),
|
|
9461
|
+
assignee_id: z2.string().min(1).optional()
|
|
9462
|
+
}).strict();
|
|
9463
|
+
var withLabelIds = (value) => {
|
|
9464
|
+
if (!isRecord(value) || typeof value.label_id !== "string") return value;
|
|
9465
|
+
const { label_id, ...rest } = value;
|
|
9466
|
+
return { ...rest, label_ids: [label_id] };
|
|
9467
|
+
};
|
|
9468
|
+
var mothershipLinearRuleSchema = z2.preprocess(withLabelIds, linearRuleFields);
|
|
9469
|
+
var storedMothershipLinearRuleSchema = z2.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: z2.string() }));
|
|
9470
|
+
var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
|
|
9471
|
+
function serviceTierRequestFields(tier) {
|
|
9472
|
+
return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
|
|
9473
|
+
}
|
|
9474
|
+
var mothershipSubagentSettingsSchema = z2.object({
|
|
9475
|
+
coding_agent: z2.enum(VALID_AGENT_PROVIDERS),
|
|
9476
|
+
model: z2.string().nullable(),
|
|
9477
|
+
thinking_level: z2.enum(VALID_THINKING_LEVELS).nullable(),
|
|
9478
|
+
service_tier: z2.enum(SUBAGENT_SERVICE_TIERS),
|
|
9479
|
+
goal_mode: z2.boolean(),
|
|
9480
|
+
plan_mode: z2.boolean()
|
|
9481
|
+
});
|
|
9482
|
+
var QUEUE_SECTIONS = [
|
|
9483
|
+
{ label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
|
|
9484
|
+
{ label: "Working", groups: ["working"] },
|
|
9485
|
+
{ label: "Shipping", groups: ["shipping"] }
|
|
9486
|
+
];
|
|
9487
|
+
var MOTHERSHIP_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups);
|
|
9488
|
+
var MOTHERSHIP_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
|
|
9489
|
+
|
|
9490
|
+
// ../shared/src/models-dev.ts
|
|
9491
|
+
import { z as z3 } from "zod";
|
|
9492
|
+
var MODELS_DEV_API_URL = "https://models.dev/api.json";
|
|
9493
|
+
var MODELS_DEV_CACHE_MS = 5 * 6e4;
|
|
9494
|
+
var MODELS_DEV_TIMEOUT_MS = 5e3;
|
|
9495
|
+
var modelsDevCatalogSchema = z3.record(z3.string(), z3.object({
|
|
9496
|
+
models: z3.record(z3.string(), z3.object({
|
|
9497
|
+
id: z3.string().optional(),
|
|
9498
|
+
name: z3.string(),
|
|
9499
|
+
description: z3.string().optional(),
|
|
9500
|
+
status: z3.enum(["alpha", "beta", "deprecated"]).optional(),
|
|
9501
|
+
provider: z3.object({ npm: z3.string().optional() }).optional(),
|
|
9502
|
+
cost: z3.object({
|
|
9503
|
+
input: z3.number().finite().nonnegative().optional(),
|
|
9504
|
+
output: z3.number().finite().nonnegative().optional(),
|
|
9505
|
+
cache_read: z3.number().finite().nonnegative().optional(),
|
|
9506
|
+
cache_write: z3.number().finite().nonnegative().optional()
|
|
9507
|
+
}).optional()
|
|
9508
|
+
}))
|
|
9509
|
+
}));
|
|
9510
|
+
var catalogCache;
|
|
9511
|
+
var catalogRequest;
|
|
9512
|
+
async function fetchModelsDevCatalog() {
|
|
9513
|
+
if (catalogCache && catalogCache.expiresAt > Date.now()) return catalogCache.catalog;
|
|
9514
|
+
catalogRequest ??= withTimeout((async () => {
|
|
9515
|
+
const response = await fetch(MODELS_DEV_API_URL, { signal: AbortSignal.timeout(MODELS_DEV_TIMEOUT_MS) });
|
|
9516
|
+
if (!response.ok) throw new Error(`Failed to load models.dev catalog (${response.status})`);
|
|
9517
|
+
return modelsDevCatalogSchema.parse(await response.json());
|
|
9518
|
+
})(), MODELS_DEV_TIMEOUT_MS, "Timed out loading models.dev catalog").then((catalog) => {
|
|
9519
|
+
catalogCache = { catalog, expiresAt: Date.now() + MODELS_DEV_CACHE_MS };
|
|
9520
|
+
return catalog;
|
|
9521
|
+
}).finally(() => {
|
|
9522
|
+
catalogRequest = void 0;
|
|
9523
|
+
});
|
|
9524
|
+
if (!catalogCache) return catalogRequest;
|
|
9525
|
+
catalogRequest.catch(() => void 0);
|
|
9526
|
+
return catalogCache.catalog;
|
|
9527
|
+
}
|
|
9528
|
+
|
|
9529
|
+
// ../shared/src/credentials/opencode-go.ts
|
|
9530
|
+
var OPENCODE_GO_PROVIDER = "opencode-go";
|
|
9531
|
+
var OPENCODE_ZEN_PROVIDER = "opencode";
|
|
9532
|
+
var OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
|
|
9533
|
+
var DEFAULT_OPENCODE_GO_MODEL = "glm-5.3";
|
|
9534
|
+
function isOpenCodeZenModel(model2) {
|
|
9535
|
+
return model2.startsWith(`${OPENCODE_ZEN_PROVIDER}/`);
|
|
9536
|
+
}
|
|
9537
|
+
async function fetchOpenCodeGoCatalog(agent, fallbackModelIds = [DEFAULT_OPENCODE_GO_MODEL]) {
|
|
9538
|
+
try {
|
|
9539
|
+
const catalog = await fetchModelsDevCatalog();
|
|
9540
|
+
const provider2 = catalog[OPENCODE_GO_PROVIDER];
|
|
9541
|
+
if (!provider2) throw new Error("OpenCode Go model catalog is unavailable");
|
|
9542
|
+
const zenFreeModels = agent === "opencode" ? Object.entries(catalog[OPENCODE_ZEN_PROVIDER]?.models ?? {}).filter(([, definition]) => definition.cost?.input === 0).map(([id, definition]) => [`${OPENCODE_ZEN_PROVIDER}/${id}`, definition]) : [];
|
|
9543
|
+
const models = Object.fromEntries(
|
|
9544
|
+
[...Object.entries(provider2.models), ...zenFreeModels].filter(([, definition]) => definition.status !== "deprecated" && definition.status !== "alpha").map(([id, definition]) => [id, {
|
|
9545
|
+
id: definition.id ?? id,
|
|
9546
|
+
name: definition.name,
|
|
9547
|
+
api: definition.provider?.npm === "@ai-sdk/anthropic" ? "anthropic-messages" : definition.provider?.npm === "@ai-sdk/openai" ? "openai-responses" : void 0,
|
|
9548
|
+
...definition.description ? { description: definition.description } : {},
|
|
9549
|
+
...definition.status ? { status: definition.status } : {}
|
|
9550
|
+
}])
|
|
9551
|
+
);
|
|
9552
|
+
if (Object.keys(models).length === 0) throw new Error("OpenCode Go model catalog is unavailable");
|
|
9553
|
+
return { models, authoritative: true };
|
|
9554
|
+
} catch {
|
|
9555
|
+
return {
|
|
9556
|
+
authoritative: false,
|
|
9557
|
+
models: Object.fromEntries(fallbackModelIds.filter((id) => agent === "opencode" || !isOpenCodeZenModel(id)).map((id) => [id, {
|
|
9558
|
+
id,
|
|
9559
|
+
name: id === DEFAULT_OPENCODE_GO_MODEL ? "GLM 5.3" : id
|
|
9560
|
+
}]))
|
|
9561
|
+
};
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
|
|
9565
|
+
// ../shared/src/api-casing.ts
|
|
9566
|
+
var toCamel = (key) => key.replace(/_([a-z0-9])/g, (_, char) => char.toUpperCase());
|
|
9567
|
+
function withCamelCaseKeys(body) {
|
|
9568
|
+
if (!isRecord(body)) return body;
|
|
9569
|
+
const aliases = Object.entries(body).filter(([key]) => key.includes("_") && !(toCamel(key) in body));
|
|
9570
|
+
return aliases.length ? { ...body, ...Object.fromEntries(aliases.map(([key, entry]) => [toCamel(key), entry])) } : body;
|
|
9571
|
+
}
|
|
9572
|
+
|
|
9573
|
+
// ../shared/src/engine/types.ts
|
|
9574
|
+
import { z as z5 } from "zod";
|
|
9575
|
+
|
|
9576
|
+
// ../shared/src/aster.ts
|
|
9577
|
+
var ASTER_PROVIDER = "aster";
|
|
9578
|
+
var ASTER_BASE_URL = "https://api.asterlab.ai/v1";
|
|
9579
|
+
var ASTER_MODELS = [
|
|
9580
|
+
"kimi-k3",
|
|
9581
|
+
"glm-5.2",
|
|
9582
|
+
"gpt-oss-120b-fast",
|
|
9583
|
+
"gpt-oss-120b"
|
|
9584
|
+
];
|
|
9585
|
+
var DEFAULT_ASTER_MODEL = ASTER_MODELS[0];
|
|
9586
|
+
var ASTER_MODEL_LABELS = {
|
|
9587
|
+
"kimi-k3": "Kimi K3",
|
|
9588
|
+
"glm-5.2": "GLM 5.2",
|
|
9589
|
+
"gpt-oss-120b-fast": "GPT-OSS 120B Fast",
|
|
9590
|
+
"gpt-oss-120b": "GPT-OSS 120B"
|
|
9591
|
+
};
|
|
9592
|
+
|
|
9593
|
+
// ../shared/src/chat-kind.ts
|
|
9594
|
+
var CHAT_KINDS = ["standard", "pull_request_fixes", "pull_request_review", "pull_request_tour"];
|
|
9595
|
+
function isChatKind(value) {
|
|
9596
|
+
return CHAT_KINDS.some((kind) => kind === value);
|
|
9597
|
+
}
|
|
9598
|
+
function getChatKind(chat) {
|
|
9599
|
+
if (chat.kind !== void 0) return chat.kind;
|
|
9600
|
+
const purpose = /^(?:PR #|MR !)\d+ (fixes|review|tour)$/.exec(chat.title)?.[1];
|
|
9601
|
+
return CHAT_KINDS.find((kind) => kind === `pull_request_${purpose}`) ?? "standard";
|
|
9602
|
+
}
|
|
9603
|
+
|
|
9547
9604
|
// ../shared/src/routes/reviews.ts
|
|
9605
|
+
import { z as z4 } from "zod";
|
|
9548
9606
|
var PULL_REQUEST_COMMENT_DESTINATIONS = ["comment", "review", "agent"];
|
|
9549
|
-
var diffSideSchema =
|
|
9550
|
-
var createPullRequestCommentRequestSchema =
|
|
9551
|
-
body:
|
|
9552
|
-
destination:
|
|
9553
|
-
quote:
|
|
9554
|
-
target:
|
|
9555
|
-
|
|
9556
|
-
path:
|
|
9557
|
-
line:
|
|
9607
|
+
var diffSideSchema = z4.enum(["additions", "deletions"]);
|
|
9608
|
+
var createPullRequestCommentRequestSchema = z4.object({
|
|
9609
|
+
body: z4.string().trim().min(1).max(65536),
|
|
9610
|
+
destination: z4.enum(PULL_REQUEST_COMMENT_DESTINATIONS),
|
|
9611
|
+
quote: z4.string().optional(),
|
|
9612
|
+
target: z4.union([
|
|
9613
|
+
z4.object({
|
|
9614
|
+
path: z4.string().min(1),
|
|
9615
|
+
line: z4.number().int().positive(),
|
|
9558
9616
|
side: diffSideSchema,
|
|
9559
|
-
startLine:
|
|
9617
|
+
startLine: z4.number().int().positive().optional(),
|
|
9560
9618
|
startSide: diffSideSchema.optional()
|
|
9561
9619
|
}),
|
|
9562
|
-
|
|
9620
|
+
z4.object({ replyTo: z4.string().min(1) })
|
|
9563
9621
|
])
|
|
9564
9622
|
});
|
|
9565
9623
|
var PULL_REQUEST_REVIEW_EVENTS = ["comment", "approve", "request_changes"];
|
|
9566
|
-
var submitPullRequestReviewRequestSchema =
|
|
9567
|
-
event:
|
|
9568
|
-
body:
|
|
9624
|
+
var submitPullRequestReviewRequestSchema = z4.object({
|
|
9625
|
+
event: z4.enum(PULL_REQUEST_REVIEW_EVENTS),
|
|
9626
|
+
body: z4.string().trim().max(65536).default("")
|
|
9569
9627
|
});
|
|
9570
|
-
var text =
|
|
9571
|
-
var optionalText =
|
|
9572
|
-
var pullRequestTourSchema =
|
|
9628
|
+
var text = z4.string().trim().catch("");
|
|
9629
|
+
var optionalText = z4.string().trim().min(1).optional().catch(void 0);
|
|
9630
|
+
var pullRequestTourSchema = z4.object({
|
|
9573
9631
|
/** The tour chat that wrote this file, so a rerun doesn't show the previous run's tour as in progress. */
|
|
9574
9632
|
runId: optionalText,
|
|
9575
9633
|
headSha: optionalText,
|
|
9576
|
-
status:
|
|
9634
|
+
status: z4.enum(["writing", "done"]).catch("writing"),
|
|
9577
9635
|
summary: text,
|
|
9578
9636
|
diagram: optionalText,
|
|
9579
|
-
files:
|
|
9580
|
-
skip:
|
|
9637
|
+
files: z4.array(z4.object({ path: text, explanation: text })).catch([]),
|
|
9638
|
+
skip: z4.array(z4.object({ path: text, note: text })).catch([])
|
|
9581
9639
|
});
|
|
9582
9640
|
|
|
9583
9641
|
// ../shared/src/languages.ts
|
|
@@ -10021,37 +10079,37 @@ var MODEL_LABELS = {
|
|
|
10021
10079
|
"kimi-k2.5": "Kimi K2.5"
|
|
10022
10080
|
};
|
|
10023
10081
|
var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
10024
|
-
var resourcePressure =
|
|
10025
|
-
var sandboxResourceMinuteSchema =
|
|
10026
|
-
minute:
|
|
10027
|
-
samples:
|
|
10028
|
-
cpuCount:
|
|
10029
|
-
memoryTotalMb:
|
|
10030
|
-
cpuBusyAvg:
|
|
10031
|
-
cpuBusyMax:
|
|
10032
|
-
memoryUsedAvgMb:
|
|
10033
|
-
memoryUsedMaxMb:
|
|
10034
|
-
memoryCacheAvgMb:
|
|
10035
|
-
memoryAvailableMinMb:
|
|
10082
|
+
var resourcePressure = z5.number().min(0).max(100).nullable();
|
|
10083
|
+
var sandboxResourceMinuteSchema = z5.object({
|
|
10084
|
+
minute: z5.iso.datetime(),
|
|
10085
|
+
samples: z5.number().int().min(1).max(255),
|
|
10086
|
+
cpuCount: z5.number().int().min(1),
|
|
10087
|
+
memoryTotalMb: z5.number().min(0),
|
|
10088
|
+
cpuBusyAvg: z5.number().min(0),
|
|
10089
|
+
cpuBusyMax: z5.number().min(0),
|
|
10090
|
+
memoryUsedAvgMb: z5.number().min(0),
|
|
10091
|
+
memoryUsedMaxMb: z5.number().min(0),
|
|
10092
|
+
memoryCacheAvgMb: z5.number().min(0),
|
|
10093
|
+
memoryAvailableMinMb: z5.number().min(0),
|
|
10036
10094
|
cpuPressureSomeMax: resourcePressure,
|
|
10037
10095
|
cpuPressureFullMax: resourcePressure,
|
|
10038
10096
|
memoryPressureSomeMax: resourcePressure,
|
|
10039
10097
|
memoryPressureFullMax: resourcePressure,
|
|
10040
10098
|
ioPressureSomeMax: resourcePressure,
|
|
10041
10099
|
ioPressureFullMax: resourcePressure,
|
|
10042
|
-
oomKills:
|
|
10100
|
+
oomKills: z5.number().int().min(0)
|
|
10043
10101
|
});
|
|
10044
10102
|
var MAX_PENDING_RESOURCE_MINUTES = 120;
|
|
10045
|
-
var sandboxResourceMinutesSchema =
|
|
10046
|
-
var sandboxMemorySampleSchema =
|
|
10047
|
-
at:
|
|
10048
|
-
memoryTotalMb:
|
|
10049
|
-
memoryUsedMb:
|
|
10103
|
+
var sandboxResourceMinutesSchema = z5.array(sandboxResourceMinuteSchema).max(MAX_PENDING_RESOURCE_MINUTES);
|
|
10104
|
+
var sandboxMemorySampleSchema = z5.object({
|
|
10105
|
+
at: z5.iso.datetime(),
|
|
10106
|
+
memoryTotalMb: z5.number().min(0),
|
|
10107
|
+
memoryUsedMb: z5.number().min(0),
|
|
10050
10108
|
memoryPressureSome: resourcePressure
|
|
10051
10109
|
});
|
|
10052
|
-
var engineUpdateProgressSchema =
|
|
10053
|
-
|
|
10054
|
-
|
|
10110
|
+
var engineUpdateProgressSchema = z5.discriminatedUnion("state", [
|
|
10111
|
+
z5.object({ state: z5.enum(["updating", "updated"]), from: z5.string(), to: z5.string() }),
|
|
10112
|
+
z5.object({ state: z5.literal("failed"), from: z5.string(), to: z5.string(), reason: z5.string() })
|
|
10055
10113
|
]);
|
|
10056
10114
|
var MAX_CANVAS_FILE_BYTES = 100 * 1024 * 1024;
|
|
10057
10115
|
var MAX_CANVAS_PREVIEW_BYTES = 5 * 1024 * 1024;
|
|
@@ -10185,7 +10243,7 @@ function detectAgentQuotaLimit(text4) {
|
|
|
10185
10243
|
}
|
|
10186
10244
|
|
|
10187
10245
|
// ../shared/src/analytics/types.ts
|
|
10188
|
-
import { z as
|
|
10246
|
+
import { z as z6 } from "zod";
|
|
10189
10247
|
|
|
10190
10248
|
// ../shared/src/external-api-host.ts
|
|
10191
10249
|
function validateExternalApiHost(url, providerLabel) {
|
|
@@ -10556,6 +10614,13 @@ function needsMoreMemory(usedMb, totalMb, pressureSome) {
|
|
|
10556
10614
|
var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
|
|
10557
10615
|
|
|
10558
10616
|
// ../shared/src/pricing.ts
|
|
10617
|
+
var BILLING_BLOCK_TITLES = {
|
|
10618
|
+
INSUFFICIENT_MINUTES: "Out of usage",
|
|
10619
|
+
PAYMENT_FAILED: "Payment failed",
|
|
10620
|
+
USAGE_LIMIT_REACHED: "Usage limit reached",
|
|
10621
|
+
SOURCE_LIMIT_REACHED: "Out of usage",
|
|
10622
|
+
ORGANIZATION_BANNED: "Organization banned"
|
|
10623
|
+
};
|
|
10559
10624
|
var TRIAL_CREDIT_CENTS = 1e4;
|
|
10560
10625
|
var SCOUT_SOURCE = "mothership";
|
|
10561
10626
|
var WORKSPACE_SOURCES = ["api", "dashboard", "slack", "linear", "github", "gitlab", "automation", SCOUT_SOURCE];
|
|
@@ -10644,19 +10709,19 @@ function hasAgentChatActivityFields(value) {
|
|
|
10644
10709
|
function isAgentChatActivityRecord(value) {
|
|
10645
10710
|
return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
|
|
10646
10711
|
}
|
|
10647
|
-
var credentialAccountSchema =
|
|
10648
|
-
ownerName:
|
|
10649
|
-
email:
|
|
10712
|
+
var credentialAccountSchema = z6.object({
|
|
10713
|
+
ownerName: z6.string().optional(),
|
|
10714
|
+
email: z6.string().optional(),
|
|
10650
10715
|
/** 1-based place in the owner's account pool, set only when the pool holds several accounts. */
|
|
10651
|
-
ordinal:
|
|
10716
|
+
ordinal: z6.number().int().positive().optional()
|
|
10652
10717
|
});
|
|
10653
|
-
var agentCredentialSnapshotSchema =
|
|
10654
|
-
method:
|
|
10655
|
-
scope:
|
|
10656
|
-
revision:
|
|
10718
|
+
var agentCredentialSnapshotSchema = z6.object({
|
|
10719
|
+
method: z6.enum(CREDENTIAL_METHOD),
|
|
10720
|
+
scope: z6.enum(CREDENTIAL_SCOPE),
|
|
10721
|
+
revision: z6.string().optional(),
|
|
10657
10722
|
account: credentialAccountSchema.optional(),
|
|
10658
10723
|
/** The `credentials` row, which tells apart accounts pooled under one method and scope. */
|
|
10659
|
-
credentialId:
|
|
10724
|
+
credentialId: z6.string().optional()
|
|
10660
10725
|
});
|
|
10661
10726
|
function isSameCredential(a, b) {
|
|
10662
10727
|
return a.method === b.method && a.scope === b.scope && a.credentialId === b.credentialId;
|
|
@@ -10811,7 +10876,7 @@ function parseCodexTurnRetryPayload(payload) {
|
|
|
10811
10876
|
var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
|
|
10812
10877
|
|
|
10813
10878
|
// ../shared/src/engine/v1.ts
|
|
10814
|
-
import { z as
|
|
10879
|
+
import { z as z7 } from "zod";
|
|
10815
10880
|
var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
10816
10881
|
var ENGINE_STREAM_LAST_EVENT_ID_HEADER = "Last-Event-ID";
|
|
10817
10882
|
var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
|
|
@@ -10819,107 +10884,107 @@ var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
|
|
|
10819
10884
|
var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
|
|
10820
10885
|
var ENGINE_ACTIVATE_PATH = "/lifecycle/activate";
|
|
10821
10886
|
var ENGINE_SLEEP_PATH = "/lifecycle/sleep";
|
|
10822
|
-
var updateChatDisplayNameRequestSchema =
|
|
10823
|
-
displayName:
|
|
10887
|
+
var updateChatDisplayNameRequestSchema = z7.object({
|
|
10888
|
+
displayName: z7.string().trim().min(1).max(100)
|
|
10824
10889
|
});
|
|
10825
|
-
var createChatRequestSchema =
|
|
10826
|
-
id:
|
|
10827
|
-
createdAt:
|
|
10828
|
-
provider:
|
|
10829
|
-
title:
|
|
10830
|
-
parentChatId:
|
|
10831
|
-
forkSourceChatId:
|
|
10832
|
-
pullRequestNotesPath:
|
|
10833
|
-
kind:
|
|
10834
|
-
sideChat:
|
|
10835
|
-
clientRequestId:
|
|
10890
|
+
var createChatRequestSchema = z7.object({
|
|
10891
|
+
id: z7.string().uuid().optional(),
|
|
10892
|
+
createdAt: z7.string().datetime().optional(),
|
|
10893
|
+
provider: z7.enum(VALID_AGENT_PROVIDERS),
|
|
10894
|
+
title: z7.string().min(1).optional(),
|
|
10895
|
+
parentChatId: z7.string().uuid().optional(),
|
|
10896
|
+
forkSourceChatId: z7.string().uuid().optional(),
|
|
10897
|
+
pullRequestNotesPath: z7.string().min(1).optional(),
|
|
10898
|
+
kind: z7.enum(CHAT_KINDS).optional(),
|
|
10899
|
+
sideChat: z7.boolean().optional(),
|
|
10900
|
+
clientRequestId: z7.string().min(1).max(128).optional()
|
|
10836
10901
|
}).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
|
|
10837
10902
|
message: "A side chat must fork its parent chat"
|
|
10838
10903
|
});
|
|
10839
|
-
var spawnSubagentRequestSchema =
|
|
10840
|
-
provider:
|
|
10841
|
-
prompt:
|
|
10842
|
-
forkTurns:
|
|
10904
|
+
var spawnSubagentRequestSchema = z7.object({
|
|
10905
|
+
provider: z7.enum(VALID_AGENT_PROVIDERS),
|
|
10906
|
+
prompt: z7.string().min(1),
|
|
10907
|
+
forkTurns: z7.string().regex(/^(all|none|[1-9]\d*)$/).refine(
|
|
10843
10908
|
(value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
|
|
10844
10909
|
"Expected all, none, or a positive safe integer string"
|
|
10845
10910
|
).default("all"),
|
|
10846
|
-
model:
|
|
10847
|
-
thinkingLevel:
|
|
10848
|
-
fastMode:
|
|
10849
|
-
ultrafastMode:
|
|
10850
|
-
title:
|
|
10911
|
+
model: z7.string().min(1).optional(),
|
|
10912
|
+
thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
|
|
10913
|
+
fastMode: z7.boolean().optional(),
|
|
10914
|
+
ultrafastMode: z7.boolean().optional(),
|
|
10915
|
+
title: z7.string().min(1).optional()
|
|
10851
10916
|
});
|
|
10852
|
-
var messageSubagentRequestSchema =
|
|
10853
|
-
message:
|
|
10854
|
-
model:
|
|
10855
|
-
thinkingLevel:
|
|
10856
|
-
fastMode:
|
|
10857
|
-
ultrafastMode:
|
|
10917
|
+
var messageSubagentRequestSchema = z7.object({
|
|
10918
|
+
message: z7.string().min(1),
|
|
10919
|
+
model: z7.string().min(1).optional(),
|
|
10920
|
+
thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
|
|
10921
|
+
fastMode: z7.boolean().optional(),
|
|
10922
|
+
ultrafastMode: z7.boolean().optional()
|
|
10858
10923
|
});
|
|
10859
|
-
var waitSubagentRequestSchema =
|
|
10860
|
-
timeoutMinutes:
|
|
10924
|
+
var waitSubagentRequestSchema = z7.object({
|
|
10925
|
+
timeoutMinutes: z7.coerce.number().positive().max(1440).optional()
|
|
10861
10926
|
});
|
|
10862
|
-
var subagentResponseSchema =
|
|
10863
|
-
chatId:
|
|
10864
|
-
status:
|
|
10865
|
-
response:
|
|
10866
|
-
timedOut:
|
|
10867
|
-
interruptedByUserMessage:
|
|
10927
|
+
var subagentResponseSchema = z7.object({
|
|
10928
|
+
chatId: z7.string().uuid(),
|
|
10929
|
+
status: z7.enum(["working", "completed"]),
|
|
10930
|
+
response: z7.string().optional(),
|
|
10931
|
+
timedOut: z7.literal(true).optional(),
|
|
10932
|
+
interruptedByUserMessage: z7.literal(true).optional()
|
|
10868
10933
|
});
|
|
10869
|
-
var integrationErrorNotificationTargetSchema =
|
|
10870
|
-
|
|
10871
|
-
type:
|
|
10872
|
-
conversation:
|
|
10873
|
-
channelId:
|
|
10874
|
-
threadTs:
|
|
10934
|
+
var integrationErrorNotificationTargetSchema = z7.discriminatedUnion("type", [
|
|
10935
|
+
z7.object({
|
|
10936
|
+
type: z7.literal("slack"),
|
|
10937
|
+
conversation: z7.object({
|
|
10938
|
+
channelId: z7.string().min(1),
|
|
10939
|
+
threadTs: z7.string().min(1)
|
|
10875
10940
|
}).optional()
|
|
10876
10941
|
}),
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
type:
|
|
10880
|
-
provider:
|
|
10881
|
-
resource:
|
|
10882
|
-
repositoryId:
|
|
10883
|
-
resourceNumber:
|
|
10942
|
+
z7.object({ type: z7.literal("linear"), sessionId: z7.string().min(1) }),
|
|
10943
|
+
z7.object({
|
|
10944
|
+
type: z7.literal("code_host"),
|
|
10945
|
+
provider: z7.enum(["github", "gitlab"]),
|
|
10946
|
+
resource: z7.enum(["issue", "pull_request"]),
|
|
10947
|
+
repositoryId: z7.string().min(1),
|
|
10948
|
+
resourceNumber: z7.number().int().positive()
|
|
10884
10949
|
}),
|
|
10885
|
-
|
|
10950
|
+
z7.object({ type: z7.literal("automation"), executionId: z7.string().min(1) })
|
|
10886
10951
|
]);
|
|
10887
|
-
var sendChatMessageRequestSchema =
|
|
10888
|
-
messageId:
|
|
10889
|
-
submittedAt:
|
|
10890
|
-
message:
|
|
10891
|
-
provider:
|
|
10892
|
-
model:
|
|
10893
|
-
customInstructions:
|
|
10894
|
-
planMode:
|
|
10895
|
-
images:
|
|
10896
|
-
type:
|
|
10897
|
-
source:
|
|
10898
|
-
|
|
10899
|
-
|
|
10952
|
+
var sendChatMessageRequestSchema = z7.object({
|
|
10953
|
+
messageId: z7.string().min(1).optional(),
|
|
10954
|
+
submittedAt: z7.string().datetime().optional(),
|
|
10955
|
+
message: z7.string().min(1),
|
|
10956
|
+
provider: z7.enum(VALID_AGENT_PROVIDERS).optional(),
|
|
10957
|
+
model: z7.string().optional(),
|
|
10958
|
+
customInstructions: z7.string().optional(),
|
|
10959
|
+
planMode: z7.boolean().optional(),
|
|
10960
|
+
images: z7.array(z7.object({
|
|
10961
|
+
type: z7.literal("image"),
|
|
10962
|
+
source: z7.discriminatedUnion("type", [
|
|
10963
|
+
z7.object({ type: z7.literal("base64"), media_type: z7.enum(IMAGE_MEDIA_TYPES), data: z7.string().min(1) }),
|
|
10964
|
+
z7.object({ type: z7.literal("url"), url: z7.string().url() })
|
|
10900
10965
|
])
|
|
10901
10966
|
})).optional(),
|
|
10902
|
-
canvasUploadIds:
|
|
10903
|
-
thinkingLevel:
|
|
10904
|
-
inheritThinkingLevel:
|
|
10905
|
-
goalMode:
|
|
10906
|
-
fastMode:
|
|
10907
|
-
ultrafastMode:
|
|
10908
|
-
source:
|
|
10909
|
-
enableInteractiveTools:
|
|
10910
|
-
type:
|
|
10911
|
-
merge:
|
|
10912
|
-
idempotencyKey:
|
|
10913
|
-
automationId:
|
|
10914
|
-
environmentId:
|
|
10915
|
-
senderUserId:
|
|
10916
|
-
senderEmail:
|
|
10917
|
-
senderDisplayName:
|
|
10918
|
-
senderAvatarUrl:
|
|
10967
|
+
canvasUploadIds: z7.array(z7.string().min(1)).optional(),
|
|
10968
|
+
thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
|
|
10969
|
+
inheritThinkingLevel: z7.boolean().optional(),
|
|
10970
|
+
goalMode: z7.boolean().optional(),
|
|
10971
|
+
fastMode: z7.boolean().optional(),
|
|
10972
|
+
ultrafastMode: z7.boolean().optional(),
|
|
10973
|
+
source: z7.enum(MESSAGE_SOURCES).optional(),
|
|
10974
|
+
enableInteractiveTools: z7.boolean().optional(),
|
|
10975
|
+
type: z7.string().min(1).optional(),
|
|
10976
|
+
merge: z7.boolean().optional(),
|
|
10977
|
+
idempotencyKey: z7.string().min(1).max(128).optional(),
|
|
10978
|
+
automationId: z7.string().optional(),
|
|
10979
|
+
environmentId: z7.string().min(1).optional(),
|
|
10980
|
+
senderUserId: z7.string().optional(),
|
|
10981
|
+
senderEmail: z7.string().optional(),
|
|
10982
|
+
senderDisplayName: z7.string().optional(),
|
|
10983
|
+
senderAvatarUrl: z7.string().optional(),
|
|
10919
10984
|
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
|
|
10920
|
-
errorNotificationTargets:
|
|
10921
|
-
replacesMessageId:
|
|
10922
|
-
steer:
|
|
10985
|
+
errorNotificationTargets: z7.array(integrationErrorNotificationTargetSchema).optional(),
|
|
10986
|
+
replacesMessageId: z7.string().min(1).max(256).optional(),
|
|
10987
|
+
steer: z7.union([z7.boolean(), z7.literal("alone")]).optional()
|
|
10923
10988
|
}).passthrough();
|
|
10924
10989
|
function isChatMessageSender(value) {
|
|
10925
10990
|
return isRecord(value) && (value.messageId === void 0 || typeof value.messageId === "string") && typeof value.senderUserId === "string" && typeof value.senderEmail === "string" && typeof value.recordedAt === "string";
|
|
@@ -11110,18 +11175,18 @@ async function steerQueuedInOrder(queue, messageId, steer) {
|
|
|
11110
11175
|
}
|
|
11111
11176
|
return true;
|
|
11112
11177
|
}
|
|
11113
|
-
var sendChatMessageResponseSchema =
|
|
11114
|
-
messageId:
|
|
11115
|
-
queued:
|
|
11116
|
-
position:
|
|
11117
|
-
chatId:
|
|
11118
|
-
steered:
|
|
11178
|
+
var sendChatMessageResponseSchema = z7.object({
|
|
11179
|
+
messageId: z7.string(),
|
|
11180
|
+
queued: z7.boolean(),
|
|
11181
|
+
position: z7.number(),
|
|
11182
|
+
chatId: z7.string().optional(),
|
|
11183
|
+
steered: z7.boolean().optional()
|
|
11119
11184
|
});
|
|
11120
|
-
var interruptChatRequestSchema =
|
|
11121
|
-
var respondToolInputRequestSchema =
|
|
11122
|
-
requestId:
|
|
11123
|
-
selectionId:
|
|
11124
|
-
source:
|
|
11185
|
+
var interruptChatRequestSchema = z7.object({ stoppedAt: z7.string().datetime().optional() });
|
|
11186
|
+
var respondToolInputRequestSchema = z7.object({
|
|
11187
|
+
requestId: z7.string().min(1),
|
|
11188
|
+
selectionId: z7.string().min(1),
|
|
11189
|
+
source: z7.enum(CLIENT_MESSAGE_SOURCES).optional()
|
|
11125
11190
|
});
|
|
11126
11191
|
function isLatestChatHistoryPage(params) {
|
|
11127
11192
|
return params.beforeCursor === void 0 && params.beforeEvent === void 0 && params.beforeTurn === void 0;
|
|
@@ -11200,153 +11265,106 @@ function isSubagentMcpServerName(server) {
|
|
|
11200
11265
|
}
|
|
11201
11266
|
|
|
11202
11267
|
// ../shared/src/workspace-identity.ts
|
|
11203
|
-
import { z as
|
|
11268
|
+
import { z as z8 } from "zod";
|
|
11204
11269
|
var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
|
|
11205
11270
|
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
11206
11271
|
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
11207
11272
|
var IDENTITY_PROXY_PORT = 17323;
|
|
11208
11273
|
var IDENTITY_TOKEN_PATH = "/token";
|
|
11209
|
-
var workspaceAudienceSchema =
|
|
11210
|
-
var workspaceTokenRequestSchema =
|
|
11274
|
+
var workspaceAudienceSchema = z8.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
|
|
11275
|
+
var workspaceTokenRequestSchema = z8.object({
|
|
11211
11276
|
audience: workspaceAudienceSchema.optional(),
|
|
11212
|
-
aws_source_identity:
|
|
11277
|
+
aws_source_identity: z8.boolean().optional()
|
|
11213
11278
|
});
|
|
11214
|
-
var workspaceTokenClaimsSchema =
|
|
11215
|
-
iss:
|
|
11216
|
-
sub:
|
|
11217
|
-
aud:
|
|
11218
|
-
iat:
|
|
11219
|
-
nbf:
|
|
11220
|
-
exp:
|
|
11221
|
-
jti:
|
|
11222
|
-
organization_id:
|
|
11223
|
-
workspace_id:
|
|
11224
|
-
environment_id:
|
|
11225
|
-
creator_id:
|
|
11226
|
-
creator_email:
|
|
11227
|
-
[AWS_SOURCE_IDENTITY_CLAIM]:
|
|
11279
|
+
var workspaceTokenClaimsSchema = z8.object({
|
|
11280
|
+
iss: z8.string(),
|
|
11281
|
+
sub: z8.string(),
|
|
11282
|
+
aud: z8.string(),
|
|
11283
|
+
iat: z8.number().int(),
|
|
11284
|
+
nbf: z8.number().int(),
|
|
11285
|
+
exp: z8.number().int(),
|
|
11286
|
+
jti: z8.string(),
|
|
11287
|
+
organization_id: z8.string().uuid(),
|
|
11288
|
+
workspace_id: z8.string().uuid(),
|
|
11289
|
+
environment_id: z8.string().uuid(),
|
|
11290
|
+
creator_id: z8.string().uuid().nullable(),
|
|
11291
|
+
creator_email: z8.string().nullable().default(null),
|
|
11292
|
+
[AWS_SOURCE_IDENTITY_CLAIM]: z8.string().uuid().optional()
|
|
11228
11293
|
}).passthrough();
|
|
11229
|
-
var workspaceTokenResponseSchema =
|
|
11230
|
-
issuer:
|
|
11231
|
-
audience:
|
|
11232
|
-
token:
|
|
11233
|
-
expires_at:
|
|
11294
|
+
var workspaceTokenResponseSchema = z8.object({
|
|
11295
|
+
issuer: z8.string(),
|
|
11296
|
+
audience: z8.string(),
|
|
11297
|
+
token: z8.string(),
|
|
11298
|
+
expires_at: z8.string()
|
|
11234
11299
|
});
|
|
11235
|
-
var legacyWorkspaceTokenBundleSchema =
|
|
11236
|
-
version:
|
|
11237
|
-
issuer:
|
|
11238
|
-
default_audience:
|
|
11239
|
-
tokens:
|
|
11300
|
+
var legacyWorkspaceTokenBundleSchema = z8.object({
|
|
11301
|
+
version: z8.literal(1),
|
|
11302
|
+
issuer: z8.string(),
|
|
11303
|
+
default_audience: z8.string(),
|
|
11304
|
+
tokens: z8.record(z8.string(), z8.object({ token: z8.string(), expires_at: z8.string() }))
|
|
11240
11305
|
});
|
|
11241
|
-
var mcpWorkloadAuthSchema =
|
|
11242
|
-
type:
|
|
11306
|
+
var mcpWorkloadAuthSchema = z8.strictObject({
|
|
11307
|
+
type: z8.literal("workspace_identity"),
|
|
11243
11308
|
audience: workspaceAudienceSchema
|
|
11244
11309
|
});
|
|
11245
|
-
var mcpAuthSchema =
|
|
11310
|
+
var mcpAuthSchema = z8.discriminatedUnion("type", [
|
|
11246
11311
|
mcpWorkloadAuthSchema,
|
|
11247
|
-
|
|
11312
|
+
z8.strictObject({ type: z8.literal("oauth") })
|
|
11248
11313
|
]);
|
|
11249
|
-
var engineMcpOAuthTokenRequestSchema =
|
|
11250
|
-
environment_mcp_id:
|
|
11251
|
-
force_refresh:
|
|
11314
|
+
var engineMcpOAuthTokenRequestSchema = z8.object({
|
|
11315
|
+
environment_mcp_id: z8.string().uuid(),
|
|
11316
|
+
force_refresh: z8.boolean().optional()
|
|
11252
11317
|
});
|
|
11253
|
-
var engineMcpOAuthTokenResponseSchema =
|
|
11254
|
-
url:
|
|
11255
|
-
access_token:
|
|
11256
|
-
expires_at:
|
|
11318
|
+
var engineMcpOAuthTokenResponseSchema = z8.object({
|
|
11319
|
+
url: z8.string(),
|
|
11320
|
+
access_token: z8.string(),
|
|
11321
|
+
expires_at: z8.string().nullable()
|
|
11257
11322
|
});
|
|
11258
11323
|
|
|
11259
11324
|
// ../shared/src/routes/environment.ts
|
|
11260
|
-
import { z as
|
|
11325
|
+
import { z as z9 } from "zod";
|
|
11261
11326
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
11262
|
-
var stringMap =
|
|
11263
|
-
var createEnvironmentMcpRequestSchema =
|
|
11264
|
-
name:
|
|
11265
|
-
transport:
|
|
11266
|
-
config:
|
|
11267
|
-
|
|
11268
|
-
|
|
11327
|
+
var stringMap = z9.record(z9.string(), z9.string());
|
|
11328
|
+
var createEnvironmentMcpRequestSchema = z9.object({
|
|
11329
|
+
name: z9.string(),
|
|
11330
|
+
transport: z9.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
11331
|
+
config: z9.union([
|
|
11332
|
+
z9.object({ command: z9.string().min(1), args: z9.array(z9.string()).optional(), env: stringMap.optional() }),
|
|
11333
|
+
z9.object({ url: z9.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
|
|
11269
11334
|
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
11270
11335
|
});
|
|
11271
11336
|
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
11272
|
-
var screenPasswordSchema =
|
|
11273
|
-
var hostSchema =
|
|
11274
|
-
var createEnvironmentDeviceRequestSchema =
|
|
11275
|
-
name:
|
|
11337
|
+
var screenPasswordSchema = z9.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.');
|
|
11338
|
+
var hostSchema = z9.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");
|
|
11339
|
+
var createEnvironmentDeviceRequestSchema = z9.object({
|
|
11340
|
+
name: z9.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`."),
|
|
11276
11341
|
host: hostSchema.optional().describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address. Leave it out when the device connects to Replicas itself with `replicas device connect`."),
|
|
11277
|
-
port:
|
|
11278
|
-
username:
|
|
11342
|
+
port: z9.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
|
|
11343
|
+
username: z9.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."),
|
|
11279
11344
|
screen_password: screenPasswordSchema.optional()
|
|
11280
11345
|
});
|
|
11281
11346
|
var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
|
|
11282
|
-
host:
|
|
11283
|
-
screen_password:
|
|
11347
|
+
host: z9.union([hostSchema, z9.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
|
|
11348
|
+
screen_password: z9.union([screenPasswordSchema, z9.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
|
|
11284
11349
|
});
|
|
11285
|
-
var deviceConnectionResponseSchema =
|
|
11286
|
-
name:
|
|
11287
|
-
port:
|
|
11288
|
-
workspace_ids:
|
|
11350
|
+
var deviceConnectionResponseSchema = z9.object({
|
|
11351
|
+
name: z9.string(),
|
|
11352
|
+
port: z9.number(),
|
|
11353
|
+
workspace_ids: z9.array(z9.string())
|
|
11289
11354
|
});
|
|
11290
|
-
var deviceHostKeysRequestSchema =
|
|
11291
|
-
host_keys:
|
|
11355
|
+
var deviceHostKeysRequestSchema = z9.object({
|
|
11356
|
+
host_keys: z9.array(z9.string().max(2048).regex(/^[a-z0-9@.-]+ [A-Za-z0-9+/]+={0,3}$/, "Each host key must be `<type> <base64>`")).min(1).max(8).transform((keys) => [...new Set(keys)].sort())
|
|
11292
11357
|
});
|
|
11293
11358
|
var DEVICE_HOST_KEYS_HEADER = "x-replicas-device-host-keys";
|
|
11294
|
-
var provisionedDeviceSchema =
|
|
11295
|
-
name:
|
|
11296
|
-
host:
|
|
11297
|
-
port:
|
|
11298
|
-
username:
|
|
11299
|
-
private_key:
|
|
11300
|
-
screen_password:
|
|
11301
|
-
});
|
|
11302
|
-
|
|
11303
|
-
// ../shared/src/routes/mothership.ts
|
|
11304
|
-
import { z as z9 } from "zod";
|
|
11305
|
-
|
|
11306
|
-
// ../shared/src/routes/pull-requests.ts
|
|
11307
|
-
import { z as z8 } from "zod";
|
|
11308
|
-
var PULL_REQUEST_MERGE_METHODS = ["merge", "squash", "rebase"];
|
|
11309
|
-
var DEPLOY_START_WINDOW_MS = 30 * 6e4;
|
|
11310
|
-
var mergePullRequestRequestSchema = z8.object({
|
|
11311
|
-
mergeMethod: z8.enum(PULL_REQUEST_MERGE_METHODS).optional(),
|
|
11312
|
-
bypassRules: z8.boolean().optional()
|
|
11359
|
+
var provisionedDeviceSchema = z9.object({
|
|
11360
|
+
name: z9.string(),
|
|
11361
|
+
host: z9.string().nullable(),
|
|
11362
|
+
port: z9.number(),
|
|
11363
|
+
username: z9.string(),
|
|
11364
|
+
private_key: z9.string(),
|
|
11365
|
+
screen_password: z9.string().optional()
|
|
11313
11366
|
});
|
|
11314
11367
|
|
|
11315
|
-
// ../shared/src/routes/mothership.ts
|
|
11316
|
-
var linearRuleFields = z9.object({
|
|
11317
|
-
team_id: z9.string().min(1),
|
|
11318
|
-
current_cycle: z9.boolean().optional(),
|
|
11319
|
-
label_ids: z9.array(z9.string().min(1)).min(1).optional(),
|
|
11320
|
-
project_id: z9.string().min(1).optional(),
|
|
11321
|
-
assignee_id: z9.string().min(1).optional()
|
|
11322
|
-
}).strict();
|
|
11323
|
-
var withLabelIds = (value) => {
|
|
11324
|
-
if (!isRecord(value) || typeof value.label_id !== "string") return value;
|
|
11325
|
-
const { label_id, ...rest } = value;
|
|
11326
|
-
return { ...rest, label_ids: [label_id] };
|
|
11327
|
-
};
|
|
11328
|
-
var mothershipLinearRuleSchema = z9.preprocess(withLabelIds, linearRuleFields);
|
|
11329
|
-
var storedMothershipLinearRuleSchema = z9.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: z9.string() }));
|
|
11330
|
-
var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
|
|
11331
|
-
function serviceTierRequestFields(tier) {
|
|
11332
|
-
return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
|
|
11333
|
-
}
|
|
11334
|
-
var mothershipSubagentSettingsSchema = z9.object({
|
|
11335
|
-
coding_agent: z9.enum(VALID_AGENT_PROVIDERS),
|
|
11336
|
-
model: z9.string().nullable(),
|
|
11337
|
-
thinking_level: z9.enum(VALID_THINKING_LEVELS).nullable(),
|
|
11338
|
-
service_tier: z9.enum(SUBAGENT_SERVICE_TIERS),
|
|
11339
|
-
goal_mode: z9.boolean(),
|
|
11340
|
-
plan_mode: z9.boolean()
|
|
11341
|
-
});
|
|
11342
|
-
var QUEUE_SECTIONS = [
|
|
11343
|
-
{ label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
|
|
11344
|
-
{ label: "Working", groups: ["working"] },
|
|
11345
|
-
{ label: "Shipping", groups: ["shipping"] }
|
|
11346
|
-
];
|
|
11347
|
-
var MOTHERSHIP_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups);
|
|
11348
|
-
var MOTHERSHIP_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
|
|
11349
|
-
|
|
11350
11368
|
// ../shared/src/runtime-env.ts
|
|
11351
11369
|
var REPLICAS_RUNTIME_ENV_ALIASES = {
|
|
11352
11370
|
monolithUrl: ["REPLICAS_MONOLITH_URL", "MONOLITH_URL"],
|
|
@@ -11601,17 +11619,20 @@ async function* iterateSseStream(body, onChunk) {
|
|
|
11601
11619
|
const reader = body.getReader();
|
|
11602
11620
|
const decoder2 = new TextDecoder();
|
|
11603
11621
|
let buffer = "";
|
|
11622
|
+
let searchFrom = 0;
|
|
11604
11623
|
while (true) {
|
|
11605
11624
|
const { done, value } = await reader.read();
|
|
11606
11625
|
if (done) break;
|
|
11607
11626
|
onChunk?.();
|
|
11608
11627
|
buffer += decoder2.decode(value, { stream: true });
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11628
|
+
let end = buffer.indexOf("\n\n", searchFrom);
|
|
11629
|
+
while (end >= 0) {
|
|
11630
|
+
const event = parseSseChunk(buffer.slice(0, end));
|
|
11631
|
+
buffer = buffer.slice(end + 2);
|
|
11613
11632
|
if (event) yield event;
|
|
11633
|
+
end = buffer.indexOf("\n\n");
|
|
11614
11634
|
}
|
|
11635
|
+
searchFrom = Math.max(0, buffer.length - 1);
|
|
11615
11636
|
}
|
|
11616
11637
|
}
|
|
11617
11638
|
async function readSseStream(body, onEvent, shouldContinue = () => true, onChunk) {
|
|
@@ -11662,6 +11683,73 @@ var RECENCY_HALF_LIFE_MS = 14 * DAY_MS;
|
|
|
11662
11683
|
var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
|
|
11663
11684
|
var PICK_WINDOW_MS = 21 * DAY_MS;
|
|
11664
11685
|
|
|
11686
|
+
// ../shared/src/routes/workspaces.ts
|
|
11687
|
+
import { z as z12 } from "zod";
|
|
11688
|
+
|
|
11689
|
+
// ../shared/src/workspace-credentials.ts
|
|
11690
|
+
import { z as z11 } from "zod";
|
|
11691
|
+
var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
|
|
11692
|
+
var workspaceCredentialProviderSchema = z11.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
11693
|
+
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
11694
|
+
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11695
|
+
provider: z11.enum(VALID_AGENT_PROVIDERS)
|
|
11696
|
+
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11697
|
+
message: "This inference provider is not supported by this agent"
|
|
11698
|
+
});
|
|
11699
|
+
var switchWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11700
|
+
provider: workspaceCredentialProviderSchema
|
|
11701
|
+
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11702
|
+
message: "This authentication method is not supported by this agent"
|
|
11703
|
+
});
|
|
11704
|
+
|
|
11705
|
+
// ../shared/src/routes/workspaces.ts
|
|
11706
|
+
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
11707
|
+
var SUPPORT_EMAIL = "founders@replicas.dev";
|
|
11708
|
+
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.`;
|
|
11709
|
+
var STALE_PREPARING_MS = 10 * 6e4;
|
|
11710
|
+
var WORKSPACE_PAUSED_COPY = {
|
|
11711
|
+
out_of_minutes: {
|
|
11712
|
+
title: BILLING_BLOCK_TITLES.INSUFFICIENT_MINUTES,
|
|
11713
|
+
line: "This workspace was paused because your organization used all its included usage. An admin can subscribe or add credits in billing settings."
|
|
11714
|
+
},
|
|
11715
|
+
usage_limit: {
|
|
11716
|
+
title: BILLING_BLOCK_TITLES.USAGE_LIMIT_REACHED,
|
|
11717
|
+
line: "This workspace was paused because your organization reached its usage limit for this period. An admin can raise or remove it in billing settings."
|
|
11718
|
+
}
|
|
11719
|
+
};
|
|
11720
|
+
var WORKSPACE_SIDEBAR_VIEWS = ["owned", "shared", "team", "automated"];
|
|
11721
|
+
var WORKSPACE_STATUS_FILTERS = WORKSPACE_STATUSES.map((status) => status === "error" ? "failed" : status);
|
|
11722
|
+
var DEFAULT_STATUS_FILTERS = [...WORKSPACE_STATUS_FILTERS];
|
|
11723
|
+
var DEFAULT_WORKSPACE_FILTERS = {
|
|
11724
|
+
statuses: [...DEFAULT_STATUS_FILTERS],
|
|
11725
|
+
ownerIds: [],
|
|
11726
|
+
activity: "any"
|
|
11727
|
+
};
|
|
11728
|
+
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11729
|
+
var workspaceExecRequestSchema = z12.object({
|
|
11730
|
+
command: z12.string().regex(/\S/, "command is required"),
|
|
11731
|
+
timeout_seconds: z12.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
11732
|
+
});
|
|
11733
|
+
var terminalRtcCandidateSchema = z12.object({ type: z12.literal("rtc-candidate"), candidate: z12.string(), mid: z12.string() });
|
|
11734
|
+
var terminalSocketServerMessageSchema = z12.discriminatedUnion("type", [
|
|
11735
|
+
z12.object({ type: z12.literal("output"), data: z12.string() }),
|
|
11736
|
+
z12.object({ type: z12.literal("rtc-answer"), sdp: z12.string() }),
|
|
11737
|
+
terminalRtcCandidateSchema,
|
|
11738
|
+
z12.object({ type: z12.literal("rtc-switch") })
|
|
11739
|
+
]);
|
|
11740
|
+
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
11741
|
+
|
|
11742
|
+
// ../shared/src/workspace-search.ts
|
|
11743
|
+
var WORKSPACE_SEARCH_INDEX_PARAMS = {
|
|
11744
|
+
viewModes: [...WORKSPACE_SIDEBAR_VIEWS].sort().join(","),
|
|
11745
|
+
archived: "include",
|
|
11746
|
+
excludeScout: "true",
|
|
11747
|
+
excludeSubagents: "true",
|
|
11748
|
+
excludeAutomationRuns: "true",
|
|
11749
|
+
page: 1,
|
|
11750
|
+
limit: 1e3
|
|
11751
|
+
};
|
|
11752
|
+
|
|
11665
11753
|
// ../shared/src/auth-fallback.ts
|
|
11666
11754
|
function describeCredential(provider2, credential) {
|
|
11667
11755
|
const { ownerName, email, ordinal: ordinal2 } = credential.account ?? {};
|
|
@@ -11687,79 +11775,63 @@ function describeAuthFallback(payload) {
|
|
|
11687
11775
|
};
|
|
11688
11776
|
}
|
|
11689
11777
|
|
|
11690
|
-
// ../shared/src/workspace-credentials.ts
|
|
11691
|
-
import { z as z11 } from "zod";
|
|
11692
|
-
var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
|
|
11693
|
-
var workspaceCredentialProviderSchema = z11.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
11694
|
-
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
11695
|
-
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11696
|
-
provider: z11.enum(VALID_AGENT_PROVIDERS)
|
|
11697
|
-
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11698
|
-
message: "This inference provider is not supported by this agent"
|
|
11699
|
-
});
|
|
11700
|
-
var switchWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11701
|
-
provider: workspaceCredentialProviderSchema
|
|
11702
|
-
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11703
|
-
message: "This authentication method is not supported by this agent"
|
|
11704
|
-
});
|
|
11705
|
-
|
|
11706
11778
|
// ../shared/src/chat-fork.ts
|
|
11707
|
-
import { z as
|
|
11779
|
+
import { z as z14 } from "zod";
|
|
11708
11780
|
|
|
11709
11781
|
// ../shared/src/fallback-chains.ts
|
|
11710
|
-
import { z as
|
|
11711
|
-
var fallbackHarnessStepSchema =
|
|
11712
|
-
kind:
|
|
11713
|
-
provider:
|
|
11714
|
-
model:
|
|
11715
|
-
thinkingLevel:
|
|
11782
|
+
import { z as z13 } from "zod";
|
|
11783
|
+
var fallbackHarnessStepSchema = z13.object({
|
|
11784
|
+
kind: z13.literal("harness"),
|
|
11785
|
+
provider: z13.enum(VALID_AGENT_PROVIDERS),
|
|
11786
|
+
model: z13.string().min(1),
|
|
11787
|
+
thinkingLevel: z13.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
|
|
11716
11788
|
});
|
|
11717
|
-
var fallbackPlanStepSchema =
|
|
11718
|
-
|
|
11719
|
-
kind:
|
|
11789
|
+
var fallbackPlanStepSchema = z13.discriminatedUnion("kind", [
|
|
11790
|
+
z13.object({
|
|
11791
|
+
kind: z13.literal("credentials"),
|
|
11720
11792
|
// An empty list would allow every method.
|
|
11721
|
-
methods:
|
|
11722
|
-
models:
|
|
11793
|
+
methods: z13.array(z13.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
|
|
11794
|
+
models: z13.record(z13.string(), z13.string().min(1)).optional()
|
|
11723
11795
|
}),
|
|
11724
11796
|
fallbackHarnessStepSchema
|
|
11725
11797
|
]);
|
|
11726
|
-
var fallbackPlanResponseSchema =
|
|
11727
|
-
steps:
|
|
11798
|
+
var fallbackPlanResponseSchema = z13.object({
|
|
11799
|
+
steps: z13.array(z13.unknown()).transform((steps2) => steps2.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
|
|
11728
11800
|
});
|
|
11729
11801
|
|
|
11730
11802
|
// ../shared/src/chat-fork.ts
|
|
11731
|
-
var fallbackReasonSchema =
|
|
11732
|
-
var chatForkInfoSchema =
|
|
11733
|
-
source:
|
|
11734
|
-
chatId:
|
|
11735
|
-
provider:
|
|
11736
|
-
title:
|
|
11803
|
+
var fallbackReasonSchema = z14.enum(AGENT_FALLBACK_REASONS);
|
|
11804
|
+
var chatForkInfoSchema = z14.object({
|
|
11805
|
+
source: z14.object({
|
|
11806
|
+
chatId: z14.string().min(1),
|
|
11807
|
+
provider: z14.enum(VALID_AGENT_PROVIDERS),
|
|
11808
|
+
title: z14.string()
|
|
11737
11809
|
}),
|
|
11738
|
-
trigger:
|
|
11810
|
+
trigger: z14.enum(["manual", "auto", "side", "switch"]),
|
|
11739
11811
|
reason: fallbackReasonSchema.optional(),
|
|
11740
|
-
state:
|
|
11741
|
-
error:
|
|
11742
|
-
startedAt:
|
|
11743
|
-
completedAt:
|
|
11812
|
+
state: z14.enum(["preparing", "ready", "failed"]),
|
|
11813
|
+
error: z14.string().optional(),
|
|
11814
|
+
startedAt: z14.string(),
|
|
11815
|
+
completedAt: z14.string().optional()
|
|
11744
11816
|
});
|
|
11745
11817
|
function coerceChatForkInfo(value) {
|
|
11746
11818
|
const parsed = chatForkInfoSchema.safeParse(value);
|
|
11747
11819
|
return parsed.success ? parsed.data : null;
|
|
11748
11820
|
}
|
|
11749
|
-
var forkChatRequestSchema =
|
|
11750
|
-
provider:
|
|
11751
|
-
model:
|
|
11752
|
-
thinkingLevel:
|
|
11753
|
-
title:
|
|
11754
|
-
message:
|
|
11755
|
-
id:
|
|
11756
|
-
clientRequestId:
|
|
11757
|
-
enableInteractiveTools:
|
|
11821
|
+
var forkChatRequestSchema = z14.object({
|
|
11822
|
+
provider: z14.enum(VALID_AGENT_PROVIDERS),
|
|
11823
|
+
model: z14.string().min(1).optional(),
|
|
11824
|
+
thinkingLevel: z14.enum(VALID_THINKING_LEVELS).optional(),
|
|
11825
|
+
title: z14.string().min(1).max(200).optional(),
|
|
11826
|
+
message: z14.string().trim().optional(),
|
|
11827
|
+
id: z14.string().uuid().optional(),
|
|
11828
|
+
clientRequestId: z14.string().min(1).max(128).optional(),
|
|
11829
|
+
enableInteractiveTools: z14.boolean().optional(),
|
|
11758
11830
|
// Server-injected by the monolith from the authenticated request; never trusted from clients.
|
|
11759
|
-
senderUserId:
|
|
11760
|
-
senderEmail:
|
|
11761
|
-
senderDisplayName:
|
|
11762
|
-
senderAvatarUrl:
|
|
11831
|
+
senderUserId: z14.string().optional(),
|
|
11832
|
+
senderEmail: z14.string().optional(),
|
|
11833
|
+
senderDisplayName: z14.string().optional(),
|
|
11834
|
+
senderAvatarUrl: z14.string().optional()
|
|
11763
11835
|
});
|
|
11764
11836
|
function describeQuotaLimit(reason) {
|
|
11765
11837
|
if (reason === "auth_failed") return "could not authenticate";
|
|
@@ -11771,10 +11843,10 @@ function describeChatForkReason(reason, provider2) {
|
|
|
11771
11843
|
return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
|
|
11772
11844
|
}
|
|
11773
11845
|
var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
|
|
11774
|
-
var agentQuotaExhaustedPayloadSchema =
|
|
11775
|
-
provider:
|
|
11846
|
+
var agentQuotaExhaustedPayloadSchema = z14.object({
|
|
11847
|
+
provider: z14.enum(VALID_AGENT_PROVIDERS),
|
|
11776
11848
|
reason: fallbackReasonSchema,
|
|
11777
|
-
detail:
|
|
11849
|
+
detail: z14.string().optional(),
|
|
11778
11850
|
forkTo: fallbackHarnessStepSchema.optional()
|
|
11779
11851
|
});
|
|
11780
11852
|
function defaultForkChatTitle(source, provider2) {
|
|
@@ -11809,17 +11881,17 @@ function getChatThreadSources(chats, chat) {
|
|
|
11809
11881
|
}
|
|
11810
11882
|
|
|
11811
11883
|
// ../shared/src/credential-refresh.ts
|
|
11812
|
-
import { z as
|
|
11813
|
-
var engineCredentialRefreshFailureSchema =
|
|
11814
|
-
code:
|
|
11884
|
+
import { z as z15 } from "zod";
|
|
11885
|
+
var engineCredentialRefreshFailureSchema = z15.object({
|
|
11886
|
+
code: z15.string(),
|
|
11815
11887
|
credential: workspaceCredentialSelectionSchema.optional()
|
|
11816
11888
|
});
|
|
11817
11889
|
|
|
11818
11890
|
// ../shared/src/credential-pool.ts
|
|
11819
|
-
import { z as
|
|
11891
|
+
import { z as z16 } from "zod";
|
|
11820
11892
|
var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
|
|
11821
|
-
var reorderCredentialPoolSchema =
|
|
11822
|
-
credential_ids:
|
|
11893
|
+
var reorderCredentialPoolSchema = z16.object({
|
|
11894
|
+
credential_ids: z16.array(z16.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
11823
11895
|
});
|
|
11824
11896
|
|
|
11825
11897
|
// ../shared/src/mothership-events.ts
|
|
@@ -11957,40 +12029,40 @@ var LINEAR_ICON_DEFINITION = {
|
|
|
11957
12029
|
import { z as z19 } from "zod";
|
|
11958
12030
|
|
|
11959
12031
|
// ../shared/src/routes/linear.ts
|
|
11960
|
-
import { z as
|
|
11961
|
-
var linearSessionMetadataSchema =
|
|
11962
|
-
via_mothership:
|
|
11963
|
-
attached:
|
|
11964
|
-
routing_chat_id:
|
|
11965
|
-
issue_id:
|
|
11966
|
-
issue_identifier:
|
|
11967
|
-
issue_title:
|
|
11968
|
-
issue_description:
|
|
11969
|
-
issue_url:
|
|
11970
|
-
comment_id:
|
|
11971
|
-
comment_body:
|
|
11972
|
-
triggered_by_id:
|
|
11973
|
-
triggered_by_name:
|
|
11974
|
-
triggered_by_email:
|
|
11975
|
-
linear_workspace_id:
|
|
11976
|
-
creator_id:
|
|
11977
|
-
creator_name:
|
|
11978
|
-
creator_email:
|
|
11979
|
-
assignee_id:
|
|
11980
|
-
assignee_name:
|
|
11981
|
-
assignee_email:
|
|
11982
|
-
issue_state:
|
|
11983
|
-
parent_issue:
|
|
11984
|
-
id:
|
|
11985
|
-
identifier:
|
|
11986
|
-
title:
|
|
11987
|
-
description:
|
|
12032
|
+
import { z as z17 } from "zod";
|
|
12033
|
+
var linearSessionMetadataSchema = z17.object({
|
|
12034
|
+
via_mothership: z17.boolean().optional(),
|
|
12035
|
+
attached: z17.boolean().optional(),
|
|
12036
|
+
routing_chat_id: z17.string().optional(),
|
|
12037
|
+
issue_id: z17.string(),
|
|
12038
|
+
issue_identifier: z17.string(),
|
|
12039
|
+
issue_title: z17.string(),
|
|
12040
|
+
issue_description: z17.string(),
|
|
12041
|
+
issue_url: z17.string(),
|
|
12042
|
+
comment_id: z17.string(),
|
|
12043
|
+
comment_body: z17.string(),
|
|
12044
|
+
triggered_by_id: z17.string().optional(),
|
|
12045
|
+
triggered_by_name: z17.string().optional(),
|
|
12046
|
+
triggered_by_email: z17.string().optional(),
|
|
12047
|
+
linear_workspace_id: z17.string().optional(),
|
|
12048
|
+
creator_id: z17.string().optional(),
|
|
12049
|
+
creator_name: z17.string().optional(),
|
|
12050
|
+
creator_email: z17.string().optional(),
|
|
12051
|
+
assignee_id: z17.string().optional(),
|
|
12052
|
+
assignee_name: z17.string().optional(),
|
|
12053
|
+
assignee_email: z17.string().optional(),
|
|
12054
|
+
issue_state: z17.string().optional(),
|
|
12055
|
+
parent_issue: z17.object({
|
|
12056
|
+
id: z17.string(),
|
|
12057
|
+
identifier: z17.string(),
|
|
12058
|
+
title: z17.string(),
|
|
12059
|
+
description: z17.string().nullable()
|
|
11988
12060
|
}).optional(),
|
|
11989
|
-
workspace:
|
|
11990
|
-
id:
|
|
11991
|
-
coding_agent:
|
|
11992
|
-
task_description:
|
|
11993
|
-
created_at:
|
|
12061
|
+
workspace: z17.object({
|
|
12062
|
+
id: z17.string(),
|
|
12063
|
+
coding_agent: z17.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
12064
|
+
task_description: z17.string(),
|
|
12065
|
+
created_at: z17.string()
|
|
11994
12066
|
}).optional()
|
|
11995
12067
|
});
|
|
11996
12068
|
var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
|
|
@@ -12000,7 +12072,7 @@ var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
|
|
|
12000
12072
|
var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
|
|
12001
12073
|
|
|
12002
12074
|
// ../shared/src/automations/trigger-schemas.ts
|
|
12003
|
-
import { z as
|
|
12075
|
+
import { z as z18 } from "zod";
|
|
12004
12076
|
|
|
12005
12077
|
// ../shared/src/uuid.ts
|
|
12006
12078
|
function createUuidFromHex(value) {
|
|
@@ -12017,66 +12089,41 @@ function getReviewerLoginsError(event, logins) {
|
|
|
12017
12089
|
if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
|
|
12018
12090
|
return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
|
|
12019
12091
|
}
|
|
12020
|
-
var repositoryTriggerConfigSchema =
|
|
12021
|
-
event:
|
|
12022
|
-
repository_ids:
|
|
12023
|
-
group_pr_events:
|
|
12024
|
-
excluded_actors:
|
|
12025
|
-
reviewer_logins:
|
|
12092
|
+
var repositoryTriggerConfigSchema = z18.object({
|
|
12093
|
+
event: z18.string(),
|
|
12094
|
+
repository_ids: z18.array(z18.string().regex(UUID_RE, "must be a repository id")).optional(),
|
|
12095
|
+
group_pr_events: z18.boolean().optional(),
|
|
12096
|
+
excluded_actors: z18.array(z18.string()).optional(),
|
|
12097
|
+
reviewer_logins: z18.array(z18.string()).optional()
|
|
12026
12098
|
});
|
|
12027
|
-
var cronTriggerSchema =
|
|
12028
|
-
var githubTriggerSchema =
|
|
12029
|
-
type:
|
|
12099
|
+
var cronTriggerSchema = z18.object({ type: z18.literal("cron"), config: z18.object({ schedule: z18.string(), timezone: z18.string().optional() }) });
|
|
12100
|
+
var githubTriggerSchema = z18.object({
|
|
12101
|
+
type: z18.literal("github"),
|
|
12030
12102
|
config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
|
|
12031
12103
|
const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
|
|
12032
12104
|
if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
|
|
12033
12105
|
})
|
|
12034
12106
|
});
|
|
12035
|
-
var gitlabTriggerSchema =
|
|
12036
|
-
var linearTriggerConfigSchema =
|
|
12037
|
-
var automationTriggerSchema =
|
|
12107
|
+
var gitlabTriggerSchema = z18.object({ type: z18.literal("gitlab"), config: repositoryTriggerConfigSchema });
|
|
12108
|
+
var linearTriggerConfigSchema = z18.object({ event: z18.string(), team_ids: z18.array(z18.string()).optional(), state_types: z18.array(z18.enum(LINEAR_STATE_TYPES)).optional() });
|
|
12109
|
+
var automationTriggerSchema = z18.discriminatedUnion("type", [
|
|
12038
12110
|
cronTriggerSchema,
|
|
12039
12111
|
githubTriggerSchema,
|
|
12040
12112
|
gitlabTriggerSchema,
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12113
|
+
z18.object({ type: z18.literal("slack"), config: z18.object({ event: z18.string(), channel_ids: z18.array(z18.string()).optional(), group_thread_replies: z18.boolean().optional() }) }),
|
|
12114
|
+
z18.object({ type: z18.literal("sentry"), config: z18.object({ event: z18.string(), project_slugs: z18.array(z18.string()).optional(), min_level: z18.string().optional() }) }),
|
|
12115
|
+
z18.object({ type: z18.literal("linear"), config: linearTriggerConfigSchema }),
|
|
12116
|
+
z18.object({ type: z18.literal("custom"), config: z18.object({}) })
|
|
12045
12117
|
]);
|
|
12046
12118
|
|
|
12047
12119
|
// ../shared/src/automations/types.ts
|
|
12048
12120
|
var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
|
|
12121
|
+
var AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MIN = 3;
|
|
12122
|
+
var AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MAX = 1440;
|
|
12049
12123
|
var AUTOMATION_LIFECYCLE_POLICIES = ["default", "archive_when_done", "sleep_when_done", "delete_when_done"];
|
|
12050
12124
|
var AUTOMATION_AUTO_PAUSE_DAYS = 7;
|
|
12051
12125
|
var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
|
|
12052
12126
|
|
|
12053
|
-
// ../shared/src/routes/workspaces.ts
|
|
12054
|
-
import { z as z18 } from "zod";
|
|
12055
|
-
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
12056
|
-
var SUPPORT_EMAIL = "founders@replicas.dev";
|
|
12057
|
-
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.`;
|
|
12058
|
-
var STALE_PREPARING_MS = 10 * 6e4;
|
|
12059
|
-
var WORKSPACE_STATUS_FILTERS = WORKSPACE_STATUSES.map((status) => status === "error" ? "failed" : status);
|
|
12060
|
-
var DEFAULT_STATUS_FILTERS = [...WORKSPACE_STATUS_FILTERS];
|
|
12061
|
-
var DEFAULT_WORKSPACE_FILTERS = {
|
|
12062
|
-
statuses: [...DEFAULT_STATUS_FILTERS],
|
|
12063
|
-
ownerIds: [],
|
|
12064
|
-
activity: "any"
|
|
12065
|
-
};
|
|
12066
|
-
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
12067
|
-
var workspaceExecRequestSchema = z18.object({
|
|
12068
|
-
command: z18.string().regex(/\S/, "command is required"),
|
|
12069
|
-
timeout_seconds: z18.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
12070
|
-
});
|
|
12071
|
-
var terminalRtcCandidateSchema = z18.object({ type: z18.literal("rtc-candidate"), candidate: z18.string(), mid: z18.string() });
|
|
12072
|
-
var terminalSocketServerMessageSchema = z18.discriminatedUnion("type", [
|
|
12073
|
-
z18.object({ type: z18.literal("output"), data: z18.string() }),
|
|
12074
|
-
z18.object({ type: z18.literal("rtc-answer"), sdp: z18.string() }),
|
|
12075
|
-
terminalRtcCandidateSchema,
|
|
12076
|
-
z18.object({ type: z18.literal("rtc-switch") })
|
|
12077
|
-
]);
|
|
12078
|
-
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
12079
|
-
|
|
12080
12127
|
// ../shared/src/replicas-mcp.ts
|
|
12081
12128
|
var REPLICAS_MCP_SERVER_NAME = "replicas-mcp";
|
|
12082
12129
|
var REPLICAS_MCP_TOOLS = {
|
|
@@ -12109,6 +12156,7 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12109
12156
|
waitForSubagents: "wait_for_subagents",
|
|
12110
12157
|
getBoard: "get_board",
|
|
12111
12158
|
updateBoard: "update_board",
|
|
12159
|
+
sendToChat: "send_to_chat",
|
|
12112
12160
|
getLinearRouting: "get_linear_routing",
|
|
12113
12161
|
setLinearRouting: "set_linear_routing",
|
|
12114
12162
|
clearLinearRouting: "clear_linear_routing",
|
|
@@ -12248,7 +12296,7 @@ import { z as z23 } from "zod";
|
|
|
12248
12296
|
import { z as z20 } from "zod";
|
|
12249
12297
|
|
|
12250
12298
|
// ../shared/src/workspace-attention.ts
|
|
12251
|
-
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup"];
|
|
12299
|
+
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
|
|
12252
12300
|
var CHAT_ATTENTION_REASONS = ["question", "blocked"];
|
|
12253
12301
|
|
|
12254
12302
|
// ../shared/src/routes/push.ts
|
|
@@ -14890,6 +14938,7 @@ function removeTag(text4, tag) {
|
|
|
14890
14938
|
function stripReplicasInstructionBlock(text4) {
|
|
14891
14939
|
return removeTag(text4, REPLICAS_INSTRUCTIONS_TAG);
|
|
14892
14940
|
}
|
|
14941
|
+
var MOTHERSHIP_EVENT_CHAT_NOTE = `The user doesn't see text you write in this turn. If it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; otherwise update the board and end with a one-line note.`;
|
|
14893
14942
|
var BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
14894
14943
|
var BOARD_RULES = `- The board, a live status page you keep with \`${REPLICAS_MCP_TOOLS.updateBoard}\` in the Ships pane beside this chat, is the user's one view of the work: keep it covering every ship, pull request, deploy and blocker. Show ships, pull requests and Linear tickets as ship, pr and linear blocks, which stay current on their own, instead of describing their status. Keep exactly these sections, always in this order, leaving out any that are empty; when you add one, give it the position that keeps this order:
|
|
14895
14944
|
- Questions (needs_you): only decisions you truly can't make, and blocked ships. Give each your recommendation and a choice. Make routine calls yourself, such as retries, small scope choices or test cleanup, and note them on the ship's row instead of asking.
|
|
@@ -14899,8 +14948,8 @@ var BOARD_RULES = `- The board, a live status page you keep with \`${REPLICAS_MC
|
|
|
14899
14948
|
- On every \`finished\` and \`archived\` event, move that ship's rows out of Working, or remove them, so Working only lists ships that are working.
|
|
14900
14949
|
- A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or add it to Questions only if you can't decide.
|
|
14901
14950
|
- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.
|
|
14902
|
-
- On every ship event and every answer the user gives on the board (marked "${BOARD_ANSWER_NOTE}"), act with tools on the answer or on any work the event unblocks, such as starting the next task once a pull request merges, and update the board.
|
|
14903
|
-
- The chat is like texting an assistant: the user sees only your final reply
|
|
14951
|
+
- On every ship event and every answer the user gives on the board (marked "${BOARD_ANSWER_NOTE}"), act with tools on the answer or on any work the event unblocks, such as starting the next task once a pull request merges, and update the board. The user sees nothing you write in these turns: the only way to reach them is \`${REPLICAS_MCP_TOOLS.sendToChat}\`. Call it only for what they would want right now: a deliverable they asked for, with its media, links or answer (the finished video, the requested numbers); a failure or blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged", "deploying", "it's on the board" or "I asked the ship to\u2026": the board and the chat's own rows show those. End the turn with a one-line note of what you did; only the activity log shows it.
|
|
14952
|
+
- The chat is like texting an assistant: the user sees only your final reply to each message they type, plus what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, never your tool calls or earlier text. Write in a line or two with links, and include any media inline. Anything that needs the user later goes on the board. Never restate the board in chat: no status tables, per-ship lists or summaries of what ships did.
|
|
14904
14953
|
- When the user picks a choice or clicks a button that messages or merges, Replicas removes that item from the board for you. Add it back, or a new item, only if the user is still needed.
|
|
14905
14954
|
`;
|
|
14906
14955
|
var MOTHERSHIP_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MOTHERSHIP_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MOTHERSHIP_INSTRUCTIONS_TAG}>`);
|
|
@@ -15622,6 +15671,9 @@ function insertDisplayMessageByTimestamp(messages, message2) {
|
|
|
15622
15671
|
}
|
|
15623
15672
|
|
|
15624
15673
|
// ../shared/src/display-message/format.ts
|
|
15674
|
+
function describeQuotaStatus(message2) {
|
|
15675
|
+
return message2.state === "rate_limited" ? `Codex hit a rate limit${message2.rateLimitResetType ? ` (${message2.rateLimitResetType})` : ""} \u2014 try again after reset` : "Codex is out of credits \u2014 top up your OpenAI account to resume";
|
|
15676
|
+
}
|
|
15625
15677
|
function planItemsFromMessage(message2) {
|
|
15626
15678
|
if (message2.type === "todo_list") {
|
|
15627
15679
|
return message2.items.map((item) => ({ text: item.text, status: todoItemStatus(item) }));
|
|
@@ -15674,7 +15726,7 @@ ${operation.diff}` : ""}`).join("\n\n");
|
|
|
15674
15726
|
if (message2.type === "skill") return { kind: "tool", title: `Skill \xB7 ${message2.skillName}`, summary: message2.args ?? "", content: "" };
|
|
15675
15727
|
if (message2.type === "quota_status") {
|
|
15676
15728
|
const rateLimited = message2.state === "rate_limited";
|
|
15677
|
-
return { kind: "error", title: rateLimited ? "Codex rate limit" : "Codex credits", summary: "", content:
|
|
15729
|
+
return { kind: "error", title: rateLimited ? "Codex rate limit" : "Codex credits", summary: "", content: `${describeQuotaStatus(message2)}.` };
|
|
15678
15730
|
}
|
|
15679
15731
|
if (message2.type === "auth_fallback") {
|
|
15680
15732
|
const { headline, outcomeClause } = describeAuthFallback(message2);
|
|
@@ -16392,6 +16444,7 @@ var REPLICAS_API_STEPS = {
|
|
|
16392
16444
|
[REPLICAS_MCP_TOOLS.clearLinearRouting]: { icon: "trash", live: "Clearing Linear routing", done: "Cleared Linear routing" },
|
|
16393
16445
|
[REPLICAS_MCP_TOOLS.getBoard]: { icon: "book", live: "Reading board", done: "Read board" },
|
|
16394
16446
|
[REPLICAS_MCP_TOOLS.updateBoard]: { icon: "file-pen", live: "Updating board", done: "Updated board" },
|
|
16447
|
+
[REPLICAS_MCP_TOOLS.sendToChat]: { icon: "message", live: "Sending to chat", done: "Sent to chat" },
|
|
16395
16448
|
[REPLICAS_MCP_TOOLS.mergeWhenReady]: { icon: "target", live: "Setting merge when ready", done: "Set merge when ready" }
|
|
16396
16449
|
};
|
|
16397
16450
|
function replicasToolName(message2) {
|
|
@@ -16540,10 +16593,14 @@ function currentStepLabel(messages, earlierPlainStep) {
|
|
|
16540
16593
|
}
|
|
16541
16594
|
|
|
16542
16595
|
// ../shared/src/user-message-attachments.ts
|
|
16596
|
+
import { z as z27 } from "zod";
|
|
16543
16597
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
16598
|
+
var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
16599
|
+
var annotationLinesSchema = z27.object({ path: z27.string(), start: z27.number(), end: z27.number() });
|
|
16544
16600
|
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".';
|
|
16545
16601
|
var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
16546
16602
|
var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
|
|
16603
|
+
var ANNOTATION_FILE_REGEX = /^File: (.+):(\d+)(?:-(\d+))?$/;
|
|
16547
16604
|
function findAnnotationsNote(content) {
|
|
16548
16605
|
const complete = content.match(ANNOTATIONS_NOTE_REGEX);
|
|
16549
16606
|
if (complete) return { index: complete.index ?? 0, body: complete[1] };
|
|
@@ -16556,10 +16613,16 @@ function findAnnotationsNote(content) {
|
|
|
16556
16613
|
function parseAnnotationsNote(body) {
|
|
16557
16614
|
return body.split(ANNOTATION_HEADER_REGEX).slice(1).map((entry) => {
|
|
16558
16615
|
const lines = entry.trim().split("\n");
|
|
16616
|
+
const file = lines[0]?.match(ANNOTATION_FILE_REGEX);
|
|
16617
|
+
if (file) lines.shift();
|
|
16559
16618
|
const quoteLength = lines.findIndex((line) => !line.startsWith(">"));
|
|
16560
16619
|
const quote = lines.slice(0, quoteLength === -1 ? void 0 : quoteLength).map((line) => line.replace(/^>\s?/, ""));
|
|
16561
16620
|
const comment = quoteLength === -1 ? "" : lines.slice(quoteLength).join("\n").trim();
|
|
16562
|
-
return {
|
|
16621
|
+
return {
|
|
16622
|
+
text: quote.join("\n"),
|
|
16623
|
+
...comment ? { comment } : {},
|
|
16624
|
+
...file ? { lines: { path: file[1], start: Number(file[2]), end: Number(file[3] ?? file[2]) } } : {}
|
|
16625
|
+
};
|
|
16563
16626
|
});
|
|
16564
16627
|
}
|
|
16565
16628
|
var APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)" window="([^"\n]*)" image="(\d+)">\n([^\n<]*)(?:\n\n([^<]*))?\n<\/replicas_appshot>$/;
|
|
@@ -18707,7 +18770,7 @@ function filterDisplayMessages(messages, provider2) {
|
|
|
18707
18770
|
if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
|
|
18708
18771
|
return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
|
|
18709
18772
|
}
|
|
18710
|
-
const cleaned = (msg.images?.length || files.length)
|
|
18773
|
+
const cleaned = withoutAttachmentPlaceholder(content, Boolean(msg.images?.length || files.length));
|
|
18711
18774
|
if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [];
|
|
18712
18775
|
const origin = parseMessageOrigin(msg.content);
|
|
18713
18776
|
if (cleaned === msg.content && !origin && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
|
|
@@ -18742,18 +18805,18 @@ function attachSendersToMessages(messages, senders) {
|
|
|
18742
18805
|
...sender.senderDisplayName ? { senderDisplayName: sender.senderDisplayName } : {},
|
|
18743
18806
|
...sender.senderAvatarUrl ? { senderAvatarUrl: sender.senderAvatarUrl } : {}
|
|
18744
18807
|
} : message2;
|
|
18808
|
+
const matched = /* @__PURE__ */ new Set();
|
|
18745
18809
|
const next = messages.map((message2) => {
|
|
18746
18810
|
const sender = message2.type === "user" ? sendersByMessageId.get(message2.id) : void 0;
|
|
18811
|
+
if (sender) matched.add(sender);
|
|
18747
18812
|
return sender ? attachSender(message2, sender) : message2;
|
|
18748
18813
|
});
|
|
18749
18814
|
messages.forEach((message2, index) => {
|
|
18750
|
-
if (message2.type === "user" && !sendersByMessageId.has(message2.id) && !isMothershipEventMessage(message2.content)) {
|
|
18815
|
+
if (message2.type === "user" && !message2.origin && !message2.senderUserId && !message2.senderEmail && !sendersByMessageId.has(message2.id) && !isMothershipEventMessage(message2.content)) {
|
|
18751
18816
|
userIndices.push(index);
|
|
18752
18817
|
}
|
|
18753
18818
|
});
|
|
18754
|
-
const timestampSenders = senders.filter((sender) => sender.messageId && !
|
|
18755
|
-
(message2) => message2.type === "user" && sendersByMessageId.get(message2.id) === sender
|
|
18756
|
-
));
|
|
18819
|
+
const timestampSenders = senders.filter((sender) => sender.messageId && !matched.has(sender));
|
|
18757
18820
|
for (const sender of timestampSenders) {
|
|
18758
18821
|
const senderTime = parseTimestampMs(sender.recordedAt);
|
|
18759
18822
|
if (!senderTime) continue;
|
|
@@ -19454,8 +19517,19 @@ function extractLatestContextUsage(events, provider2) {
|
|
|
19454
19517
|
return latest;
|
|
19455
19518
|
}
|
|
19456
19519
|
|
|
19520
|
+
// ../shared/src/composer-voice-input.ts
|
|
19521
|
+
var BAR_HEIGHTS = [6, 10, 14, 8, 12, 16, 9, 13, 7, 15, 11, 6];
|
|
19522
|
+
var VOICE_WAVEFORM = {
|
|
19523
|
+
bands: BAR_HEIGHTS.length,
|
|
19524
|
+
intervalMs: 32,
|
|
19525
|
+
rmsFloor: 1e-3,
|
|
19526
|
+
minDecibels: -48,
|
|
19527
|
+
decibelRange: 36,
|
|
19528
|
+
barHeights: BAR_HEIGHTS
|
|
19529
|
+
};
|
|
19530
|
+
|
|
19457
19531
|
// ../shared/src/e2b.ts
|
|
19458
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-10-
|
|
19532
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-10-v5";
|
|
19459
19533
|
|
|
19460
19534
|
// ../shared/src/e2b-retry.ts
|
|
19461
19535
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -19701,6 +19775,23 @@ function getGoalCommandObjectiveValidationError(message2, goalMode) {
|
|
|
19701
19775
|
return `Goal objective must be at most ${MAX_CODEX_GOAL_OBJECTIVE_CHARS} characters (${length} provided). Shorten the /goal objective, or send the extra details as a regular message after setting the goal.`;
|
|
19702
19776
|
}
|
|
19703
19777
|
|
|
19778
|
+
// ../shared/src/keyboard-shortcuts.ts
|
|
19779
|
+
var MAC_KEY_LABELS = {
|
|
19780
|
+
ArrowUp: "\u2191",
|
|
19781
|
+
ArrowDown: "\u2193",
|
|
19782
|
+
ArrowLeft: "\u2190",
|
|
19783
|
+
ArrowRight: "\u2192",
|
|
19784
|
+
Enter: "\u21B5",
|
|
19785
|
+
Escape: "Esc",
|
|
19786
|
+
Tab: "\u21E5",
|
|
19787
|
+
" ": "Space",
|
|
19788
|
+
Backspace: "\u232B",
|
|
19789
|
+
Shift: "\u21E7",
|
|
19790
|
+
Alt: "\u2325",
|
|
19791
|
+
Mod: "\u2318"
|
|
19792
|
+
};
|
|
19793
|
+
var OTHER_KEY_LABELS = { ...MAC_KEY_LABELS, Enter: "Enter", Tab: "Tab", Backspace: "Backspace", Shift: "Shift", Alt: "Alt", Mod: "Ctrl" };
|
|
19794
|
+
|
|
19704
19795
|
// ../shared/src/replicas-config.ts
|
|
19705
19796
|
import { parse as parseYaml2 } from "yaml";
|
|
19706
19797
|
|
|
@@ -19911,10 +20002,10 @@ function hasChatStarted(chat) {
|
|
|
19911
20002
|
}
|
|
19912
20003
|
|
|
19913
20004
|
// ../shared/src/routes/billing.ts
|
|
19914
|
-
import { z as
|
|
20005
|
+
import { z as z28 } from "zod";
|
|
19915
20006
|
var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
|
|
19916
|
-
var usageLimitCentsSchema =
|
|
19917
|
-
var sourceLimitsCentsSchema =
|
|
20007
|
+
var usageLimitCentsSchema = z28.number().int().min(100).max(1e8);
|
|
20008
|
+
var sourceLimitsCentsSchema = z28.partialRecord(z28.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
|
|
19918
20009
|
|
|
19919
20010
|
// ../shared/src/routes/codex.ts
|
|
19920
20011
|
var CODEX_AUTH_ENV_KEYS = [
|
|
@@ -20068,7 +20159,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
20068
20159
|
};
|
|
20069
20160
|
|
|
20070
20161
|
// ../shared/src/routes/command-protection.ts
|
|
20071
|
-
import { z as
|
|
20162
|
+
import { z as z29 } from "zod";
|
|
20072
20163
|
|
|
20073
20164
|
// ../shared/src/git-invocations.ts
|
|
20074
20165
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -20159,27 +20250,27 @@ function findCheckoutTarget(args) {
|
|
|
20159
20250
|
}
|
|
20160
20251
|
|
|
20161
20252
|
// ../shared/src/routes/command-protection.ts
|
|
20162
|
-
var commandProtectionRepoStateSchema =
|
|
20163
|
-
branch:
|
|
20164
|
-
defaultBranch:
|
|
20165
|
-
pushBranch:
|
|
20166
|
-
pushConfig:
|
|
20167
|
-
headMessage:
|
|
20168
|
-
mergeInProgress:
|
|
20253
|
+
var commandProtectionRepoStateSchema = z29.object({
|
|
20254
|
+
branch: z29.string().nullable(),
|
|
20255
|
+
defaultBranch: z29.string().nullable(),
|
|
20256
|
+
pushBranch: z29.string().nullable(),
|
|
20257
|
+
pushConfig: z29.string().nullable(),
|
|
20258
|
+
headMessage: z29.string().nullable(),
|
|
20259
|
+
mergeInProgress: z29.boolean().optional()
|
|
20169
20260
|
});
|
|
20170
|
-
var commandProtectionEvaluateRequestSchema =
|
|
20171
|
-
provider:
|
|
20172
|
-
source:
|
|
20173
|
-
toolName:
|
|
20174
|
-
toolInput:
|
|
20175
|
-
command:
|
|
20176
|
-
cwd:
|
|
20177
|
-
toolUseId:
|
|
20261
|
+
var commandProtectionEvaluateRequestSchema = z29.object({
|
|
20262
|
+
provider: z29.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
20263
|
+
source: z29.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
20264
|
+
toolName: z29.string(),
|
|
20265
|
+
toolInput: z29.unknown(),
|
|
20266
|
+
command: z29.string().nullish(),
|
|
20267
|
+
cwd: z29.string().nullish(),
|
|
20268
|
+
toolUseId: z29.string().nullish(),
|
|
20178
20269
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
20179
20270
|
// policy can see branches and commit messages the command text only references.
|
|
20180
|
-
gitContext:
|
|
20181
|
-
repos:
|
|
20182
|
-
messageFiles:
|
|
20271
|
+
gitContext: z29.object({
|
|
20272
|
+
repos: z29.record(z29.string(), commandProtectionRepoStateSchema),
|
|
20273
|
+
messageFiles: z29.record(z29.string(), z29.string())
|
|
20183
20274
|
}).optional()
|
|
20184
20275
|
});
|
|
20185
20276
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -20399,119 +20490,119 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
20399
20490
|
}
|
|
20400
20491
|
|
|
20401
20492
|
// ../shared/src/routes/scout.ts
|
|
20402
|
-
import { z as
|
|
20493
|
+
import { z as z30 } from "zod";
|
|
20403
20494
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
20404
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
20405
|
-
comment_id:
|
|
20406
|
-
action:
|
|
20495
|
+
var scoutLinearSessionIntentRequestSchema = z30.object({
|
|
20496
|
+
comment_id: z30.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
20497
|
+
action: z30.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
20407
20498
|
});
|
|
20408
|
-
var scoutLinearStartRequestSchema =
|
|
20409
|
-
issue_id:
|
|
20410
|
-
agent_session_id:
|
|
20411
|
-
prompt:
|
|
20499
|
+
var scoutLinearStartRequestSchema = z30.object({
|
|
20500
|
+
issue_id: z30.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
20501
|
+
agent_session_id: z30.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
20502
|
+
prompt: z30.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
20412
20503
|
});
|
|
20413
|
-
var scoutRouteLinearTicketRequestSchema =
|
|
20414
|
-
agent_session_id:
|
|
20415
|
-
environment_id:
|
|
20416
|
-
mothership_id:
|
|
20504
|
+
var scoutRouteLinearTicketRequestSchema = z30.object({
|
|
20505
|
+
agent_session_id: z30.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
|
|
20506
|
+
environment_id: z30.string().trim().min(1).optional().describe("Start the ticket in this environment."),
|
|
20507
|
+
mothership_id: z30.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
|
|
20417
20508
|
}).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
|
|
20418
|
-
var slackChannelIdSchema =
|
|
20419
|
-
var slackThreadTsSchema =
|
|
20420
|
-
var scoutSlackMessageReferenceSchema =
|
|
20509
|
+
var slackChannelIdSchema = z30.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
20510
|
+
var slackThreadTsSchema = z30.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
20511
|
+
var scoutSlackMessageReferenceSchema = z30.object({
|
|
20421
20512
|
channel_id: slackChannelIdSchema,
|
|
20422
20513
|
thread_ts: slackThreadTsSchema,
|
|
20423
|
-
message_ts:
|
|
20424
|
-
user_id:
|
|
20514
|
+
message_ts: z30.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
20515
|
+
user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
|
|
20425
20516
|
});
|
|
20426
|
-
var scoutSlackSpawnRequestSchema =
|
|
20517
|
+
var scoutSlackSpawnRequestSchema = z30.object({
|
|
20427
20518
|
channel_id: slackChannelIdSchema,
|
|
20428
20519
|
thread_ts: slackThreadTsSchema,
|
|
20429
|
-
message_ts:
|
|
20430
|
-
user_id:
|
|
20431
|
-
prompt:
|
|
20432
|
-
acknowledgement_ts:
|
|
20433
|
-
environment_id:
|
|
20520
|
+
message_ts: z30.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."),
|
|
20521
|
+
user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
20522
|
+
prompt: z30.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."),
|
|
20523
|
+
acknowledgement_ts: z30.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."),
|
|
20524
|
+
environment_id: z30.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.`)
|
|
20434
20525
|
});
|
|
20435
20526
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
20436
|
-
title:
|
|
20437
|
-
prompt:
|
|
20438
|
-
acknowledgement_ts:
|
|
20527
|
+
title: z30.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
20528
|
+
prompt: z30.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."),
|
|
20529
|
+
acknowledgement_ts: z30.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.")
|
|
20439
20530
|
});
|
|
20440
|
-
var scoutSlackRelayRequestSchema =
|
|
20531
|
+
var scoutSlackRelayRequestSchema = z30.object({
|
|
20441
20532
|
channel_id: slackChannelIdSchema,
|
|
20442
20533
|
thread_ts: slackThreadTsSchema,
|
|
20443
|
-
message:
|
|
20444
|
-
user_id:
|
|
20445
|
-
queue:
|
|
20446
|
-
workspace_id:
|
|
20447
|
-
message_ts:
|
|
20534
|
+
message: z30.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."),
|
|
20535
|
+
user_id: z30.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`."),
|
|
20536
|
+
queue: z30.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."),
|
|
20537
|
+
workspace_id: z30.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.`),
|
|
20538
|
+
message_ts: z30.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.")
|
|
20448
20539
|
});
|
|
20449
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
20540
|
+
var scoutSlackSetThreadMutedRequestSchema = z30.object({
|
|
20450
20541
|
channel_id: slackChannelIdSchema,
|
|
20451
20542
|
thread_ts: slackThreadTsSchema,
|
|
20452
|
-
muted:
|
|
20543
|
+
muted: z30.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
20453
20544
|
});
|
|
20454
20545
|
var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
|
|
20455
|
-
archive:
|
|
20546
|
+
archive: z30.boolean().describe("true only when the person also asked to close or archive the workspace.")
|
|
20456
20547
|
});
|
|
20457
|
-
var scoutListWorkspacesRequestSchema =
|
|
20548
|
+
var scoutListWorkspacesRequestSchema = z30.object({
|
|
20458
20549
|
channel_id: slackChannelIdSchema,
|
|
20459
20550
|
thread_ts: slackThreadTsSchema,
|
|
20460
|
-
message_ts:
|
|
20461
|
-
user_id:
|
|
20462
|
-
query:
|
|
20551
|
+
message_ts: z30.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
20552
|
+
user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
20553
|
+
query: z30.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
|
|
20463
20554
|
});
|
|
20464
|
-
var scoutSlackConfirmationSchema =
|
|
20465
|
-
confirmation_channel_id:
|
|
20466
|
-
confirmation_thread_ts:
|
|
20467
|
-
confirmation_message_ts:
|
|
20468
|
-
confirmation_user_id:
|
|
20555
|
+
var scoutSlackConfirmationSchema = z30.object({
|
|
20556
|
+
confirmation_channel_id: z30.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
20557
|
+
confirmation_thread_ts: z30.string().describe("`thread_ts` from that message's envelope."),
|
|
20558
|
+
confirmation_message_ts: z30.string().describe("`message_ts` from that message's envelope."),
|
|
20559
|
+
confirmation_user_id: z30.string().describe("`user_id` from that message's envelope.")
|
|
20469
20560
|
});
|
|
20470
20561
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
20471
20562
|
var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20472
|
-
preset_id:
|
|
20473
|
-
name:
|
|
20474
|
-
description:
|
|
20475
|
-
icon:
|
|
20476
|
-
instructions:
|
|
20563
|
+
preset_id: z30.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
20564
|
+
name: z30.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
20565
|
+
description: z30.string().optional().describe("One-line summary shown in settings."),
|
|
20566
|
+
icon: z30.enum(SCOUT_PRESET_ICONS).optional(),
|
|
20567
|
+
instructions: z30.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
20477
20568
|
});
|
|
20478
20569
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20479
|
-
source:
|
|
20480
|
-
external_id:
|
|
20481
|
-
monitored:
|
|
20482
|
-
preset_id:
|
|
20483
|
-
instructions:
|
|
20484
|
-
proactivity:
|
|
20485
|
-
muted:
|
|
20570
|
+
source: z30.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
20571
|
+
external_id: z30.string().describe("Slack channel id or Linear team id."),
|
|
20572
|
+
monitored: z30.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."),
|
|
20573
|
+
preset_id: z30.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
20574
|
+
instructions: z30.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
|
|
20575
|
+
proactivity: z30.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."),
|
|
20576
|
+
muted: z30.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
|
|
20486
20577
|
});
|
|
20487
20578
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20488
|
-
muted:
|
|
20579
|
+
muted: z30.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
|
|
20489
20580
|
});
|
|
20490
20581
|
var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
|
|
20491
|
-
preset_id:
|
|
20492
|
-
instructions:
|
|
20493
|
-
proactivity:
|
|
20582
|
+
preset_id: z30.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
|
|
20583
|
+
instructions: z30.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
|
|
20584
|
+
proactivity: z30.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.")
|
|
20494
20585
|
});
|
|
20495
20586
|
var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20496
|
-
proactivity:
|
|
20587
|
+
proactivity: z30.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.`)
|
|
20497
20588
|
});
|
|
20498
20589
|
var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20499
|
-
preset_id:
|
|
20590
|
+
preset_id: z30.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
20500
20591
|
});
|
|
20501
20592
|
var RESET_TO_DEFAULT = "default";
|
|
20502
|
-
var resettable = (schema, description) =>
|
|
20593
|
+
var resettable = (schema, description) => z30.union([schema, z30.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
|
|
20503
20594
|
var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
20504
|
-
agent_provider: resettable(
|
|
20505
|
-
model: resettable(
|
|
20506
|
-
thinking_level: resettable(
|
|
20507
|
-
goal_mode: resettable(
|
|
20508
|
-
fast_mode: resettable(
|
|
20595
|
+
agent_provider: resettable(z30.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
|
|
20596
|
+
model: resettable(z30.string(), "Model id for that agent; the default is the agent's own."),
|
|
20597
|
+
thinking_level: resettable(z30.enum(VALID_THINKING_LEVELS), "Thinking level."),
|
|
20598
|
+
goal_mode: resettable(z30.boolean(), "Goal mode."),
|
|
20599
|
+
fast_mode: resettable(z30.boolean(), "Fast mode.")
|
|
20509
20600
|
});
|
|
20510
|
-
var scoutClaimSettingsOfferToolInputSchema =
|
|
20601
|
+
var scoutClaimSettingsOfferToolInputSchema = z30.object({
|
|
20511
20602
|
channel_id: slackChannelIdSchema,
|
|
20512
|
-
kind:
|
|
20513
|
-
user_id:
|
|
20514
|
-
declined:
|
|
20603
|
+
kind: z30.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."),
|
|
20604
|
+
user_id: z30.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."),
|
|
20605
|
+
declined: z30.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
|
|
20515
20606
|
});
|
|
20516
20607
|
|
|
20517
20608
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -20869,22 +20960,22 @@ var PLUGIN_CATALOG = [
|
|
|
20869
20960
|
].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
|
|
20870
20961
|
|
|
20871
20962
|
// ../shared/src/routes/sentry.ts
|
|
20872
|
-
import { z as
|
|
20873
|
-
var sentrySelfHostedConnectRequestSchema =
|
|
20874
|
-
baseUrl:
|
|
20875
|
-
token:
|
|
20876
|
-
webhookSecret:
|
|
20963
|
+
import { z as z31 } from "zod";
|
|
20964
|
+
var sentrySelfHostedConnectRequestSchema = z31.object({
|
|
20965
|
+
baseUrl: z31.string().min(1),
|
|
20966
|
+
token: z31.string().trim().min(1),
|
|
20967
|
+
webhookSecret: z31.string().trim().optional()
|
|
20877
20968
|
});
|
|
20878
20969
|
|
|
20879
20970
|
// ../shared/src/routes/user.ts
|
|
20880
20971
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
20881
20972
|
|
|
20882
20973
|
// ../shared/src/routes/web-auth.ts
|
|
20883
|
-
import { z as
|
|
20884
|
-
var webAuthRedeemResponseSchema =
|
|
20885
|
-
path:
|
|
20886
|
-
organizationId:
|
|
20887
|
-
session:
|
|
20974
|
+
import { z as z32 } from "zod";
|
|
20975
|
+
var webAuthRedeemResponseSchema = z32.object({
|
|
20976
|
+
path: z32.string(),
|
|
20977
|
+
organizationId: z32.string().nullable(),
|
|
20978
|
+
session: z32.object({ access_token: z32.string(), refresh_token: z32.string(), user: z32.object({ id: z32.string(), email: z32.string() }) }).nullable()
|
|
20888
20979
|
});
|
|
20889
20980
|
|
|
20890
20981
|
// ../shared/src/routes/client-state.ts
|
|
@@ -20895,6 +20986,7 @@ var WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-atten
|
|
|
20895
20986
|
var WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-section-order-";
|
|
20896
20987
|
var WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-stages-";
|
|
20897
20988
|
var WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-marked-unread-";
|
|
20989
|
+
var WORKSPACE_PINNED_CLIENT_STATE_KEY_PREFIX = "replicas-pinned-workspaces-";
|
|
20898
20990
|
var PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX = "replicas-prompt-history-";
|
|
20899
20991
|
var WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX = "replicas-workspace-search-opens-";
|
|
20900
20992
|
var orgUserClientStateKey = (prefix) => (organizationId, userId) => `${prefix}${organizationId}-${userId}`;
|
|
@@ -20903,94 +20995,95 @@ var workspaceAttentionDoneClientStateKey = orgUserClientStateKey(WORKSPACE_ATTEN
|
|
|
20903
20995
|
var workspaceStagesClientStateKey = orgUserClientStateKey(WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX);
|
|
20904
20996
|
var workspaceSectionOrderClientStateKey = orgUserClientStateKey(WORKSPACE_SECTION_ORDER_CLIENT_STATE_KEY_PREFIX);
|
|
20905
20997
|
var workspaceMarkedUnreadClientStateKey = orgUserClientStateKey(WORKSPACE_MARKED_UNREAD_CLIENT_STATE_KEY_PREFIX);
|
|
20998
|
+
var workspacePinnedClientStateKey = orgUserClientStateKey(WORKSPACE_PINNED_CLIENT_STATE_KEY_PREFIX);
|
|
20906
20999
|
var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX);
|
|
20907
21000
|
var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
|
|
20908
21001
|
|
|
20909
21002
|
// ../shared/src/routes/workspace-events.ts
|
|
20910
|
-
import { z as
|
|
20911
|
-
var workspaceTurnCompletionSchema =
|
|
20912
|
-
workspaceName:
|
|
20913
|
-
completedAt:
|
|
20914
|
-
processing:
|
|
20915
|
-
pullRequestFeedback:
|
|
20916
|
-
attention:
|
|
21003
|
+
import { z as z33 } from "zod";
|
|
21004
|
+
var workspaceTurnCompletionSchema = z33.object({
|
|
21005
|
+
workspaceName: z33.string(),
|
|
21006
|
+
completedAt: z33.string(),
|
|
21007
|
+
processing: z33.boolean().optional(),
|
|
21008
|
+
pullRequestFeedback: z33.boolean().optional(),
|
|
21009
|
+
attention: z33.object({ reason: z33.enum(CHAT_ATTENTION_REASONS), userId: z33.string() }).optional()
|
|
20917
21010
|
});
|
|
20918
|
-
var workspaceChangedEventSchema =
|
|
20919
|
-
|
|
20920
|
-
type:
|
|
20921
|
-
workspaceId:
|
|
20922
|
-
workspace:
|
|
20923
|
-
name:
|
|
21011
|
+
var workspaceChangedEventSchema = z33.discriminatedUnion("type", [
|
|
21012
|
+
z33.object({
|
|
21013
|
+
type: z33.literal("workspace.changed"),
|
|
21014
|
+
workspaceId: z33.string(),
|
|
21015
|
+
workspace: z33.object({ status: z33.enum(WORKSPACE_STATUSES), last_activity_at: z33.string().nullable() }).optional(),
|
|
21016
|
+
name: z33.string().optional(),
|
|
20924
21017
|
completion: workspaceTurnCompletionSchema.optional(),
|
|
20925
|
-
ts:
|
|
21018
|
+
ts: z33.string()
|
|
20926
21019
|
}),
|
|
20927
|
-
|
|
20928
|
-
type:
|
|
20929
|
-
workspaceId:
|
|
20930
|
-
chatId:
|
|
20931
|
-
ts:
|
|
21020
|
+
z33.object({
|
|
21021
|
+
type: z33.literal("workspace.chat.changed"),
|
|
21022
|
+
workspaceId: z33.string(),
|
|
21023
|
+
chatId: z33.string(),
|
|
21024
|
+
ts: z33.string()
|
|
20932
21025
|
}),
|
|
20933
|
-
|
|
20934
|
-
type:
|
|
20935
|
-
workspaceId:
|
|
20936
|
-
chatId:
|
|
20937
|
-
afterCursor:
|
|
20938
|
-
processing:
|
|
20939
|
-
ts:
|
|
21026
|
+
z33.object({
|
|
21027
|
+
type: z33.literal("workspace.chat.advanced"),
|
|
21028
|
+
workspaceId: z33.string(),
|
|
21029
|
+
chatId: z33.string(),
|
|
21030
|
+
afterCursor: z33.string().optional(),
|
|
21031
|
+
processing: z33.boolean(),
|
|
21032
|
+
ts: z33.string()
|
|
20940
21033
|
}),
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
type:
|
|
20944
|
-
workspaceId:
|
|
20945
|
-
ts:
|
|
21034
|
+
z33.object({ type: z33.literal("presence.changed"), ts: z33.string() }),
|
|
21035
|
+
z33.object({
|
|
21036
|
+
type: z33.literal("mobile-testing.changed"),
|
|
21037
|
+
workspaceId: z33.string(),
|
|
21038
|
+
ts: z33.string()
|
|
20946
21039
|
}),
|
|
20947
|
-
|
|
20948
|
-
type:
|
|
20949
|
-
workspaceId:
|
|
20950
|
-
ts:
|
|
21040
|
+
z33.object({
|
|
21041
|
+
type: z33.literal("variable-request.changed"),
|
|
21042
|
+
workspaceId: z33.string(),
|
|
21043
|
+
ts: z33.string()
|
|
20951
21044
|
}),
|
|
20952
|
-
|
|
20953
|
-
type:
|
|
20954
|
-
prUrl:
|
|
20955
|
-
ts:
|
|
21045
|
+
z33.object({
|
|
21046
|
+
type: z33.literal("pull-request.changed"),
|
|
21047
|
+
prUrl: z33.string(),
|
|
21048
|
+
ts: z33.string()
|
|
20956
21049
|
}),
|
|
20957
|
-
|
|
20958
|
-
type:
|
|
20959
|
-
workspaceId:
|
|
20960
|
-
subagent:
|
|
20961
|
-
ts:
|
|
21050
|
+
z33.object({
|
|
21051
|
+
type: z33.literal("mothership.subagent.changed"),
|
|
21052
|
+
workspaceId: z33.string(),
|
|
21053
|
+
subagent: z33.object({ id: z33.string(), name: z33.string(), prUrl: z33.string().nullable() }),
|
|
21054
|
+
ts: z33.string()
|
|
20962
21055
|
}),
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
type:
|
|
20966
|
-
workspaceId:
|
|
20967
|
-
workspaceName:
|
|
20968
|
-
sharedWithUserId:
|
|
20969
|
-
sharedByName:
|
|
20970
|
-
ts:
|
|
21056
|
+
z33.object({ type: z33.literal("needs-you.changed"), workspaceId: z33.string().nullable(), ts: z33.string() }),
|
|
21057
|
+
z33.object({
|
|
21058
|
+
type: z33.literal("workspace.shared"),
|
|
21059
|
+
workspaceId: z33.string(),
|
|
21060
|
+
workspaceName: z33.string(),
|
|
21061
|
+
sharedWithUserId: z33.string(),
|
|
21062
|
+
sharedByName: z33.string(),
|
|
21063
|
+
ts: z33.string()
|
|
20971
21064
|
})
|
|
20972
21065
|
]);
|
|
20973
21066
|
|
|
20974
21067
|
// ../shared/src/routes/presence.ts
|
|
20975
|
-
import { z as
|
|
20976
|
-
var presenceStatusSchema =
|
|
20977
|
-
var presenceLocationSchema =
|
|
20978
|
-
workspaceId:
|
|
21068
|
+
import { z as z34 } from "zod";
|
|
21069
|
+
var presenceStatusSchema = z34.enum(["online", "typing"]);
|
|
21070
|
+
var presenceLocationSchema = z34.object({
|
|
21071
|
+
workspaceId: z34.string().optional()
|
|
20979
21072
|
});
|
|
20980
|
-
var presenceEntrySchema =
|
|
20981
|
-
userId:
|
|
21073
|
+
var presenceEntrySchema = z34.object({
|
|
21074
|
+
userId: z34.string(),
|
|
20982
21075
|
status: presenceStatusSchema,
|
|
20983
21076
|
location: presenceLocationSchema,
|
|
20984
|
-
ts:
|
|
21077
|
+
ts: z34.string()
|
|
20985
21078
|
});
|
|
20986
|
-
var updatePresenceRequestSchema =
|
|
21079
|
+
var updatePresenceRequestSchema = z34.object({
|
|
20987
21080
|
status: presenceStatusSchema,
|
|
20988
21081
|
location: presenceLocationSchema.optional()
|
|
20989
21082
|
});
|
|
20990
21083
|
|
|
20991
21084
|
// ../shared/src/routes/review-messages.ts
|
|
20992
|
-
import { z as
|
|
20993
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
21085
|
+
import { z as z35 } from "zod";
|
|
21086
|
+
var sendPullRequestReviewMessageRequestSchema = z35.object({
|
|
20994
21087
|
...sendChatMessageRequestSchema.pick({
|
|
20995
21088
|
message: true,
|
|
20996
21089
|
messageId: true,
|
|
@@ -21003,8 +21096,8 @@ var sendPullRequestReviewMessageRequestSchema = z34.object({
|
|
|
21003
21096
|
ultrafastMode: true
|
|
21004
21097
|
}).shape,
|
|
21005
21098
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
21006
|
-
newChat:
|
|
21007
|
-
provider:
|
|
21099
|
+
newChat: z35.boolean().optional(),
|
|
21100
|
+
provider: z35.enum(VALID_AGENT_PROVIDERS).optional()
|
|
21008
21101
|
});
|
|
21009
21102
|
|
|
21010
21103
|
// ../shared/src/audit-log.ts
|
|
@@ -21020,6 +21113,436 @@ var AUDIT_LOG_ACTIONS = Object.values(AUDIT_LOG_ACTION);
|
|
|
21020
21113
|
// ../shared/src/automations/cron/runs.ts
|
|
21021
21114
|
var import_cron_parser = __toESM(require_dist());
|
|
21022
21115
|
|
|
21116
|
+
// ../shared/src/automations/cron/draft.ts
|
|
21117
|
+
var SCHEDULE_MONTH_DAYS = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
21118
|
+
|
|
21119
|
+
// ../shared/src/automations/cron/timezones.ts
|
|
21120
|
+
var FALLBACK_TIMEZONES = [
|
|
21121
|
+
"UTC",
|
|
21122
|
+
"Africa/Abidjan",
|
|
21123
|
+
"Africa/Accra",
|
|
21124
|
+
"Africa/Addis_Ababa",
|
|
21125
|
+
"Africa/Algiers",
|
|
21126
|
+
"Africa/Asmera",
|
|
21127
|
+
"Africa/Bamako",
|
|
21128
|
+
"Africa/Bangui",
|
|
21129
|
+
"Africa/Banjul",
|
|
21130
|
+
"Africa/Bissau",
|
|
21131
|
+
"Africa/Blantyre",
|
|
21132
|
+
"Africa/Brazzaville",
|
|
21133
|
+
"Africa/Bujumbura",
|
|
21134
|
+
"Africa/Cairo",
|
|
21135
|
+
"Africa/Casablanca",
|
|
21136
|
+
"Africa/Ceuta",
|
|
21137
|
+
"Africa/Conakry",
|
|
21138
|
+
"Africa/Dakar",
|
|
21139
|
+
"Africa/Dar_es_Salaam",
|
|
21140
|
+
"Africa/Djibouti",
|
|
21141
|
+
"Africa/Douala",
|
|
21142
|
+
"Africa/El_Aaiun",
|
|
21143
|
+
"Africa/Freetown",
|
|
21144
|
+
"Africa/Gaborone",
|
|
21145
|
+
"Africa/Harare",
|
|
21146
|
+
"Africa/Johannesburg",
|
|
21147
|
+
"Africa/Juba",
|
|
21148
|
+
"Africa/Kampala",
|
|
21149
|
+
"Africa/Khartoum",
|
|
21150
|
+
"Africa/Kigali",
|
|
21151
|
+
"Africa/Kinshasa",
|
|
21152
|
+
"Africa/Lagos",
|
|
21153
|
+
"Africa/Libreville",
|
|
21154
|
+
"Africa/Lome",
|
|
21155
|
+
"Africa/Luanda",
|
|
21156
|
+
"Africa/Lubumbashi",
|
|
21157
|
+
"Africa/Lusaka",
|
|
21158
|
+
"Africa/Malabo",
|
|
21159
|
+
"Africa/Maputo",
|
|
21160
|
+
"Africa/Maseru",
|
|
21161
|
+
"Africa/Mbabane",
|
|
21162
|
+
"Africa/Mogadishu",
|
|
21163
|
+
"Africa/Monrovia",
|
|
21164
|
+
"Africa/Nairobi",
|
|
21165
|
+
"Africa/Ndjamena",
|
|
21166
|
+
"Africa/Niamey",
|
|
21167
|
+
"Africa/Nouakchott",
|
|
21168
|
+
"Africa/Ouagadougou",
|
|
21169
|
+
"Africa/Porto-Novo",
|
|
21170
|
+
"Africa/Sao_Tome",
|
|
21171
|
+
"Africa/Tripoli",
|
|
21172
|
+
"Africa/Tunis",
|
|
21173
|
+
"Africa/Windhoek",
|
|
21174
|
+
"America/Adak",
|
|
21175
|
+
"America/Anchorage",
|
|
21176
|
+
"America/Anguilla",
|
|
21177
|
+
"America/Antigua",
|
|
21178
|
+
"America/Araguaina",
|
|
21179
|
+
"America/Argentina/La_Rioja",
|
|
21180
|
+
"America/Argentina/Rio_Gallegos",
|
|
21181
|
+
"America/Argentina/Salta",
|
|
21182
|
+
"America/Argentina/San_Juan",
|
|
21183
|
+
"America/Argentina/San_Luis",
|
|
21184
|
+
"America/Argentina/Tucuman",
|
|
21185
|
+
"America/Argentina/Ushuaia",
|
|
21186
|
+
"America/Aruba",
|
|
21187
|
+
"America/Asuncion",
|
|
21188
|
+
"America/Bahia",
|
|
21189
|
+
"America/Bahia_Banderas",
|
|
21190
|
+
"America/Barbados",
|
|
21191
|
+
"America/Belem",
|
|
21192
|
+
"America/Belize",
|
|
21193
|
+
"America/Blanc-Sablon",
|
|
21194
|
+
"America/Boa_Vista",
|
|
21195
|
+
"America/Bogota",
|
|
21196
|
+
"America/Boise",
|
|
21197
|
+
"America/Buenos_Aires",
|
|
21198
|
+
"America/Cambridge_Bay",
|
|
21199
|
+
"America/Campo_Grande",
|
|
21200
|
+
"America/Cancun",
|
|
21201
|
+
"America/Caracas",
|
|
21202
|
+
"America/Catamarca",
|
|
21203
|
+
"America/Cayenne",
|
|
21204
|
+
"America/Cayman",
|
|
21205
|
+
"America/Chicago",
|
|
21206
|
+
"America/Chihuahua",
|
|
21207
|
+
"America/Ciudad_Juarez",
|
|
21208
|
+
"America/Coral_Harbour",
|
|
21209
|
+
"America/Cordoba",
|
|
21210
|
+
"America/Costa_Rica",
|
|
21211
|
+
"America/Coyhaique",
|
|
21212
|
+
"America/Creston",
|
|
21213
|
+
"America/Cuiaba",
|
|
21214
|
+
"America/Curacao",
|
|
21215
|
+
"America/Danmarkshavn",
|
|
21216
|
+
"America/Dawson",
|
|
21217
|
+
"America/Dawson_Creek",
|
|
21218
|
+
"America/Denver",
|
|
21219
|
+
"America/Detroit",
|
|
21220
|
+
"America/Dominica",
|
|
21221
|
+
"America/Edmonton",
|
|
21222
|
+
"America/Eirunepe",
|
|
21223
|
+
"America/El_Salvador",
|
|
21224
|
+
"America/Fort_Nelson",
|
|
21225
|
+
"America/Fortaleza",
|
|
21226
|
+
"America/Glace_Bay",
|
|
21227
|
+
"America/Godthab",
|
|
21228
|
+
"America/Goose_Bay",
|
|
21229
|
+
"America/Grand_Turk",
|
|
21230
|
+
"America/Grenada",
|
|
21231
|
+
"America/Guadeloupe",
|
|
21232
|
+
"America/Guatemala",
|
|
21233
|
+
"America/Guayaquil",
|
|
21234
|
+
"America/Guyana",
|
|
21235
|
+
"America/Halifax",
|
|
21236
|
+
"America/Havana",
|
|
21237
|
+
"America/Hermosillo",
|
|
21238
|
+
"America/Indiana/Knox",
|
|
21239
|
+
"America/Indiana/Marengo",
|
|
21240
|
+
"America/Indiana/Petersburg",
|
|
21241
|
+
"America/Indiana/Tell_City",
|
|
21242
|
+
"America/Indiana/Vevay",
|
|
21243
|
+
"America/Indiana/Vincennes",
|
|
21244
|
+
"America/Indiana/Winamac",
|
|
21245
|
+
"America/Indianapolis",
|
|
21246
|
+
"America/Inuvik",
|
|
21247
|
+
"America/Iqaluit",
|
|
21248
|
+
"America/Jamaica",
|
|
21249
|
+
"America/Jujuy",
|
|
21250
|
+
"America/Juneau",
|
|
21251
|
+
"America/Kentucky/Monticello",
|
|
21252
|
+
"America/Kralendijk",
|
|
21253
|
+
"America/La_Paz",
|
|
21254
|
+
"America/Lima",
|
|
21255
|
+
"America/Los_Angeles",
|
|
21256
|
+
"America/Louisville",
|
|
21257
|
+
"America/Lower_Princes",
|
|
21258
|
+
"America/Maceio",
|
|
21259
|
+
"America/Managua",
|
|
21260
|
+
"America/Manaus",
|
|
21261
|
+
"America/Marigot",
|
|
21262
|
+
"America/Martinique",
|
|
21263
|
+
"America/Matamoros",
|
|
21264
|
+
"America/Mazatlan",
|
|
21265
|
+
"America/Mendoza",
|
|
21266
|
+
"America/Menominee",
|
|
21267
|
+
"America/Merida",
|
|
21268
|
+
"America/Metlakatla",
|
|
21269
|
+
"America/Mexico_City",
|
|
21270
|
+
"America/Miquelon",
|
|
21271
|
+
"America/Moncton",
|
|
21272
|
+
"America/Monterrey",
|
|
21273
|
+
"America/Montevideo",
|
|
21274
|
+
"America/Montserrat",
|
|
21275
|
+
"America/Nassau",
|
|
21276
|
+
"America/New_York",
|
|
21277
|
+
"America/Nome",
|
|
21278
|
+
"America/Noronha",
|
|
21279
|
+
"America/North_Dakota/Beulah",
|
|
21280
|
+
"America/North_Dakota/Center",
|
|
21281
|
+
"America/North_Dakota/New_Salem",
|
|
21282
|
+
"America/Ojinaga",
|
|
21283
|
+
"America/Panama",
|
|
21284
|
+
"America/Paramaribo",
|
|
21285
|
+
"America/Phoenix",
|
|
21286
|
+
"America/Port-au-Prince",
|
|
21287
|
+
"America/Port_of_Spain",
|
|
21288
|
+
"America/Porto_Velho",
|
|
21289
|
+
"America/Puerto_Rico",
|
|
21290
|
+
"America/Punta_Arenas",
|
|
21291
|
+
"America/Rankin_Inlet",
|
|
21292
|
+
"America/Recife",
|
|
21293
|
+
"America/Regina",
|
|
21294
|
+
"America/Resolute",
|
|
21295
|
+
"America/Rio_Branco",
|
|
21296
|
+
"America/Santarem",
|
|
21297
|
+
"America/Santiago",
|
|
21298
|
+
"America/Santo_Domingo",
|
|
21299
|
+
"America/Sao_Paulo",
|
|
21300
|
+
"America/Scoresbysund",
|
|
21301
|
+
"America/Sitka",
|
|
21302
|
+
"America/St_Barthelemy",
|
|
21303
|
+
"America/St_Johns",
|
|
21304
|
+
"America/St_Kitts",
|
|
21305
|
+
"America/St_Lucia",
|
|
21306
|
+
"America/St_Thomas",
|
|
21307
|
+
"America/St_Vincent",
|
|
21308
|
+
"America/Swift_Current",
|
|
21309
|
+
"America/Tegucigalpa",
|
|
21310
|
+
"America/Thule",
|
|
21311
|
+
"America/Tijuana",
|
|
21312
|
+
"America/Toronto",
|
|
21313
|
+
"America/Tortola",
|
|
21314
|
+
"America/Vancouver",
|
|
21315
|
+
"America/Whitehorse",
|
|
21316
|
+
"America/Winnipeg",
|
|
21317
|
+
"America/Yakutat",
|
|
21318
|
+
"Antarctica/Casey",
|
|
21319
|
+
"Antarctica/Davis",
|
|
21320
|
+
"Antarctica/DumontDUrville",
|
|
21321
|
+
"Antarctica/Macquarie",
|
|
21322
|
+
"Antarctica/Mawson",
|
|
21323
|
+
"Antarctica/McMurdo",
|
|
21324
|
+
"Antarctica/Palmer",
|
|
21325
|
+
"Antarctica/Rothera",
|
|
21326
|
+
"Antarctica/Syowa",
|
|
21327
|
+
"Antarctica/Troll",
|
|
21328
|
+
"Antarctica/Vostok",
|
|
21329
|
+
"Arctic/Longyearbyen",
|
|
21330
|
+
"Asia/Aden",
|
|
21331
|
+
"Asia/Almaty",
|
|
21332
|
+
"Asia/Amman",
|
|
21333
|
+
"Asia/Anadyr",
|
|
21334
|
+
"Asia/Aqtau",
|
|
21335
|
+
"Asia/Aqtobe",
|
|
21336
|
+
"Asia/Ashgabat",
|
|
21337
|
+
"Asia/Atyrau",
|
|
21338
|
+
"Asia/Baghdad",
|
|
21339
|
+
"Asia/Bahrain",
|
|
21340
|
+
"Asia/Baku",
|
|
21341
|
+
"Asia/Bangkok",
|
|
21342
|
+
"Asia/Barnaul",
|
|
21343
|
+
"Asia/Beirut",
|
|
21344
|
+
"Asia/Bishkek",
|
|
21345
|
+
"Asia/Brunei",
|
|
21346
|
+
"Asia/Calcutta",
|
|
21347
|
+
"Asia/Chita",
|
|
21348
|
+
"Asia/Colombo",
|
|
21349
|
+
"Asia/Damascus",
|
|
21350
|
+
"Asia/Dhaka",
|
|
21351
|
+
"Asia/Dili",
|
|
21352
|
+
"Asia/Dubai",
|
|
21353
|
+
"Asia/Dushanbe",
|
|
21354
|
+
"Asia/Famagusta",
|
|
21355
|
+
"Asia/Gaza",
|
|
21356
|
+
"Asia/Hebron",
|
|
21357
|
+
"Asia/Hong_Kong",
|
|
21358
|
+
"Asia/Hovd",
|
|
21359
|
+
"Asia/Irkutsk",
|
|
21360
|
+
"Asia/Jakarta",
|
|
21361
|
+
"Asia/Jayapura",
|
|
21362
|
+
"Asia/Jerusalem",
|
|
21363
|
+
"Asia/Kabul",
|
|
21364
|
+
"Asia/Kamchatka",
|
|
21365
|
+
"Asia/Karachi",
|
|
21366
|
+
"Asia/Katmandu",
|
|
21367
|
+
"Asia/Khandyga",
|
|
21368
|
+
"Asia/Krasnoyarsk",
|
|
21369
|
+
"Asia/Kuala_Lumpur",
|
|
21370
|
+
"Asia/Kuching",
|
|
21371
|
+
"Asia/Kuwait",
|
|
21372
|
+
"Asia/Macau",
|
|
21373
|
+
"Asia/Magadan",
|
|
21374
|
+
"Asia/Makassar",
|
|
21375
|
+
"Asia/Manila",
|
|
21376
|
+
"Asia/Muscat",
|
|
21377
|
+
"Asia/Nicosia",
|
|
21378
|
+
"Asia/Novokuznetsk",
|
|
21379
|
+
"Asia/Novosibirsk",
|
|
21380
|
+
"Asia/Omsk",
|
|
21381
|
+
"Asia/Oral",
|
|
21382
|
+
"Asia/Phnom_Penh",
|
|
21383
|
+
"Asia/Pontianak",
|
|
21384
|
+
"Asia/Pyongyang",
|
|
21385
|
+
"Asia/Qatar",
|
|
21386
|
+
"Asia/Qostanay",
|
|
21387
|
+
"Asia/Qyzylorda",
|
|
21388
|
+
"Asia/Rangoon",
|
|
21389
|
+
"Asia/Riyadh",
|
|
21390
|
+
"Asia/Saigon",
|
|
21391
|
+
"Asia/Sakhalin",
|
|
21392
|
+
"Asia/Samarkand",
|
|
21393
|
+
"Asia/Seoul",
|
|
21394
|
+
"Asia/Shanghai",
|
|
21395
|
+
"Asia/Singapore",
|
|
21396
|
+
"Asia/Srednekolymsk",
|
|
21397
|
+
"Asia/Taipei",
|
|
21398
|
+
"Asia/Tashkent",
|
|
21399
|
+
"Asia/Tbilisi",
|
|
21400
|
+
"Asia/Tehran",
|
|
21401
|
+
"Asia/Thimphu",
|
|
21402
|
+
"Asia/Tokyo",
|
|
21403
|
+
"Asia/Tomsk",
|
|
21404
|
+
"Asia/Ulaanbaatar",
|
|
21405
|
+
"Asia/Urumqi",
|
|
21406
|
+
"Asia/Ust-Nera",
|
|
21407
|
+
"Asia/Vientiane",
|
|
21408
|
+
"Asia/Vladivostok",
|
|
21409
|
+
"Asia/Yakutsk",
|
|
21410
|
+
"Asia/Yekaterinburg",
|
|
21411
|
+
"Asia/Yerevan",
|
|
21412
|
+
"Atlantic/Azores",
|
|
21413
|
+
"Atlantic/Bermuda",
|
|
21414
|
+
"Atlantic/Canary",
|
|
21415
|
+
"Atlantic/Cape_Verde",
|
|
21416
|
+
"Atlantic/Faeroe",
|
|
21417
|
+
"Atlantic/Madeira",
|
|
21418
|
+
"Atlantic/Reykjavik",
|
|
21419
|
+
"Atlantic/South_Georgia",
|
|
21420
|
+
"Atlantic/St_Helena",
|
|
21421
|
+
"Atlantic/Stanley",
|
|
21422
|
+
"Australia/Adelaide",
|
|
21423
|
+
"Australia/Brisbane",
|
|
21424
|
+
"Australia/Broken_Hill",
|
|
21425
|
+
"Australia/Darwin",
|
|
21426
|
+
"Australia/Eucla",
|
|
21427
|
+
"Australia/Hobart",
|
|
21428
|
+
"Australia/Lindeman",
|
|
21429
|
+
"Australia/Lord_Howe",
|
|
21430
|
+
"Australia/Melbourne",
|
|
21431
|
+
"Australia/Perth",
|
|
21432
|
+
"Australia/Sydney",
|
|
21433
|
+
"Europe/Amsterdam",
|
|
21434
|
+
"Europe/Andorra",
|
|
21435
|
+
"Europe/Astrakhan",
|
|
21436
|
+
"Europe/Athens",
|
|
21437
|
+
"Europe/Belgrade",
|
|
21438
|
+
"Europe/Berlin",
|
|
21439
|
+
"Europe/Bratislava",
|
|
21440
|
+
"Europe/Brussels",
|
|
21441
|
+
"Europe/Bucharest",
|
|
21442
|
+
"Europe/Budapest",
|
|
21443
|
+
"Europe/Busingen",
|
|
21444
|
+
"Europe/Chisinau",
|
|
21445
|
+
"Europe/Copenhagen",
|
|
21446
|
+
"Europe/Dublin",
|
|
21447
|
+
"Europe/Gibraltar",
|
|
21448
|
+
"Europe/Guernsey",
|
|
21449
|
+
"Europe/Helsinki",
|
|
21450
|
+
"Europe/Isle_of_Man",
|
|
21451
|
+
"Europe/Istanbul",
|
|
21452
|
+
"Europe/Jersey",
|
|
21453
|
+
"Europe/Kaliningrad",
|
|
21454
|
+
"Europe/Kiev",
|
|
21455
|
+
"Europe/Kirov",
|
|
21456
|
+
"Europe/Lisbon",
|
|
21457
|
+
"Europe/Ljubljana",
|
|
21458
|
+
"Europe/London",
|
|
21459
|
+
"Europe/Luxembourg",
|
|
21460
|
+
"Europe/Madrid",
|
|
21461
|
+
"Europe/Malta",
|
|
21462
|
+
"Europe/Mariehamn",
|
|
21463
|
+
"Europe/Minsk",
|
|
21464
|
+
"Europe/Monaco",
|
|
21465
|
+
"Europe/Moscow",
|
|
21466
|
+
"Europe/Oslo",
|
|
21467
|
+
"Europe/Paris",
|
|
21468
|
+
"Europe/Podgorica",
|
|
21469
|
+
"Europe/Prague",
|
|
21470
|
+
"Europe/Riga",
|
|
21471
|
+
"Europe/Rome",
|
|
21472
|
+
"Europe/Samara",
|
|
21473
|
+
"Europe/San_Marino",
|
|
21474
|
+
"Europe/Sarajevo",
|
|
21475
|
+
"Europe/Saratov",
|
|
21476
|
+
"Europe/Simferopol",
|
|
21477
|
+
"Europe/Skopje",
|
|
21478
|
+
"Europe/Sofia",
|
|
21479
|
+
"Europe/Stockholm",
|
|
21480
|
+
"Europe/Tallinn",
|
|
21481
|
+
"Europe/Tirane",
|
|
21482
|
+
"Europe/Ulyanovsk",
|
|
21483
|
+
"Europe/Vaduz",
|
|
21484
|
+
"Europe/Vatican",
|
|
21485
|
+
"Europe/Vienna",
|
|
21486
|
+
"Europe/Vilnius",
|
|
21487
|
+
"Europe/Volgograd",
|
|
21488
|
+
"Europe/Warsaw",
|
|
21489
|
+
"Europe/Zagreb",
|
|
21490
|
+
"Europe/Zurich",
|
|
21491
|
+
"Indian/Antananarivo",
|
|
21492
|
+
"Indian/Chagos",
|
|
21493
|
+
"Indian/Christmas",
|
|
21494
|
+
"Indian/Cocos",
|
|
21495
|
+
"Indian/Comoro",
|
|
21496
|
+
"Indian/Kerguelen",
|
|
21497
|
+
"Indian/Mahe",
|
|
21498
|
+
"Indian/Maldives",
|
|
21499
|
+
"Indian/Mauritius",
|
|
21500
|
+
"Indian/Mayotte",
|
|
21501
|
+
"Indian/Reunion",
|
|
21502
|
+
"Pacific/Apia",
|
|
21503
|
+
"Pacific/Auckland",
|
|
21504
|
+
"Pacific/Bougainville",
|
|
21505
|
+
"Pacific/Chatham",
|
|
21506
|
+
"Pacific/Easter",
|
|
21507
|
+
"Pacific/Efate",
|
|
21508
|
+
"Pacific/Enderbury",
|
|
21509
|
+
"Pacific/Fakaofo",
|
|
21510
|
+
"Pacific/Fiji",
|
|
21511
|
+
"Pacific/Funafuti",
|
|
21512
|
+
"Pacific/Galapagos",
|
|
21513
|
+
"Pacific/Gambier",
|
|
21514
|
+
"Pacific/Guadalcanal",
|
|
21515
|
+
"Pacific/Guam",
|
|
21516
|
+
"Pacific/Honolulu",
|
|
21517
|
+
"Pacific/Kiritimati",
|
|
21518
|
+
"Pacific/Kosrae",
|
|
21519
|
+
"Pacific/Kwajalein",
|
|
21520
|
+
"Pacific/Majuro",
|
|
21521
|
+
"Pacific/Marquesas",
|
|
21522
|
+
"Pacific/Midway",
|
|
21523
|
+
"Pacific/Nauru",
|
|
21524
|
+
"Pacific/Niue",
|
|
21525
|
+
"Pacific/Norfolk",
|
|
21526
|
+
"Pacific/Noumea",
|
|
21527
|
+
"Pacific/Pago_Pago",
|
|
21528
|
+
"Pacific/Palau",
|
|
21529
|
+
"Pacific/Pitcairn",
|
|
21530
|
+
"Pacific/Ponape",
|
|
21531
|
+
"Pacific/Port_Moresby",
|
|
21532
|
+
"Pacific/Rarotonga",
|
|
21533
|
+
"Pacific/Saipan",
|
|
21534
|
+
"Pacific/Tahiti",
|
|
21535
|
+
"Pacific/Tarawa",
|
|
21536
|
+
"Pacific/Tongatapu",
|
|
21537
|
+
"Pacific/Truk",
|
|
21538
|
+
"Pacific/Wake",
|
|
21539
|
+
"Pacific/Wallis"
|
|
21540
|
+
];
|
|
21541
|
+
var SCHEDULE_TIMEZONES = typeof Intl.supportedValuesOf === "function" ? ["UTC", ...Intl.supportedValuesOf("timeZone")] : FALLBACK_TIMEZONES;
|
|
21542
|
+
|
|
21543
|
+
// ../shared/src/automations/form.ts
|
|
21544
|
+
var AUTOMATION_AUTO_STOP_RANGE_LABEL = `${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MIN}-${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MAX}`;
|
|
21545
|
+
|
|
21023
21546
|
// ../shared/src/routes/repo-files.ts
|
|
21024
21547
|
var MAX_REPO_FILE_CONTENT_BYTES = 256 * 1024;
|
|
21025
21548
|
function searchRepoFileIndex(repos, params, multiRepo) {
|
|
@@ -21081,6 +21604,9 @@ var WEBHOOK_PROVIDER_SET = new Set(WEBHOOK_PROVIDERS);
|
|
|
21081
21604
|
var ENVIRONMENT_HOOK_RUN_LOG_LIMIT = 5 * 1024 * 1024;
|
|
21082
21605
|
var ENVIRONMENT_HOOK_RUN_TAIL_LIMIT = 8 * 1024;
|
|
21083
21606
|
|
|
21607
|
+
// ../shared/src/workspace-alerts.ts
|
|
21608
|
+
var MOTHERSHIP_RELAY_WINDOW_MS = 5 * 6e4;
|
|
21609
|
+
|
|
21084
21610
|
// ../shared/src/workspace-sidebar-state.ts
|
|
21085
21611
|
var WORKSPACE_SOURCE_LABELS = {
|
|
21086
21612
|
slack: "Slack",
|
|
@@ -21091,6 +21617,15 @@ var WORKSPACE_SOURCE_LABELS = {
|
|
|
21091
21617
|
api: "the API",
|
|
21092
21618
|
[SCOUT_SOURCE]: "Scout"
|
|
21093
21619
|
};
|
|
21620
|
+
var WORKSPACE_SOURCE_ICONS = {
|
|
21621
|
+
slack: "slack",
|
|
21622
|
+
linear: "linear",
|
|
21623
|
+
github: "github",
|
|
21624
|
+
gitlab: "gitlab",
|
|
21625
|
+
automation: "zap",
|
|
21626
|
+
api: "key",
|
|
21627
|
+
[SCOUT_SOURCE]: "binoculars"
|
|
21628
|
+
};
|
|
21094
21629
|
var FIRST_BOOT_GRACE_MS = 15 * 6e4;
|
|
21095
21630
|
var SLOW_ENGINE_GRACE_MS = 10 * 6e4;
|
|
21096
21631
|
var WORKSPACE_STAGE_LABELS = {
|
|
@@ -21225,30 +21760,30 @@ function isSkillRegistryManifest(value) {
|
|
|
21225
21760
|
}
|
|
21226
21761
|
|
|
21227
21762
|
// ../shared/src/routes/variable-requests.ts
|
|
21228
|
-
import { z as
|
|
21763
|
+
import { z as z36 } from "zod";
|
|
21229
21764
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
21230
21765
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
21231
|
-
var requestedVariableSchema =
|
|
21232
|
-
key:
|
|
21233
|
-
required:
|
|
21234
|
-
replace:
|
|
21766
|
+
var requestedVariableSchema = z36.object({
|
|
21767
|
+
key: z36.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
21768
|
+
required: z36.boolean(),
|
|
21769
|
+
replace: z36.boolean().optional()
|
|
21235
21770
|
});
|
|
21236
|
-
var requestedVariablesSchema =
|
|
21237
|
-
var createVariableRequestSchema =
|
|
21771
|
+
var requestedVariablesSchema = z36.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");
|
|
21772
|
+
var createVariableRequestSchema = z36.object({
|
|
21238
21773
|
variables: requestedVariablesSchema,
|
|
21239
|
-
reason:
|
|
21240
|
-
wait:
|
|
21774
|
+
reason: z36.string().trim().max(500).nullish().transform((value) => value || null),
|
|
21775
|
+
wait: z36.boolean().default(true)
|
|
21241
21776
|
});
|
|
21242
|
-
var respondVariableRequestSchema =
|
|
21243
|
-
|
|
21244
|
-
action:
|
|
21245
|
-
destination:
|
|
21777
|
+
var respondVariableRequestSchema = z36.discriminatedUnion("action", [
|
|
21778
|
+
z36.object({
|
|
21779
|
+
action: z36.literal("provide"),
|
|
21780
|
+
destination: z36.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
21246
21781
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
21247
|
-
environment_ids:
|
|
21248
|
-
overwrite:
|
|
21249
|
-
values:
|
|
21782
|
+
environment_ids: z36.array(z36.string().uuid()).optional(),
|
|
21783
|
+
overwrite: z36.boolean().optional(),
|
|
21784
|
+
values: z36.record(z36.string().regex(VARIABLE_KEY_RE), z36.string())
|
|
21250
21785
|
}),
|
|
21251
|
-
|
|
21786
|
+
z36.object({ action: z36.literal("skip") })
|
|
21252
21787
|
]);
|
|
21253
21788
|
|
|
21254
21789
|
export {
|
|
@@ -21269,8 +21804,6 @@ export {
|
|
|
21269
21804
|
isValidThinkingLevel,
|
|
21270
21805
|
codexReasoningEffortForThinkingLevel,
|
|
21271
21806
|
getProviderDisplayName,
|
|
21272
|
-
exhaustedUntil,
|
|
21273
|
-
detectAgentQuotaLimit,
|
|
21274
21807
|
listOpenAICompatibleModels,
|
|
21275
21808
|
resolveOpenAICompatibleModelsUrl,
|
|
21276
21809
|
openAICompatibleAuthEnvKeys,
|
|
@@ -21285,7 +21818,6 @@ export {
|
|
|
21285
21818
|
CREDENTIAL_METHOD,
|
|
21286
21819
|
detectEnvironmentAuthMethod,
|
|
21287
21820
|
AGENT_CREDENTIAL_METHODS_IN_ORDER,
|
|
21288
|
-
describeCredential,
|
|
21289
21821
|
SANDBOX_SKILL_DIRS,
|
|
21290
21822
|
AUTO_SIZE_RULES,
|
|
21291
21823
|
needsMoreMemory,
|
|
@@ -21299,6 +21831,18 @@ export {
|
|
|
21299
21831
|
isTokenUsageCounts,
|
|
21300
21832
|
isTokenUsageUploadRecord,
|
|
21301
21833
|
workspaceCredentialProviderSchema,
|
|
21834
|
+
isGitHubUrl,
|
|
21835
|
+
DEFAULT_WEB_APP_URL,
|
|
21836
|
+
WEB_APP_PATHS,
|
|
21837
|
+
parseCodeHostPrUrl,
|
|
21838
|
+
decodePathSegments,
|
|
21839
|
+
buildCodeHostPrUrl,
|
|
21840
|
+
SUBAGENT_SERVICE_TIERS,
|
|
21841
|
+
serviceTierRequestFields,
|
|
21842
|
+
TERMINAL_RTC_ICE_SERVER,
|
|
21843
|
+
exhaustedUntil,
|
|
21844
|
+
detectAgentQuotaLimit,
|
|
21845
|
+
describeCredential,
|
|
21302
21846
|
fallbackPlanResponseSchema,
|
|
21303
21847
|
ASTER_PROVIDER,
|
|
21304
21848
|
ASTER_BASE_URL,
|
|
@@ -21312,12 +21856,6 @@ export {
|
|
|
21312
21856
|
isOpenCodeZenModel,
|
|
21313
21857
|
fetchOpenCodeGoCatalog,
|
|
21314
21858
|
getChatKind,
|
|
21315
|
-
isGitHubUrl,
|
|
21316
|
-
DEFAULT_WEB_APP_URL,
|
|
21317
|
-
WEB_APP_PATHS,
|
|
21318
|
-
parseCodeHostPrUrl,
|
|
21319
|
-
decodePathSegments,
|
|
21320
|
-
buildCodeHostPrUrl,
|
|
21321
21859
|
detectLanguageByPath,
|
|
21322
21860
|
isDefaultChat,
|
|
21323
21861
|
hasGeneratedChatTitle,
|
|
@@ -21428,9 +21966,6 @@ export {
|
|
|
21428
21966
|
engineMcpOAuthTokenResponseSchema,
|
|
21429
21967
|
DEVICE_HOST_KEYS_HEADER,
|
|
21430
21968
|
provisionedDeviceSchema,
|
|
21431
|
-
SUBAGENT_SERVICE_TIERS,
|
|
21432
|
-
serviceTierRequestFields,
|
|
21433
|
-
TERMINAL_RTC_ICE_SERVER,
|
|
21434
21969
|
REPLICAS_MCP_SERVER_NAME,
|
|
21435
21970
|
REPLICAS_MCP_TOOLS,
|
|
21436
21971
|
REPLICAS_RUNTIME_ENV_ALIASES,
|