replicas-engine 0.1.1571 → 0.1.1573
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-M2TEF4CT.js → asp-host-BFWHEKH2.js} +5 -5
- package/dist/src/{chunk-FA46DI77.js → chunk-7GDMOVQD.js} +1 -1
- package/dist/src/{chunk-W6B5O2RE.js → chunk-AXMFMS57.js} +2 -2
- package/dist/src/{chunk-OM4YYRJM.js → chunk-B2YPDZ5K.js} +6 -6
- package/dist/src/{chunk-XBAFU7YE.js → chunk-FX2FEVNU.js} +767 -751
- package/dist/src/{chunk-N5G6OKOC.js → chunk-GO6JDTLJ.js} +2 -2
- package/dist/src/{chunk-YS7OSAJO.js → chunk-LTY2N65C.js} +1 -1
- package/dist/src/{chunk-WSPZ6P4J.js → chunk-NPZY67IB.js} +2 -2
- package/dist/src/{chunk-V2HEROPN.js → chunk-RK3YQVHG.js} +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +9 -8
- 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 z39 = 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
|
+
z39 = offsetZ;
|
|
1127
1127
|
this.dt = dt;
|
|
1128
1128
|
} else {
|
|
1129
|
-
|
|
1129
|
+
z39 = "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
|
+
z39 = dt.zone.name;
|
|
1140
1140
|
} else {
|
|
1141
|
-
|
|
1141
|
+
z39 = "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 || z39;
|
|
1151
1151
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1152
1152
|
}
|
|
1153
1153
|
format() {
|
|
@@ -9304,7 +9304,7 @@ function getProviderDisplayName(provider2, variant = "short") {
|
|
|
9304
9304
|
}
|
|
9305
9305
|
|
|
9306
9306
|
// ../shared/src/routes/mothership.ts
|
|
9307
|
-
import { z as
|
|
9307
|
+
import { z as z4 } from "zod";
|
|
9308
9308
|
|
|
9309
9309
|
// ../shared/src/routes/pull-requests.ts
|
|
9310
9310
|
import { z } from "zod";
|
|
@@ -9466,32 +9466,78 @@ var mergePullRequestRequestSchema = z.object({
|
|
|
9466
9466
|
bypassRules: z.boolean().optional()
|
|
9467
9467
|
});
|
|
9468
9468
|
|
|
9469
|
+
// ../shared/src/automations/linear/index.ts
|
|
9470
|
+
import { z as z3 } from "zod";
|
|
9471
|
+
|
|
9472
|
+
// ../shared/src/routes/linear.ts
|
|
9473
|
+
import { z as z2 } from "zod";
|
|
9474
|
+
var linearSessionMetadataSchema = z2.object({
|
|
9475
|
+
via_mothership: z2.boolean().optional(),
|
|
9476
|
+
attached: z2.boolean().optional(),
|
|
9477
|
+
routing_chat_id: z2.string().optional(),
|
|
9478
|
+
issue_id: z2.string(),
|
|
9479
|
+
issue_identifier: z2.string(),
|
|
9480
|
+
issue_title: z2.string(),
|
|
9481
|
+
issue_description: z2.string(),
|
|
9482
|
+
issue_url: z2.string(),
|
|
9483
|
+
comment_id: z2.string(),
|
|
9484
|
+
comment_body: z2.string(),
|
|
9485
|
+
triggered_by_id: z2.string().optional(),
|
|
9486
|
+
triggered_by_name: z2.string().optional(),
|
|
9487
|
+
triggered_by_email: z2.string().optional(),
|
|
9488
|
+
linear_workspace_id: z2.string().optional(),
|
|
9489
|
+
creator_id: z2.string().optional(),
|
|
9490
|
+
creator_name: z2.string().optional(),
|
|
9491
|
+
creator_email: z2.string().optional(),
|
|
9492
|
+
assignee_id: z2.string().optional(),
|
|
9493
|
+
assignee_name: z2.string().optional(),
|
|
9494
|
+
assignee_email: z2.string().optional(),
|
|
9495
|
+
issue_state: z2.string().optional(),
|
|
9496
|
+
parent_issue: z2.object({
|
|
9497
|
+
id: z2.string(),
|
|
9498
|
+
identifier: z2.string(),
|
|
9499
|
+
title: z2.string(),
|
|
9500
|
+
description: z2.string().nullable()
|
|
9501
|
+
}).optional(),
|
|
9502
|
+
workspace: z2.object({
|
|
9503
|
+
id: z2.string(),
|
|
9504
|
+
coding_agent: z2.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
9505
|
+
task_description: z2.string(),
|
|
9506
|
+
created_at: z2.string()
|
|
9507
|
+
}).optional()
|
|
9508
|
+
});
|
|
9509
|
+
var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
|
|
9510
|
+
|
|
9511
|
+
// ../shared/src/automations/linear/index.ts
|
|
9512
|
+
var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
|
|
9513
|
+
var LINEAR_ISSUE_MATCHED_EVENT = "issue.matched";
|
|
9514
|
+
var linearIssueFiltersSchema = z3.object({
|
|
9515
|
+
current_cycle: z3.boolean().optional(),
|
|
9516
|
+
label_ids: z3.array(z3.string().min(1)).min(1).optional(),
|
|
9517
|
+
project_id: z3.string().min(1).optional(),
|
|
9518
|
+
assignee_id: z3.string().min(1).optional()
|
|
9519
|
+
});
|
|
9520
|
+
var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
|
|
9521
|
+
|
|
9469
9522
|
// ../shared/src/routes/mothership.ts
|
|
9470
|
-
var linearRuleFields =
|
|
9471
|
-
team_id: z2.string().min(1),
|
|
9472
|
-
current_cycle: z2.boolean().optional(),
|
|
9473
|
-
label_ids: z2.array(z2.string().min(1)).min(1).optional(),
|
|
9474
|
-
project_id: z2.string().min(1).optional(),
|
|
9475
|
-
assignee_id: z2.string().min(1).optional()
|
|
9476
|
-
}).strict();
|
|
9523
|
+
var linearRuleFields = linearIssueFiltersSchema.extend({ team_id: z4.string().min(1) }).strict();
|
|
9477
9524
|
var withLabelIds = (value) => {
|
|
9478
9525
|
if (!isRecord(value) || typeof value.label_id !== "string") return value;
|
|
9479
9526
|
const { label_id, ...rest } = value;
|
|
9480
9527
|
return { ...rest, label_ids: [label_id] };
|
|
9481
9528
|
};
|
|
9482
|
-
var mothershipLinearRuleSchema =
|
|
9483
|
-
var storedMothershipLinearRuleSchema = z2.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: z2.string() }));
|
|
9529
|
+
var mothershipLinearRuleSchema = z4.preprocess(withLabelIds, linearRuleFields);
|
|
9484
9530
|
var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
|
|
9485
9531
|
function serviceTierRequestFields(tier) {
|
|
9486
9532
|
return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
|
|
9487
9533
|
}
|
|
9488
|
-
var mothershipSubagentSettingsSchema =
|
|
9489
|
-
coding_agent:
|
|
9490
|
-
model:
|
|
9491
|
-
thinking_level:
|
|
9492
|
-
service_tier:
|
|
9493
|
-
goal_mode:
|
|
9494
|
-
plan_mode:
|
|
9534
|
+
var mothershipSubagentSettingsSchema = z4.object({
|
|
9535
|
+
coding_agent: z4.enum(VALID_AGENT_PROVIDERS),
|
|
9536
|
+
model: z4.string().nullable(),
|
|
9537
|
+
thinking_level: z4.enum(VALID_THINKING_LEVELS).nullable(),
|
|
9538
|
+
service_tier: z4.enum(SUBAGENT_SERVICE_TIERS),
|
|
9539
|
+
goal_mode: z4.boolean(),
|
|
9540
|
+
plan_mode: z4.boolean()
|
|
9495
9541
|
});
|
|
9496
9542
|
var QUEUE_SECTIONS = [
|
|
9497
9543
|
{ label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
|
|
@@ -9502,22 +9548,22 @@ var MOTHERSHIP_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups
|
|
|
9502
9548
|
var MOTHERSHIP_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
|
|
9503
9549
|
|
|
9504
9550
|
// ../shared/src/models-dev.ts
|
|
9505
|
-
import { z as
|
|
9551
|
+
import { z as z5 } from "zod";
|
|
9506
9552
|
var MODELS_DEV_API_URL = "https://models.dev/api.json";
|
|
9507
9553
|
var MODELS_DEV_CACHE_MS = 5 * 6e4;
|
|
9508
9554
|
var MODELS_DEV_TIMEOUT_MS = 5e3;
|
|
9509
|
-
var modelsDevCatalogSchema =
|
|
9510
|
-
models:
|
|
9511
|
-
id:
|
|
9512
|
-
name:
|
|
9513
|
-
description:
|
|
9514
|
-
status:
|
|
9515
|
-
provider:
|
|
9516
|
-
cost:
|
|
9517
|
-
input:
|
|
9518
|
-
output:
|
|
9519
|
-
cache_read:
|
|
9520
|
-
cache_write:
|
|
9555
|
+
var modelsDevCatalogSchema = z5.record(z5.string(), z5.object({
|
|
9556
|
+
models: z5.record(z5.string(), z5.object({
|
|
9557
|
+
id: z5.string().optional(),
|
|
9558
|
+
name: z5.string(),
|
|
9559
|
+
description: z5.string().optional(),
|
|
9560
|
+
status: z5.enum(["alpha", "beta", "deprecated"]).optional(),
|
|
9561
|
+
provider: z5.object({ npm: z5.string().optional() }).optional(),
|
|
9562
|
+
cost: z5.object({
|
|
9563
|
+
input: z5.number().finite().nonnegative().optional(),
|
|
9564
|
+
output: z5.number().finite().nonnegative().optional(),
|
|
9565
|
+
cache_read: z5.number().finite().nonnegative().optional(),
|
|
9566
|
+
cache_write: z5.number().finite().nonnegative().optional()
|
|
9521
9567
|
}).optional()
|
|
9522
9568
|
}))
|
|
9523
9569
|
}));
|
|
@@ -9585,7 +9631,7 @@ function withCamelCaseKeys(body) {
|
|
|
9585
9631
|
}
|
|
9586
9632
|
|
|
9587
9633
|
// ../shared/src/engine/types.ts
|
|
9588
|
-
import { z as
|
|
9634
|
+
import { z as z7 } from "zod";
|
|
9589
9635
|
|
|
9590
9636
|
// ../shared/src/aster.ts
|
|
9591
9637
|
var ASTER_PROVIDER = "aster";
|
|
@@ -9616,40 +9662,40 @@ function getChatKind(chat) {
|
|
|
9616
9662
|
}
|
|
9617
9663
|
|
|
9618
9664
|
// ../shared/src/routes/reviews.ts
|
|
9619
|
-
import { z as
|
|
9665
|
+
import { z as z6 } from "zod";
|
|
9620
9666
|
var PULL_REQUEST_COMMENT_DESTINATIONS = ["comment", "review", "agent"];
|
|
9621
|
-
var diffSideSchema =
|
|
9622
|
-
var createPullRequestCommentRequestSchema =
|
|
9623
|
-
body:
|
|
9624
|
-
destination:
|
|
9625
|
-
quote:
|
|
9626
|
-
target:
|
|
9627
|
-
|
|
9628
|
-
path:
|
|
9629
|
-
line:
|
|
9667
|
+
var diffSideSchema = z6.enum(["additions", "deletions"]);
|
|
9668
|
+
var createPullRequestCommentRequestSchema = z6.object({
|
|
9669
|
+
body: z6.string().trim().min(1).max(65536),
|
|
9670
|
+
destination: z6.enum(PULL_REQUEST_COMMENT_DESTINATIONS),
|
|
9671
|
+
quote: z6.string().optional(),
|
|
9672
|
+
target: z6.union([
|
|
9673
|
+
z6.object({
|
|
9674
|
+
path: z6.string().min(1),
|
|
9675
|
+
line: z6.number().int().positive(),
|
|
9630
9676
|
side: diffSideSchema,
|
|
9631
|
-
startLine:
|
|
9677
|
+
startLine: z6.number().int().positive().optional(),
|
|
9632
9678
|
startSide: diffSideSchema.optional()
|
|
9633
9679
|
}),
|
|
9634
|
-
|
|
9680
|
+
z6.object({ replyTo: z6.string().min(1) })
|
|
9635
9681
|
])
|
|
9636
9682
|
});
|
|
9637
9683
|
var PULL_REQUEST_REVIEW_EVENTS = ["comment", "approve", "request_changes"];
|
|
9638
|
-
var submitPullRequestReviewRequestSchema =
|
|
9639
|
-
event:
|
|
9640
|
-
body:
|
|
9684
|
+
var submitPullRequestReviewRequestSchema = z6.object({
|
|
9685
|
+
event: z6.enum(PULL_REQUEST_REVIEW_EVENTS),
|
|
9686
|
+
body: z6.string().trim().max(65536).default("")
|
|
9641
9687
|
});
|
|
9642
|
-
var text =
|
|
9643
|
-
var optionalText =
|
|
9644
|
-
var pullRequestTourSchema =
|
|
9688
|
+
var text = z6.string().trim().catch("");
|
|
9689
|
+
var optionalText = z6.string().trim().min(1).optional().catch(void 0);
|
|
9690
|
+
var pullRequestTourSchema = z6.object({
|
|
9645
9691
|
/** The tour chat that wrote this file, so a rerun doesn't show the previous run's tour as in progress. */
|
|
9646
9692
|
runId: optionalText,
|
|
9647
9693
|
headSha: optionalText,
|
|
9648
|
-
status:
|
|
9694
|
+
status: z6.enum(["writing", "done"]).catch("writing"),
|
|
9649
9695
|
summary: text,
|
|
9650
9696
|
diagram: optionalText,
|
|
9651
|
-
files:
|
|
9652
|
-
skip:
|
|
9697
|
+
files: z6.array(z6.object({ path: text, explanation: text })).catch([]),
|
|
9698
|
+
skip: z6.array(z6.object({ path: text, note: text })).catch([])
|
|
9653
9699
|
});
|
|
9654
9700
|
|
|
9655
9701
|
// ../shared/src/languages.ts
|
|
@@ -10097,37 +10143,37 @@ var MODEL_LABELS = {
|
|
|
10097
10143
|
"kimi-k2.5": "Kimi K2.5"
|
|
10098
10144
|
};
|
|
10099
10145
|
var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
10100
|
-
var resourcePressure =
|
|
10101
|
-
var sandboxResourceMinuteSchema =
|
|
10102
|
-
minute:
|
|
10103
|
-
samples:
|
|
10104
|
-
cpuCount:
|
|
10105
|
-
memoryTotalMb:
|
|
10106
|
-
cpuBusyAvg:
|
|
10107
|
-
cpuBusyMax:
|
|
10108
|
-
memoryUsedAvgMb:
|
|
10109
|
-
memoryUsedMaxMb:
|
|
10110
|
-
memoryCacheAvgMb:
|
|
10111
|
-
memoryAvailableMinMb:
|
|
10146
|
+
var resourcePressure = z7.number().min(0).max(100).nullable();
|
|
10147
|
+
var sandboxResourceMinuteSchema = z7.object({
|
|
10148
|
+
minute: z7.iso.datetime(),
|
|
10149
|
+
samples: z7.number().int().min(1).max(255),
|
|
10150
|
+
cpuCount: z7.number().int().min(1),
|
|
10151
|
+
memoryTotalMb: z7.number().min(0),
|
|
10152
|
+
cpuBusyAvg: z7.number().min(0),
|
|
10153
|
+
cpuBusyMax: z7.number().min(0),
|
|
10154
|
+
memoryUsedAvgMb: z7.number().min(0),
|
|
10155
|
+
memoryUsedMaxMb: z7.number().min(0),
|
|
10156
|
+
memoryCacheAvgMb: z7.number().min(0),
|
|
10157
|
+
memoryAvailableMinMb: z7.number().min(0),
|
|
10112
10158
|
cpuPressureSomeMax: resourcePressure,
|
|
10113
10159
|
cpuPressureFullMax: resourcePressure,
|
|
10114
10160
|
memoryPressureSomeMax: resourcePressure,
|
|
10115
10161
|
memoryPressureFullMax: resourcePressure,
|
|
10116
10162
|
ioPressureSomeMax: resourcePressure,
|
|
10117
10163
|
ioPressureFullMax: resourcePressure,
|
|
10118
|
-
oomKills:
|
|
10164
|
+
oomKills: z7.number().int().min(0)
|
|
10119
10165
|
});
|
|
10120
10166
|
var MAX_PENDING_RESOURCE_MINUTES = 120;
|
|
10121
|
-
var sandboxResourceMinutesSchema =
|
|
10122
|
-
var sandboxMemorySampleSchema =
|
|
10123
|
-
at:
|
|
10124
|
-
memoryTotalMb:
|
|
10125
|
-
memoryUsedMb:
|
|
10167
|
+
var sandboxResourceMinutesSchema = z7.array(sandboxResourceMinuteSchema).max(MAX_PENDING_RESOURCE_MINUTES);
|
|
10168
|
+
var sandboxMemorySampleSchema = z7.object({
|
|
10169
|
+
at: z7.iso.datetime(),
|
|
10170
|
+
memoryTotalMb: z7.number().min(0),
|
|
10171
|
+
memoryUsedMb: z7.number().min(0),
|
|
10126
10172
|
memoryPressureSome: resourcePressure
|
|
10127
10173
|
});
|
|
10128
|
-
var engineUpdateProgressSchema =
|
|
10129
|
-
|
|
10130
|
-
|
|
10174
|
+
var engineUpdateProgressSchema = z7.discriminatedUnion("state", [
|
|
10175
|
+
z7.object({ state: z7.enum(["updating", "updated"]), from: z7.string(), to: z7.string() }),
|
|
10176
|
+
z7.object({ state: z7.literal("failed"), from: z7.string(), to: z7.string(), reason: z7.string() })
|
|
10131
10177
|
]);
|
|
10132
10178
|
var MAX_CANVAS_FILE_BYTES = 100 * 1024 * 1024;
|
|
10133
10179
|
var MAX_CANVAS_PREVIEW_BYTES = 5 * 1024 * 1024;
|
|
@@ -10261,7 +10307,7 @@ function detectAgentQuotaLimit(text4) {
|
|
|
10261
10307
|
}
|
|
10262
10308
|
|
|
10263
10309
|
// ../shared/src/analytics/types.ts
|
|
10264
|
-
import { z as
|
|
10310
|
+
import { z as z8 } from "zod";
|
|
10265
10311
|
|
|
10266
10312
|
// ../shared/src/external-api-host.ts
|
|
10267
10313
|
function validateExternalApiHost(url, providerLabel) {
|
|
@@ -10729,19 +10775,19 @@ function hasAgentChatActivityFields(value) {
|
|
|
10729
10775
|
function isAgentChatActivityRecord(value) {
|
|
10730
10776
|
return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
|
|
10731
10777
|
}
|
|
10732
|
-
var credentialAccountSchema =
|
|
10733
|
-
ownerName:
|
|
10734
|
-
email:
|
|
10778
|
+
var credentialAccountSchema = z8.object({
|
|
10779
|
+
ownerName: z8.string().optional(),
|
|
10780
|
+
email: z8.string().optional(),
|
|
10735
10781
|
/** 1-based place in the owner's account pool, set only when the pool holds several accounts. */
|
|
10736
|
-
ordinal:
|
|
10782
|
+
ordinal: z8.number().int().positive().optional()
|
|
10737
10783
|
});
|
|
10738
|
-
var agentCredentialSnapshotSchema =
|
|
10739
|
-
method:
|
|
10740
|
-
scope:
|
|
10741
|
-
revision:
|
|
10784
|
+
var agentCredentialSnapshotSchema = z8.object({
|
|
10785
|
+
method: z8.enum(CREDENTIAL_METHOD),
|
|
10786
|
+
scope: z8.enum(CREDENTIAL_SCOPE),
|
|
10787
|
+
revision: z8.string().optional(),
|
|
10742
10788
|
account: credentialAccountSchema.optional(),
|
|
10743
10789
|
/** The `credentials` row, which tells apart accounts pooled under one method and scope. */
|
|
10744
|
-
credentialId:
|
|
10790
|
+
credentialId: z8.string().optional()
|
|
10745
10791
|
});
|
|
10746
10792
|
function isSameCredential(a, b) {
|
|
10747
10793
|
return a.method === b.method && a.scope === b.scope && a.credentialId === b.credentialId;
|
|
@@ -10897,7 +10943,7 @@ function parseCodexTurnRetryPayload(payload) {
|
|
|
10897
10943
|
var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
|
|
10898
10944
|
|
|
10899
10945
|
// ../shared/src/engine/v1.ts
|
|
10900
|
-
import { z as
|
|
10946
|
+
import { z as z9 } from "zod";
|
|
10901
10947
|
var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
10902
10948
|
var ENGINE_STREAM_LAST_EVENT_ID_HEADER = "Last-Event-ID";
|
|
10903
10949
|
var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
|
|
@@ -10905,107 +10951,107 @@ var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
|
|
|
10905
10951
|
var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
|
|
10906
10952
|
var ENGINE_ACTIVATE_PATH = "/lifecycle/activate";
|
|
10907
10953
|
var ENGINE_SLEEP_PATH = "/lifecycle/sleep";
|
|
10908
|
-
var updateChatDisplayNameRequestSchema =
|
|
10909
|
-
displayName:
|
|
10954
|
+
var updateChatDisplayNameRequestSchema = z9.object({
|
|
10955
|
+
displayName: z9.string().trim().min(1).max(100)
|
|
10910
10956
|
});
|
|
10911
|
-
var createChatRequestSchema =
|
|
10912
|
-
id:
|
|
10913
|
-
createdAt:
|
|
10914
|
-
provider:
|
|
10915
|
-
title:
|
|
10916
|
-
parentChatId:
|
|
10917
|
-
forkSourceChatId:
|
|
10918
|
-
pullRequestNotesPath:
|
|
10919
|
-
kind:
|
|
10920
|
-
sideChat:
|
|
10921
|
-
clientRequestId:
|
|
10957
|
+
var createChatRequestSchema = z9.object({
|
|
10958
|
+
id: z9.string().uuid().optional(),
|
|
10959
|
+
createdAt: z9.string().datetime().optional(),
|
|
10960
|
+
provider: z9.enum(VALID_AGENT_PROVIDERS),
|
|
10961
|
+
title: z9.string().min(1).optional(),
|
|
10962
|
+
parentChatId: z9.string().uuid().optional(),
|
|
10963
|
+
forkSourceChatId: z9.string().uuid().optional(),
|
|
10964
|
+
pullRequestNotesPath: z9.string().min(1).optional(),
|
|
10965
|
+
kind: z9.enum(CHAT_KINDS).optional(),
|
|
10966
|
+
sideChat: z9.boolean().optional(),
|
|
10967
|
+
clientRequestId: z9.string().min(1).max(128).optional()
|
|
10922
10968
|
}).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
|
|
10923
10969
|
message: "A side chat must fork its parent chat"
|
|
10924
10970
|
});
|
|
10925
|
-
var spawnSubagentRequestSchema =
|
|
10926
|
-
provider:
|
|
10927
|
-
prompt:
|
|
10928
|
-
forkTurns:
|
|
10971
|
+
var spawnSubagentRequestSchema = z9.object({
|
|
10972
|
+
provider: z9.enum(VALID_AGENT_PROVIDERS),
|
|
10973
|
+
prompt: z9.string().min(1),
|
|
10974
|
+
forkTurns: z9.string().regex(/^(all|none|[1-9]\d*)$/).refine(
|
|
10929
10975
|
(value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
|
|
10930
10976
|
"Expected all, none, or a positive safe integer string"
|
|
10931
10977
|
).default("all"),
|
|
10932
|
-
model:
|
|
10933
|
-
thinkingLevel:
|
|
10934
|
-
fastMode:
|
|
10935
|
-
ultrafastMode:
|
|
10936
|
-
title:
|
|
10978
|
+
model: z9.string().min(1).optional(),
|
|
10979
|
+
thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
|
|
10980
|
+
fastMode: z9.boolean().optional(),
|
|
10981
|
+
ultrafastMode: z9.boolean().optional(),
|
|
10982
|
+
title: z9.string().min(1).optional()
|
|
10937
10983
|
});
|
|
10938
|
-
var messageSubagentRequestSchema =
|
|
10939
|
-
message:
|
|
10940
|
-
model:
|
|
10941
|
-
thinkingLevel:
|
|
10942
|
-
fastMode:
|
|
10943
|
-
ultrafastMode:
|
|
10984
|
+
var messageSubagentRequestSchema = z9.object({
|
|
10985
|
+
message: z9.string().min(1),
|
|
10986
|
+
model: z9.string().min(1).optional(),
|
|
10987
|
+
thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
|
|
10988
|
+
fastMode: z9.boolean().optional(),
|
|
10989
|
+
ultrafastMode: z9.boolean().optional()
|
|
10944
10990
|
});
|
|
10945
|
-
var waitSubagentRequestSchema =
|
|
10946
|
-
timeoutMinutes:
|
|
10991
|
+
var waitSubagentRequestSchema = z9.object({
|
|
10992
|
+
timeoutMinutes: z9.coerce.number().positive().max(1440).optional()
|
|
10947
10993
|
});
|
|
10948
|
-
var subagentResponseSchema =
|
|
10949
|
-
chatId:
|
|
10950
|
-
status:
|
|
10951
|
-
response:
|
|
10952
|
-
timedOut:
|
|
10953
|
-
interruptedByUserMessage:
|
|
10994
|
+
var subagentResponseSchema = z9.object({
|
|
10995
|
+
chatId: z9.string().uuid(),
|
|
10996
|
+
status: z9.enum(["working", "completed"]),
|
|
10997
|
+
response: z9.string().optional(),
|
|
10998
|
+
timedOut: z9.literal(true).optional(),
|
|
10999
|
+
interruptedByUserMessage: z9.literal(true).optional()
|
|
10954
11000
|
});
|
|
10955
|
-
var integrationErrorNotificationTargetSchema =
|
|
10956
|
-
|
|
10957
|
-
type:
|
|
10958
|
-
conversation:
|
|
10959
|
-
channelId:
|
|
10960
|
-
threadTs:
|
|
11001
|
+
var integrationErrorNotificationTargetSchema = z9.discriminatedUnion("type", [
|
|
11002
|
+
z9.object({
|
|
11003
|
+
type: z9.literal("slack"),
|
|
11004
|
+
conversation: z9.object({
|
|
11005
|
+
channelId: z9.string().min(1),
|
|
11006
|
+
threadTs: z9.string().min(1)
|
|
10961
11007
|
}).optional()
|
|
10962
11008
|
}),
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
type:
|
|
10966
|
-
provider:
|
|
10967
|
-
resource:
|
|
10968
|
-
repositoryId:
|
|
10969
|
-
resourceNumber:
|
|
11009
|
+
z9.object({ type: z9.literal("linear"), sessionId: z9.string().min(1) }),
|
|
11010
|
+
z9.object({
|
|
11011
|
+
type: z9.literal("code_host"),
|
|
11012
|
+
provider: z9.enum(["github", "gitlab"]),
|
|
11013
|
+
resource: z9.enum(["issue", "pull_request"]),
|
|
11014
|
+
repositoryId: z9.string().min(1),
|
|
11015
|
+
resourceNumber: z9.number().int().positive()
|
|
10970
11016
|
}),
|
|
10971
|
-
|
|
11017
|
+
z9.object({ type: z9.literal("automation"), executionId: z9.string().min(1) })
|
|
10972
11018
|
]);
|
|
10973
|
-
var sendChatMessageRequestSchema =
|
|
10974
|
-
messageId:
|
|
10975
|
-
submittedAt:
|
|
10976
|
-
message:
|
|
10977
|
-
provider:
|
|
10978
|
-
model:
|
|
10979
|
-
customInstructions:
|
|
10980
|
-
planMode:
|
|
10981
|
-
images:
|
|
10982
|
-
type:
|
|
10983
|
-
source:
|
|
10984
|
-
|
|
10985
|
-
|
|
11019
|
+
var sendChatMessageRequestSchema = z9.object({
|
|
11020
|
+
messageId: z9.string().min(1).optional(),
|
|
11021
|
+
submittedAt: z9.string().datetime().optional(),
|
|
11022
|
+
message: z9.string().min(1),
|
|
11023
|
+
provider: z9.enum(VALID_AGENT_PROVIDERS).optional(),
|
|
11024
|
+
model: z9.string().optional(),
|
|
11025
|
+
customInstructions: z9.string().optional(),
|
|
11026
|
+
planMode: z9.boolean().optional(),
|
|
11027
|
+
images: z9.array(z9.object({
|
|
11028
|
+
type: z9.literal("image"),
|
|
11029
|
+
source: z9.discriminatedUnion("type", [
|
|
11030
|
+
z9.object({ type: z9.literal("base64"), media_type: z9.enum(IMAGE_MEDIA_TYPES), data: z9.string().min(1) }),
|
|
11031
|
+
z9.object({ type: z9.literal("url"), url: z9.string().url() })
|
|
10986
11032
|
])
|
|
10987
11033
|
})).optional(),
|
|
10988
|
-
canvasUploadIds:
|
|
10989
|
-
thinkingLevel:
|
|
10990
|
-
inheritThinkingLevel:
|
|
10991
|
-
goalMode:
|
|
10992
|
-
fastMode:
|
|
10993
|
-
ultrafastMode:
|
|
10994
|
-
source:
|
|
10995
|
-
enableInteractiveTools:
|
|
10996
|
-
type:
|
|
10997
|
-
merge:
|
|
10998
|
-
idempotencyKey:
|
|
10999
|
-
automationId:
|
|
11000
|
-
environmentId:
|
|
11001
|
-
senderUserId:
|
|
11002
|
-
senderEmail:
|
|
11003
|
-
senderDisplayName:
|
|
11004
|
-
senderAvatarUrl:
|
|
11034
|
+
canvasUploadIds: z9.array(z9.string().min(1)).optional(),
|
|
11035
|
+
thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
|
|
11036
|
+
inheritThinkingLevel: z9.boolean().optional(),
|
|
11037
|
+
goalMode: z9.boolean().optional(),
|
|
11038
|
+
fastMode: z9.boolean().optional(),
|
|
11039
|
+
ultrafastMode: z9.boolean().optional(),
|
|
11040
|
+
source: z9.enum(MESSAGE_SOURCES).optional(),
|
|
11041
|
+
enableInteractiveTools: z9.boolean().optional(),
|
|
11042
|
+
type: z9.string().min(1).optional(),
|
|
11043
|
+
merge: z9.boolean().optional(),
|
|
11044
|
+
idempotencyKey: z9.string().min(1).max(128).optional(),
|
|
11045
|
+
automationId: z9.string().optional(),
|
|
11046
|
+
environmentId: z9.string().min(1).optional(),
|
|
11047
|
+
senderUserId: z9.string().optional(),
|
|
11048
|
+
senderEmail: z9.string().optional(),
|
|
11049
|
+
senderDisplayName: z9.string().optional(),
|
|
11050
|
+
senderAvatarUrl: z9.string().optional(),
|
|
11005
11051
|
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
|
|
11006
|
-
errorNotificationTargets:
|
|
11007
|
-
replacesMessageId:
|
|
11008
|
-
steer:
|
|
11052
|
+
errorNotificationTargets: z9.array(integrationErrorNotificationTargetSchema).optional(),
|
|
11053
|
+
replacesMessageId: z9.string().min(1).max(256).optional(),
|
|
11054
|
+
steer: z9.union([z9.boolean(), z9.literal("alone")]).optional()
|
|
11009
11055
|
}).passthrough();
|
|
11010
11056
|
function isChatMessageSender(value) {
|
|
11011
11057
|
return isRecord(value) && (value.messageId === void 0 || typeof value.messageId === "string") && typeof value.senderUserId === "string" && typeof value.senderEmail === "string" && typeof value.recordedAt === "string";
|
|
@@ -11196,18 +11242,18 @@ async function steerQueuedInOrder(queue, messageId, steer) {
|
|
|
11196
11242
|
}
|
|
11197
11243
|
return true;
|
|
11198
11244
|
}
|
|
11199
|
-
var sendChatMessageResponseSchema =
|
|
11200
|
-
messageId:
|
|
11201
|
-
queued:
|
|
11202
|
-
position:
|
|
11203
|
-
chatId:
|
|
11204
|
-
steered:
|
|
11245
|
+
var sendChatMessageResponseSchema = z9.object({
|
|
11246
|
+
messageId: z9.string(),
|
|
11247
|
+
queued: z9.boolean(),
|
|
11248
|
+
position: z9.number(),
|
|
11249
|
+
chatId: z9.string().optional(),
|
|
11250
|
+
steered: z9.boolean().optional()
|
|
11205
11251
|
});
|
|
11206
|
-
var interruptChatRequestSchema =
|
|
11207
|
-
var respondToolInputRequestSchema =
|
|
11208
|
-
requestId:
|
|
11209
|
-
selectionId:
|
|
11210
|
-
source:
|
|
11252
|
+
var interruptChatRequestSchema = z9.object({ stoppedAt: z9.string().datetime().optional() });
|
|
11253
|
+
var respondToolInputRequestSchema = z9.object({
|
|
11254
|
+
requestId: z9.string().min(1),
|
|
11255
|
+
selectionId: z9.string().min(1),
|
|
11256
|
+
source: z9.enum(CLIENT_MESSAGE_SOURCES).optional()
|
|
11211
11257
|
});
|
|
11212
11258
|
function isLatestChatHistoryPage(params) {
|
|
11213
11259
|
return params.beforeCursor === void 0 && params.beforeEvent === void 0 && params.beforeTurn === void 0;
|
|
@@ -11286,104 +11332,104 @@ function isSubagentMcpServerName(server) {
|
|
|
11286
11332
|
}
|
|
11287
11333
|
|
|
11288
11334
|
// ../shared/src/workspace-identity.ts
|
|
11289
|
-
import { z as
|
|
11335
|
+
import { z as z10 } from "zod";
|
|
11290
11336
|
var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
|
|
11291
11337
|
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
11292
11338
|
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
11293
11339
|
var IDENTITY_PROXY_PORT = 17323;
|
|
11294
11340
|
var IDENTITY_TOKEN_PATH = "/token";
|
|
11295
|
-
var workspaceAudienceSchema =
|
|
11296
|
-
var workspaceTokenRequestSchema =
|
|
11341
|
+
var workspaceAudienceSchema = z10.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
|
|
11342
|
+
var workspaceTokenRequestSchema = z10.object({
|
|
11297
11343
|
audience: workspaceAudienceSchema.optional(),
|
|
11298
|
-
aws_source_identity:
|
|
11344
|
+
aws_source_identity: z10.boolean().optional()
|
|
11299
11345
|
});
|
|
11300
|
-
var workspaceTokenClaimsSchema =
|
|
11301
|
-
iss:
|
|
11302
|
-
sub:
|
|
11303
|
-
aud:
|
|
11304
|
-
iat:
|
|
11305
|
-
nbf:
|
|
11306
|
-
exp:
|
|
11307
|
-
jti:
|
|
11308
|
-
organization_id:
|
|
11309
|
-
workspace_id:
|
|
11310
|
-
environment_id:
|
|
11311
|
-
creator_id:
|
|
11312
|
-
creator_email:
|
|
11313
|
-
[AWS_SOURCE_IDENTITY_CLAIM]:
|
|
11346
|
+
var workspaceTokenClaimsSchema = z10.object({
|
|
11347
|
+
iss: z10.string(),
|
|
11348
|
+
sub: z10.string(),
|
|
11349
|
+
aud: z10.string(),
|
|
11350
|
+
iat: z10.number().int(),
|
|
11351
|
+
nbf: z10.number().int(),
|
|
11352
|
+
exp: z10.number().int(),
|
|
11353
|
+
jti: z10.string(),
|
|
11354
|
+
organization_id: z10.string().uuid(),
|
|
11355
|
+
workspace_id: z10.string().uuid(),
|
|
11356
|
+
environment_id: z10.string().uuid(),
|
|
11357
|
+
creator_id: z10.string().uuid().nullable(),
|
|
11358
|
+
creator_email: z10.string().nullable().default(null),
|
|
11359
|
+
[AWS_SOURCE_IDENTITY_CLAIM]: z10.string().uuid().optional()
|
|
11314
11360
|
}).passthrough();
|
|
11315
|
-
var workspaceTokenResponseSchema =
|
|
11316
|
-
issuer:
|
|
11317
|
-
audience:
|
|
11318
|
-
token:
|
|
11319
|
-
expires_at:
|
|
11361
|
+
var workspaceTokenResponseSchema = z10.object({
|
|
11362
|
+
issuer: z10.string(),
|
|
11363
|
+
audience: z10.string(),
|
|
11364
|
+
token: z10.string(),
|
|
11365
|
+
expires_at: z10.string()
|
|
11320
11366
|
});
|
|
11321
|
-
var legacyWorkspaceTokenBundleSchema =
|
|
11322
|
-
version:
|
|
11323
|
-
issuer:
|
|
11324
|
-
default_audience:
|
|
11325
|
-
tokens:
|
|
11367
|
+
var legacyWorkspaceTokenBundleSchema = z10.object({
|
|
11368
|
+
version: z10.literal(1),
|
|
11369
|
+
issuer: z10.string(),
|
|
11370
|
+
default_audience: z10.string(),
|
|
11371
|
+
tokens: z10.record(z10.string(), z10.object({ token: z10.string(), expires_at: z10.string() }))
|
|
11326
11372
|
});
|
|
11327
|
-
var mcpWorkloadAuthSchema =
|
|
11328
|
-
type:
|
|
11373
|
+
var mcpWorkloadAuthSchema = z10.strictObject({
|
|
11374
|
+
type: z10.literal("workspace_identity"),
|
|
11329
11375
|
audience: workspaceAudienceSchema
|
|
11330
11376
|
});
|
|
11331
|
-
var mcpAuthSchema =
|
|
11377
|
+
var mcpAuthSchema = z10.discriminatedUnion("type", [
|
|
11332
11378
|
mcpWorkloadAuthSchema,
|
|
11333
|
-
|
|
11379
|
+
z10.strictObject({ type: z10.literal("oauth") })
|
|
11334
11380
|
]);
|
|
11335
|
-
var engineMcpOAuthTokenRequestSchema =
|
|
11336
|
-
environment_mcp_id:
|
|
11337
|
-
force_refresh:
|
|
11381
|
+
var engineMcpOAuthTokenRequestSchema = z10.object({
|
|
11382
|
+
environment_mcp_id: z10.string().uuid(),
|
|
11383
|
+
force_refresh: z10.boolean().optional()
|
|
11338
11384
|
});
|
|
11339
|
-
var engineMcpOAuthTokenResponseSchema =
|
|
11340
|
-
url:
|
|
11341
|
-
access_token:
|
|
11342
|
-
expires_at:
|
|
11385
|
+
var engineMcpOAuthTokenResponseSchema = z10.object({
|
|
11386
|
+
url: z10.string(),
|
|
11387
|
+
access_token: z10.string(),
|
|
11388
|
+
expires_at: z10.string().nullable()
|
|
11343
11389
|
});
|
|
11344
11390
|
|
|
11345
11391
|
// ../shared/src/routes/environment.ts
|
|
11346
|
-
import { z as
|
|
11392
|
+
import { z as z11 } from "zod";
|
|
11347
11393
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
11348
|
-
var stringMap =
|
|
11349
|
-
var createEnvironmentMcpRequestSchema =
|
|
11350
|
-
name:
|
|
11351
|
-
transport:
|
|
11352
|
-
config:
|
|
11353
|
-
|
|
11354
|
-
|
|
11394
|
+
var stringMap = z11.record(z11.string(), z11.string());
|
|
11395
|
+
var createEnvironmentMcpRequestSchema = z11.object({
|
|
11396
|
+
name: z11.string(),
|
|
11397
|
+
transport: z11.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
11398
|
+
config: z11.union([
|
|
11399
|
+
z11.object({ command: z11.string().min(1), args: z11.array(z11.string()).optional(), env: stringMap.optional() }),
|
|
11400
|
+
z11.object({ url: z11.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
|
|
11355
11401
|
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
11356
11402
|
});
|
|
11357
11403
|
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
11358
|
-
var screenPasswordSchema =
|
|
11359
|
-
var hostSchema =
|
|
11360
|
-
var createEnvironmentDeviceRequestSchema =
|
|
11361
|
-
name:
|
|
11404
|
+
var screenPasswordSchema = z11.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.');
|
|
11405
|
+
var hostSchema = z11.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");
|
|
11406
|
+
var createEnvironmentDeviceRequestSchema = z11.object({
|
|
11407
|
+
name: z11.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`."),
|
|
11362
11408
|
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`."),
|
|
11363
|
-
port:
|
|
11364
|
-
username:
|
|
11409
|
+
port: z11.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
|
|
11410
|
+
username: z11.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."),
|
|
11365
11411
|
screen_password: screenPasswordSchema.optional()
|
|
11366
11412
|
});
|
|
11367
11413
|
var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
|
|
11368
|
-
host:
|
|
11369
|
-
screen_password:
|
|
11414
|
+
host: z11.union([hostSchema, z11.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
|
|
11415
|
+
screen_password: z11.union([screenPasswordSchema, z11.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
|
|
11370
11416
|
});
|
|
11371
|
-
var deviceConnectionResponseSchema =
|
|
11372
|
-
name:
|
|
11373
|
-
port:
|
|
11374
|
-
workspace_ids:
|
|
11417
|
+
var deviceConnectionResponseSchema = z11.object({
|
|
11418
|
+
name: z11.string(),
|
|
11419
|
+
port: z11.number(),
|
|
11420
|
+
workspace_ids: z11.array(z11.string())
|
|
11375
11421
|
});
|
|
11376
|
-
var deviceHostKeysRequestSchema =
|
|
11377
|
-
host_keys:
|
|
11422
|
+
var deviceHostKeysRequestSchema = z11.object({
|
|
11423
|
+
host_keys: z11.array(z11.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())
|
|
11378
11424
|
});
|
|
11379
11425
|
var DEVICE_HOST_KEYS_HEADER = "x-replicas-device-host-keys";
|
|
11380
|
-
var provisionedDeviceSchema =
|
|
11381
|
-
name:
|
|
11382
|
-
host:
|
|
11383
|
-
port:
|
|
11384
|
-
username:
|
|
11385
|
-
private_key:
|
|
11386
|
-
screen_password:
|
|
11426
|
+
var provisionedDeviceSchema = z11.object({
|
|
11427
|
+
name: z11.string(),
|
|
11428
|
+
host: z11.string().nullable(),
|
|
11429
|
+
port: z11.number(),
|
|
11430
|
+
username: z11.string(),
|
|
11431
|
+
private_key: z11.string(),
|
|
11432
|
+
screen_password: z11.string().optional()
|
|
11387
11433
|
});
|
|
11388
11434
|
|
|
11389
11435
|
// ../shared/src/runtime-env.ts
|
|
@@ -11606,19 +11652,19 @@ function gitIdentityConfigCommands(identity, scope = "global") {
|
|
|
11606
11652
|
}
|
|
11607
11653
|
|
|
11608
11654
|
// ../shared/src/headless-agent.ts
|
|
11609
|
-
import { z as
|
|
11610
|
-
var headlessAgentRequestSchema =
|
|
11611
|
-
mode:
|
|
11612
|
-
agent:
|
|
11655
|
+
import { z as z12 } from "zod";
|
|
11656
|
+
var headlessAgentRequestSchema = z12.object({
|
|
11657
|
+
mode: z12.literal("structured"),
|
|
11658
|
+
agent: z12.custom(
|
|
11613
11659
|
(value) => typeof value === "string" && isValidAgentProvider(value)
|
|
11614
11660
|
),
|
|
11615
|
-
model:
|
|
11616
|
-
prompt:
|
|
11617
|
-
workingDirectory:
|
|
11618
|
-
timeoutSeconds:
|
|
11619
|
-
thinkingLevel:
|
|
11620
|
-
codexOauthTokens:
|
|
11621
|
-
outputSchema:
|
|
11661
|
+
model: z12.string().min(1),
|
|
11662
|
+
prompt: z12.string(),
|
|
11663
|
+
workingDirectory: z12.string().min(1),
|
|
11664
|
+
timeoutSeconds: z12.number().int().min(1).max(1800).default(300),
|
|
11665
|
+
thinkingLevel: z12.enum(STANDARD_THINKING_LEVELS).optional(),
|
|
11666
|
+
codexOauthTokens: z12.object({ accessToken: z12.string(), accountId: z12.string() }).optional(),
|
|
11667
|
+
outputSchema: z12.record(z12.string(), z12.json())
|
|
11622
11668
|
});
|
|
11623
11669
|
var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
|
|
11624
11670
|
|
|
@@ -11706,15 +11752,15 @@ var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
|
|
|
11706
11752
|
var PICK_WINDOW_MS = 21 * DAY_MS;
|
|
11707
11753
|
|
|
11708
11754
|
// ../shared/src/routes/workspaces.ts
|
|
11709
|
-
import { z as
|
|
11755
|
+
import { z as z14 } from "zod";
|
|
11710
11756
|
|
|
11711
11757
|
// ../shared/src/workspace-credentials.ts
|
|
11712
|
-
import { z as
|
|
11758
|
+
import { z as z13 } from "zod";
|
|
11713
11759
|
var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
|
|
11714
|
-
var workspaceCredentialProviderSchema =
|
|
11760
|
+
var workspaceCredentialProviderSchema = z13.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
11715
11761
|
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
11716
11762
|
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
11717
|
-
provider:
|
|
11763
|
+
provider: z13.enum(VALID_AGENT_PROVIDERS)
|
|
11718
11764
|
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
11719
11765
|
message: "This inference provider is not supported by this agent"
|
|
11720
11766
|
});
|
|
@@ -11748,16 +11794,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
|
|
|
11748
11794
|
activity: "any"
|
|
11749
11795
|
};
|
|
11750
11796
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11751
|
-
var workspaceExecRequestSchema =
|
|
11752
|
-
command:
|
|
11753
|
-
timeout_seconds:
|
|
11797
|
+
var workspaceExecRequestSchema = z14.object({
|
|
11798
|
+
command: z14.string().regex(/\S/, "command is required"),
|
|
11799
|
+
timeout_seconds: z14.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
11754
11800
|
});
|
|
11755
|
-
var terminalRtcCandidateSchema =
|
|
11756
|
-
var terminalSocketServerMessageSchema =
|
|
11757
|
-
|
|
11758
|
-
|
|
11801
|
+
var terminalRtcCandidateSchema = z14.object({ type: z14.literal("rtc-candidate"), candidate: z14.string(), mid: z14.string() });
|
|
11802
|
+
var terminalSocketServerMessageSchema = z14.discriminatedUnion("type", [
|
|
11803
|
+
z14.object({ type: z14.literal("output"), data: z14.string() }),
|
|
11804
|
+
z14.object({ type: z14.literal("rtc-answer"), sdp: z14.string() }),
|
|
11759
11805
|
terminalRtcCandidateSchema,
|
|
11760
|
-
|
|
11806
|
+
z14.object({ type: z14.literal("rtc-switch") })
|
|
11761
11807
|
]);
|
|
11762
11808
|
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
11763
11809
|
|
|
@@ -11798,62 +11844,62 @@ function describeAuthFallback(payload) {
|
|
|
11798
11844
|
}
|
|
11799
11845
|
|
|
11800
11846
|
// ../shared/src/chat-fork.ts
|
|
11801
|
-
import { z as
|
|
11847
|
+
import { z as z16 } from "zod";
|
|
11802
11848
|
|
|
11803
11849
|
// ../shared/src/fallback-chains.ts
|
|
11804
|
-
import { z as
|
|
11805
|
-
var fallbackHarnessStepSchema =
|
|
11806
|
-
kind:
|
|
11807
|
-
provider:
|
|
11808
|
-
model:
|
|
11809
|
-
thinkingLevel:
|
|
11850
|
+
import { z as z15 } from "zod";
|
|
11851
|
+
var fallbackHarnessStepSchema = z15.object({
|
|
11852
|
+
kind: z15.literal("harness"),
|
|
11853
|
+
provider: z15.enum(VALID_AGENT_PROVIDERS),
|
|
11854
|
+
model: z15.string().min(1),
|
|
11855
|
+
thinkingLevel: z15.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
|
|
11810
11856
|
});
|
|
11811
|
-
var fallbackPlanStepSchema =
|
|
11812
|
-
|
|
11813
|
-
kind:
|
|
11857
|
+
var fallbackPlanStepSchema = z15.discriminatedUnion("kind", [
|
|
11858
|
+
z15.object({
|
|
11859
|
+
kind: z15.literal("credentials"),
|
|
11814
11860
|
// An empty list would allow every method.
|
|
11815
|
-
methods:
|
|
11816
|
-
models:
|
|
11861
|
+
methods: z15.array(z15.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
|
|
11862
|
+
models: z15.record(z15.string(), z15.string().min(1)).optional()
|
|
11817
11863
|
}),
|
|
11818
11864
|
fallbackHarnessStepSchema
|
|
11819
11865
|
]);
|
|
11820
|
-
var fallbackPlanResponseSchema =
|
|
11821
|
-
steps:
|
|
11866
|
+
var fallbackPlanResponseSchema = z15.object({
|
|
11867
|
+
steps: z15.array(z15.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
|
|
11822
11868
|
});
|
|
11823
11869
|
|
|
11824
11870
|
// ../shared/src/chat-fork.ts
|
|
11825
|
-
var fallbackReasonSchema =
|
|
11826
|
-
var chatForkInfoSchema =
|
|
11827
|
-
source:
|
|
11828
|
-
chatId:
|
|
11829
|
-
provider:
|
|
11830
|
-
title:
|
|
11871
|
+
var fallbackReasonSchema = z16.enum(AGENT_FALLBACK_REASONS);
|
|
11872
|
+
var chatForkInfoSchema = z16.object({
|
|
11873
|
+
source: z16.object({
|
|
11874
|
+
chatId: z16.string().min(1),
|
|
11875
|
+
provider: z16.enum(VALID_AGENT_PROVIDERS),
|
|
11876
|
+
title: z16.string()
|
|
11831
11877
|
}),
|
|
11832
|
-
trigger:
|
|
11878
|
+
trigger: z16.enum(["manual", "auto", "side", "switch"]),
|
|
11833
11879
|
reason: fallbackReasonSchema.optional(),
|
|
11834
|
-
state:
|
|
11835
|
-
error:
|
|
11836
|
-
startedAt:
|
|
11837
|
-
completedAt:
|
|
11880
|
+
state: z16.enum(["preparing", "ready", "failed"]),
|
|
11881
|
+
error: z16.string().optional(),
|
|
11882
|
+
startedAt: z16.string(),
|
|
11883
|
+
completedAt: z16.string().optional()
|
|
11838
11884
|
});
|
|
11839
11885
|
function coerceChatForkInfo(value) {
|
|
11840
11886
|
const parsed = chatForkInfoSchema.safeParse(value);
|
|
11841
11887
|
return parsed.success ? parsed.data : null;
|
|
11842
11888
|
}
|
|
11843
|
-
var forkChatRequestSchema =
|
|
11844
|
-
provider:
|
|
11845
|
-
model:
|
|
11846
|
-
thinkingLevel:
|
|
11847
|
-
title:
|
|
11848
|
-
message:
|
|
11849
|
-
id:
|
|
11850
|
-
clientRequestId:
|
|
11851
|
-
enableInteractiveTools:
|
|
11889
|
+
var forkChatRequestSchema = z16.object({
|
|
11890
|
+
provider: z16.enum(VALID_AGENT_PROVIDERS),
|
|
11891
|
+
model: z16.string().min(1).optional(),
|
|
11892
|
+
thinkingLevel: z16.enum(VALID_THINKING_LEVELS).optional(),
|
|
11893
|
+
title: z16.string().min(1).max(200).optional(),
|
|
11894
|
+
message: z16.string().trim().optional(),
|
|
11895
|
+
id: z16.string().uuid().optional(),
|
|
11896
|
+
clientRequestId: z16.string().min(1).max(128).optional(),
|
|
11897
|
+
enableInteractiveTools: z16.boolean().optional(),
|
|
11852
11898
|
// Server-injected by the monolith from the authenticated request; never trusted from clients.
|
|
11853
|
-
senderUserId:
|
|
11854
|
-
senderEmail:
|
|
11855
|
-
senderDisplayName:
|
|
11856
|
-
senderAvatarUrl:
|
|
11899
|
+
senderUserId: z16.string().optional(),
|
|
11900
|
+
senderEmail: z16.string().optional(),
|
|
11901
|
+
senderDisplayName: z16.string().optional(),
|
|
11902
|
+
senderAvatarUrl: z16.string().optional()
|
|
11857
11903
|
});
|
|
11858
11904
|
function describeQuotaLimit(reason) {
|
|
11859
11905
|
if (reason === "auth_failed") return "could not authenticate";
|
|
@@ -11865,10 +11911,10 @@ function describeChatForkReason(reason, provider2) {
|
|
|
11865
11911
|
return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
|
|
11866
11912
|
}
|
|
11867
11913
|
var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
|
|
11868
|
-
var agentQuotaExhaustedPayloadSchema =
|
|
11869
|
-
provider:
|
|
11914
|
+
var agentQuotaExhaustedPayloadSchema = z16.object({
|
|
11915
|
+
provider: z16.enum(VALID_AGENT_PROVIDERS),
|
|
11870
11916
|
reason: fallbackReasonSchema,
|
|
11871
|
-
detail:
|
|
11917
|
+
detail: z16.string().optional(),
|
|
11872
11918
|
forkTo: fallbackHarnessStepSchema.optional()
|
|
11873
11919
|
});
|
|
11874
11920
|
function defaultForkChatTitle(source, provider2) {
|
|
@@ -11903,21 +11949,21 @@ function getChatThreadSources(chats, chat) {
|
|
|
11903
11949
|
}
|
|
11904
11950
|
|
|
11905
11951
|
// ../shared/src/credential-refresh.ts
|
|
11906
|
-
import { z as
|
|
11907
|
-
var engineCredentialRefreshFailureSchema =
|
|
11908
|
-
code:
|
|
11952
|
+
import { z as z17 } from "zod";
|
|
11953
|
+
var engineCredentialRefreshFailureSchema = z17.object({
|
|
11954
|
+
code: z17.string(),
|
|
11909
11955
|
credential: workspaceCredentialSelectionSchema.optional()
|
|
11910
11956
|
});
|
|
11911
11957
|
|
|
11912
11958
|
// ../shared/src/credential-pool.ts
|
|
11913
|
-
import { z as
|
|
11959
|
+
import { z as z18 } from "zod";
|
|
11914
11960
|
var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
|
|
11915
|
-
var reorderCredentialPoolSchema =
|
|
11916
|
-
credential_ids:
|
|
11961
|
+
var reorderCredentialPoolSchema = z18.object({
|
|
11962
|
+
credential_ids: z18.array(z18.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
11917
11963
|
});
|
|
11918
11964
|
|
|
11919
11965
|
// ../shared/src/mothership-events.ts
|
|
11920
|
-
import { z as
|
|
11966
|
+
import { z as z25 } from "zod";
|
|
11921
11967
|
|
|
11922
11968
|
// ../shared/src/design-tokens.ts
|
|
11923
11969
|
var plain = {
|
|
@@ -12084,53 +12130,10 @@ var LINEAR_ICON_DEFINITION = {
|
|
|
12084
12130
|
};
|
|
12085
12131
|
|
|
12086
12132
|
// ../shared/src/replicas-mcp.ts
|
|
12087
|
-
import { z as
|
|
12088
|
-
|
|
12089
|
-
// ../shared/src/routes/linear.ts
|
|
12090
|
-
import { z as z17 } from "zod";
|
|
12091
|
-
var linearSessionMetadataSchema = z17.object({
|
|
12092
|
-
via_mothership: z17.boolean().optional(),
|
|
12093
|
-
attached: z17.boolean().optional(),
|
|
12094
|
-
routing_chat_id: z17.string().optional(),
|
|
12095
|
-
issue_id: z17.string(),
|
|
12096
|
-
issue_identifier: z17.string(),
|
|
12097
|
-
issue_title: z17.string(),
|
|
12098
|
-
issue_description: z17.string(),
|
|
12099
|
-
issue_url: z17.string(),
|
|
12100
|
-
comment_id: z17.string(),
|
|
12101
|
-
comment_body: z17.string(),
|
|
12102
|
-
triggered_by_id: z17.string().optional(),
|
|
12103
|
-
triggered_by_name: z17.string().optional(),
|
|
12104
|
-
triggered_by_email: z17.string().optional(),
|
|
12105
|
-
linear_workspace_id: z17.string().optional(),
|
|
12106
|
-
creator_id: z17.string().optional(),
|
|
12107
|
-
creator_name: z17.string().optional(),
|
|
12108
|
-
creator_email: z17.string().optional(),
|
|
12109
|
-
assignee_id: z17.string().optional(),
|
|
12110
|
-
assignee_name: z17.string().optional(),
|
|
12111
|
-
assignee_email: z17.string().optional(),
|
|
12112
|
-
issue_state: z17.string().optional(),
|
|
12113
|
-
parent_issue: z17.object({
|
|
12114
|
-
id: z17.string(),
|
|
12115
|
-
identifier: z17.string(),
|
|
12116
|
-
title: z17.string(),
|
|
12117
|
-
description: z17.string().nullable()
|
|
12118
|
-
}).optional(),
|
|
12119
|
-
workspace: z17.object({
|
|
12120
|
-
id: z17.string(),
|
|
12121
|
-
coding_agent: z17.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
12122
|
-
task_description: z17.string(),
|
|
12123
|
-
created_at: z17.string()
|
|
12124
|
-
}).optional()
|
|
12125
|
-
});
|
|
12126
|
-
var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
|
|
12127
|
-
|
|
12128
|
-
// ../shared/src/automations/linear/index.ts
|
|
12129
|
-
var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
|
|
12130
|
-
var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
|
|
12133
|
+
import { z as z20 } from "zod";
|
|
12131
12134
|
|
|
12132
12135
|
// ../shared/src/automations/trigger-schemas.ts
|
|
12133
|
-
import { z as
|
|
12136
|
+
import { z as z19 } from "zod";
|
|
12134
12137
|
|
|
12135
12138
|
// ../shared/src/uuid.ts
|
|
12136
12139
|
function createUuidFromHex(value) {
|
|
@@ -12147,31 +12150,37 @@ function getReviewerLoginsError(event, logins) {
|
|
|
12147
12150
|
if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
|
|
12148
12151
|
return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
|
|
12149
12152
|
}
|
|
12150
|
-
var repositoryTriggerConfigSchema =
|
|
12151
|
-
event:
|
|
12152
|
-
repository_ids:
|
|
12153
|
-
group_pr_events:
|
|
12154
|
-
excluded_actors:
|
|
12155
|
-
reviewer_logins:
|
|
12153
|
+
var repositoryTriggerConfigSchema = z19.object({
|
|
12154
|
+
event: z19.string(),
|
|
12155
|
+
repository_ids: z19.array(z19.string().regex(UUID_RE, "must be a repository id")).optional(),
|
|
12156
|
+
group_pr_events: z19.boolean().optional(),
|
|
12157
|
+
excluded_actors: z19.array(z19.string()).optional(),
|
|
12158
|
+
reviewer_logins: z19.array(z19.string()).optional()
|
|
12156
12159
|
});
|
|
12157
|
-
var cronTriggerSchema =
|
|
12158
|
-
var githubTriggerSchema =
|
|
12159
|
-
type:
|
|
12160
|
+
var cronTriggerSchema = z19.object({ type: z19.literal("cron"), config: z19.object({ schedule: z19.string(), timezone: z19.string().optional() }) });
|
|
12161
|
+
var githubTriggerSchema = z19.object({
|
|
12162
|
+
type: z19.literal("github"),
|
|
12160
12163
|
config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
|
|
12161
12164
|
const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
|
|
12162
12165
|
if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
|
|
12163
12166
|
})
|
|
12164
12167
|
});
|
|
12165
|
-
var gitlabTriggerSchema =
|
|
12166
|
-
var linearTriggerConfigSchema =
|
|
12167
|
-
|
|
12168
|
+
var gitlabTriggerSchema = z19.object({ type: z19.literal("gitlab"), config: repositoryTriggerConfigSchema });
|
|
12169
|
+
var linearTriggerConfigSchema = linearIssueFiltersSchema.extend({
|
|
12170
|
+
event: z19.string(),
|
|
12171
|
+
team_ids: z19.array(z19.string()).optional(),
|
|
12172
|
+
state_types: z19.array(z19.enum(LINEAR_STATE_TYPES)).optional()
|
|
12173
|
+
}).superRefine((config, ctx) => {
|
|
12174
|
+
if (config.event === LINEAR_ISSUE_MATCHED_EVENT && config.team_ids?.length !== 1) ctx.addIssue({ code: "custom", message: "The Linear issue matches trigger needs exactly one team", path: ["team_ids"] });
|
|
12175
|
+
});
|
|
12176
|
+
var automationTriggerSchema = z19.discriminatedUnion("type", [
|
|
12168
12177
|
cronTriggerSchema,
|
|
12169
12178
|
githubTriggerSchema,
|
|
12170
12179
|
gitlabTriggerSchema,
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12180
|
+
z19.object({ type: z19.literal("slack"), config: z19.object({ event: z19.string(), channel_ids: z19.array(z19.string()).optional(), group_thread_replies: z19.boolean().optional() }) }),
|
|
12181
|
+
z19.object({ type: z19.literal("sentry"), config: z19.object({ event: z19.string(), project_slugs: z19.array(z19.string()).optional(), min_level: z19.string().optional() }) }),
|
|
12182
|
+
z19.object({ type: z19.literal("linear"), config: linearTriggerConfigSchema }),
|
|
12183
|
+
z19.object({ type: z19.literal("custom"), config: z19.object({}) })
|
|
12175
12184
|
]);
|
|
12176
12185
|
|
|
12177
12186
|
// ../shared/src/automations/types.ts
|
|
@@ -12251,55 +12260,55 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12251
12260
|
deleteChat: "delete_chat",
|
|
12252
12261
|
listRepositories: "list_repositories"
|
|
12253
12262
|
};
|
|
12254
|
-
var automationToolInputSchema =
|
|
12255
|
-
name:
|
|
12256
|
-
prompt:
|
|
12257
|
-
environment_id:
|
|
12258
|
-
triggers:
|
|
12263
|
+
var automationToolInputSchema = z20.object({
|
|
12264
|
+
name: z20.string().describe("Short automation name."),
|
|
12265
|
+
prompt: z20.string().describe("Prompt each automation run starts with."),
|
|
12266
|
+
environment_id: z20.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
12267
|
+
triggers: z20.array(automationTriggerSchema).min(1).describe(
|
|
12259
12268
|
`One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
|
|
12260
12269
|
),
|
|
12261
|
-
description:
|
|
12262
|
-
plan_mode:
|
|
12263
|
-
goal_mode:
|
|
12264
|
-
fast_mode:
|
|
12265
|
-
workspace_lifecycle_policy:
|
|
12270
|
+
description: z20.string().optional().describe("One-line summary shown in the dashboard."),
|
|
12271
|
+
plan_mode: z20.boolean().optional(),
|
|
12272
|
+
goal_mode: z20.boolean().optional(),
|
|
12273
|
+
fast_mode: z20.boolean().optional(),
|
|
12274
|
+
workspace_lifecycle_policy: z20.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
12266
12275
|
"What happens to a run's workspace when the agent finishes. `delete_when_done` (default, except one-time runs, which default to `default`) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
|
|
12267
12276
|
)
|
|
12268
12277
|
});
|
|
12269
12278
|
var credentialUserIdDescription = `Organization automations only: the user ID (see \`${REPLICAS_MCP_TOOLS.whoami}\`) of the member whose coding agent credentials, such as their Claude subscription, runs use before the organization's. Only your workspace's owner, or whoever's credentials this workspace runs on.`;
|
|
12270
|
-
var automationBackgroundSchema =
|
|
12279
|
+
var automationBackgroundSchema = z20.boolean().optional().describe(
|
|
12271
12280
|
"Marks this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list."
|
|
12272
12281
|
);
|
|
12273
12282
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
12274
|
-
credential_user_id:
|
|
12283
|
+
credential_user_id: z20.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
|
|
12275
12284
|
background: automationBackgroundSchema,
|
|
12276
|
-
scope:
|
|
12285
|
+
scope: z20.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
12277
12286
|
});
|
|
12278
12287
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
12279
|
-
automation_id:
|
|
12280
|
-
enabled:
|
|
12281
|
-
agent_provider:
|
|
12282
|
-
model:
|
|
12283
|
-
thinking_level:
|
|
12284
|
-
workspace_size:
|
|
12285
|
-
credential_user_id:
|
|
12288
|
+
automation_id: z20.string().describe("Automation ID"),
|
|
12289
|
+
enabled: z20.boolean().optional(),
|
|
12290
|
+
agent_provider: z20.enum(AGENT).nullable().optional(),
|
|
12291
|
+
model: z20.string().nullable().optional(),
|
|
12292
|
+
thinking_level: z20.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
12293
|
+
workspace_size: z20.enum(WORKSPACE_SIZES).optional(),
|
|
12294
|
+
credential_user_id: z20.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
|
|
12286
12295
|
background: automationBackgroundSchema,
|
|
12287
|
-
scope:
|
|
12296
|
+
scope: z20.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
12288
12297
|
});
|
|
12289
|
-
var chatPath = { id:
|
|
12298
|
+
var chatPath = { id: z20.string().describe("Workspace ID"), chat_id: z20.string().describe("Chat ID") };
|
|
12290
12299
|
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
12291
|
-
var createChatToolInputSchema =
|
|
12292
|
-
var forkChatToolInputSchema =
|
|
12293
|
-
var renameChatToolInputSchema =
|
|
12294
|
-
var runCommandToolInputSchema =
|
|
12295
|
-
var environmentMcpPath = { environment_id:
|
|
12296
|
-
var createEnvironmentMcpToolInputSchema =
|
|
12297
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
12300
|
+
var createChatToolInputSchema = z20.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
12301
|
+
var forkChatToolInputSchema = z20.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
|
|
12302
|
+
var renameChatToolInputSchema = z20.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
|
|
12303
|
+
var runCommandToolInputSchema = z20.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
12304
|
+
var environmentMcpPath = { environment_id: z20.string().describe("Environment ID") };
|
|
12305
|
+
var createEnvironmentMcpToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
12306
|
+
var updateEnvironmentMcpToolInputSchema = z20.object({
|
|
12298
12307
|
...environmentMcpPath,
|
|
12299
|
-
mcp_id:
|
|
12308
|
+
mcp_id: z20.string().describe("MCP ID"),
|
|
12300
12309
|
...updateEnvironmentMcpRequestSchema.shape
|
|
12301
12310
|
});
|
|
12302
|
-
var createEnvironmentDeviceToolInputSchema =
|
|
12311
|
+
var createEnvironmentDeviceToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
|
|
12303
12312
|
|
|
12304
12313
|
// ../shared/src/scout.ts
|
|
12305
12314
|
var SCOUT_SOURCE_TYPES = ["slack", "linear"];
|
|
@@ -12371,63 +12380,63 @@ When someone accepts an offer to automate a repeated request, set it up here ins
|
|
|
12371
12380
|
`;
|
|
12372
12381
|
|
|
12373
12382
|
// ../shared/src/routes/preferences.ts
|
|
12374
|
-
import { z as
|
|
12383
|
+
import { z as z24 } from "zod";
|
|
12375
12384
|
|
|
12376
12385
|
// ../shared/src/routes/push.ts
|
|
12377
|
-
import { z as
|
|
12386
|
+
import { z as z21 } from "zod";
|
|
12378
12387
|
|
|
12379
12388
|
// ../shared/src/workspace-attention.ts
|
|
12380
12389
|
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
|
|
12381
12390
|
var CHAT_ATTENTION_REASONS = ["question", "blocked"];
|
|
12382
12391
|
|
|
12383
12392
|
// ../shared/src/routes/push.ts
|
|
12384
|
-
var registerPushDeviceRequestSchema =
|
|
12385
|
-
|
|
12386
|
-
platform:
|
|
12387
|
-
token:
|
|
12388
|
-
appId:
|
|
12389
|
-
apnsEnvironment:
|
|
12393
|
+
var registerPushDeviceRequestSchema = z21.discriminatedUnion("platform", [
|
|
12394
|
+
z21.object({
|
|
12395
|
+
platform: z21.literal("ios"),
|
|
12396
|
+
token: z21.string().regex(/^[0-9a-f]{64,200}$/i),
|
|
12397
|
+
appId: z21.string().min(1).max(255),
|
|
12398
|
+
apnsEnvironment: z21.enum(["sandbox", "production"])
|
|
12390
12399
|
}),
|
|
12391
|
-
|
|
12392
|
-
platform:
|
|
12393
|
-
token:
|
|
12394
|
-
appId:
|
|
12400
|
+
z21.object({
|
|
12401
|
+
platform: z21.literal("android"),
|
|
12402
|
+
token: z21.string().min(1).max(4096),
|
|
12403
|
+
appId: z21.string().min(1).max(255)
|
|
12395
12404
|
})
|
|
12396
12405
|
]);
|
|
12397
12406
|
var PUSH_HOLD_MINUTES = 5;
|
|
12398
|
-
var chatRefSchema =
|
|
12399
|
-
var recordPushActivityRequestSchema =
|
|
12400
|
-
organizationId:
|
|
12407
|
+
var chatRefSchema = z21.object({ workspaceId: z21.string().uuid(), chatId: z21.string().min(1).max(100) });
|
|
12408
|
+
var recordPushActivityRequestSchema = z21.object({
|
|
12409
|
+
organizationId: z21.string().uuid(),
|
|
12401
12410
|
/** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
|
|
12402
|
-
idleSeconds:
|
|
12403
|
-
seenWorkspaceIds:
|
|
12404
|
-
seenChats:
|
|
12411
|
+
idleSeconds: z21.number().min(0).optional(),
|
|
12412
|
+
seenWorkspaceIds: z21.array(z21.string().uuid()).max(20),
|
|
12413
|
+
seenChats: z21.array(chatRefSchema).max(20).optional()
|
|
12405
12414
|
});
|
|
12406
12415
|
var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
|
|
12407
12416
|
var PUSH_OPTION_LABEL_MAX = 60;
|
|
12408
12417
|
var PUSH_OPTIONS_MAX = 4;
|
|
12409
|
-
var pushQuestionSchema =
|
|
12410
|
-
var pushNotificationDataSchema =
|
|
12411
|
-
organizationId:
|
|
12412
|
-
workspaceId:
|
|
12413
|
-
chatId:
|
|
12414
|
-
kind:
|
|
12415
|
-
completedAt:
|
|
12416
|
-
toolRequestId:
|
|
12418
|
+
var pushQuestionSchema = z21.object({ id: z21.string().max(64), allowCustom: z21.boolean().optional(), options: z21.array(z21.object({ id: z21.string().max(64), label: z21.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
|
|
12419
|
+
var pushNotificationDataSchema = z21.object({
|
|
12420
|
+
organizationId: z21.string(),
|
|
12421
|
+
workspaceId: z21.string(),
|
|
12422
|
+
chatId: z21.string().nullable(),
|
|
12423
|
+
kind: z21.enum(PUSH_NOTIFICATION_KINDS),
|
|
12424
|
+
completedAt: z21.string(),
|
|
12425
|
+
toolRequestId: z21.string().optional(),
|
|
12417
12426
|
question: pushQuestionSchema.optional()
|
|
12418
12427
|
});
|
|
12419
|
-
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind:
|
|
12428
|
+
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z21.literal("shared") });
|
|
12420
12429
|
var registerLiveActivityRequestSchema = chatRefSchema.extend({
|
|
12421
|
-
deviceId:
|
|
12430
|
+
deviceId: z21.string().uuid(),
|
|
12422
12431
|
/** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
|
|
12423
|
-
pushToken:
|
|
12432
|
+
pushToken: z21.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
|
|
12424
12433
|
/** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
|
|
12425
|
-
startedAt:
|
|
12434
|
+
startedAt: z21.number().positive().optional()
|
|
12426
12435
|
});
|
|
12427
|
-
var syncLiveActivitiesRequestSchema =
|
|
12428
|
-
activities:
|
|
12436
|
+
var syncLiveActivitiesRequestSchema = z21.object({
|
|
12437
|
+
activities: z21.array(chatRefSchema).max(100)
|
|
12429
12438
|
});
|
|
12430
|
-
var setLiveActivityStartTokenRequestSchema =
|
|
12439
|
+
var setLiveActivityStartTokenRequestSchema = z21.object({ token: z21.string().regex(/^[0-9a-f]{64,400}$/i) });
|
|
12431
12440
|
|
|
12432
12441
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
12433
12442
|
var SECTION = `### Computer use (Linux desktop control)
|
|
@@ -12439,7 +12448,8 @@ Use this when:
|
|
|
12439
12448
|
- A task requires interacting with a website, web app, or desktop application that has no usable API
|
|
12440
12449
|
- You want the user to watch the agent work - they can open the \`Desktop\` tab, or you can share the URL from \`replicas computer info\`
|
|
12441
12450
|
- You're testing UI changes in a browser before reporting them as done
|
|
12442
|
-
- You want to record a screen capture of a task as proof to share back
|
|
12451
|
+
- You want to record a screen capture of a task as proof to share back
|
|
12452
|
+
- You need to open or use an app on the user's Mac: use \`replicas computer mac\`, never \`ssh\` with \`open\` or AppleScript, which can switch the user's view`;
|
|
12443
12453
|
var REFERENCE = `# Computer use (Linux desktop control)
|
|
12444
12454
|
|
|
12445
12455
|
Every Replicas workspace boots with a full Linux desktop stack - Xvfb (1920\xD71080), openbox, tint2, PulseAudio, ffmpeg, and Google Chrome. The engine auto-registers the H.264 and Opus viewer (port 6080) as an authenticated preview at startup, so the dashboard \`Desktop\` tab is live the moment the workspace is up. You drive the desktop through the \`replicas computer\` CLI.
|
|
@@ -12708,7 +12718,7 @@ var DOCKER_ABILITY = {
|
|
|
12708
12718
|
};
|
|
12709
12719
|
|
|
12710
12720
|
// ../shared/src/routes/environment-setups.ts
|
|
12711
|
-
import { z as
|
|
12721
|
+
import { z as z22 } from "zod";
|
|
12712
12722
|
var ENVIRONMENT_SETUP_STEPS = [
|
|
12713
12723
|
{ key: "understand", label: "Understand the codebase" },
|
|
12714
12724
|
{ key: "install", label: "Install dependencies and run the app" },
|
|
@@ -12741,17 +12751,17 @@ var ENVIRONMENT_SETUP_LIMITS = {
|
|
|
12741
12751
|
repositories: 20
|
|
12742
12752
|
};
|
|
12743
12753
|
var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
12744
|
-
var text2 = (max) => max === void 0 ?
|
|
12754
|
+
var text2 = (max) => max === void 0 ? z22.string().trim() : z22.string().trim().max(max);
|
|
12745
12755
|
var requiredText = (max) => text2(max).min(1, "must not be empty");
|
|
12746
12756
|
var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
|
|
12747
12757
|
var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
|
|
12748
|
-
var list = (item, max) => max === void 0 ?
|
|
12758
|
+
var list = (item, max) => max === void 0 ? z22.array(item) : z22.array(item).max(max);
|
|
12749
12759
|
var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
|
|
12750
12760
|
function isEnvironmentSetupAuthoredTriggerType(type) {
|
|
12751
12761
|
return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
|
|
12752
12762
|
}
|
|
12753
|
-
var proposalTriggerSchema =
|
|
12754
|
-
var existingTriggerSchema =
|
|
12763
|
+
var proposalTriggerSchema = z22.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
|
|
12764
|
+
var existingTriggerSchema = z22.custom(
|
|
12755
12765
|
(value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
|
|
12756
12766
|
"must be an automation trigger"
|
|
12757
12767
|
);
|
|
@@ -12759,17 +12769,17 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
|
|
|
12759
12769
|
(trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
|
|
12760
12770
|
);
|
|
12761
12771
|
function automationSchema(limits) {
|
|
12762
|
-
const authored =
|
|
12772
|
+
const authored = z22.object({
|
|
12763
12773
|
name: text2(limits.nameChars),
|
|
12764
12774
|
description: text2(limits.descriptionChars),
|
|
12765
12775
|
prompt: text2(limits.automationPromptChars),
|
|
12766
12776
|
triggers: list(proposalTriggerSchema, limits.automationTriggers)
|
|
12767
12777
|
});
|
|
12768
|
-
const updated = authored.extend({ triggers: list(
|
|
12769
|
-
return
|
|
12778
|
+
const updated = authored.extend({ triggers: list(z22.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
|
|
12779
|
+
return z22.object({
|
|
12770
12780
|
key: requiredText(limits.automationKeyChars),
|
|
12771
|
-
action:
|
|
12772
|
-
automation_id:
|
|
12781
|
+
action: z22.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
|
|
12782
|
+
automation_id: z22.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
|
|
12773
12783
|
name: text2().default(""),
|
|
12774
12784
|
description: optionalText2().transform((value) => value ?? ""),
|
|
12775
12785
|
prompt: text2().default(""),
|
|
@@ -12792,7 +12802,7 @@ function automationSchema(limits) {
|
|
|
12792
12802
|
const content = (automation.action === "update" ? updated : authored).safeParse(automation);
|
|
12793
12803
|
if (content.success) return { ...automation, ...content.data };
|
|
12794
12804
|
for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
|
|
12795
|
-
return
|
|
12805
|
+
return z22.NEVER;
|
|
12796
12806
|
});
|
|
12797
12807
|
}
|
|
12798
12808
|
function automationListSchema(limits) {
|
|
@@ -12810,7 +12820,7 @@ function automationListSchema(limits) {
|
|
|
12810
12820
|
});
|
|
12811
12821
|
}
|
|
12812
12822
|
function environmentSchema(limits) {
|
|
12813
|
-
return
|
|
12823
|
+
return z22.object({
|
|
12814
12824
|
name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
|
|
12815
12825
|
description: clearableText(limits.descriptionChars),
|
|
12816
12826
|
system_prompt: clearableText(limits.systemPromptChars),
|
|
@@ -12819,41 +12829,41 @@ function environmentSchema(limits) {
|
|
|
12819
12829
|
});
|
|
12820
12830
|
}
|
|
12821
12831
|
function proposalSchema(limits) {
|
|
12822
|
-
return
|
|
12832
|
+
return z22.object({
|
|
12823
12833
|
summary: requiredText(limits.summaryChars),
|
|
12824
12834
|
stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
|
|
12825
12835
|
environment: environmentSchema(limits),
|
|
12826
|
-
variables: list(
|
|
12827
|
-
key:
|
|
12836
|
+
variables: list(z22.object({
|
|
12837
|
+
key: z22.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
|
|
12828
12838
|
description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
|
|
12829
|
-
required:
|
|
12839
|
+
required: z22.boolean().default(false)
|
|
12830
12840
|
}), limits.variables).default([]),
|
|
12831
12841
|
automations: automationListSchema(limits),
|
|
12832
|
-
verification: list(
|
|
12842
|
+
verification: list(z22.object({
|
|
12833
12843
|
label: requiredText(limits.nameChars),
|
|
12834
|
-
status:
|
|
12844
|
+
status: z22.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
|
|
12835
12845
|
detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
|
|
12836
12846
|
}), limits.verificationItems).default([]),
|
|
12837
|
-
media: list(
|
|
12838
|
-
media_id:
|
|
12847
|
+
media: list(z22.object({
|
|
12848
|
+
media_id: z22.string().regex(UUID_RE, "must be a media id"),
|
|
12839
12849
|
title: requiredText(limits.nameChars)
|
|
12840
12850
|
}), limits.mediaItems).default([])
|
|
12841
12851
|
});
|
|
12842
12852
|
}
|
|
12843
12853
|
var environmentSetupProposalSchema = proposalSchema({});
|
|
12844
12854
|
var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
|
|
12845
|
-
var environmentSetupRunStateSchema =
|
|
12846
|
-
status:
|
|
12847
|
-
steps:
|
|
12855
|
+
var environmentSetupRunStateSchema = z22.object({
|
|
12856
|
+
status: z22.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
|
|
12857
|
+
steps: z22.partialRecord(z22.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z22.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
|
|
12848
12858
|
proposal: environmentSetupProposalSchema.nullable().default(null),
|
|
12849
|
-
applied:
|
|
12850
|
-
applied_at:
|
|
12851
|
-
automation_ids:
|
|
12859
|
+
applied: z22.object({
|
|
12860
|
+
applied_at: z22.string(),
|
|
12861
|
+
automation_ids: z22.array(z22.string())
|
|
12852
12862
|
}).nullable().default(null)
|
|
12853
12863
|
});
|
|
12854
|
-
var applyEnvironmentSetupRequestSchema =
|
|
12864
|
+
var applyEnvironmentSetupRequestSchema = z22.object({
|
|
12855
12865
|
environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
|
|
12856
|
-
variables: list(
|
|
12866
|
+
variables: list(z22.object({ key: z22.string().regex(VARIABLE_KEY_RE), value: z22.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
|
|
12857
12867
|
automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
|
|
12858
12868
|
});
|
|
12859
12869
|
|
|
@@ -13328,7 +13338,7 @@ var GITLAB_ABILITY = {
|
|
|
13328
13338
|
};
|
|
13329
13339
|
|
|
13330
13340
|
// ../shared/src/routes/compute.ts
|
|
13331
|
-
import { z as
|
|
13341
|
+
import { z as z23 } from "zod";
|
|
13332
13342
|
var COMPUTE_SANDBOX_KINDS = ["gpu"];
|
|
13333
13343
|
var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
|
|
13334
13344
|
var DEFAULT_GPU_TYPE = "L4";
|
|
@@ -13345,27 +13355,27 @@ var COMPUTE_SANDBOX_LIMITS = {
|
|
|
13345
13355
|
maxIdleTimeoutMinutes: 60,
|
|
13346
13356
|
maxTransferBytes: 1024 ** 3
|
|
13347
13357
|
};
|
|
13348
|
-
var computeEnvSchema =
|
|
13349
|
-
var createComputeSandboxRequestSchema =
|
|
13350
|
-
kind:
|
|
13351
|
-
gpu:
|
|
13352
|
-
image:
|
|
13353
|
-
timeoutMinutes:
|
|
13354
|
-
idleTimeoutMinutes:
|
|
13355
|
-
ports:
|
|
13358
|
+
var computeEnvSchema = z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
|
|
13359
|
+
var createComputeSandboxRequestSchema = z23.object({
|
|
13360
|
+
kind: z23.enum(COMPUTE_SANDBOX_KINDS),
|
|
13361
|
+
gpu: z23.string().trim().optional(),
|
|
13362
|
+
image: z23.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
|
|
13363
|
+
timeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
|
|
13364
|
+
idleTimeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
|
|
13365
|
+
ports: z23.array(z23.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
|
|
13356
13366
|
env: computeEnvSchema.optional()
|
|
13357
13367
|
});
|
|
13358
|
-
var computeExecRequestSchema =
|
|
13359
|
-
command:
|
|
13360
|
-
workdir:
|
|
13368
|
+
var computeExecRequestSchema = z23.object({
|
|
13369
|
+
command: z23.string().min(1).max(1e5),
|
|
13370
|
+
workdir: z23.string().min(1).max(4096).optional(),
|
|
13361
13371
|
env: computeEnvSchema.optional(),
|
|
13362
|
-
detach:
|
|
13372
|
+
detach: z23.boolean().optional()
|
|
13363
13373
|
});
|
|
13364
|
-
var computeUploadRequestSchema =
|
|
13365
|
-
size:
|
|
13374
|
+
var computeUploadRequestSchema = z23.object({
|
|
13375
|
+
size: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
13366
13376
|
});
|
|
13367
|
-
var computeTransferPathSchema =
|
|
13368
|
-
path:
|
|
13377
|
+
var computeTransferPathSchema = z23.object({
|
|
13378
|
+
path: z23.string().min(1).max(4096).optional()
|
|
13369
13379
|
});
|
|
13370
13380
|
|
|
13371
13381
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
@@ -13553,7 +13563,7 @@ var LINEAR_ABILITY = {
|
|
|
13553
13563
|
|
|
13554
13564
|
// ../shared/src/default-skills/replicas-agent/abilities/local-computer.ts
|
|
13555
13565
|
var SECTION8 = `### The user's computer
|
|
13556
|
-
Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`.
|
|
13566
|
+
Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`. To open or use an app on their Mac, use \`replicas computer mac\` instead (\`references/COMPUTER-USE.md\`), so the user's view never switches.
|
|
13557
13567
|
|
|
13558
13568
|
**Reference:** \`references/LOCAL-COMPUTER.md\`
|
|
13559
13569
|
|
|
@@ -13576,7 +13586,13 @@ replicas local-control request --reason "Build and run the iOS app in the Simula
|
|
|
13576
13586
|
|
|
13577
13587
|
It asks the user above the chat composer to let this workspace use their computer and to open the desktop app, waits until their computer connects, and prints its name. If it stops waiting first, end your turn and say what you need the computer for; you get a message when the user answers.
|
|
13578
13588
|
|
|
13579
|
-
It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (
|
|
13589
|
+
It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (bringing an app to the front, booting a simulator window, changing settings).
|
|
13590
|
+
|
|
13591
|
+
## Apps on a Mac: use \`replicas computer mac\`, not \`ssh\`
|
|
13592
|
+
|
|
13593
|
+
To open or use an app (launch it, click, type, play music, read its window), use \`replicas computer mac\` (see \`references/COMPUTER-USE.md\`). It keeps the app in the background, so the user's front window and focus stay theirs, and the user sees what you do in Replicas. It takes no host: it drives the Mac connected through the desktop app (a \`desktop-*\` host). When you're working on a different computer, ask the user before using it. \`open\`, \`osascript\` and other commands over \`ssh\` can bring an app to the front and switch the user's view, and they don't show up in Replicas.
|
|
13594
|
+
|
|
13595
|
+
Use \`ssh\` when it makes more sense: files, shell commands, builds, the Simulator through \`xcrun simctl\`, and quick read-only checks (\`osascript\` asking an app what it is doing) that change nothing on screen.
|
|
13580
13596
|
|
|
13581
13597
|
## Running commands
|
|
13582
13598
|
|
|
@@ -13633,7 +13649,7 @@ ssh mac 'xcodebuild -version; xcrun simctl list runtimes; xcrun simctl list devi
|
|
|
13633
13649
|
var LOCAL_COMPUTER_ABILITY = {
|
|
13634
13650
|
label: "User's computer",
|
|
13635
13651
|
description: "Run commands, builds and simulators on the user's own Mac or Linux computer over `ssh`.",
|
|
13636
|
-
bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator",
|
|
13652
|
+
bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator, or opening and using an app on their Mac in the background (`replicas computer mac`, never `ssh` with `open` or AppleScript)",
|
|
13637
13653
|
section: SECTION8,
|
|
13638
13654
|
referenceFile: { name: "LOCAL-COMPUTER.md", content: REFERENCE8 }
|
|
13639
13655
|
};
|
|
@@ -15110,9 +15126,9 @@ var DEFAULT_DEFAULT_SKILLS = {
|
|
|
15110
15126
|
}
|
|
15111
15127
|
};
|
|
15112
15128
|
var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
|
|
15113
|
-
var linearRoutingSkillSchema =
|
|
15114
|
-
|
|
15115
|
-
|
|
15129
|
+
var linearRoutingSkillSchema = z24.union([
|
|
15130
|
+
z24.object({ name: z24.string().min(1), content: z24.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
|
|
15131
|
+
z24.object({ name: z24.string().min(1), repository_id: z24.string().regex(UUID_RE), path: z24.string().min(1) })
|
|
15116
15132
|
]);
|
|
15117
15133
|
|
|
15118
15134
|
// ../shared/src/prompts.ts
|
|
@@ -15291,18 +15307,18 @@ var UNKNOWN_EVENT_KIND = "update";
|
|
|
15291
15307
|
var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
15292
15308
|
var MOTHERSHIP_EVENT_TYPE = "multitask-event";
|
|
15293
15309
|
var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
15294
|
-
var mothershipEventSchema =
|
|
15295
|
-
id:
|
|
15296
|
-
at:
|
|
15297
|
-
kind:
|
|
15298
|
-
agentId:
|
|
15299
|
-
agentName:
|
|
15300
|
-
summary:
|
|
15301
|
-
detail:
|
|
15310
|
+
var mothershipEventSchema = z25.object({
|
|
15311
|
+
id: z25.string(),
|
|
15312
|
+
at: z25.string(),
|
|
15313
|
+
kind: z25.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
|
|
15314
|
+
agentId: z25.string(),
|
|
15315
|
+
agentName: z25.string(),
|
|
15316
|
+
summary: z25.string(),
|
|
15317
|
+
detail: z25.string().optional(),
|
|
15302
15318
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
15303
|
-
chatId:
|
|
15319
|
+
chatId: z25.string().optional(),
|
|
15304
15320
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
15305
|
-
noticed:
|
|
15321
|
+
noticed: z25.boolean().optional()
|
|
15306
15322
|
});
|
|
15307
15323
|
var TAG = "multitask_event";
|
|
15308
15324
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
@@ -16346,7 +16362,7 @@ function subagentReport(output) {
|
|
|
16346
16362
|
}
|
|
16347
16363
|
|
|
16348
16364
|
// ../shared/src/learned-skills.ts
|
|
16349
|
-
import { z as
|
|
16365
|
+
import { z as z26 } from "zod";
|
|
16350
16366
|
|
|
16351
16367
|
// ../shared/src/frontmatter.ts
|
|
16352
16368
|
import { parse as parseYaml } from "yaml";
|
|
@@ -16369,20 +16385,20 @@ function parseFrontmatter(content) {
|
|
|
16369
16385
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
16370
16386
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
16371
16387
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
16372
|
-
var learnedSkillsManifestSchema =
|
|
16373
|
-
skills:
|
|
16388
|
+
var learnedSkillsManifestSchema = z26.object({
|
|
16389
|
+
skills: z26.array(z26.object({ name: z26.string(), sha256: z26.string() }))
|
|
16374
16390
|
});
|
|
16375
|
-
var dreamVerdictChecksSchema =
|
|
16376
|
-
repeatable:
|
|
16377
|
-
realInstruction:
|
|
16378
|
-
noContradiction:
|
|
16379
|
-
formatExact:
|
|
16380
|
-
humanOnly:
|
|
16381
|
-
actionable:
|
|
16382
|
-
durable:
|
|
16391
|
+
var dreamVerdictChecksSchema = z26.object({
|
|
16392
|
+
repeatable: z26.boolean(),
|
|
16393
|
+
realInstruction: z26.boolean(),
|
|
16394
|
+
noContradiction: z26.boolean(),
|
|
16395
|
+
formatExact: z26.boolean(),
|
|
16396
|
+
humanOnly: z26.boolean(),
|
|
16397
|
+
actionable: z26.boolean(),
|
|
16398
|
+
durable: z26.boolean()
|
|
16383
16399
|
});
|
|
16384
16400
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
16385
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
16401
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z26.boolean(), reason: z26.string() });
|
|
16386
16402
|
var learnedSkillFormatInstruction = (speaker) => `Write a SKILL.md whose frontmatter has a kebab-case \`name\` and a short \`description\` that starts with "Use when" and names the situations it applies to; the body records only what ${speaker} actually said, restated as a direct instruction, usually one to three lines. Every line of a learning is loaded into future sessions, so leave out anything an agent could infer on its own: no headings, explanations, rules, or examples unless ${speaker} stated those specifics themselves. For "from now on, use Conventional Commits", the body is just "Use Conventional Commits for every commit message and PR title."`;
|
|
16387
16403
|
|
|
16388
16404
|
// ../shared/src/terminal.ts
|
|
@@ -16413,7 +16429,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16413
16429
|
}
|
|
16414
16430
|
|
|
16415
16431
|
// ../shared/src/mothership-board.ts
|
|
16416
|
-
import { z as
|
|
16432
|
+
import { z as z27 } from "zod";
|
|
16417
16433
|
var MOTHERSHIP_TICKET_LIMITS = {
|
|
16418
16434
|
title: 80,
|
|
16419
16435
|
task: 1e3,
|
|
@@ -16432,63 +16448,63 @@ var MOTHERSHIP_TICKET_LIMITS = {
|
|
|
16432
16448
|
};
|
|
16433
16449
|
var L = MOTHERSHIP_TICKET_LIMITS;
|
|
16434
16450
|
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
16435
|
-
var text3 = (max) =>
|
|
16436
|
-
var clearable = (schema) =>
|
|
16437
|
-
var httpsUrl =
|
|
16451
|
+
var text3 = (max) => z27.string().trim().min(1).max(max, tooLong(max));
|
|
16452
|
+
var clearable = (schema) => z27.union([schema, z27.literal("")]).optional();
|
|
16453
|
+
var httpsUrl = z27.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
16438
16454
|
var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
|
|
16439
16455
|
var markdown = `${inlineMarkdown} and line breaks.`;
|
|
16440
|
-
var linearIdentifier =
|
|
16441
|
-
var mediaSchema =
|
|
16456
|
+
var linearIdentifier = z27.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
16457
|
+
var mediaSchema = z27.object({
|
|
16442
16458
|
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
16443
16459
|
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
16444
|
-
kind:
|
|
16460
|
+
kind: z27.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
16445
16461
|
});
|
|
16446
|
-
var questionSchema =
|
|
16462
|
+
var questionSchema = z27.object({
|
|
16447
16463
|
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
16448
|
-
options:
|
|
16464
|
+
options: z27.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
|
|
16449
16465
|
});
|
|
16450
16466
|
var mothershipTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Mothership channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
|
|
16451
16467
|
var mothershipTicketTaskSchema = text3(L.task);
|
|
16452
|
-
var mothershipTicketMediaSchema =
|
|
16453
|
-
var mothershipTicketQuestionsSchema =
|
|
16468
|
+
var mothershipTicketMediaSchema = z27.array(mediaSchema);
|
|
16469
|
+
var mothershipTicketQuestionsSchema = z27.array(questionSchema.extend({ id: z27.string() }));
|
|
16454
16470
|
var issueSchema = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
|
|
16455
16471
|
var fixSchema = clearable(text3(L.fix)).describe(`What was done or is being done about it, with pull requests as #number. Keep it current as the work goes on, and say how it ended once the pull requests land. ${markdown} At most ${L.fix} characters.`);
|
|
16456
|
-
var updateMothershipTicketRequestSchema =
|
|
16472
|
+
var updateMothershipTicketRequestSchema = z27.object({
|
|
16457
16473
|
title: mothershipTicketTitleSchema.optional(),
|
|
16458
16474
|
issue: issueSchema,
|
|
16459
16475
|
fix: fixSchema,
|
|
16460
|
-
media:
|
|
16461
|
-
questions:
|
|
16476
|
+
media: z27.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
|
|
16477
|
+
questions: z27.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
|
|
16462
16478
|
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
16463
16479
|
});
|
|
16464
|
-
var updateMothershipBoardRequestSchema =
|
|
16480
|
+
var updateMothershipBoardRequestSchema = z27.object({
|
|
16465
16481
|
overview: clearable(text3(L.overview)).describe(`One line at the top of the board on where the work as a whole stands. "" removes it. At most ${L.overview} characters.`),
|
|
16466
|
-
tickets:
|
|
16467
|
-
id:
|
|
16482
|
+
tickets: z27.array(z27.object({
|
|
16483
|
+
id: z27.uuid(),
|
|
16468
16484
|
title: mothershipTicketTitleSchema.optional(),
|
|
16469
16485
|
issue: issueSchema,
|
|
16470
16486
|
fix: fixSchema,
|
|
16471
|
-
pull_requests:
|
|
16487
|
+
pull_requests: z27.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
|
|
16472
16488
|
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
|
|
16473
16489
|
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
16474
|
-
archived:
|
|
16490
|
+
archived: z27.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
|
|
16475
16491
|
})).max(50).optional().describe("Changes to existing tickets."),
|
|
16476
|
-
order:
|
|
16477
|
-
create:
|
|
16492
|
+
order: z27.array(z27.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
16493
|
+
create: z27.array(z27.object({
|
|
16478
16494
|
title: mothershipTicketTitleSchema,
|
|
16479
16495
|
task: mothershipTicketTaskSchema.optional(),
|
|
16480
16496
|
issue: text3(L.issue).optional(),
|
|
16481
|
-
questions:
|
|
16497
|
+
questions: z27.array(questionSchema).max(L.questions).optional(),
|
|
16482
16498
|
note: text3(L.note).optional()
|
|
16483
16499
|
})).max(5).optional().describe("Tickets with no ship, for your own questions to the user or work no ship does. Their answers come to you.")
|
|
16484
16500
|
});
|
|
16485
|
-
var answerMothershipTicketRequestSchema =
|
|
16486
|
-
questionId:
|
|
16501
|
+
var answerMothershipTicketRequestSchema = z27.object({
|
|
16502
|
+
questionId: z27.string().min(1),
|
|
16487
16503
|
answer: text3(L.answer)
|
|
16488
16504
|
});
|
|
16489
|
-
var mothershipTicketAnswerRefSchema =
|
|
16505
|
+
var mothershipTicketAnswerRefSchema = z27.object({ mothershipId: z27.uuid(), ticketId: z27.uuid(), questionId: z27.string().min(1) });
|
|
16490
16506
|
var LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
16491
|
-
var linearIssueSummariesRequestSchema =
|
|
16507
|
+
var linearIssueSummariesRequestSchema = z27.object({ identifiers: z27.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
16492
16508
|
|
|
16493
16509
|
// ../shared/src/user-message-matching.ts
|
|
16494
16510
|
var parsedTimestamps = /* @__PURE__ */ new Map();
|
|
@@ -16856,10 +16872,10 @@ function currentStepLabel(messages, earlierPlainStep) {
|
|
|
16856
16872
|
}
|
|
16857
16873
|
|
|
16858
16874
|
// ../shared/src/user-message-attachments.ts
|
|
16859
|
-
import { z as
|
|
16875
|
+
import { z as z28 } from "zod";
|
|
16860
16876
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
16861
16877
|
var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
16862
|
-
var annotationLinesSchema =
|
|
16878
|
+
var annotationLinesSchema = z28.object({ path: z28.string(), start: z28.number(), end: z28.number() });
|
|
16863
16879
|
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".';
|
|
16864
16880
|
var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
16865
16881
|
var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
|
|
@@ -20156,7 +20172,7 @@ var VOICE_WAVEFORM = {
|
|
|
20156
20172
|
};
|
|
20157
20173
|
|
|
20158
20174
|
// ../shared/src/e2b.ts
|
|
20159
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-14-
|
|
20175
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-14-v28";
|
|
20160
20176
|
|
|
20161
20177
|
// ../shared/src/e2b-retry.ts
|
|
20162
20178
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -20629,10 +20645,10 @@ function hasChatStarted(chat) {
|
|
|
20629
20645
|
}
|
|
20630
20646
|
|
|
20631
20647
|
// ../shared/src/routes/billing.ts
|
|
20632
|
-
import { z as
|
|
20648
|
+
import { z as z29 } from "zod";
|
|
20633
20649
|
var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
|
|
20634
|
-
var usageLimitCentsSchema =
|
|
20635
|
-
var sourceLimitsCentsSchema =
|
|
20650
|
+
var usageLimitCentsSchema = z29.number().int().min(100).max(1e8);
|
|
20651
|
+
var sourceLimitsCentsSchema = z29.partialRecord(z29.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
|
|
20636
20652
|
|
|
20637
20653
|
// ../shared/src/routes/codex.ts
|
|
20638
20654
|
var CODEX_AUTH_ENV_KEYS = [
|
|
@@ -20786,7 +20802,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
20786
20802
|
};
|
|
20787
20803
|
|
|
20788
20804
|
// ../shared/src/routes/command-protection.ts
|
|
20789
|
-
import { z as
|
|
20805
|
+
import { z as z30 } from "zod";
|
|
20790
20806
|
|
|
20791
20807
|
// ../shared/src/git-invocations.ts
|
|
20792
20808
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -20877,27 +20893,27 @@ function findCheckoutTarget(args) {
|
|
|
20877
20893
|
}
|
|
20878
20894
|
|
|
20879
20895
|
// ../shared/src/routes/command-protection.ts
|
|
20880
|
-
var commandProtectionRepoStateSchema =
|
|
20881
|
-
branch:
|
|
20882
|
-
defaultBranch:
|
|
20883
|
-
pushBranch:
|
|
20884
|
-
pushConfig:
|
|
20885
|
-
headMessage:
|
|
20886
|
-
mergeInProgress:
|
|
20896
|
+
var commandProtectionRepoStateSchema = z30.object({
|
|
20897
|
+
branch: z30.string().nullable(),
|
|
20898
|
+
defaultBranch: z30.string().nullable(),
|
|
20899
|
+
pushBranch: z30.string().nullable(),
|
|
20900
|
+
pushConfig: z30.string().nullable(),
|
|
20901
|
+
headMessage: z30.string().nullable(),
|
|
20902
|
+
mergeInProgress: z30.boolean().optional()
|
|
20887
20903
|
});
|
|
20888
|
-
var commandProtectionEvaluateRequestSchema =
|
|
20889
|
-
provider:
|
|
20890
|
-
source:
|
|
20891
|
-
toolName:
|
|
20892
|
-
toolInput:
|
|
20893
|
-
command:
|
|
20894
|
-
cwd:
|
|
20895
|
-
toolUseId:
|
|
20904
|
+
var commandProtectionEvaluateRequestSchema = z30.object({
|
|
20905
|
+
provider: z30.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
20906
|
+
source: z30.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
20907
|
+
toolName: z30.string(),
|
|
20908
|
+
toolInput: z30.unknown(),
|
|
20909
|
+
command: z30.string().nullish(),
|
|
20910
|
+
cwd: z30.string().nullish(),
|
|
20911
|
+
toolUseId: z30.string().nullish(),
|
|
20896
20912
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
20897
20913
|
// policy can see branches and commit messages the command text only references.
|
|
20898
|
-
gitContext:
|
|
20899
|
-
repos:
|
|
20900
|
-
messageFiles:
|
|
20914
|
+
gitContext: z30.object({
|
|
20915
|
+
repos: z30.record(z30.string(), commandProtectionRepoStateSchema),
|
|
20916
|
+
messageFiles: z30.record(z30.string(), z30.string())
|
|
20901
20917
|
}).optional()
|
|
20902
20918
|
});
|
|
20903
20919
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -21118,119 +21134,119 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
21118
21134
|
}
|
|
21119
21135
|
|
|
21120
21136
|
// ../shared/src/routes/scout.ts
|
|
21121
|
-
import { z as
|
|
21137
|
+
import { z as z31 } from "zod";
|
|
21122
21138
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
21123
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
21124
|
-
comment_id:
|
|
21125
|
-
action:
|
|
21139
|
+
var scoutLinearSessionIntentRequestSchema = z31.object({
|
|
21140
|
+
comment_id: z31.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
21141
|
+
action: z31.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
21126
21142
|
});
|
|
21127
|
-
var scoutLinearStartRequestSchema =
|
|
21128
|
-
issue_id:
|
|
21129
|
-
agent_session_id:
|
|
21130
|
-
prompt:
|
|
21143
|
+
var scoutLinearStartRequestSchema = z31.object({
|
|
21144
|
+
issue_id: z31.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
21145
|
+
agent_session_id: z31.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
21146
|
+
prompt: z31.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
21131
21147
|
});
|
|
21132
|
-
var scoutRouteLinearTicketRequestSchema =
|
|
21133
|
-
agent_session_id:
|
|
21134
|
-
environment_id:
|
|
21135
|
-
mothership_id:
|
|
21148
|
+
var scoutRouteLinearTicketRequestSchema = z31.object({
|
|
21149
|
+
agent_session_id: z31.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
|
|
21150
|
+
environment_id: z31.string().trim().min(1).optional().describe("Start the ticket in this environment."),
|
|
21151
|
+
mothership_id: z31.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
|
|
21136
21152
|
}).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
|
|
21137
|
-
var slackChannelIdSchema =
|
|
21138
|
-
var slackThreadTsSchema =
|
|
21139
|
-
var scoutSlackMessageReferenceSchema =
|
|
21153
|
+
var slackChannelIdSchema = z31.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
21154
|
+
var slackThreadTsSchema = z31.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
21155
|
+
var scoutSlackMessageReferenceSchema = z31.object({
|
|
21140
21156
|
channel_id: slackChannelIdSchema,
|
|
21141
21157
|
thread_ts: slackThreadTsSchema,
|
|
21142
|
-
message_ts:
|
|
21143
|
-
user_id:
|
|
21158
|
+
message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
21159
|
+
user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
|
|
21144
21160
|
});
|
|
21145
|
-
var scoutSlackSpawnRequestSchema =
|
|
21161
|
+
var scoutSlackSpawnRequestSchema = z31.object({
|
|
21146
21162
|
channel_id: slackChannelIdSchema,
|
|
21147
21163
|
thread_ts: slackThreadTsSchema,
|
|
21148
|
-
message_ts:
|
|
21149
|
-
user_id:
|
|
21150
|
-
prompt:
|
|
21151
|
-
acknowledgement_ts:
|
|
21152
|
-
environment_id:
|
|
21164
|
+
message_ts: z31.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."),
|
|
21165
|
+
user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
21166
|
+
prompt: z31.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."),
|
|
21167
|
+
acknowledgement_ts: z31.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."),
|
|
21168
|
+
environment_id: z31.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.`)
|
|
21153
21169
|
});
|
|
21154
21170
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
21155
|
-
title:
|
|
21156
|
-
prompt:
|
|
21157
|
-
acknowledgement_ts:
|
|
21171
|
+
title: z31.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
21172
|
+
prompt: z31.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."),
|
|
21173
|
+
acknowledgement_ts: z31.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.")
|
|
21158
21174
|
});
|
|
21159
|
-
var scoutSlackRelayRequestSchema =
|
|
21175
|
+
var scoutSlackRelayRequestSchema = z31.object({
|
|
21160
21176
|
channel_id: slackChannelIdSchema,
|
|
21161
21177
|
thread_ts: slackThreadTsSchema,
|
|
21162
|
-
message:
|
|
21163
|
-
user_id:
|
|
21164
|
-
queue:
|
|
21165
|
-
workspace_id:
|
|
21166
|
-
message_ts:
|
|
21178
|
+
message: z31.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."),
|
|
21179
|
+
user_id: z31.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`."),
|
|
21180
|
+
queue: z31.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."),
|
|
21181
|
+
workspace_id: z31.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.`),
|
|
21182
|
+
message_ts: z31.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.")
|
|
21167
21183
|
});
|
|
21168
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
21184
|
+
var scoutSlackSetThreadMutedRequestSchema = z31.object({
|
|
21169
21185
|
channel_id: slackChannelIdSchema,
|
|
21170
21186
|
thread_ts: slackThreadTsSchema,
|
|
21171
|
-
muted:
|
|
21187
|
+
muted: z31.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
21172
21188
|
});
|
|
21173
21189
|
var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
|
|
21174
|
-
archive:
|
|
21190
|
+
archive: z31.boolean().describe("true only when the person also asked to close or archive the workspace.")
|
|
21175
21191
|
});
|
|
21176
|
-
var scoutListWorkspacesRequestSchema =
|
|
21192
|
+
var scoutListWorkspacesRequestSchema = z31.object({
|
|
21177
21193
|
channel_id: slackChannelIdSchema,
|
|
21178
21194
|
thread_ts: slackThreadTsSchema,
|
|
21179
|
-
message_ts:
|
|
21180
|
-
user_id:
|
|
21181
|
-
query:
|
|
21195
|
+
message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
21196
|
+
user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
21197
|
+
query: z31.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
|
|
21182
21198
|
});
|
|
21183
|
-
var scoutSlackConfirmationSchema =
|
|
21184
|
-
confirmation_channel_id:
|
|
21185
|
-
confirmation_thread_ts:
|
|
21186
|
-
confirmation_message_ts:
|
|
21187
|
-
confirmation_user_id:
|
|
21199
|
+
var scoutSlackConfirmationSchema = z31.object({
|
|
21200
|
+
confirmation_channel_id: z31.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
21201
|
+
confirmation_thread_ts: z31.string().describe("`thread_ts` from that message's envelope."),
|
|
21202
|
+
confirmation_message_ts: z31.string().describe("`message_ts` from that message's envelope."),
|
|
21203
|
+
confirmation_user_id: z31.string().describe("`user_id` from that message's envelope.")
|
|
21188
21204
|
});
|
|
21189
21205
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
21190
21206
|
var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21191
|
-
preset_id:
|
|
21192
|
-
name:
|
|
21193
|
-
description:
|
|
21194
|
-
icon:
|
|
21195
|
-
instructions:
|
|
21207
|
+
preset_id: z31.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
21208
|
+
name: z31.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
21209
|
+
description: z31.string().optional().describe("One-line summary shown in settings."),
|
|
21210
|
+
icon: z31.enum(SCOUT_PRESET_ICONS).optional(),
|
|
21211
|
+
instructions: z31.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
21196
21212
|
});
|
|
21197
21213
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21198
|
-
source:
|
|
21199
|
-
external_id:
|
|
21200
|
-
monitored:
|
|
21201
|
-
preset_id:
|
|
21202
|
-
instructions:
|
|
21203
|
-
proactivity:
|
|
21204
|
-
muted:
|
|
21214
|
+
source: z31.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
21215
|
+
external_id: z31.string().describe("Slack channel id or Linear team id."),
|
|
21216
|
+
monitored: z31.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."),
|
|
21217
|
+
preset_id: z31.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
21218
|
+
instructions: z31.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
|
|
21219
|
+
proactivity: z31.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."),
|
|
21220
|
+
muted: z31.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.`)
|
|
21205
21221
|
});
|
|
21206
21222
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21207
|
-
muted:
|
|
21223
|
+
muted: z31.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
|
|
21208
21224
|
});
|
|
21209
21225
|
var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
|
|
21210
|
-
preset_id:
|
|
21211
|
-
instructions:
|
|
21212
|
-
proactivity:
|
|
21226
|
+
preset_id: z31.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
|
|
21227
|
+
instructions: z31.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
|
|
21228
|
+
proactivity: z31.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.")
|
|
21213
21229
|
});
|
|
21214
21230
|
var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21215
|
-
proactivity:
|
|
21231
|
+
proactivity: z31.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.`)
|
|
21216
21232
|
});
|
|
21217
21233
|
var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21218
|
-
preset_id:
|
|
21234
|
+
preset_id: z31.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
21219
21235
|
});
|
|
21220
21236
|
var RESET_TO_DEFAULT = "default";
|
|
21221
|
-
var resettable = (schema, description) =>
|
|
21237
|
+
var resettable = (schema, description) => z31.union([schema, z31.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
|
|
21222
21238
|
var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21223
|
-
agent_provider: resettable(
|
|
21224
|
-
model: resettable(
|
|
21225
|
-
thinking_level: resettable(
|
|
21226
|
-
goal_mode: resettable(
|
|
21227
|
-
fast_mode: resettable(
|
|
21239
|
+
agent_provider: resettable(z31.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
|
|
21240
|
+
model: resettable(z31.string(), "Model id for that agent; the default is the agent's own."),
|
|
21241
|
+
thinking_level: resettable(z31.enum(VALID_THINKING_LEVELS), "Thinking level."),
|
|
21242
|
+
goal_mode: resettable(z31.boolean(), "Goal mode."),
|
|
21243
|
+
fast_mode: resettable(z31.boolean(), "Fast mode.")
|
|
21228
21244
|
});
|
|
21229
|
-
var scoutClaimSettingsOfferToolInputSchema =
|
|
21245
|
+
var scoutClaimSettingsOfferToolInputSchema = z31.object({
|
|
21230
21246
|
channel_id: slackChannelIdSchema,
|
|
21231
|
-
kind:
|
|
21232
|
-
user_id:
|
|
21233
|
-
declined:
|
|
21247
|
+
kind: z31.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."),
|
|
21248
|
+
user_id: z31.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."),
|
|
21249
|
+
declined: z31.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
|
|
21234
21250
|
});
|
|
21235
21251
|
|
|
21236
21252
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -21588,22 +21604,22 @@ var PLUGIN_CATALOG = [
|
|
|
21588
21604
|
].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
|
|
21589
21605
|
|
|
21590
21606
|
// ../shared/src/routes/sentry.ts
|
|
21591
|
-
import { z as
|
|
21592
|
-
var sentrySelfHostedConnectRequestSchema =
|
|
21593
|
-
baseUrl:
|
|
21594
|
-
token:
|
|
21595
|
-
webhookSecret:
|
|
21607
|
+
import { z as z32 } from "zod";
|
|
21608
|
+
var sentrySelfHostedConnectRequestSchema = z32.object({
|
|
21609
|
+
baseUrl: z32.string().min(1),
|
|
21610
|
+
token: z32.string().trim().min(1),
|
|
21611
|
+
webhookSecret: z32.string().trim().optional()
|
|
21596
21612
|
});
|
|
21597
21613
|
|
|
21598
21614
|
// ../shared/src/routes/user.ts
|
|
21599
21615
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
21600
21616
|
|
|
21601
21617
|
// ../shared/src/routes/web-auth.ts
|
|
21602
|
-
import { z as
|
|
21603
|
-
var webAuthRedeemResponseSchema =
|
|
21604
|
-
path:
|
|
21605
|
-
organizationId:
|
|
21606
|
-
session:
|
|
21618
|
+
import { z as z33 } from "zod";
|
|
21619
|
+
var webAuthRedeemResponseSchema = z33.object({
|
|
21620
|
+
path: z33.string(),
|
|
21621
|
+
organizationId: z33.string().nullable(),
|
|
21622
|
+
session: z33.object({ access_token: z33.string(), refresh_token: z33.string(), user: z33.object({ id: z33.string(), email: z33.string() }) }).nullable()
|
|
21607
21623
|
});
|
|
21608
21624
|
|
|
21609
21625
|
// ../shared/src/routes/client-state.ts
|
|
@@ -21628,104 +21644,104 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
|
|
|
21628
21644
|
var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
|
|
21629
21645
|
|
|
21630
21646
|
// ../shared/src/routes/workspace-events.ts
|
|
21631
|
-
import { z as
|
|
21647
|
+
import { z as z35 } from "zod";
|
|
21632
21648
|
|
|
21633
21649
|
// ../shared/src/routes/presence.ts
|
|
21634
|
-
import { z as
|
|
21635
|
-
var presenceStatusSchema =
|
|
21636
|
-
var presenceLocationSchema =
|
|
21637
|
-
workspaceId:
|
|
21650
|
+
import { z as z34 } from "zod";
|
|
21651
|
+
var presenceStatusSchema = z34.enum(["online", "typing"]);
|
|
21652
|
+
var presenceLocationSchema = z34.object({
|
|
21653
|
+
workspaceId: z34.string().optional()
|
|
21638
21654
|
});
|
|
21639
|
-
var presenceEntrySchema =
|
|
21640
|
-
userId:
|
|
21655
|
+
var presenceEntrySchema = z34.object({
|
|
21656
|
+
userId: z34.string(),
|
|
21641
21657
|
status: presenceStatusSchema,
|
|
21642
21658
|
location: presenceLocationSchema,
|
|
21643
|
-
ts:
|
|
21659
|
+
ts: z34.string()
|
|
21644
21660
|
});
|
|
21645
|
-
var updatePresenceRequestSchema =
|
|
21661
|
+
var updatePresenceRequestSchema = z34.object({
|
|
21646
21662
|
status: presenceStatusSchema,
|
|
21647
21663
|
location: presenceLocationSchema.optional()
|
|
21648
21664
|
});
|
|
21649
21665
|
|
|
21650
21666
|
// ../shared/src/routes/workspace-events.ts
|
|
21651
|
-
var workspaceTurnCompletionSchema =
|
|
21652
|
-
workspaceName:
|
|
21653
|
-
completedAt:
|
|
21654
|
-
processing:
|
|
21655
|
-
pullRequestFeedback:
|
|
21656
|
-
attention:
|
|
21667
|
+
var workspaceTurnCompletionSchema = z35.object({
|
|
21668
|
+
workspaceName: z35.string(),
|
|
21669
|
+
completedAt: z35.string(),
|
|
21670
|
+
processing: z35.boolean().optional(),
|
|
21671
|
+
pullRequestFeedback: z35.boolean().optional(),
|
|
21672
|
+
attention: z35.object({ reason: z35.enum(CHAT_ATTENTION_REASONS), userId: z35.string() }).optional()
|
|
21657
21673
|
});
|
|
21658
|
-
var workspaceEventSchemaByType =
|
|
21659
|
-
|
|
21660
|
-
type:
|
|
21661
|
-
workspaceId:
|
|
21662
|
-
accessChangedFor:
|
|
21663
|
-
accessChangedForOrg:
|
|
21664
|
-
workspace:
|
|
21665
|
-
name:
|
|
21674
|
+
var workspaceEventSchemaByType = z35.discriminatedUnion("type", [
|
|
21675
|
+
z35.object({
|
|
21676
|
+
type: z35.literal("workspace.changed"),
|
|
21677
|
+
workspaceId: z35.string(),
|
|
21678
|
+
accessChangedFor: z35.string().optional(),
|
|
21679
|
+
accessChangedForOrg: z35.literal(true).optional(),
|
|
21680
|
+
workspace: z35.object({ status: z35.enum(WORKSPACE_STATUSES), last_activity_at: z35.string().nullable() }).optional(),
|
|
21681
|
+
name: z35.string().optional(),
|
|
21666
21682
|
completion: workspaceTurnCompletionSchema.optional(),
|
|
21667
|
-
ts:
|
|
21683
|
+
ts: z35.string()
|
|
21668
21684
|
}),
|
|
21669
|
-
|
|
21670
|
-
type:
|
|
21671
|
-
workspaceId:
|
|
21672
|
-
chatId:
|
|
21673
|
-
ts:
|
|
21685
|
+
z35.object({
|
|
21686
|
+
type: z35.literal("workspace.chat.changed"),
|
|
21687
|
+
workspaceId: z35.string(),
|
|
21688
|
+
chatId: z35.string(),
|
|
21689
|
+
ts: z35.string()
|
|
21674
21690
|
}),
|
|
21675
|
-
|
|
21676
|
-
type:
|
|
21677
|
-
workspaceId:
|
|
21678
|
-
chatId:
|
|
21679
|
-
afterCursor:
|
|
21680
|
-
processing:
|
|
21681
|
-
ts:
|
|
21691
|
+
z35.object({
|
|
21692
|
+
type: z35.literal("workspace.chat.advanced"),
|
|
21693
|
+
workspaceId: z35.string(),
|
|
21694
|
+
chatId: z35.string(),
|
|
21695
|
+
afterCursor: z35.string().optional(),
|
|
21696
|
+
processing: z35.boolean(),
|
|
21697
|
+
ts: z35.string()
|
|
21682
21698
|
}),
|
|
21683
|
-
|
|
21684
|
-
type:
|
|
21685
|
-
workspaceId:
|
|
21686
|
-
ts:
|
|
21699
|
+
z35.object({
|
|
21700
|
+
type: z35.literal("mobile-testing.changed"),
|
|
21701
|
+
workspaceId: z35.string(),
|
|
21702
|
+
ts: z35.string()
|
|
21687
21703
|
}),
|
|
21688
|
-
|
|
21689
|
-
type:
|
|
21690
|
-
workspaceId:
|
|
21691
|
-
ts:
|
|
21704
|
+
z35.object({
|
|
21705
|
+
type: z35.literal("variable-request.changed"),
|
|
21706
|
+
workspaceId: z35.string(),
|
|
21707
|
+
ts: z35.string()
|
|
21692
21708
|
}),
|
|
21693
|
-
|
|
21694
|
-
type:
|
|
21695
|
-
workspaceId:
|
|
21696
|
-
ts:
|
|
21709
|
+
z35.object({
|
|
21710
|
+
type: z35.literal("local-control-request.changed"),
|
|
21711
|
+
workspaceId: z35.string(),
|
|
21712
|
+
ts: z35.string()
|
|
21697
21713
|
}),
|
|
21698
|
-
|
|
21699
|
-
type:
|
|
21700
|
-
prUrl:
|
|
21701
|
-
ts:
|
|
21714
|
+
z35.object({
|
|
21715
|
+
type: z35.literal("pull-request.changed"),
|
|
21716
|
+
prUrl: z35.string(),
|
|
21717
|
+
ts: z35.string()
|
|
21702
21718
|
}),
|
|
21703
|
-
|
|
21704
|
-
type:
|
|
21705
|
-
workspaceId:
|
|
21706
|
-
subagent:
|
|
21707
|
-
ts:
|
|
21719
|
+
z35.object({
|
|
21720
|
+
type: z35.literal("mothership.subagent.changed"),
|
|
21721
|
+
workspaceId: z35.string(),
|
|
21722
|
+
subagent: z35.object({ id: z35.string(), name: z35.string(), prUrl: z35.string().nullable() }),
|
|
21723
|
+
ts: z35.string()
|
|
21708
21724
|
}),
|
|
21709
|
-
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
type:
|
|
21713
|
-
workspaceId:
|
|
21714
|
-
workspaceName:
|
|
21715
|
-
sharedWithUserId:
|
|
21716
|
-
sharedByName:
|
|
21717
|
-
ts:
|
|
21725
|
+
z35.object({ type: z35.literal("mothership.board.changed"), workspaceId: z35.string(), ts: z35.string() }),
|
|
21726
|
+
z35.object({ type: z35.literal("needs-you.changed"), workspaceId: z35.string().nullable(), userId: z35.string().optional(), ts: z35.string() }),
|
|
21727
|
+
z35.object({
|
|
21728
|
+
type: z35.literal("workspace.shared"),
|
|
21729
|
+
workspaceId: z35.string(),
|
|
21730
|
+
workspaceName: z35.string(),
|
|
21731
|
+
sharedWithUserId: z35.string(),
|
|
21732
|
+
sharedByName: z35.string(),
|
|
21733
|
+
ts: z35.string()
|
|
21718
21734
|
})
|
|
21719
21735
|
]);
|
|
21720
|
-
var workspaceChangedEventSchema =
|
|
21736
|
+
var workspaceChangedEventSchema = z35.union([
|
|
21721
21737
|
workspaceEventSchemaByType,
|
|
21722
|
-
|
|
21723
|
-
|
|
21738
|
+
z35.object({ type: z35.literal("presence.changed"), userId: z35.string(), entry: presenceEntrySchema.nullable(), ts: z35.string() }),
|
|
21739
|
+
z35.object({ type: z35.literal("presence.changed"), ts: z35.string() })
|
|
21724
21740
|
]);
|
|
21725
21741
|
|
|
21726
21742
|
// ../shared/src/routes/review-messages.ts
|
|
21727
|
-
import { z as
|
|
21728
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
21743
|
+
import { z as z36 } from "zod";
|
|
21744
|
+
var sendPullRequestReviewMessageRequestSchema = z36.object({
|
|
21729
21745
|
...sendChatMessageRequestSchema.pick({
|
|
21730
21746
|
message: true,
|
|
21731
21747
|
messageId: true,
|
|
@@ -21738,8 +21754,8 @@ var sendPullRequestReviewMessageRequestSchema = z35.object({
|
|
|
21738
21754
|
ultrafastMode: true
|
|
21739
21755
|
}).shape,
|
|
21740
21756
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
21741
|
-
newChat:
|
|
21742
|
-
provider:
|
|
21757
|
+
newChat: z36.boolean().optional(),
|
|
21758
|
+
provider: z36.enum(VALID_AGENT_PROVIDERS).optional()
|
|
21743
21759
|
});
|
|
21744
21760
|
|
|
21745
21761
|
// ../shared/src/audit-log.ts
|
|
@@ -22402,40 +22418,40 @@ function isSkillRegistryManifest(value) {
|
|
|
22402
22418
|
}
|
|
22403
22419
|
|
|
22404
22420
|
// ../shared/src/routes/variable-requests.ts
|
|
22405
|
-
import { z as
|
|
22421
|
+
import { z as z37 } from "zod";
|
|
22406
22422
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
22407
22423
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
22408
|
-
var requestedVariableSchema =
|
|
22409
|
-
key:
|
|
22410
|
-
required:
|
|
22411
|
-
replace:
|
|
22424
|
+
var requestedVariableSchema = z37.object({
|
|
22425
|
+
key: z37.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
22426
|
+
required: z37.boolean(),
|
|
22427
|
+
replace: z37.boolean().optional()
|
|
22412
22428
|
});
|
|
22413
|
-
var requestedVariablesSchema =
|
|
22414
|
-
var createVariableRequestSchema =
|
|
22429
|
+
var requestedVariablesSchema = z37.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");
|
|
22430
|
+
var createVariableRequestSchema = z37.object({
|
|
22415
22431
|
variables: requestedVariablesSchema,
|
|
22416
|
-
reason:
|
|
22417
|
-
wait:
|
|
22432
|
+
reason: z37.string().trim().max(500).nullish().transform((value) => value || null),
|
|
22433
|
+
wait: z37.boolean().default(true)
|
|
22418
22434
|
});
|
|
22419
|
-
var respondVariableRequestSchema =
|
|
22420
|
-
|
|
22421
|
-
action:
|
|
22422
|
-
destination:
|
|
22435
|
+
var respondVariableRequestSchema = z37.discriminatedUnion("action", [
|
|
22436
|
+
z37.object({
|
|
22437
|
+
action: z37.literal("provide"),
|
|
22438
|
+
destination: z37.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
22423
22439
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
22424
|
-
environment_ids:
|
|
22425
|
-
overwrite:
|
|
22426
|
-
values:
|
|
22440
|
+
environment_ids: z37.array(z37.string().uuid()).optional(),
|
|
22441
|
+
overwrite: z37.boolean().optional(),
|
|
22442
|
+
values: z37.record(z37.string().regex(VARIABLE_KEY_RE), z37.string())
|
|
22427
22443
|
}),
|
|
22428
|
-
|
|
22444
|
+
z37.object({ action: z37.literal("skip") })
|
|
22429
22445
|
]);
|
|
22430
22446
|
|
|
22431
22447
|
// ../shared/src/routes/local-control-requests.ts
|
|
22432
|
-
import { z as
|
|
22433
|
-
var createLocalControlRequestSchema =
|
|
22434
|
-
reason:
|
|
22435
|
-
wait:
|
|
22448
|
+
import { z as z38 } from "zod";
|
|
22449
|
+
var createLocalControlRequestSchema = z38.object({
|
|
22450
|
+
reason: z38.string().trim().max(500).optional().transform((value) => value || null),
|
|
22451
|
+
wait: z38.boolean().default(true)
|
|
22436
22452
|
});
|
|
22437
|
-
var respondLocalControlRequestSchema =
|
|
22438
|
-
var setLocalControlSchema =
|
|
22453
|
+
var respondLocalControlRequestSchema = z38.object({ action: z38.enum(["allow", "dismiss"]) });
|
|
22454
|
+
var setLocalControlSchema = z38.object({ enabled: z38.boolean() });
|
|
22439
22455
|
|
|
22440
22456
|
export {
|
|
22441
22457
|
ENGINE_SEND_MESSAGE_FAILED_ERROR,
|