replicas-engine 0.1.1668 → 0.1.1669
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-BPRG7VOK.js → asp-host-DTBU37TZ.js} +5 -5
- package/dist/src/{chunk-TPQPZ5RB.js → chunk-2LX33VLS.js} +1 -1
- package/dist/src/{chunk-ITVVSNFO.js → chunk-5BDCGAEV.js} +2 -2
- package/dist/src/{chunk-G5GMFRVW.js → chunk-6VUUNM6Z.js} +1 -1
- package/dist/src/{chunk-PVYN6HZL.js → chunk-77JPD27V.js} +2 -2
- package/dist/src/{chunk-A75PZTYH.js → chunk-7QJH7SD2.js} +687 -620
- package/dist/src/{chunk-U3OVQGXD.js → chunk-HQWUF7L5.js} +2 -2
- package/dist/src/{chunk-KZSL7XN6.js → chunk-IH56QPAV.js} +6 -6
- package/dist/src/{chunk-YDW4J5Q7.js → chunk-LR637LW6.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 +8 -8
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -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 z47 = 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
|
+
z47 = offsetZ;
|
|
1127
1127
|
this.dt = dt;
|
|
1128
1128
|
} else {
|
|
1129
|
-
|
|
1129
|
+
z47 = "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
|
+
z47 = dt.zone.name;
|
|
1140
1140
|
} else {
|
|
1141
|
-
|
|
1141
|
+
z47 = "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 || z47;
|
|
1151
1151
|
this.dtf = getCachedDTF(intl, intlOpts);
|
|
1152
1152
|
}
|
|
1153
1153
|
format() {
|
|
@@ -9325,6 +9325,7 @@ var WEB_APP_PATHS = {
|
|
|
9325
9325
|
environment: "/environment",
|
|
9326
9326
|
analytics: "/analytics",
|
|
9327
9327
|
review: "/review",
|
|
9328
|
+
issues: "/issues",
|
|
9328
9329
|
dashboard: DASHBOARD_PATH,
|
|
9329
9330
|
agents: `${DASHBOARD_PATH}/agents`,
|
|
9330
9331
|
integrations: `${DASHBOARD_PATH}/integrations`,
|
|
@@ -12526,7 +12527,7 @@ var reorderCredentialPoolSchema = z21.object({
|
|
|
12526
12527
|
});
|
|
12527
12528
|
|
|
12528
12529
|
// ../shared/src/manager-events.ts
|
|
12529
|
-
import { z as
|
|
12530
|
+
import { z as z30 } from "zod";
|
|
12530
12531
|
|
|
12531
12532
|
// ../shared/src/provider-icons.ts
|
|
12532
12533
|
var PROVIDER_ICON_DEFINITIONS = {
|
|
@@ -16208,31 +16209,310 @@ function parseMessageOrigin(raw) {
|
|
|
16208
16209
|
return automation ? { kind: "automation", id: automation[2], name: automation[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation[0].length)) } : null;
|
|
16209
16210
|
}
|
|
16210
16211
|
|
|
16212
|
+
// ../shared/src/tag-blocks.ts
|
|
16213
|
+
var ATTRIBUTE = /(\w+)="([^"]*)"/g;
|
|
16214
|
+
var MULTITASK_EVENT_TAG = "multitask_event";
|
|
16215
|
+
var tagBlockPattern = (tag) => new RegExp(`<${tag}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${tag}>`, "g");
|
|
16216
|
+
var escapeTagAttribute = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
16217
|
+
var parseTagAttributes = (raw) => Object.fromEntries([...raw.matchAll(ATTRIBUTE)].map(([, key, value]) => [key, value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&")]));
|
|
16218
|
+
|
|
16219
|
+
// ../shared/src/issue-events.ts
|
|
16220
|
+
import { z as z29 } from "zod";
|
|
16221
|
+
|
|
16222
|
+
// ../shared/src/routes/issues.ts
|
|
16223
|
+
import { z as z28 } from "zod";
|
|
16224
|
+
var ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
|
|
16225
|
+
var ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
|
|
16226
|
+
var ISSUE_ACTOR_TYPES = ["user", "workspace"];
|
|
16227
|
+
var ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
|
|
16228
|
+
var ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
|
|
16229
|
+
var ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
|
|
16230
|
+
var issueStatusSchema = z28.enum(ISSUE_STATUSES);
|
|
16231
|
+
var issuePrioritySchema = z28.enum(ISSUE_PRIORITIES);
|
|
16232
|
+
var issueSubscriberRoleSchema = z28.enum(ISSUE_SUBSCRIBER_ROLES);
|
|
16233
|
+
var issueRelationTypeSchema = z28.enum(ISSUE_RELATION_TYPES);
|
|
16234
|
+
var issuePullRequestStateSchema = z28.enum(ISSUE_PULL_REQUEST_STATES);
|
|
16235
|
+
var ISSUE_STATUS_LABELS = { backlog: "Backlog", todo: "Todo", in_progress: "In Progress", in_review: "In Review", done: "Done", canceled: "Canceled", duplicate: "Duplicate" };
|
|
16236
|
+
var ISSUE_PRIORITY_LABELS = { none: "No priority", urgent: "Urgent", high: "High", medium: "Medium", low: "Low" };
|
|
16237
|
+
var issueActorSchema = z28.object({
|
|
16238
|
+
type: z28.enum(ISSUE_ACTOR_TYPES),
|
|
16239
|
+
id: z28.string().toLowerCase().uuid()
|
|
16240
|
+
});
|
|
16241
|
+
var ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
|
|
16242
|
+
var timestamp = z28.string();
|
|
16243
|
+
var nullableTimestamp = timestamp.nullable();
|
|
16244
|
+
var issueSchema = z28.object({
|
|
16245
|
+
id: z28.string().uuid(),
|
|
16246
|
+
organization_id: z28.string().uuid(),
|
|
16247
|
+
number: z28.number().int(),
|
|
16248
|
+
identifier: z28.string(),
|
|
16249
|
+
title: z28.string(),
|
|
16250
|
+
description: z28.string(),
|
|
16251
|
+
status: issueStatusSchema,
|
|
16252
|
+
priority: issuePrioritySchema,
|
|
16253
|
+
parent_id: z28.string().uuid().nullable(),
|
|
16254
|
+
manager_id: z28.string().uuid().nullable(),
|
|
16255
|
+
creator: issueActorSchema,
|
|
16256
|
+
/** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
|
|
16257
|
+
sort_order: z28.number(),
|
|
16258
|
+
created_at: timestamp,
|
|
16259
|
+
updated_at: timestamp,
|
|
16260
|
+
completed_at: nullableTimestamp,
|
|
16261
|
+
canceled_at: nullableTimestamp,
|
|
16262
|
+
archived_at: nullableTimestamp
|
|
16263
|
+
});
|
|
16264
|
+
var issueSubscriberSchema = z28.object({
|
|
16265
|
+
issue_id: z28.string().uuid(),
|
|
16266
|
+
subscriber: issueActorSchema,
|
|
16267
|
+
role: issueSubscriberRoleSchema,
|
|
16268
|
+
created_at: timestamp
|
|
16269
|
+
});
|
|
16270
|
+
var issueRelationSchema = z28.object({
|
|
16271
|
+
id: z28.string().uuid(),
|
|
16272
|
+
type: issueRelationTypeSchema,
|
|
16273
|
+
issue_id: z28.string().uuid(),
|
|
16274
|
+
related_issue_id: z28.string().uuid(),
|
|
16275
|
+
created_at: timestamp
|
|
16276
|
+
});
|
|
16277
|
+
var issuePullRequestSchema = z28.object({
|
|
16278
|
+
id: z28.string().uuid(),
|
|
16279
|
+
issue_id: z28.string().uuid(),
|
|
16280
|
+
url: z28.string(),
|
|
16281
|
+
pull_request_id: z28.string().uuid().nullable(),
|
|
16282
|
+
title: z28.string().nullable(),
|
|
16283
|
+
state: issuePullRequestStateSchema,
|
|
16284
|
+
created_at: timestamp,
|
|
16285
|
+
updated_at: timestamp
|
|
16286
|
+
});
|
|
16287
|
+
var issueCommentSchema = z28.object({
|
|
16288
|
+
id: z28.string().uuid(),
|
|
16289
|
+
issue_id: z28.string().uuid(),
|
|
16290
|
+
author: issueActorSchema,
|
|
16291
|
+
body: z28.string(),
|
|
16292
|
+
created_at: timestamp,
|
|
16293
|
+
updated_at: timestamp
|
|
16294
|
+
});
|
|
16295
|
+
var change = (value) => z28.object({ from: value, to: value });
|
|
16296
|
+
var nullableId = z28.string().uuid().nullable();
|
|
16297
|
+
var ISSUE_EVENT_TYPES = [
|
|
16298
|
+
"created",
|
|
16299
|
+
"title_changed",
|
|
16300
|
+
"description_changed",
|
|
16301
|
+
"status_changed",
|
|
16302
|
+
"priority_changed",
|
|
16303
|
+
"parent_changed",
|
|
16304
|
+
"manager_changed",
|
|
16305
|
+
"sort_order_changed",
|
|
16306
|
+
"assignee_added",
|
|
16307
|
+
"assignee_removed",
|
|
16308
|
+
"subscriber_added",
|
|
16309
|
+
"subscriber_removed",
|
|
16310
|
+
"relation_added",
|
|
16311
|
+
"relation_removed",
|
|
16312
|
+
"pr_linked",
|
|
16313
|
+
"pr_unlinked",
|
|
16314
|
+
"pr_state_changed",
|
|
16315
|
+
"comment_added",
|
|
16316
|
+
"comment_edited",
|
|
16317
|
+
"comment_deleted",
|
|
16318
|
+
"archived",
|
|
16319
|
+
"restored"
|
|
16320
|
+
];
|
|
16321
|
+
var issueEventDataSchemas = {
|
|
16322
|
+
created: z28.object({ issue: issueSchema }),
|
|
16323
|
+
title_changed: change(z28.string()),
|
|
16324
|
+
description_changed: change(z28.string()),
|
|
16325
|
+
status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
|
|
16326
|
+
priority_changed: change(issuePrioritySchema),
|
|
16327
|
+
parent_changed: change(nullableId),
|
|
16328
|
+
manager_changed: change(nullableId),
|
|
16329
|
+
sort_order_changed: change(z28.number()),
|
|
16330
|
+
/** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
|
|
16331
|
+
assignee_added: z28.object({ subscriber: issueSubscriberSchema }),
|
|
16332
|
+
assignee_removed: z28.object({ subscriber: issueSubscriberSchema }),
|
|
16333
|
+
subscriber_added: z28.object({ subscriber: issueSubscriberSchema }),
|
|
16334
|
+
subscriber_removed: z28.object({ subscriber: issueSubscriberSchema }),
|
|
16335
|
+
relation_added: z28.object({ relation: issueRelationSchema }),
|
|
16336
|
+
relation_removed: z28.object({ relation: issueRelationSchema }),
|
|
16337
|
+
pr_linked: z28.object({ pull_request: issuePullRequestSchema }),
|
|
16338
|
+
pr_unlinked: z28.object({ pull_request: issuePullRequestSchema }),
|
|
16339
|
+
pr_state_changed: z28.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
|
|
16340
|
+
comment_added: z28.object({ comment: issueCommentSchema }),
|
|
16341
|
+
comment_edited: z28.object({ comment: issueCommentSchema, from: z28.string() }),
|
|
16342
|
+
comment_deleted: z28.object({ comment: issueCommentSchema }),
|
|
16343
|
+
archived: z28.object({ archived_at: timestamp }),
|
|
16344
|
+
restored: z28.object({
|
|
16345
|
+
issue: issueSchema,
|
|
16346
|
+
subscribers: z28.array(issueSubscriberSchema),
|
|
16347
|
+
relations: z28.array(issueRelationSchema),
|
|
16348
|
+
pull_requests: z28.array(issuePullRequestSchema)
|
|
16349
|
+
})
|
|
16350
|
+
};
|
|
16351
|
+
var issueEventBase = z28.object({
|
|
16352
|
+
sync_id: z28.number().int(),
|
|
16353
|
+
issue_id: z28.string().uuid(),
|
|
16354
|
+
actor: issueActorSchema,
|
|
16355
|
+
/** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
|
|
16356
|
+
client_mutation_id: z28.string().nullable(),
|
|
16357
|
+
created_at: timestamp
|
|
16358
|
+
});
|
|
16359
|
+
var issueEventVariant = (type) => issueEventBase.extend({ type: z28.literal(type), data: issueEventDataSchemas[type] });
|
|
16360
|
+
var issueEventSchema = z28.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
|
|
16361
|
+
var clientMutationId = z28.string().min(1).max(128).optional();
|
|
16362
|
+
var title2 = z28.string().trim().min(1).max(500);
|
|
16363
|
+
var description = z28.string().max(1e5);
|
|
16364
|
+
var body = z28.string().trim().min(1).max(1e5);
|
|
16365
|
+
var createIssueRequestSchema = z28.object({
|
|
16366
|
+
/** Client-generated id, so an optimistic create can be referenced before the server answers. */
|
|
16367
|
+
id: z28.string().uuid().optional(),
|
|
16368
|
+
title: title2,
|
|
16369
|
+
description: description.optional(),
|
|
16370
|
+
status: issueStatusSchema.optional(),
|
|
16371
|
+
priority: issuePrioritySchema.optional(),
|
|
16372
|
+
parent_id: z28.string().uuid().optional(),
|
|
16373
|
+
manager_id: z28.string().uuid().optional(),
|
|
16374
|
+
sort_order: z28.number().finite().optional(),
|
|
16375
|
+
assignees: z28.array(issueActorSchema).max(20).optional(),
|
|
16376
|
+
subscribers: z28.array(issueActorSchema).max(50).optional(),
|
|
16377
|
+
client_mutation_id: clientMutationId
|
|
16378
|
+
});
|
|
16379
|
+
var updateIssueRequestSchema = z28.object({
|
|
16380
|
+
title: title2.optional(),
|
|
16381
|
+
description: description.optional(),
|
|
16382
|
+
status: issueStatusSchema.optional(),
|
|
16383
|
+
priority: issuePrioritySchema.optional(),
|
|
16384
|
+
// PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
|
|
16385
|
+
parent_id: nullableId.optional(),
|
|
16386
|
+
manager_id: nullableId.optional(),
|
|
16387
|
+
sort_order: z28.number().finite().optional(),
|
|
16388
|
+
client_mutation_id: clientMutationId
|
|
16389
|
+
});
|
|
16390
|
+
var issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
|
|
16391
|
+
var createIssueCommentRequestSchema = z28.object({
|
|
16392
|
+
id: z28.string().uuid().optional(),
|
|
16393
|
+
body,
|
|
16394
|
+
client_mutation_id: clientMutationId
|
|
16395
|
+
});
|
|
16396
|
+
var updateIssueCommentRequestSchema = z28.object({ body, client_mutation_id: clientMutationId });
|
|
16397
|
+
var createIssueRelationRequestSchema = z28.object({
|
|
16398
|
+
id: z28.string().uuid().optional(),
|
|
16399
|
+
type: issueRelationTypeSchema,
|
|
16400
|
+
related_issue: z28.string().min(1),
|
|
16401
|
+
client_mutation_id: clientMutationId
|
|
16402
|
+
});
|
|
16403
|
+
var linkIssuePullRequestRequestSchema = z28.object({
|
|
16404
|
+
id: z28.string().uuid().optional(),
|
|
16405
|
+
url: z28.string().url().max(2e3),
|
|
16406
|
+
title: z28.string().max(500).optional(),
|
|
16407
|
+
state: issuePullRequestStateSchema.optional(),
|
|
16408
|
+
pull_request_id: z28.string().uuid().optional(),
|
|
16409
|
+
client_mutation_id: clientMutationId
|
|
16410
|
+
});
|
|
16411
|
+
var updateIssuePullRequestRequestSchema = z28.object({
|
|
16412
|
+
state: issuePullRequestStateSchema,
|
|
16413
|
+
client_mutation_id: clientMutationId
|
|
16414
|
+
});
|
|
16415
|
+
var issueMutationRequestSchema = z28.object({ client_mutation_id: clientMutationId });
|
|
16416
|
+
var updateIssueSettingsRequestSchema = z28.object({ issue_key: z28.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
|
|
16417
|
+
var listIssuesQuerySchema = z28.object({
|
|
16418
|
+
status: z28.string().optional(),
|
|
16419
|
+
priority: z28.string().optional(),
|
|
16420
|
+
assignee: z28.string().optional(),
|
|
16421
|
+
subscriber: z28.string().optional(),
|
|
16422
|
+
creator: z28.string().optional(),
|
|
16423
|
+
manager_id: z28.string().optional(),
|
|
16424
|
+
parent_id: z28.string().optional(),
|
|
16425
|
+
q: z28.string().max(200).optional(),
|
|
16426
|
+
include_archived: z28.enum(["true", "false"]).optional(),
|
|
16427
|
+
limit: z28.coerce.number().int().min(1).max(200).optional(),
|
|
16428
|
+
cursor: z28.coerce.number().int().min(0).max(2147483647).optional()
|
|
16429
|
+
});
|
|
16430
|
+
var issueDetailResponseSchema = z28.object({
|
|
16431
|
+
issue: issueSchema,
|
|
16432
|
+
subscribers: z28.array(issueSubscriberSchema),
|
|
16433
|
+
relations: z28.array(issueRelationSchema),
|
|
16434
|
+
pull_requests: z28.array(issuePullRequestSchema),
|
|
16435
|
+
comments: z28.array(issueCommentSchema),
|
|
16436
|
+
events: z28.array(issueEventSchema),
|
|
16437
|
+
sub_issues: z28.array(issueSchema)
|
|
16438
|
+
});
|
|
16439
|
+
var listIssuesResponseSchema = z28.object({ issues: z28.array(issueSchema), next_cursor: z28.number().nullable() });
|
|
16440
|
+
var issuesDeltaQuerySchema = z28.object({
|
|
16441
|
+
after: z28.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
16442
|
+
limit: z28.coerce.number().int().min(1).max(1e3).optional()
|
|
16443
|
+
});
|
|
16444
|
+
var issueInboxQuerySchema = z28.object({
|
|
16445
|
+
limit: z28.coerce.number().int().min(1).max(100).optional(),
|
|
16446
|
+
before: z28.coerce.number().int().min(1).optional()
|
|
16447
|
+
});
|
|
16448
|
+
var markIssueInboxReadRequestSchema = z28.object({ sync_id: z28.number().int().min(0).optional() });
|
|
16449
|
+
|
|
16450
|
+
// ../shared/src/issue-events.ts
|
|
16451
|
+
var ISSUE_EVENT_TAG = "issue_event";
|
|
16452
|
+
var transitionSchema = z29.discriminatedUnion("field", [
|
|
16453
|
+
z29.object({ field: z29.literal("status"), from: issueStatusSchema, to: issueStatusSchema }),
|
|
16454
|
+
z29.object({ field: z29.literal("priority"), from: issuePrioritySchema, to: issuePrioritySchema })
|
|
16455
|
+
]);
|
|
16456
|
+
var issueEventChangeSchema = z29.object({ actor: z29.string(), agent: z29.boolean(), text: z29.string(), transition: transitionSchema.optional() });
|
|
16457
|
+
var CHANGE_LINE = /^(.+?)( \(agent\))? (created it|renamed it|edited |changed the |made it|moved it|removed |assigned |unassigned |marked |linked |unlinked |pull request |commented|deleted a comment|archived it|restored it)(.*)$/;
|
|
16458
|
+
var TRANSITION = /^changed the (status|priority): (\w+) → (\w+)$/;
|
|
16459
|
+
function parseChange(line, excerpt) {
|
|
16460
|
+
const match = line.match(CHANGE_LINE);
|
|
16461
|
+
const rest = (match ? match[3] + match[4] : line).replaceAll(" (agent)", "").replace(/(?:\. Now)?:$/, "");
|
|
16462
|
+
const [, field, from, to] = rest.match(TRANSITION) ?? [];
|
|
16463
|
+
const transition = transitionSchema.safeParse({ field, from, to }).data;
|
|
16464
|
+
const labels = !transition ? [] : transition.field === "status" ? [ISSUE_STATUS_LABELS[transition.from], ISSUE_STATUS_LABELS[transition.to]] : [ISSUE_PRIORITY_LABELS[transition.from], ISSUE_PRIORITY_LABELS[transition.to]];
|
|
16465
|
+
const text4 = transition ? `changed the ${transition.field}: ${labels.join(" \u2192 ")}` : rest;
|
|
16466
|
+
return { actor: match?.[1] ?? "", agent: Boolean(match?.[2]), text: excerpt ? `${text4}: ${excerpt}` : text4, ...transition ? { transition } : {} };
|
|
16467
|
+
}
|
|
16468
|
+
var issueChangeSentence = (change2) => [change2.actor, change2.text].filter(Boolean).join(" ");
|
|
16469
|
+
function extractIssueEvents(text4) {
|
|
16470
|
+
return [...text4.matchAll(tagBlockPattern(ISSUE_EVENT_TAG))].flatMap((match) => {
|
|
16471
|
+
const attributes = parseTagAttributes(match[1]);
|
|
16472
|
+
if (!attributes.issue) return [];
|
|
16473
|
+
const detail = match[2].replaceAll(`<\\/${ISSUE_EVENT_TAG}`, `</${ISSUE_EVENT_TAG}`).trim();
|
|
16474
|
+
const changes = detail.split("\n\n").flatMap((paragraph) => {
|
|
16475
|
+
const [line, ...quoted] = paragraph.split("\n");
|
|
16476
|
+
if (!line.trim() || line.startsWith(">")) return [];
|
|
16477
|
+
return [parseChange(line, line.endsWith(". Now:") ? void 0 : quoted.map((quote) => quote.replace(/^>\s?/, "").trim()).find(Boolean))];
|
|
16478
|
+
});
|
|
16479
|
+
return [{
|
|
16480
|
+
id: `${attributes.issue}:${attributes.sync_id ?? ""}`,
|
|
16481
|
+
at: "",
|
|
16482
|
+
kind: "issue",
|
|
16483
|
+
agentId: attributes.issue,
|
|
16484
|
+
agentName: attributes.issue,
|
|
16485
|
+
summary: changes.map(issueChangeSentence).join(" \xB7 "),
|
|
16486
|
+
...detail ? { detail } : {},
|
|
16487
|
+
issue: { title: attributes.title ?? "", url: attributes.url ?? "", changes }
|
|
16488
|
+
}];
|
|
16489
|
+
});
|
|
16490
|
+
}
|
|
16491
|
+
|
|
16211
16492
|
// ../shared/src/manager-events.ts
|
|
16212
16493
|
var MANAGER_EVENT_KINDS = ["finished", "ready", "needs_attention", "approved", "merged", "closed", "archived", "replied"];
|
|
16213
16494
|
var UNKNOWN_EVENT_KIND = "update";
|
|
16214
16495
|
var MANAGER_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
16215
16496
|
var MANAGER_EVENT_TYPE = "multitask-event";
|
|
16216
16497
|
var MANAGER_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
16217
|
-
var managerEventSchema =
|
|
16218
|
-
id:
|
|
16219
|
-
at:
|
|
16220
|
-
kind:
|
|
16221
|
-
agentId:
|
|
16222
|
-
agentName:
|
|
16223
|
-
summary:
|
|
16224
|
-
detail:
|
|
16498
|
+
var managerEventSchema = z30.object({
|
|
16499
|
+
id: z30.string(),
|
|
16500
|
+
at: z30.string(),
|
|
16501
|
+
kind: z30.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND, "issue"]),
|
|
16502
|
+
agentId: z30.string(),
|
|
16503
|
+
agentName: z30.string(),
|
|
16504
|
+
summary: z30.string(),
|
|
16505
|
+
detail: z30.string().optional(),
|
|
16225
16506
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
16226
|
-
chatId:
|
|
16227
|
-
ticket:
|
|
16507
|
+
chatId: z30.string().optional(),
|
|
16508
|
+
ticket: z30.object({ id: z30.string(), title: z30.string() }).optional(),
|
|
16509
|
+
issue: z30.object({ title: z30.string(), url: z30.string(), changes: z30.array(issueEventChangeSchema) }).optional(),
|
|
16228
16510
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
16229
|
-
noticed:
|
|
16511
|
+
noticed: z30.boolean().optional()
|
|
16230
16512
|
});
|
|
16231
|
-
var TAG =
|
|
16232
|
-
var BLOCK =
|
|
16233
|
-
var
|
|
16234
|
-
var escapeAttribute = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
16235
|
-
var unescapeAttribute = (value) => value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&");
|
|
16513
|
+
var TAG = MULTITASK_EVENT_TAG;
|
|
16514
|
+
var BLOCK = tagBlockPattern(TAG);
|
|
16515
|
+
var ISSUE_BLOCK = tagBlockPattern(ISSUE_EVENT_TAG);
|
|
16236
16516
|
var EVENT_RESPONSE_MAX_CHARS = 8e3;
|
|
16237
16517
|
function truncateManagerEventResponse(response, readTool) {
|
|
16238
16518
|
return response.length > EVENT_RESPONSE_MAX_CHARS ? `${response.slice(0, EVENT_RESPONSE_MAX_CHARS)}\u2026
|
|
@@ -16243,14 +16523,14 @@ function formatManagerEvents(events) {
|
|
|
16243
16523
|
return events.map((event) => {
|
|
16244
16524
|
const attributes = { id: event.id, at: event.at, kind: event.kind, agent: event.agentName, agent_id: event.agentId, ...event.chatId ? { chat_id: event.chatId } : {}, ...event.ticket ? { ticket_id: event.ticket.id, ticket: event.ticket.title } : {}, ...event.noticed ? { noticed: "true" } : {} };
|
|
16245
16525
|
const body2 = [event.summary, event.detail].filter(Boolean).join("\n\n").replaceAll(`</${TAG}`, `<\\/${TAG}`);
|
|
16246
|
-
return `<${TAG}${Object.entries(attributes).map(([key, value]) => ` ${key}="${
|
|
16526
|
+
return `<${TAG}${Object.entries(attributes).map(([key, value]) => ` ${key}="${escapeTagAttribute(value)}"`).join("")}>
|
|
16247
16527
|
${body2}
|
|
16248
16528
|
</${TAG}>`;
|
|
16249
16529
|
}).join("\n\n");
|
|
16250
16530
|
}
|
|
16251
16531
|
function extractManagerEvents(text4) {
|
|
16252
16532
|
return [...text4.matchAll(BLOCK)].flatMap((match) => {
|
|
16253
|
-
const attributes =
|
|
16533
|
+
const attributes = parseTagAttributes(match[1]);
|
|
16254
16534
|
if (!attributes.kind || !attributes.id || !attributes.agent_id) return [];
|
|
16255
16535
|
const kind = MANAGER_EVENT_KINDS.find((candidate) => candidate === attributes.kind) ?? UNKNOWN_EVENT_KIND;
|
|
16256
16536
|
const [summary, ...rest] = match[2].replaceAll(`<\\/${TAG}`, `</${TAG}`).split("\n\n");
|
|
@@ -16270,14 +16550,15 @@ function extractManagerEvents(text4) {
|
|
|
16270
16550
|
});
|
|
16271
16551
|
}
|
|
16272
16552
|
function parseManagerEvents(text4) {
|
|
16273
|
-
const events = extractManagerEvents(text4);
|
|
16274
|
-
return events.length > 0 && text4.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
16553
|
+
const events = [...extractManagerEvents(text4), ...extractIssueEvents(text4)];
|
|
16554
|
+
return events.length > 0 && text4.replace(BLOCK, "").replace(ISSUE_BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
16275
16555
|
}
|
|
16276
16556
|
function isManagerEventMessage(text4) {
|
|
16277
|
-
|
|
16557
|
+
const start = text4.trimStart();
|
|
16558
|
+
return start.startsWith(`<${TAG} `) || start.startsWith(`<${ISSUE_EVENT_TAG} `);
|
|
16278
16559
|
}
|
|
16279
16560
|
function stripManagerEventNotes(content) {
|
|
16280
|
-
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
16561
|
+
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK), ...content.matchAll(ISSUE_BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
16281
16562
|
}
|
|
16282
16563
|
|
|
16283
16564
|
// ../shared/src/display-message/types.ts
|
|
@@ -17271,7 +17552,7 @@ function subagentReport(output) {
|
|
|
17271
17552
|
}
|
|
17272
17553
|
|
|
17273
17554
|
// ../shared/src/learned-skills.ts
|
|
17274
|
-
import { z as
|
|
17555
|
+
import { z as z31 } from "zod";
|
|
17275
17556
|
|
|
17276
17557
|
// ../shared/src/frontmatter.ts
|
|
17277
17558
|
import { parse as parseYaml } from "yaml";
|
|
@@ -17294,20 +17575,20 @@ function parseFrontmatter(content) {
|
|
|
17294
17575
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
17295
17576
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
17296
17577
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
17297
|
-
var learnedSkillsManifestSchema =
|
|
17298
|
-
skills:
|
|
17578
|
+
var learnedSkillsManifestSchema = z31.object({
|
|
17579
|
+
skills: z31.array(z31.object({ name: z31.string(), sha256: z31.string() }))
|
|
17299
17580
|
});
|
|
17300
|
-
var dreamVerdictChecksSchema =
|
|
17301
|
-
repeatable:
|
|
17302
|
-
realInstruction:
|
|
17303
|
-
noContradiction:
|
|
17304
|
-
formatExact:
|
|
17305
|
-
humanOnly:
|
|
17306
|
-
actionable:
|
|
17307
|
-
durable:
|
|
17581
|
+
var dreamVerdictChecksSchema = z31.object({
|
|
17582
|
+
repeatable: z31.boolean(),
|
|
17583
|
+
realInstruction: z31.boolean(),
|
|
17584
|
+
noContradiction: z31.boolean(),
|
|
17585
|
+
formatExact: z31.boolean(),
|
|
17586
|
+
humanOnly: z31.boolean(),
|
|
17587
|
+
actionable: z31.boolean(),
|
|
17588
|
+
durable: z31.boolean()
|
|
17308
17589
|
});
|
|
17309
17590
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
17310
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
17591
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z31.boolean(), reason: z31.string() });
|
|
17311
17592
|
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."`;
|
|
17312
17593
|
|
|
17313
17594
|
// ../shared/src/terminal.ts
|
|
@@ -17338,7 +17619,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
17338
17619
|
}
|
|
17339
17620
|
|
|
17340
17621
|
// ../shared/src/manager-board.ts
|
|
17341
|
-
import { z as
|
|
17622
|
+
import { z as z32 } from "zod";
|
|
17342
17623
|
var MANAGER_TICKET_LIMITS = {
|
|
17343
17624
|
title: 80,
|
|
17344
17625
|
task: 1e3,
|
|
@@ -17358,78 +17639,78 @@ var MANAGER_TICKET_LIMITS = {
|
|
|
17358
17639
|
};
|
|
17359
17640
|
var L = MANAGER_TICKET_LIMITS;
|
|
17360
17641
|
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
17361
|
-
var text3 = (max) =>
|
|
17362
|
-
var clearable = (schema) =>
|
|
17363
|
-
var httpsUrl =
|
|
17642
|
+
var text3 = (max) => z32.string().trim().min(1).max(max, tooLong(max));
|
|
17643
|
+
var clearable = (schema) => z32.union([schema, z32.literal("")]).optional();
|
|
17644
|
+
var httpsUrl = z32.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
17364
17645
|
var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
|
|
17365
17646
|
var markdown = `${inlineMarkdown} and line breaks.`;
|
|
17366
|
-
var linearIdentifier =
|
|
17367
|
-
var mediaSchema =
|
|
17647
|
+
var linearIdentifier = z32.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
17648
|
+
var mediaSchema = z32.object({
|
|
17368
17649
|
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
17369
17650
|
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
17370
|
-
kind:
|
|
17651
|
+
kind: z32.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
17371
17652
|
});
|
|
17372
|
-
var questionSchema =
|
|
17653
|
+
var questionSchema = z32.object({
|
|
17373
17654
|
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
17374
|
-
options:
|
|
17655
|
+
options: z32.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.")
|
|
17375
17656
|
});
|
|
17376
17657
|
var managerTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Manager channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
|
|
17377
17658
|
var managerTicketTaskSchema = text3(L.task);
|
|
17378
|
-
var managerTicketMediaSchema =
|
|
17379
|
-
var managerTicketQuestionsSchema =
|
|
17380
|
-
var
|
|
17659
|
+
var managerTicketMediaSchema = z32.array(mediaSchema);
|
|
17660
|
+
var managerTicketQuestionsSchema = z32.array(questionSchema.extend({ id: z32.string() }));
|
|
17661
|
+
var issueSchema2 = 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.`);
|
|
17381
17662
|
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.`);
|
|
17382
|
-
var updateManagerTicketRequestSchema =
|
|
17663
|
+
var updateManagerTicketRequestSchema = z32.object({
|
|
17383
17664
|
title: managerTicketTitleSchema.optional(),
|
|
17384
|
-
issue:
|
|
17665
|
+
issue: issueSchema2,
|
|
17385
17666
|
fix: fixSchema,
|
|
17386
|
-
media:
|
|
17387
|
-
questions:
|
|
17667
|
+
media: z32.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.`),
|
|
17668
|
+
questions: z32.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.`),
|
|
17388
17669
|
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
17389
17670
|
});
|
|
17390
|
-
var updateManagerBoardRequestSchema =
|
|
17671
|
+
var updateManagerBoardRequestSchema = z32.object({
|
|
17391
17672
|
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.`),
|
|
17392
|
-
tickets:
|
|
17393
|
-
id:
|
|
17673
|
+
tickets: z32.array(z32.object({
|
|
17674
|
+
id: z32.uuid(),
|
|
17394
17675
|
title: managerTicketTitleSchema.optional(),
|
|
17395
|
-
issue:
|
|
17676
|
+
issue: issueSchema2,
|
|
17396
17677
|
fix: fixSchema,
|
|
17397
|
-
pull_requests:
|
|
17678
|
+
pull_requests: z32.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."),
|
|
17398
17679
|
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.`),
|
|
17399
17680
|
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
17400
|
-
archived:
|
|
17681
|
+
archived: z32.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.")
|
|
17401
17682
|
})).max(50).optional().describe("Changes to existing tickets."),
|
|
17402
|
-
order:
|
|
17403
|
-
create:
|
|
17683
|
+
order: z32.array(z32.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
17684
|
+
create: z32.array(z32.object({
|
|
17404
17685
|
title: managerTicketTitleSchema,
|
|
17405
17686
|
task: managerTicketTaskSchema.optional(),
|
|
17406
17687
|
issue: text3(L.issue).optional(),
|
|
17407
|
-
questions:
|
|
17688
|
+
questions: z32.array(questionSchema).max(L.questions).optional(),
|
|
17408
17689
|
note: text3(L.note).optional()
|
|
17409
17690
|
})).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.")
|
|
17410
17691
|
});
|
|
17411
|
-
var answerManagerTicketRequestSchema =
|
|
17412
|
-
questionId:
|
|
17692
|
+
var answerManagerTicketRequestSchema = z32.object({
|
|
17693
|
+
questionId: z32.string().min(1),
|
|
17413
17694
|
answer: text3(L.answer)
|
|
17414
17695
|
});
|
|
17415
|
-
var managerTicketAnswerRefSchema =
|
|
17416
|
-
var replyOnManagerTicketRequestSchema =
|
|
17696
|
+
var managerTicketAnswerRefSchema = z32.object({ managerId: z32.uuid(), ticketId: z32.uuid(), questionId: z32.string().min(1) });
|
|
17697
|
+
var replyOnManagerTicketRequestSchema = z32.object({
|
|
17417
17698
|
reply: text3(L.reply).describe(`Your answer to the user's latest message on the ticket, in a few sentences. ${markdown} Link a screenshot or recording uploaded with \`replicas media upload\` if it helps. At most ${L.reply} characters; keep longer detail in your chat.`),
|
|
17418
17699
|
question: questionSchema.optional().describe("A follow-up question only if you need the user to decide something. It shows on the ticket with its options, and their answer comes back to you.")
|
|
17419
17700
|
});
|
|
17420
|
-
var managerTicketReplyRefSchema =
|
|
17421
|
-
var managerTicketThreadSchema =
|
|
17422
|
-
id:
|
|
17423
|
-
from:
|
|
17424
|
-
name:
|
|
17425
|
-
ship_id:
|
|
17426
|
-
chat_id:
|
|
17427
|
-
text:
|
|
17428
|
-
at:
|
|
17429
|
-
nudge:
|
|
17701
|
+
var managerTicketReplyRefSchema = z32.object({ ticketId: z32.uuid(), text: text3(L.answer) });
|
|
17702
|
+
var managerTicketThreadSchema = z32.array(z32.object({
|
|
17703
|
+
id: z32.string(),
|
|
17704
|
+
from: z32.enum(["user", "ship"]),
|
|
17705
|
+
name: z32.string(),
|
|
17706
|
+
ship_id: z32.string(),
|
|
17707
|
+
chat_id: z32.string(),
|
|
17708
|
+
text: z32.string(),
|
|
17709
|
+
at: z32.string(),
|
|
17710
|
+
nudge: z32.enum(["sent", "missed"]).optional()
|
|
17430
17711
|
}));
|
|
17431
17712
|
var LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
17432
|
-
var linearIssueSummariesRequestSchema =
|
|
17713
|
+
var linearIssueSummariesRequestSchema = z32.object({ identifiers: z32.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
17433
17714
|
|
|
17434
17715
|
// ../shared/src/user-message-matching.ts
|
|
17435
17716
|
var parsedTimestamps = /* @__PURE__ */ new Map();
|
|
@@ -17800,19 +18081,19 @@ function currentStepLabel(messages, earlierPlainStep) {
|
|
|
17800
18081
|
}
|
|
17801
18082
|
|
|
17802
18083
|
// ../shared/src/user-message-attachments.ts
|
|
17803
|
-
import { z as
|
|
18084
|
+
import { z as z33 } from "zod";
|
|
17804
18085
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
17805
18086
|
var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
17806
|
-
var annotationLinesSchema =
|
|
17807
|
-
var messageAnnotationSchema =
|
|
17808
|
-
text:
|
|
17809
|
-
comment:
|
|
18087
|
+
var annotationLinesSchema = z33.object({ path: z33.string(), start: z33.number(), end: z33.number() });
|
|
18088
|
+
var messageAnnotationSchema = z33.object({
|
|
18089
|
+
text: z33.string(),
|
|
18090
|
+
comment: z33.string().optional(),
|
|
17810
18091
|
lines: annotationLinesSchema.optional(),
|
|
17811
18092
|
/** Which match of `text` in its message was quoted, from 0, when the same words appear more than once. */
|
|
17812
|
-
occurrence:
|
|
18093
|
+
occurrence: z33.number().int().nonnegative().optional(),
|
|
17813
18094
|
/** The rendered message the quote was selected in, and its last one when it spans several, so clients find it without searching. */
|
|
17814
|
-
messageId:
|
|
17815
|
-
endMessageId:
|
|
18095
|
+
messageId: z33.string().optional(),
|
|
18096
|
+
endMessageId: z33.string().optional()
|
|
17816
18097
|
});
|
|
17817
18098
|
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".';
|
|
17818
18099
|
var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
@@ -21267,7 +21548,7 @@ async function withRetry(label, fn, options) {
|
|
|
21267
21548
|
}
|
|
21268
21549
|
|
|
21269
21550
|
// ../shared/src/tensorlake.ts
|
|
21270
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-
|
|
21551
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v17";
|
|
21271
21552
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21272
21553
|
|
|
21273
21554
|
// ../shared/src/egress.ts
|
|
@@ -21597,7 +21878,19 @@ var KEYBOARD_SHORTCUTS = {
|
|
|
21597
21878
|
copyPullRequestGitHubLink: { label: "Copy GitHub link", group: "Review", prefix: "c", keys: { key: "g" } },
|
|
21598
21879
|
copyPullRequest: { label: "Copy PR", group: "Review", prefix: "c", keys: { key: "p" } },
|
|
21599
21880
|
openReviewChat: { label: "Start chat", group: "Review", keys: { key: ";", mod: true } },
|
|
21600
|
-
mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } }
|
|
21881
|
+
mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } },
|
|
21882
|
+
createIssue: { label: "Create issue", group: "Issues", keys: { key: "c" } },
|
|
21883
|
+
setIssueStatus: { label: "Change status", group: "Issues", keys: { key: "s" } },
|
|
21884
|
+
setIssuePriority: { label: "Change priority", group: "Issues", keys: { key: "p" } },
|
|
21885
|
+
setIssueAssignees: { label: "Assign", group: "Issues", keys: { key: "a" } },
|
|
21886
|
+
nextIssue: { label: "Next issue", group: "Issues", keys: { key: "j" } },
|
|
21887
|
+
previousIssue: { label: "Previous issue", group: "Issues", keys: { key: "k" } },
|
|
21888
|
+
openIssue: { label: "Open issue", group: "Issues", keys: { key: "Enter" } },
|
|
21889
|
+
peekIssue: { label: "Peek issue", group: "Issues", keys: { key: " " } },
|
|
21890
|
+
selectIssue: { label: "Select issue", group: "Issues", keys: { key: "x" } },
|
|
21891
|
+
toggleIssueLayout: { label: "Switch list / board", group: "Issues", keys: { key: "b", mod: true, shift: true } },
|
|
21892
|
+
copyIssueIdentifier: { label: "Copy issue ID", group: "Issues", keys: { key: ".", mod: true } },
|
|
21893
|
+
copyIssueLink: { label: "Copy issue link", group: "Issues", keys: { key: ",", mod: true, shift: true } }
|
|
21601
21894
|
};
|
|
21602
21895
|
var COMPOSER_SEND_SHORTCUTS = {
|
|
21603
21896
|
enter: { send: KEYBOARD_SHORTCUTS.send, sendAlternate: KEYBOARD_SHORTCUTS.sendAlternate, newLine: KEYBOARD_SHORTCUTS.newLine },
|
|
@@ -21807,135 +22100,135 @@ function parseProxyRouteCheck(output) {
|
|
|
21807
22100
|
}
|
|
21808
22101
|
|
|
21809
22102
|
// ../shared/src/harness/types.ts
|
|
21810
|
-
import { z as
|
|
22103
|
+
import { z as z34 } from "zod";
|
|
21811
22104
|
var HARNESS_THREAD_STATUSES = ["idle", "working", "error"];
|
|
21812
|
-
var textSchema =
|
|
21813
|
-
var imageSchema =
|
|
21814
|
-
var userMessageSchema =
|
|
21815
|
-
role:
|
|
21816
|
-
content:
|
|
21817
|
-
timestamp:
|
|
22105
|
+
var textSchema = z34.looseObject({ type: z34.literal("text"), text: z34.string() });
|
|
22106
|
+
var imageSchema = z34.looseObject({ type: z34.literal("image"), data: z34.string(), mimeType: z34.string() });
|
|
22107
|
+
var userMessageSchema = z34.looseObject({
|
|
22108
|
+
role: z34.literal("user"),
|
|
22109
|
+
content: z34.union([z34.string(), z34.array(z34.discriminatedUnion("type", [textSchema, imageSchema]))]),
|
|
22110
|
+
timestamp: z34.number()
|
|
21818
22111
|
});
|
|
21819
|
-
var assistantMessageSchema =
|
|
21820
|
-
role:
|
|
21821
|
-
content:
|
|
22112
|
+
var assistantMessageSchema = z34.looseObject({
|
|
22113
|
+
role: z34.literal("assistant"),
|
|
22114
|
+
content: z34.array(z34.discriminatedUnion("type", [
|
|
21822
22115
|
textSchema,
|
|
21823
|
-
|
|
21824
|
-
|
|
22116
|
+
z34.looseObject({ type: z34.literal("thinking"), thinking: z34.string() }),
|
|
22117
|
+
z34.looseObject({ type: z34.literal("toolCall"), id: z34.string(), name: z34.string(), arguments: z34.record(z34.string(), z34.json()) })
|
|
21825
22118
|
])),
|
|
21826
|
-
api:
|
|
21827
|
-
provider:
|
|
21828
|
-
model:
|
|
21829
|
-
usage:
|
|
21830
|
-
input:
|
|
21831
|
-
output:
|
|
21832
|
-
cacheRead:
|
|
21833
|
-
cacheWrite:
|
|
21834
|
-
totalTokens:
|
|
21835
|
-
cost:
|
|
22119
|
+
api: z34.string(),
|
|
22120
|
+
provider: z34.string(),
|
|
22121
|
+
model: z34.string(),
|
|
22122
|
+
usage: z34.looseObject({
|
|
22123
|
+
input: z34.number(),
|
|
22124
|
+
output: z34.number(),
|
|
22125
|
+
cacheRead: z34.number(),
|
|
22126
|
+
cacheWrite: z34.number(),
|
|
22127
|
+
totalTokens: z34.number(),
|
|
22128
|
+
cost: z34.looseObject({ input: z34.number(), output: z34.number(), cacheRead: z34.number(), cacheWrite: z34.number(), total: z34.number() })
|
|
21836
22129
|
}),
|
|
21837
|
-
stopReason:
|
|
21838
|
-
timestamp:
|
|
22130
|
+
stopReason: z34.enum(["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"]),
|
|
22131
|
+
timestamp: z34.number()
|
|
21839
22132
|
});
|
|
21840
|
-
var toolResultMessageSchema =
|
|
21841
|
-
role:
|
|
21842
|
-
toolCallId:
|
|
21843
|
-
toolName:
|
|
21844
|
-
content:
|
|
21845
|
-
isError:
|
|
21846
|
-
timestamp:
|
|
22133
|
+
var toolResultMessageSchema = z34.looseObject({
|
|
22134
|
+
role: z34.literal("toolResult"),
|
|
22135
|
+
toolCallId: z34.string(),
|
|
22136
|
+
toolName: z34.string(),
|
|
22137
|
+
content: z34.array(z34.discriminatedUnion("type", [textSchema, imageSchema])),
|
|
22138
|
+
isError: z34.boolean(),
|
|
22139
|
+
timestamp: z34.number()
|
|
21847
22140
|
});
|
|
21848
|
-
var harnessAgentOutcomeSchema =
|
|
21849
|
-
agentId:
|
|
21850
|
-
assignmentId:
|
|
21851
|
-
status:
|
|
21852
|
-
response:
|
|
22141
|
+
var harnessAgentOutcomeSchema = z34.object({
|
|
22142
|
+
agentId: z34.string().uuid(),
|
|
22143
|
+
assignmentId: z34.string(),
|
|
22144
|
+
status: z34.enum(["completed", "cancelled", "error", "help"]),
|
|
22145
|
+
response: z34.string()
|
|
21853
22146
|
});
|
|
21854
22147
|
var HARNESS_AGENT_TYPES = ["general", "explore", "execute"];
|
|
21855
|
-
var harnessThreadOriginSchema =
|
|
21856
|
-
kind:
|
|
21857
|
-
agentType:
|
|
21858
|
-
parentThreadId:
|
|
21859
|
-
depth:
|
|
22148
|
+
var harnessThreadOriginSchema = z34.object({
|
|
22149
|
+
kind: z34.enum(["side_chat", "subagent"]),
|
|
22150
|
+
agentType: z34.enum(HARNESS_AGENT_TYPES).optional(),
|
|
22151
|
+
parentThreadId: z34.string().uuid(),
|
|
22152
|
+
depth: z34.number().int().nonnegative(),
|
|
21860
22153
|
message: userMessageSchema
|
|
21861
22154
|
});
|
|
21862
22155
|
var harnessInboxPayloadSchemas = {
|
|
21863
|
-
message:
|
|
22156
|
+
message: z34.looseObject({
|
|
21864
22157
|
message: userMessageSchema,
|
|
21865
|
-
userId:
|
|
21866
|
-
messageId:
|
|
22158
|
+
userId: z34.string().nullable(),
|
|
22159
|
+
messageId: z34.string().optional(),
|
|
21867
22160
|
agentOutcome: harnessAgentOutcomeSchema.optional(),
|
|
21868
|
-
model:
|
|
21869
|
-
thinkingLevel:
|
|
21870
|
-
instructionsHash:
|
|
21871
|
-
queued:
|
|
22161
|
+
model: z34.string().optional(),
|
|
22162
|
+
thinkingLevel: z34.enum(VALID_THINKING_LEVELS).optional(),
|
|
22163
|
+
instructionsHash: z34.string().optional(),
|
|
22164
|
+
queued: z34.boolean().optional(),
|
|
21872
22165
|
/** Stored only on a message whose `instructionsHash` differs from the message before it; later ones find it by hash. */
|
|
21873
|
-
instructions:
|
|
22166
|
+
instructions: z34.object({ environmentSystemPrompt: z34.string().optional(), customInstructions: z34.string().optional() }).optional(),
|
|
21874
22167
|
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional()
|
|
21875
22168
|
}),
|
|
21876
|
-
interrupt:
|
|
22169
|
+
interrupt: z34.looseObject({ userId: z34.string().nullable(), messageId: z34.string().optional(), cancelQueued: z34.boolean().optional() })
|
|
21877
22170
|
};
|
|
21878
|
-
var harnessEventBodySchema =
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
22171
|
+
var harnessEventBodySchema = z34.discriminatedUnion("type", [
|
|
22172
|
+
z34.object({ type: z34.literal("thread_origin"), payload: harnessThreadOriginSchema }),
|
|
22173
|
+
z34.object({ type: z34.literal("agent_outcome"), payload: harnessAgentOutcomeSchema }),
|
|
22174
|
+
z34.object({ type: z34.literal("user_message"), payload: harnessInboxPayloadSchemas.message }),
|
|
22175
|
+
z34.object({ type: z34.literal("cancelled_message"), payload: harnessInboxPayloadSchemas.message }),
|
|
22176
|
+
z34.object({ type: z34.literal("interrupt"), payload: harnessInboxPayloadSchemas.interrupt }),
|
|
21884
22177
|
/** Saved before its tool calls run. */
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
type:
|
|
22178
|
+
z34.object({ type: z34.literal("assistant_message"), payload: z34.looseObject({ message: assistantMessageSchema }) }),
|
|
22179
|
+
z34.object({ type: z34.literal("tool_result"), payload: z34.looseObject({ message: toolResultMessageSchema }) }),
|
|
22180
|
+
z34.object({
|
|
22181
|
+
type: z34.literal("status"),
|
|
21889
22182
|
/** `cost`: what calls since the last status that saved no step of their own cost at API prices, in USD. */
|
|
21890
|
-
payload:
|
|
22183
|
+
payload: z34.looseObject({ status: z34.enum(HARNESS_THREAD_STATUSES), cost: z34.number().optional() })
|
|
21891
22184
|
}),
|
|
21892
|
-
|
|
22185
|
+
z34.object({ type: z34.literal("error"), payload: z34.looseObject({ message: z34.string() }) }),
|
|
21893
22186
|
/** The model's context is this summary followed by the events from `firstKeptSeq` on; nothing before it is deleted. */
|
|
21894
|
-
|
|
21895
|
-
type:
|
|
21896
|
-
payload:
|
|
21897
|
-
summary:
|
|
21898
|
-
firstKeptSeq:
|
|
21899
|
-
tokensBefore:
|
|
21900
|
-
readFiles:
|
|
21901
|
-
modifiedFiles:
|
|
22187
|
+
z34.object({
|
|
22188
|
+
type: z34.literal("compaction"),
|
|
22189
|
+
payload: z34.looseObject({
|
|
22190
|
+
summary: z34.string(),
|
|
22191
|
+
firstKeptSeq: z34.number(),
|
|
22192
|
+
tokensBefore: z34.number(),
|
|
22193
|
+
readFiles: z34.array(z34.string()),
|
|
22194
|
+
modifiedFiles: z34.array(z34.string()),
|
|
21902
22195
|
/** The summary call's cost at API prices, in USD; absent on compactions saved before it was recorded. */
|
|
21903
|
-
cost:
|
|
22196
|
+
cost: z34.number().optional()
|
|
21904
22197
|
})
|
|
21905
22198
|
})
|
|
21906
22199
|
]);
|
|
21907
|
-
var harnessLiveMessageSchema =
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
|
|
21911
|
-
|
|
21912
|
-
|
|
22200
|
+
var harnessLiveMessageSchema = z34.union([
|
|
22201
|
+
z34.object({ type: z34.literal("delta"), streamId: z34.string(), text: z34.string() }),
|
|
22202
|
+
z34.object({ type: z34.literal("delta"), streamId: z34.string(), thinking: z34.string() }),
|
|
22203
|
+
z34.object({ type: z34.literal("delta"), streamId: z34.string(), toolCall: z34.object({ id: z34.string(), name: z34.string(), argumentsDelta: z34.string() }) }),
|
|
22204
|
+
z34.object({ type: z34.literal("step_saved"), seq: z34.number() }),
|
|
22205
|
+
z34.object({ type: z34.literal("status"), status: z34.enum(HARNESS_THREAD_STATUSES) })
|
|
21913
22206
|
]);
|
|
21914
22207
|
|
|
21915
22208
|
// ../shared/src/harness/context.ts
|
|
21916
22209
|
var MAX_REFERENCE_IMAGE_BYTES = 8 * 1024 * 1024;
|
|
21917
22210
|
|
|
21918
22211
|
// ../shared/src/harness/worker-routes.ts
|
|
21919
|
-
import { z as
|
|
21920
|
-
var harnessWorkerEngineRequestSchema =
|
|
22212
|
+
import { z as z35 } from "zod";
|
|
22213
|
+
var harnessWorkerEngineRequestSchema = z35.object({
|
|
21921
22214
|
/** The engine we were given didn't answer, so the monolith checks the provider instead of trusting the workspace's status. */
|
|
21922
|
-
unreachable:
|
|
22215
|
+
unreachable: z35.boolean().optional()
|
|
21923
22216
|
});
|
|
21924
|
-
var harnessWorkerEngineResponseSchema =
|
|
21925
|
-
|
|
21926
|
-
|
|
22217
|
+
var harnessWorkerEngineResponseSchema = z35.discriminatedUnion("status", [
|
|
22218
|
+
z35.object({ status: z35.literal("ready"), engineUrl: z35.string(), headers: z35.record(z35.string(), z35.string()) }),
|
|
22219
|
+
z35.object({ status: z35.literal("waking") })
|
|
21927
22220
|
]);
|
|
21928
|
-
var harnessWorkerCredentialRequestSchema =
|
|
22221
|
+
var harnessWorkerCredentialRequestSchema = z35.object({
|
|
21929
22222
|
/** The credential the model rejected, so the monolith refreshes it or moves to the next one instead of handing it back. */
|
|
21930
22223
|
failedCredential: agentCredentialSnapshotSchema.optional(),
|
|
21931
22224
|
// A worker from before Claude models sends none, and only ever calls OpenAI.
|
|
21932
|
-
modelProvider:
|
|
22225
|
+
modelProvider: z35.enum(REPLICAS_MODEL_PROVIDERS).default("openai")
|
|
21933
22226
|
});
|
|
21934
|
-
var harnessWorkerCredentialResponseSchema =
|
|
21935
|
-
|
|
21936
|
-
|
|
22227
|
+
var harnessWorkerCredentialResponseSchema = z35.discriminatedUnion("method", [
|
|
22228
|
+
z35.object({ method: z35.literal("oauth"), accessToken: z35.string(), expiresAt: z35.string(), credential: agentCredentialSnapshotSchema }),
|
|
22229
|
+
z35.object({ method: z35.literal("api_key"), apiKey: z35.string(), credential: agentCredentialSnapshotSchema })
|
|
21937
22230
|
]);
|
|
21938
|
-
var harnessWorkerTurnCompleteRequestSchema =
|
|
22231
|
+
var harnessWorkerTurnCompleteRequestSchema = z35.object({ errors: z35.array(z35.string()) });
|
|
21939
22232
|
|
|
21940
22233
|
// ../shared/src/auth-errors.ts
|
|
21941
22234
|
var AUTHENTICATION_ERROR_PATTERNS = [
|
|
@@ -21999,10 +22292,10 @@ var RECONNECT_GIVE_UP_MS = 2 * 6e4;
|
|
|
21999
22292
|
var encoder3 = new TextEncoder();
|
|
22000
22293
|
|
|
22001
22294
|
// ../shared/src/routes/billing.ts
|
|
22002
|
-
import { z as
|
|
22295
|
+
import { z as z36 } from "zod";
|
|
22003
22296
|
var SOURCE_LIMIT_SOURCES = ["limrun", "modal", "revyl"];
|
|
22004
|
-
var usageLimitCentsSchema =
|
|
22005
|
-
var sourceLimitsCentsSchema =
|
|
22297
|
+
var usageLimitCentsSchema = z36.number().int().min(100).max(1e8);
|
|
22298
|
+
var sourceLimitsCentsSchema = z36.partialRecord(z36.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
|
|
22006
22299
|
|
|
22007
22300
|
// ../shared/src/routes/codex.ts
|
|
22008
22301
|
var CODEX_AUTH_ENV_KEYS = [
|
|
@@ -22156,7 +22449,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
22156
22449
|
};
|
|
22157
22450
|
|
|
22158
22451
|
// ../shared/src/routes/command-protection.ts
|
|
22159
|
-
import { z as
|
|
22452
|
+
import { z as z37 } from "zod";
|
|
22160
22453
|
|
|
22161
22454
|
// ../shared/src/git-invocations.ts
|
|
22162
22455
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -22247,34 +22540,34 @@ function findCheckoutTarget(args) {
|
|
|
22247
22540
|
}
|
|
22248
22541
|
|
|
22249
22542
|
// ../shared/src/routes/command-protection.ts
|
|
22250
|
-
var commandProtectionRepoStateSchema =
|
|
22251
|
-
branch:
|
|
22252
|
-
defaultBranch:
|
|
22253
|
-
pushBranch:
|
|
22254
|
-
pushConfig:
|
|
22255
|
-
headMessage:
|
|
22256
|
-
mergeInProgress:
|
|
22543
|
+
var commandProtectionRepoStateSchema = z37.object({
|
|
22544
|
+
branch: z37.string().nullable(),
|
|
22545
|
+
defaultBranch: z37.string().nullable(),
|
|
22546
|
+
pushBranch: z37.string().nullable(),
|
|
22547
|
+
pushConfig: z37.string().nullable(),
|
|
22548
|
+
headMessage: z37.string().nullable(),
|
|
22549
|
+
mergeInProgress: z37.boolean().optional()
|
|
22257
22550
|
});
|
|
22258
|
-
var commandProtectionEvaluateRequestSchema =
|
|
22259
|
-
provider:
|
|
22260
|
-
source:
|
|
22261
|
-
toolName:
|
|
22262
|
-
toolInput:
|
|
22263
|
-
command:
|
|
22264
|
-
cwd:
|
|
22265
|
-
toolUseId:
|
|
22551
|
+
var commandProtectionEvaluateRequestSchema = z37.object({
|
|
22552
|
+
provider: z37.enum(["claude", "codex", "cursor", "opencode", "pi", "harness"]),
|
|
22553
|
+
source: z37.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call", "harness_tool_call"]),
|
|
22554
|
+
toolName: z37.string(),
|
|
22555
|
+
toolInput: z37.unknown(),
|
|
22556
|
+
command: z37.string().nullish(),
|
|
22557
|
+
cwd: z37.string().nullish(),
|
|
22558
|
+
toolUseId: z37.string().nullish(),
|
|
22266
22559
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
22267
22560
|
// policy can see branches and commit messages the command text only references.
|
|
22268
|
-
gitContext:
|
|
22269
|
-
repos:
|
|
22270
|
-
messageFiles:
|
|
22561
|
+
gitContext: z37.object({
|
|
22562
|
+
repos: z37.record(z37.string(), commandProtectionRepoStateSchema),
|
|
22563
|
+
messageFiles: z37.record(z37.string(), z37.string())
|
|
22271
22564
|
}).optional()
|
|
22272
22565
|
});
|
|
22273
|
-
var commandProtectionEvaluateResponseSchema =
|
|
22274
|
-
allowed:
|
|
22275
|
-
enabled:
|
|
22276
|
-
reason:
|
|
22277
|
-
matchedSignals:
|
|
22566
|
+
var commandProtectionEvaluateResponseSchema = z37.object({
|
|
22567
|
+
allowed: z37.boolean(),
|
|
22568
|
+
enabled: z37.boolean(),
|
|
22569
|
+
reason: z37.string().optional(),
|
|
22570
|
+
matchedSignals: z37.array(z37.string()).optional()
|
|
22278
22571
|
});
|
|
22279
22572
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
22280
22573
|
function stringifyCommandProtectionInput(value) {
|
|
@@ -22514,153 +22807,153 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
22514
22807
|
}
|
|
22515
22808
|
|
|
22516
22809
|
// ../shared/src/routes/scout.ts
|
|
22517
|
-
import { z as
|
|
22810
|
+
import { z as z38 } from "zod";
|
|
22518
22811
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
22519
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
22520
|
-
comment_id:
|
|
22521
|
-
action:
|
|
22812
|
+
var scoutLinearSessionIntentRequestSchema = z38.object({
|
|
22813
|
+
comment_id: z38.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
22814
|
+
action: z38.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
22522
22815
|
});
|
|
22523
|
-
var scoutLinearStartRequestSchema =
|
|
22524
|
-
issue_id:
|
|
22525
|
-
agent_session_id:
|
|
22526
|
-
prompt:
|
|
22816
|
+
var scoutLinearStartRequestSchema = z38.object({
|
|
22817
|
+
issue_id: z38.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
22818
|
+
agent_session_id: z38.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
22819
|
+
prompt: z38.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
22527
22820
|
});
|
|
22528
|
-
var scoutRouteLinearTicketRequestSchema =
|
|
22529
|
-
agent_session_id:
|
|
22530
|
-
environment_id:
|
|
22531
|
-
manager_id:
|
|
22532
|
-
mothership_id:
|
|
22821
|
+
var scoutRouteLinearTicketRequestSchema = z38.object({
|
|
22822
|
+
agent_session_id: z38.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
|
|
22823
|
+
environment_id: z38.string().trim().min(1).optional().describe("Start the ticket in this environment."),
|
|
22824
|
+
manager_id: z38.string().trim().min(1).optional().describe("Hand the ticket to this Manager instead."),
|
|
22825
|
+
mothership_id: z38.string().trim().min(1).optional().describe("Old name of `manager_id`.")
|
|
22533
22826
|
}).refine((args) => !(args.environment_id && (args.manager_id || args.mothership_id)), "Pass environment_id or manager_id, not both.");
|
|
22534
|
-
var slackChannelIdSchema =
|
|
22535
|
-
var slackThreadTsSchema =
|
|
22536
|
-
var scoutSlackMessageReferenceSchema =
|
|
22827
|
+
var slackChannelIdSchema = z38.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
22828
|
+
var slackThreadTsSchema = z38.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
22829
|
+
var scoutSlackMessageReferenceSchema = z38.object({
|
|
22537
22830
|
channel_id: slackChannelIdSchema,
|
|
22538
22831
|
thread_ts: slackThreadTsSchema,
|
|
22539
|
-
message_ts:
|
|
22540
|
-
user_id:
|
|
22832
|
+
message_ts: z38.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
22833
|
+
user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
|
|
22541
22834
|
});
|
|
22542
|
-
var scoutSlackSpawnRequestSchema =
|
|
22835
|
+
var scoutSlackSpawnRequestSchema = z38.object({
|
|
22543
22836
|
channel_id: slackChannelIdSchema,
|
|
22544
22837
|
thread_ts: slackThreadTsSchema,
|
|
22545
|
-
message_ts:
|
|
22546
|
-
user_id:
|
|
22547
|
-
prompt:
|
|
22548
|
-
acknowledgement_ts:
|
|
22549
|
-
environment_id:
|
|
22838
|
+
message_ts: z38.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."),
|
|
22839
|
+
user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
22840
|
+
prompt: z38.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."),
|
|
22841
|
+
acknowledgement_ts: z38.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."),
|
|
22842
|
+
environment_id: z38.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.`)
|
|
22550
22843
|
});
|
|
22551
22844
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
22552
|
-
title:
|
|
22553
|
-
prompt:
|
|
22554
|
-
acknowledgement_ts:
|
|
22845
|
+
title: z38.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
22846
|
+
prompt: z38.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."),
|
|
22847
|
+
acknowledgement_ts: z38.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.")
|
|
22555
22848
|
});
|
|
22556
|
-
var scoutSlackRelayRequestSchema =
|
|
22849
|
+
var scoutSlackRelayRequestSchema = z38.object({
|
|
22557
22850
|
channel_id: slackChannelIdSchema,
|
|
22558
22851
|
thread_ts: slackThreadTsSchema,
|
|
22559
|
-
message:
|
|
22560
|
-
user_id:
|
|
22561
|
-
queue:
|
|
22562
|
-
workspace_id:
|
|
22563
|
-
message_ts:
|
|
22852
|
+
message: z38.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."),
|
|
22853
|
+
user_id: z38.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`."),
|
|
22854
|
+
queue: z38.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."),
|
|
22855
|
+
workspace_id: z38.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 Manager 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 Manager's channel, nothing is bound: the workspace or Manager 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.`),
|
|
22856
|
+
message_ts: z38.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.")
|
|
22564
22857
|
});
|
|
22565
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
22858
|
+
var scoutSlackSetThreadMutedRequestSchema = z38.object({
|
|
22566
22859
|
channel_id: slackChannelIdSchema,
|
|
22567
22860
|
thread_ts: slackThreadTsSchema,
|
|
22568
|
-
muted:
|
|
22861
|
+
muted: z38.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
22569
22862
|
});
|
|
22570
22863
|
var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
|
|
22571
|
-
archive:
|
|
22864
|
+
archive: z38.boolean().describe("true only when the person also asked to close or archive the workspace.")
|
|
22572
22865
|
});
|
|
22573
|
-
var scoutListWorkspacesRequestSchema =
|
|
22866
|
+
var scoutListWorkspacesRequestSchema = z38.object({
|
|
22574
22867
|
channel_id: slackChannelIdSchema,
|
|
22575
22868
|
thread_ts: slackThreadTsSchema,
|
|
22576
|
-
message_ts:
|
|
22577
|
-
user_id:
|
|
22578
|
-
query:
|
|
22869
|
+
message_ts: z38.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
22870
|
+
user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
22871
|
+
query: z38.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Manager names and pull request URLs.")
|
|
22579
22872
|
});
|
|
22580
|
-
var scoutSlackConfirmationSchema =
|
|
22581
|
-
confirmation_channel_id:
|
|
22582
|
-
confirmation_thread_ts:
|
|
22583
|
-
confirmation_message_ts:
|
|
22584
|
-
confirmation_user_id:
|
|
22873
|
+
var scoutSlackConfirmationSchema = z38.object({
|
|
22874
|
+
confirmation_channel_id: z38.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
22875
|
+
confirmation_thread_ts: z38.string().describe("`thread_ts` from that message's envelope."),
|
|
22876
|
+
confirmation_message_ts: z38.string().describe("`message_ts` from that message's envelope."),
|
|
22877
|
+
confirmation_user_id: z38.string().describe("`user_id` from that message's envelope.")
|
|
22585
22878
|
});
|
|
22586
22879
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
22587
22880
|
var scoutSettingsConfirmationSchema = scoutSlackConfirmationSchema.partial().extend({
|
|
22588
|
-
confirmation_dashboard_token:
|
|
22881
|
+
confirmation_dashboard_token: z38.string().optional().describe("For a request from a person in the Replicas dashboard: the `confirmation_dashboard_token` given in that message. Pass it instead of the Slack `confirmation_*` fields; the server authorizes the person who sent it, while it is still the latest message in its chat.")
|
|
22589
22882
|
});
|
|
22590
22883
|
var scoutSaveChannelPresetToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22591
|
-
preset_id:
|
|
22592
|
-
name:
|
|
22593
|
-
description:
|
|
22594
|
-
icon:
|
|
22595
|
-
instructions:
|
|
22884
|
+
preset_id: z38.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
22885
|
+
name: z38.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
22886
|
+
description: z38.string().optional().describe("One-line summary of what the preset is for."),
|
|
22887
|
+
icon: z38.enum(SCOUT_PRESET_ICONS).optional(),
|
|
22888
|
+
instructions: z38.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
22596
22889
|
});
|
|
22597
22890
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22598
|
-
source:
|
|
22599
|
-
external_id:
|
|
22600
|
-
monitored:
|
|
22601
|
-
preset_id:
|
|
22602
|
-
instructions:
|
|
22603
|
-
proactivity:
|
|
22604
|
-
silent:
|
|
22605
|
-
muted:
|
|
22891
|
+
source: z38.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
22892
|
+
external_id: z38.string().describe("Slack channel id or Linear team id."),
|
|
22893
|
+
monitored: z38.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."),
|
|
22894
|
+
preset_id: z38.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
22895
|
+
instructions: z38.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
|
|
22896
|
+
proactivity: z38.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."),
|
|
22897
|
+
silent: z38.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
|
|
22898
|
+
muted: z38.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
|
|
22606
22899
|
});
|
|
22607
22900
|
var managerSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
22608
22901
|
proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Manager's channel raises to at least `balanced`.")
|
|
22609
22902
|
});
|
|
22610
22903
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22611
|
-
muted:
|
|
22904
|
+
muted: z38.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
|
|
22612
22905
|
});
|
|
22613
22906
|
var scoutSetSlackConnectDefaultsToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22614
|
-
silent:
|
|
22615
|
-
muted:
|
|
22616
|
-
preset_id:
|
|
22617
|
-
instructions:
|
|
22618
|
-
proactivity:
|
|
22907
|
+
silent: z38.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
|
|
22908
|
+
muted: z38.boolean().optional().describe("Kept for older callers; prefer `silent`."),
|
|
22909
|
+
preset_id: z38.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
|
|
22910
|
+
instructions: z38.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
|
|
22911
|
+
proactivity: z38.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.")
|
|
22619
22912
|
});
|
|
22620
22913
|
var scoutSetOrganizationProactivityToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22621
|
-
proactivity:
|
|
22914
|
+
proactivity: z38.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.`)
|
|
22622
22915
|
});
|
|
22623
22916
|
var scoutDeleteChannelPresetToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22624
|
-
preset_id:
|
|
22917
|
+
preset_id: z38.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
22625
22918
|
});
|
|
22626
22919
|
var RESET_TO_DEFAULT = "default";
|
|
22627
|
-
var resettable = (schema, description2) =>
|
|
22920
|
+
var resettable = (schema, description2) => z38.union([schema, z38.literal(RESET_TO_DEFAULT)]).optional().describe(`${description2} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
|
|
22628
22921
|
var scoutSetSlackAgentDefaultsToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22629
|
-
agent_provider: resettable(
|
|
22630
|
-
model: resettable(
|
|
22631
|
-
thinking_level: resettable(
|
|
22632
|
-
goal_mode: resettable(
|
|
22633
|
-
fast_mode: resettable(
|
|
22922
|
+
agent_provider: resettable(z38.enum(VALID_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
|
|
22923
|
+
model: resettable(z38.string(), "Model id for that agent; the default is the agent's own."),
|
|
22924
|
+
thinking_level: resettable(z38.enum(VALID_THINKING_LEVELS), "Thinking level."),
|
|
22925
|
+
goal_mode: resettable(z38.boolean(), "Goal mode."),
|
|
22926
|
+
fast_mode: resettable(z38.boolean(), "Fast mode.")
|
|
22634
22927
|
});
|
|
22635
|
-
var scoutClaimSettingsOfferToolInputSchema =
|
|
22928
|
+
var scoutClaimSettingsOfferToolInputSchema = z38.object({
|
|
22636
22929
|
channel_id: slackChannelIdSchema,
|
|
22637
|
-
kind:
|
|
22638
|
-
user_id:
|
|
22639
|
-
declined:
|
|
22930
|
+
kind: z38.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."),
|
|
22931
|
+
user_id: z38.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."),
|
|
22932
|
+
declined: z38.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
|
|
22640
22933
|
});
|
|
22641
22934
|
|
|
22642
22935
|
// ../shared/src/routes/sentry.ts
|
|
22643
|
-
import { z as
|
|
22644
|
-
var sentrySelfHostedConnectRequestSchema =
|
|
22645
|
-
baseUrl:
|
|
22646
|
-
token:
|
|
22647
|
-
webhookSecret:
|
|
22936
|
+
import { z as z39 } from "zod";
|
|
22937
|
+
var sentrySelfHostedConnectRequestSchema = z39.object({
|
|
22938
|
+
baseUrl: z39.string().min(1),
|
|
22939
|
+
token: z39.string().trim().min(1),
|
|
22940
|
+
webhookSecret: z39.string().trim().optional()
|
|
22648
22941
|
});
|
|
22649
22942
|
|
|
22650
22943
|
// ../shared/src/routes/user.ts
|
|
22651
22944
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
22652
22945
|
|
|
22653
22946
|
// ../shared/src/routes/web-auth.ts
|
|
22654
|
-
import { z as
|
|
22655
|
-
var webAuthRedeemResponseSchema =
|
|
22656
|
-
path:
|
|
22657
|
-
organizationId:
|
|
22658
|
-
session:
|
|
22947
|
+
import { z as z40 } from "zod";
|
|
22948
|
+
var webAuthRedeemResponseSchema = z40.object({
|
|
22949
|
+
path: z40.string(),
|
|
22950
|
+
organizationId: z40.string().nullable(),
|
|
22951
|
+
session: z40.object({ access_token: z40.string(), refresh_token: z40.string(), user: z40.object({ id: z40.string(), email: z40.string() }) }).nullable()
|
|
22659
22952
|
});
|
|
22660
22953
|
|
|
22661
22954
|
// ../shared/src/routes/themes.ts
|
|
22662
|
-
import { z as
|
|
22663
|
-
var updateThemeRequestSchema =
|
|
22955
|
+
import { z as z41 } from "zod";
|
|
22956
|
+
var updateThemeRequestSchema = z41.object({ theme: z41.string(), palette: z41.string(), accent: z41.string(), code: z41.string() }).partial();
|
|
22664
22957
|
|
|
22665
22958
|
// ../shared/src/routes/client-state.ts
|
|
22666
22959
|
var MAX_CLIENT_STATE_REQUEST_BYTES = 5 * 1024 * 1024;
|
|
@@ -22686,106 +22979,106 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
|
|
|
22686
22979
|
var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
|
|
22687
22980
|
|
|
22688
22981
|
// ../shared/src/routes/workspace-events.ts
|
|
22689
|
-
import { z as
|
|
22982
|
+
import { z as z43 } from "zod";
|
|
22690
22983
|
|
|
22691
22984
|
// ../shared/src/routes/presence.ts
|
|
22692
|
-
import { z as
|
|
22693
|
-
var presenceStatusSchema =
|
|
22694
|
-
var presenceLocationSchema =
|
|
22695
|
-
workspaceId:
|
|
22985
|
+
import { z as z42 } from "zod";
|
|
22986
|
+
var presenceStatusSchema = z42.enum(["online", "typing"]);
|
|
22987
|
+
var presenceLocationSchema = z42.object({
|
|
22988
|
+
workspaceId: z42.string().optional()
|
|
22696
22989
|
});
|
|
22697
|
-
var presenceEntrySchema =
|
|
22698
|
-
userId:
|
|
22990
|
+
var presenceEntrySchema = z42.object({
|
|
22991
|
+
userId: z42.string(),
|
|
22699
22992
|
status: presenceStatusSchema,
|
|
22700
22993
|
location: presenceLocationSchema,
|
|
22701
|
-
ts:
|
|
22994
|
+
ts: z42.string()
|
|
22702
22995
|
});
|
|
22703
|
-
var updatePresenceRequestSchema =
|
|
22996
|
+
var updatePresenceRequestSchema = z42.object({
|
|
22704
22997
|
status: presenceStatusSchema,
|
|
22705
22998
|
location: presenceLocationSchema.optional()
|
|
22706
22999
|
});
|
|
22707
23000
|
|
|
22708
23001
|
// ../shared/src/routes/workspace-events.ts
|
|
22709
|
-
var workspaceTurnCompletionSchema =
|
|
22710
|
-
workspaceName:
|
|
22711
|
-
completedAt:
|
|
22712
|
-
processing:
|
|
22713
|
-
pullRequestFeedback:
|
|
22714
|
-
attention:
|
|
23002
|
+
var workspaceTurnCompletionSchema = z43.object({
|
|
23003
|
+
workspaceName: z43.string(),
|
|
23004
|
+
completedAt: z43.string(),
|
|
23005
|
+
processing: z43.boolean().optional(),
|
|
23006
|
+
pullRequestFeedback: z43.boolean().optional(),
|
|
23007
|
+
attention: z43.object({ reason: z43.enum(CHAT_ATTENTION_REASONS), userId: z43.string() }).optional()
|
|
22715
23008
|
});
|
|
22716
|
-
var workspaceEventSchemaByType =
|
|
22717
|
-
|
|
22718
|
-
type:
|
|
22719
|
-
workspaceId:
|
|
22720
|
-
accessChangedFor:
|
|
22721
|
-
accessChangedForOrg:
|
|
22722
|
-
workspace:
|
|
22723
|
-
name:
|
|
23009
|
+
var workspaceEventSchemaByType = z43.discriminatedUnion("type", [
|
|
23010
|
+
z43.object({
|
|
23011
|
+
type: z43.literal("workspace.changed"),
|
|
23012
|
+
workspaceId: z43.string(),
|
|
23013
|
+
accessChangedFor: z43.string().optional(),
|
|
23014
|
+
accessChangedForOrg: z43.literal(true).optional(),
|
|
23015
|
+
workspace: z43.object({ status: z43.enum(WORKSPACE_STATUSES), last_activity_at: z43.string().nullable() }).optional(),
|
|
23016
|
+
name: z43.string().optional(),
|
|
22724
23017
|
completion: workspaceTurnCompletionSchema.optional(),
|
|
22725
|
-
ts:
|
|
23018
|
+
ts: z43.string()
|
|
22726
23019
|
}),
|
|
22727
|
-
|
|
22728
|
-
type:
|
|
22729
|
-
workspaceId:
|
|
22730
|
-
chatId:
|
|
22731
|
-
ts:
|
|
23020
|
+
z43.object({
|
|
23021
|
+
type: z43.literal("workspace.chat.changed"),
|
|
23022
|
+
workspaceId: z43.string(),
|
|
23023
|
+
chatId: z43.string(),
|
|
23024
|
+
ts: z43.string()
|
|
22732
23025
|
}),
|
|
22733
|
-
|
|
22734
|
-
type:
|
|
22735
|
-
workspaceId:
|
|
22736
|
-
chatId:
|
|
22737
|
-
afterCursor:
|
|
22738
|
-
processing:
|
|
22739
|
-
ts:
|
|
23026
|
+
z43.object({
|
|
23027
|
+
type: z43.literal("workspace.chat.advanced"),
|
|
23028
|
+
workspaceId: z43.string(),
|
|
23029
|
+
chatId: z43.string(),
|
|
23030
|
+
afterCursor: z43.string().optional(),
|
|
23031
|
+
processing: z43.boolean(),
|
|
23032
|
+
ts: z43.string()
|
|
22740
23033
|
}),
|
|
22741
|
-
|
|
22742
|
-
type:
|
|
22743
|
-
workspaceId:
|
|
22744
|
-
ts:
|
|
23034
|
+
z43.object({
|
|
23035
|
+
type: z43.literal("mobile-testing.changed"),
|
|
23036
|
+
workspaceId: z43.string(),
|
|
23037
|
+
ts: z43.string()
|
|
22745
23038
|
}),
|
|
22746
|
-
|
|
22747
|
-
type:
|
|
22748
|
-
workspaceId:
|
|
22749
|
-
ts:
|
|
23039
|
+
z43.object({
|
|
23040
|
+
type: z43.literal("variable-request.changed"),
|
|
23041
|
+
workspaceId: z43.string(),
|
|
23042
|
+
ts: z43.string()
|
|
22750
23043
|
}),
|
|
22751
|
-
|
|
22752
|
-
type:
|
|
22753
|
-
workspaceId:
|
|
22754
|
-
ts:
|
|
23044
|
+
z43.object({
|
|
23045
|
+
type: z43.literal("local-control-request.changed"),
|
|
23046
|
+
workspaceId: z43.string(),
|
|
23047
|
+
ts: z43.string()
|
|
22755
23048
|
}),
|
|
22756
|
-
|
|
22757
|
-
type:
|
|
22758
|
-
prUrl:
|
|
22759
|
-
ts:
|
|
23049
|
+
z43.object({
|
|
23050
|
+
type: z43.literal("pull-request.changed"),
|
|
23051
|
+
prUrl: z43.string(),
|
|
23052
|
+
ts: z43.string()
|
|
22760
23053
|
}),
|
|
22761
|
-
|
|
22762
|
-
type:
|
|
22763
|
-
workspaceId:
|
|
22764
|
-
subagent:
|
|
22765
|
-
ts:
|
|
23054
|
+
z43.object({
|
|
23055
|
+
type: z43.enum(["manager.subagent.changed", "mothership.subagent.changed"]),
|
|
23056
|
+
workspaceId: z43.string(),
|
|
23057
|
+
subagent: z43.object({ id: z43.string(), name: z43.string(), prUrl: z43.string().nullable() }),
|
|
23058
|
+
ts: z43.string()
|
|
22766
23059
|
}),
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
type:
|
|
22772
|
-
workspaceId:
|
|
22773
|
-
workspaceName:
|
|
22774
|
-
sharedWithUserId:
|
|
22775
|
-
sharedByName:
|
|
22776
|
-
ts:
|
|
23060
|
+
z43.object({ type: z43.enum(["manager.board.changed", "mothership.board.changed"]), workspaceId: z43.string(), ts: z43.string() }),
|
|
23061
|
+
z43.object({ type: z43.literal("issues.synced"), syncId: z43.number(), ts: z43.string() }),
|
|
23062
|
+
z43.object({ type: z43.literal("needs-you.changed"), workspaceId: z43.string().nullable(), userId: z43.string().optional(), ts: z43.string() }),
|
|
23063
|
+
z43.object({
|
|
23064
|
+
type: z43.literal("workspace.shared"),
|
|
23065
|
+
workspaceId: z43.string(),
|
|
23066
|
+
workspaceName: z43.string(),
|
|
23067
|
+
sharedWithUserId: z43.string(),
|
|
23068
|
+
sharedByName: z43.string(),
|
|
23069
|
+
ts: z43.string()
|
|
22777
23070
|
}),
|
|
22778
|
-
|
|
23071
|
+
z43.object({ type: z43.literal("client-state.changed"), userId: z43.string(), keys: z43.array(z43.string()), ts: z43.string() })
|
|
22779
23072
|
]);
|
|
22780
|
-
var workspaceChangedEventSchema =
|
|
23073
|
+
var workspaceChangedEventSchema = z43.union([
|
|
22781
23074
|
workspaceEventSchemaByType,
|
|
22782
|
-
|
|
22783
|
-
|
|
23075
|
+
z43.object({ type: z43.literal("presence.changed"), userId: z43.string(), entry: presenceEntrySchema.nullable(), ts: z43.string() }),
|
|
23076
|
+
z43.object({ type: z43.literal("presence.changed"), ts: z43.string() })
|
|
22784
23077
|
]);
|
|
22785
23078
|
|
|
22786
23079
|
// ../shared/src/routes/review-messages.ts
|
|
22787
|
-
import { z as
|
|
22788
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
23080
|
+
import { z as z44 } from "zod";
|
|
23081
|
+
var sendPullRequestReviewMessageRequestSchema = z44.object({
|
|
22789
23082
|
...sendChatMessageRequestSchema.pick({
|
|
22790
23083
|
message: true,
|
|
22791
23084
|
messageId: true,
|
|
@@ -22798,8 +23091,8 @@ var sendPullRequestReviewMessageRequestSchema = z42.object({
|
|
|
22798
23091
|
ultrafastMode: true
|
|
22799
23092
|
}).shape,
|
|
22800
23093
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
22801
|
-
newChat:
|
|
22802
|
-
provider:
|
|
23094
|
+
newChat: z44.boolean().optional(),
|
|
23095
|
+
provider: z44.enum(VALID_AGENT_PROVIDERS).optional()
|
|
22803
23096
|
});
|
|
22804
23097
|
|
|
22805
23098
|
// ../shared/src/audit-log.ts
|
|
@@ -23245,232 +23538,6 @@ var SCHEDULE_TIMEZONES = typeof Intl.supportedValuesOf === "function" ? ["UTC",
|
|
|
23245
23538
|
// ../shared/src/automations/form.ts
|
|
23246
23539
|
var AUTOMATION_AUTO_STOP_RANGE_LABEL = `${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MIN}-${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MAX}`;
|
|
23247
23540
|
|
|
23248
|
-
// ../shared/src/routes/issues.ts
|
|
23249
|
-
import { z as z43 } from "zod";
|
|
23250
|
-
var ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
|
|
23251
|
-
var ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
|
|
23252
|
-
var ISSUE_ACTOR_TYPES = ["user", "workspace"];
|
|
23253
|
-
var ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
|
|
23254
|
-
var ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
|
|
23255
|
-
var ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
|
|
23256
|
-
var issueStatusSchema = z43.enum(ISSUE_STATUSES);
|
|
23257
|
-
var issuePrioritySchema = z43.enum(ISSUE_PRIORITIES);
|
|
23258
|
-
var issueSubscriberRoleSchema = z43.enum(ISSUE_SUBSCRIBER_ROLES);
|
|
23259
|
-
var issueRelationTypeSchema = z43.enum(ISSUE_RELATION_TYPES);
|
|
23260
|
-
var issuePullRequestStateSchema = z43.enum(ISSUE_PULL_REQUEST_STATES);
|
|
23261
|
-
var issueActorSchema = z43.object({
|
|
23262
|
-
type: z43.enum(ISSUE_ACTOR_TYPES),
|
|
23263
|
-
id: z43.string().toLowerCase().uuid()
|
|
23264
|
-
});
|
|
23265
|
-
var ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
|
|
23266
|
-
var timestamp = z43.string();
|
|
23267
|
-
var nullableTimestamp = timestamp.nullable();
|
|
23268
|
-
var issueSchema2 = z43.object({
|
|
23269
|
-
id: z43.string().uuid(),
|
|
23270
|
-
organization_id: z43.string().uuid(),
|
|
23271
|
-
number: z43.number().int(),
|
|
23272
|
-
identifier: z43.string(),
|
|
23273
|
-
title: z43.string(),
|
|
23274
|
-
description: z43.string(),
|
|
23275
|
-
status: issueStatusSchema,
|
|
23276
|
-
priority: issuePrioritySchema,
|
|
23277
|
-
parent_id: z43.string().uuid().nullable(),
|
|
23278
|
-
manager_id: z43.string().uuid().nullable(),
|
|
23279
|
-
creator: issueActorSchema,
|
|
23280
|
-
/** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
|
|
23281
|
-
sort_order: z43.number(),
|
|
23282
|
-
created_at: timestamp,
|
|
23283
|
-
updated_at: timestamp,
|
|
23284
|
-
completed_at: nullableTimestamp,
|
|
23285
|
-
canceled_at: nullableTimestamp,
|
|
23286
|
-
archived_at: nullableTimestamp
|
|
23287
|
-
});
|
|
23288
|
-
var issueSubscriberSchema = z43.object({
|
|
23289
|
-
issue_id: z43.string().uuid(),
|
|
23290
|
-
subscriber: issueActorSchema,
|
|
23291
|
-
role: issueSubscriberRoleSchema,
|
|
23292
|
-
created_at: timestamp
|
|
23293
|
-
});
|
|
23294
|
-
var issueRelationSchema = z43.object({
|
|
23295
|
-
id: z43.string().uuid(),
|
|
23296
|
-
type: issueRelationTypeSchema,
|
|
23297
|
-
issue_id: z43.string().uuid(),
|
|
23298
|
-
related_issue_id: z43.string().uuid(),
|
|
23299
|
-
created_at: timestamp
|
|
23300
|
-
});
|
|
23301
|
-
var issuePullRequestSchema = z43.object({
|
|
23302
|
-
id: z43.string().uuid(),
|
|
23303
|
-
issue_id: z43.string().uuid(),
|
|
23304
|
-
url: z43.string(),
|
|
23305
|
-
pull_request_id: z43.string().uuid().nullable(),
|
|
23306
|
-
title: z43.string().nullable(),
|
|
23307
|
-
state: issuePullRequestStateSchema,
|
|
23308
|
-
created_at: timestamp,
|
|
23309
|
-
updated_at: timestamp
|
|
23310
|
-
});
|
|
23311
|
-
var issueCommentSchema = z43.object({
|
|
23312
|
-
id: z43.string().uuid(),
|
|
23313
|
-
issue_id: z43.string().uuid(),
|
|
23314
|
-
author: issueActorSchema,
|
|
23315
|
-
body: z43.string(),
|
|
23316
|
-
created_at: timestamp,
|
|
23317
|
-
updated_at: timestamp
|
|
23318
|
-
});
|
|
23319
|
-
var change = (value) => z43.object({ from: value, to: value });
|
|
23320
|
-
var nullableId = z43.string().uuid().nullable();
|
|
23321
|
-
var ISSUE_EVENT_TYPES = [
|
|
23322
|
-
"created",
|
|
23323
|
-
"title_changed",
|
|
23324
|
-
"description_changed",
|
|
23325
|
-
"status_changed",
|
|
23326
|
-
"priority_changed",
|
|
23327
|
-
"parent_changed",
|
|
23328
|
-
"manager_changed",
|
|
23329
|
-
"sort_order_changed",
|
|
23330
|
-
"assignee_added",
|
|
23331
|
-
"assignee_removed",
|
|
23332
|
-
"subscriber_added",
|
|
23333
|
-
"subscriber_removed",
|
|
23334
|
-
"relation_added",
|
|
23335
|
-
"relation_removed",
|
|
23336
|
-
"pr_linked",
|
|
23337
|
-
"pr_unlinked",
|
|
23338
|
-
"pr_state_changed",
|
|
23339
|
-
"comment_added",
|
|
23340
|
-
"comment_edited",
|
|
23341
|
-
"comment_deleted",
|
|
23342
|
-
"archived",
|
|
23343
|
-
"restored"
|
|
23344
|
-
];
|
|
23345
|
-
var issueEventDataSchemas = {
|
|
23346
|
-
created: z43.object({ issue: issueSchema2 }),
|
|
23347
|
-
title_changed: change(z43.string()),
|
|
23348
|
-
description_changed: change(z43.string()),
|
|
23349
|
-
status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
|
|
23350
|
-
priority_changed: change(issuePrioritySchema),
|
|
23351
|
-
parent_changed: change(nullableId),
|
|
23352
|
-
manager_changed: change(nullableId),
|
|
23353
|
-
sort_order_changed: change(z43.number()),
|
|
23354
|
-
/** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
|
|
23355
|
-
assignee_added: z43.object({ subscriber: issueSubscriberSchema }),
|
|
23356
|
-
assignee_removed: z43.object({ subscriber: issueSubscriberSchema }),
|
|
23357
|
-
subscriber_added: z43.object({ subscriber: issueSubscriberSchema }),
|
|
23358
|
-
subscriber_removed: z43.object({ subscriber: issueSubscriberSchema }),
|
|
23359
|
-
relation_added: z43.object({ relation: issueRelationSchema }),
|
|
23360
|
-
relation_removed: z43.object({ relation: issueRelationSchema }),
|
|
23361
|
-
pr_linked: z43.object({ pull_request: issuePullRequestSchema }),
|
|
23362
|
-
pr_unlinked: z43.object({ pull_request: issuePullRequestSchema }),
|
|
23363
|
-
pr_state_changed: z43.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
|
|
23364
|
-
comment_added: z43.object({ comment: issueCommentSchema }),
|
|
23365
|
-
comment_edited: z43.object({ comment: issueCommentSchema, from: z43.string() }),
|
|
23366
|
-
comment_deleted: z43.object({ comment: issueCommentSchema }),
|
|
23367
|
-
archived: z43.object({ archived_at: timestamp }),
|
|
23368
|
-
restored: z43.object({
|
|
23369
|
-
issue: issueSchema2,
|
|
23370
|
-
subscribers: z43.array(issueSubscriberSchema),
|
|
23371
|
-
relations: z43.array(issueRelationSchema),
|
|
23372
|
-
pull_requests: z43.array(issuePullRequestSchema)
|
|
23373
|
-
})
|
|
23374
|
-
};
|
|
23375
|
-
var issueEventBase = z43.object({
|
|
23376
|
-
sync_id: z43.number().int(),
|
|
23377
|
-
issue_id: z43.string().uuid(),
|
|
23378
|
-
actor: issueActorSchema,
|
|
23379
|
-
/** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
|
|
23380
|
-
client_mutation_id: z43.string().nullable(),
|
|
23381
|
-
created_at: timestamp
|
|
23382
|
-
});
|
|
23383
|
-
var issueEventVariant = (type) => issueEventBase.extend({ type: z43.literal(type), data: issueEventDataSchemas[type] });
|
|
23384
|
-
var issueEventSchema = z43.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
|
|
23385
|
-
var clientMutationId = z43.string().min(1).max(128).optional();
|
|
23386
|
-
var title2 = z43.string().trim().min(1).max(500);
|
|
23387
|
-
var description = z43.string().max(1e5);
|
|
23388
|
-
var body = z43.string().trim().min(1).max(1e5);
|
|
23389
|
-
var createIssueRequestSchema = z43.object({
|
|
23390
|
-
/** Client-generated id, so an optimistic create can be referenced before the server answers. */
|
|
23391
|
-
id: z43.string().uuid().optional(),
|
|
23392
|
-
title: title2,
|
|
23393
|
-
description: description.optional(),
|
|
23394
|
-
status: issueStatusSchema.optional(),
|
|
23395
|
-
priority: issuePrioritySchema.optional(),
|
|
23396
|
-
parent_id: z43.string().uuid().optional(),
|
|
23397
|
-
manager_id: z43.string().uuid().optional(),
|
|
23398
|
-
sort_order: z43.number().finite().optional(),
|
|
23399
|
-
assignees: z43.array(issueActorSchema).max(20).optional(),
|
|
23400
|
-
subscribers: z43.array(issueActorSchema).max(50).optional(),
|
|
23401
|
-
client_mutation_id: clientMutationId
|
|
23402
|
-
});
|
|
23403
|
-
var updateIssueRequestSchema = z43.object({
|
|
23404
|
-
title: title2.optional(),
|
|
23405
|
-
description: description.optional(),
|
|
23406
|
-
status: issueStatusSchema.optional(),
|
|
23407
|
-
priority: issuePrioritySchema.optional(),
|
|
23408
|
-
// PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
|
|
23409
|
-
parent_id: nullableId.optional(),
|
|
23410
|
-
manager_id: nullableId.optional(),
|
|
23411
|
-
sort_order: z43.number().finite().optional(),
|
|
23412
|
-
client_mutation_id: clientMutationId
|
|
23413
|
-
});
|
|
23414
|
-
var issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
|
|
23415
|
-
var createIssueCommentRequestSchema = z43.object({
|
|
23416
|
-
id: z43.string().uuid().optional(),
|
|
23417
|
-
body,
|
|
23418
|
-
client_mutation_id: clientMutationId
|
|
23419
|
-
});
|
|
23420
|
-
var updateIssueCommentRequestSchema = z43.object({ body, client_mutation_id: clientMutationId });
|
|
23421
|
-
var createIssueRelationRequestSchema = z43.object({
|
|
23422
|
-
id: z43.string().uuid().optional(),
|
|
23423
|
-
type: issueRelationTypeSchema,
|
|
23424
|
-
related_issue: z43.string().min(1),
|
|
23425
|
-
client_mutation_id: clientMutationId
|
|
23426
|
-
});
|
|
23427
|
-
var linkIssuePullRequestRequestSchema = z43.object({
|
|
23428
|
-
id: z43.string().uuid().optional(),
|
|
23429
|
-
url: z43.string().url().max(2e3),
|
|
23430
|
-
title: z43.string().max(500).optional(),
|
|
23431
|
-
state: issuePullRequestStateSchema.optional(),
|
|
23432
|
-
pull_request_id: z43.string().uuid().optional(),
|
|
23433
|
-
client_mutation_id: clientMutationId
|
|
23434
|
-
});
|
|
23435
|
-
var updateIssuePullRequestRequestSchema = z43.object({
|
|
23436
|
-
state: issuePullRequestStateSchema,
|
|
23437
|
-
client_mutation_id: clientMutationId
|
|
23438
|
-
});
|
|
23439
|
-
var issueMutationRequestSchema = z43.object({ client_mutation_id: clientMutationId });
|
|
23440
|
-
var updateIssueSettingsRequestSchema = z43.object({ issue_key: z43.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
|
|
23441
|
-
var listIssuesQuerySchema = z43.object({
|
|
23442
|
-
status: z43.string().optional(),
|
|
23443
|
-
priority: z43.string().optional(),
|
|
23444
|
-
assignee: z43.string().optional(),
|
|
23445
|
-
subscriber: z43.string().optional(),
|
|
23446
|
-
creator: z43.string().optional(),
|
|
23447
|
-
manager_id: z43.string().optional(),
|
|
23448
|
-
parent_id: z43.string().optional(),
|
|
23449
|
-
q: z43.string().max(200).optional(),
|
|
23450
|
-
include_archived: z43.enum(["true", "false"]).optional(),
|
|
23451
|
-
limit: z43.coerce.number().int().min(1).max(200).optional(),
|
|
23452
|
-
cursor: z43.coerce.number().int().min(0).max(2147483647).optional()
|
|
23453
|
-
});
|
|
23454
|
-
var issueDetailResponseSchema = z43.object({
|
|
23455
|
-
issue: issueSchema2,
|
|
23456
|
-
subscribers: z43.array(issueSubscriberSchema),
|
|
23457
|
-
relations: z43.array(issueRelationSchema),
|
|
23458
|
-
pull_requests: z43.array(issuePullRequestSchema),
|
|
23459
|
-
comments: z43.array(issueCommentSchema),
|
|
23460
|
-
events: z43.array(issueEventSchema),
|
|
23461
|
-
sub_issues: z43.array(issueSchema2)
|
|
23462
|
-
});
|
|
23463
|
-
var listIssuesResponseSchema = z43.object({ issues: z43.array(issueSchema2), next_cursor: z43.number().nullable() });
|
|
23464
|
-
var issuesDeltaQuerySchema = z43.object({
|
|
23465
|
-
after: z43.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
23466
|
-
limit: z43.coerce.number().int().min(1).max(1e3).optional()
|
|
23467
|
-
});
|
|
23468
|
-
var issueInboxQuerySchema = z43.object({
|
|
23469
|
-
limit: z43.coerce.number().int().min(1).max(100).optional(),
|
|
23470
|
-
before: z43.coerce.number().int().min(1).optional()
|
|
23471
|
-
});
|
|
23472
|
-
var markIssueInboxReadRequestSchema = z43.object({ sync_id: z43.number().int().min(0).optional() });
|
|
23473
|
-
|
|
23474
23541
|
// ../shared/src/routes/repo-files.ts
|
|
23475
23542
|
var MAX_REPO_FILE_CONTENT_BYTES = 256 * 1024;
|
|
23476
23543
|
function searchRepoFileIndex(repos, params, multiRepo) {
|
|
@@ -23747,40 +23814,40 @@ function isSkillRegistryManifest(value) {
|
|
|
23747
23814
|
}
|
|
23748
23815
|
|
|
23749
23816
|
// ../shared/src/routes/variable-requests.ts
|
|
23750
|
-
import { z as
|
|
23817
|
+
import { z as z45 } from "zod";
|
|
23751
23818
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
23752
23819
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
23753
|
-
var requestedVariableSchema =
|
|
23754
|
-
key:
|
|
23755
|
-
required:
|
|
23756
|
-
replace:
|
|
23820
|
+
var requestedVariableSchema = z45.object({
|
|
23821
|
+
key: z45.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
23822
|
+
required: z45.boolean(),
|
|
23823
|
+
replace: z45.boolean().optional()
|
|
23757
23824
|
});
|
|
23758
|
-
var requestedVariablesSchema =
|
|
23759
|
-
var createVariableRequestSchema =
|
|
23825
|
+
var requestedVariablesSchema = z45.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");
|
|
23826
|
+
var createVariableRequestSchema = z45.object({
|
|
23760
23827
|
variables: requestedVariablesSchema,
|
|
23761
|
-
reason:
|
|
23762
|
-
wait:
|
|
23828
|
+
reason: z45.string().trim().max(500).nullish().transform((value) => value || null),
|
|
23829
|
+
wait: z45.boolean().default(true)
|
|
23763
23830
|
});
|
|
23764
|
-
var respondVariableRequestSchema =
|
|
23765
|
-
|
|
23766
|
-
action:
|
|
23767
|
-
destination:
|
|
23831
|
+
var respondVariableRequestSchema = z45.discriminatedUnion("action", [
|
|
23832
|
+
z45.object({
|
|
23833
|
+
action: z45.literal("provide"),
|
|
23834
|
+
destination: z45.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
23768
23835
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
23769
|
-
environment_ids:
|
|
23770
|
-
overwrite:
|
|
23771
|
-
values:
|
|
23836
|
+
environment_ids: z45.array(z45.string().uuid()).optional(),
|
|
23837
|
+
overwrite: z45.boolean().optional(),
|
|
23838
|
+
values: z45.record(z45.string().regex(VARIABLE_KEY_RE), z45.string())
|
|
23772
23839
|
}),
|
|
23773
|
-
|
|
23840
|
+
z45.object({ action: z45.literal("skip") })
|
|
23774
23841
|
]);
|
|
23775
23842
|
|
|
23776
23843
|
// ../shared/src/routes/local-control-requests.ts
|
|
23777
|
-
import { z as
|
|
23778
|
-
var createLocalControlRequestSchema =
|
|
23779
|
-
reason:
|
|
23780
|
-
wait:
|
|
23844
|
+
import { z as z46 } from "zod";
|
|
23845
|
+
var createLocalControlRequestSchema = z46.object({
|
|
23846
|
+
reason: z46.string().trim().max(500).optional().transform((value) => value || null),
|
|
23847
|
+
wait: z46.boolean().default(true)
|
|
23781
23848
|
});
|
|
23782
|
-
var respondLocalControlRequestSchema =
|
|
23783
|
-
var setLocalControlSchema =
|
|
23849
|
+
var respondLocalControlRequestSchema = z46.object({ action: z46.enum(["allow", "dismiss"]) });
|
|
23850
|
+
var setLocalControlSchema = z46.object({ enabled: z46.boolean() });
|
|
23784
23851
|
|
|
23785
23852
|
export {
|
|
23786
23853
|
ENGINE_SEND_MESSAGE_FAILED_ERROR,
|