@alook/cli 0.1.2 → 0.1.3
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/index.js +1469 -1263
- package/dist/session-runner.js +1418 -1212
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -188,92 +188,6 @@ class APIClient {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
// ../shared/src/constants.ts
|
|
192
|
-
var TaskStatus = {
|
|
193
|
-
QUEUED: "queued",
|
|
194
|
-
DISPATCHED: "dispatched",
|
|
195
|
-
RUNNING: "running",
|
|
196
|
-
COMPLETED: "completed",
|
|
197
|
-
FAILED: "failed",
|
|
198
|
-
CANCELLED: "cancelled",
|
|
199
|
-
SUPERSEDED: "superseded"
|
|
200
|
-
};
|
|
201
|
-
var TERMINAL_TASK_STATUSES = [
|
|
202
|
-
TaskStatus.COMPLETED,
|
|
203
|
-
TaskStatus.FAILED,
|
|
204
|
-
TaskStatus.CANCELLED,
|
|
205
|
-
TaskStatus.SUPERSEDED
|
|
206
|
-
];
|
|
207
|
-
var TASK_TYPES = {
|
|
208
|
-
USER_DM_MESSAGE: "user_dm_message",
|
|
209
|
-
EMAIL_NOTIFICATION: "email_notification",
|
|
210
|
-
CALENDAR_EVENT: "calendar_event",
|
|
211
|
-
ISSUE_EVENT: "issue_event",
|
|
212
|
-
KILL_TASK: "kill_task"
|
|
213
|
-
};
|
|
214
|
-
var IssueStatus = {
|
|
215
|
-
TODO: "todo",
|
|
216
|
-
IN_PROGRESS: "in_progress",
|
|
217
|
-
REVIEW: "review",
|
|
218
|
-
DONE: "done",
|
|
219
|
-
CLOSED: "closed",
|
|
220
|
-
CANCELED: "canceled",
|
|
221
|
-
FAILED: "failed"
|
|
222
|
-
};
|
|
223
|
-
var ACTIVE_ISSUE_STATUSES = [
|
|
224
|
-
IssueStatus.TODO,
|
|
225
|
-
IssueStatus.IN_PROGRESS,
|
|
226
|
-
IssueStatus.REVIEW
|
|
227
|
-
];
|
|
228
|
-
var TERMINAL_ISSUE_STATUSES = [
|
|
229
|
-
IssueStatus.DONE,
|
|
230
|
-
IssueStatus.CLOSED,
|
|
231
|
-
IssueStatus.CANCELED,
|
|
232
|
-
IssueStatus.FAILED
|
|
233
|
-
];
|
|
234
|
-
var POLL_INTERVAL_MS = Number(process.env.POLL_INTERVAL_MS) || 3000;
|
|
235
|
-
var OFFLINE_THRESHOLD_MS = Number(process.env.OFFLINE_THRESHOLD_MS) || 30000;
|
|
236
|
-
var COMMUNITY_MACHINE_HEARTBEAT_MS = 30000;
|
|
237
|
-
var COMMUNITY_MACHINE_OFFLINE_THRESHOLD_MS = 3 * COMMUNITY_MACHINE_HEARTBEAT_MS;
|
|
238
|
-
var COMMUNITY_MACHINE_PAIR_TOKEN_TTL_MS = 15 * 60000;
|
|
239
|
-
var EVENT_POLL_INTERVAL_MS = Number(process.env.EVENT_POLL_INTERVAL_MS) || 2000;
|
|
240
|
-
var MeetingStatus = {
|
|
241
|
-
PENDING: "pending",
|
|
242
|
-
SCHEDULED: "scheduled",
|
|
243
|
-
JOINING: "joining",
|
|
244
|
-
RECORDING: "recording",
|
|
245
|
-
COMPLETED: "completed",
|
|
246
|
-
FAILED: "failed"
|
|
247
|
-
};
|
|
248
|
-
var TERMINAL_MEETING_STATUSES = [
|
|
249
|
-
MeetingStatus.COMPLETED,
|
|
250
|
-
MeetingStatus.FAILED
|
|
251
|
-
];
|
|
252
|
-
var COMMUNITY_BOT_NAME_MIN = 1;
|
|
253
|
-
var COMMUNITY_BOT_NAME_MAX = 32;
|
|
254
|
-
var COMMUNITY_BOT_DESCRIPTION_MAX = 1024;
|
|
255
|
-
var COMMUNITY_BOT_IMAGE_URL_MAX = 2048;
|
|
256
|
-
var DEV_PORTS = {
|
|
257
|
-
web: 3000,
|
|
258
|
-
emailWorker: 8787,
|
|
259
|
-
wsDo: 8789,
|
|
260
|
-
wakeWorker: 8790
|
|
261
|
-
};
|
|
262
|
-
var DEV_WEB_URL = process.env.ALOOK_SERVER_URL || `http://localhost:${DEV_PORTS.web}`;
|
|
263
|
-
var DEV_WS_DO_URL = process.env.DEV_WS_DO_URL || `http://localhost:${DEV_PORTS.wsDo}`;
|
|
264
|
-
var DEV_EMAIL_WORKER_URL = process.env.DEV_EMAIL_WORKER_URL || `http://localhost:${DEV_PORTS.emailWorker}`;
|
|
265
|
-
var DEV_WAKE_WORKER_URL = process.env.DEV_WAKE_WORKER_URL || `http://localhost:${DEV_PORTS.wakeWorker}`;
|
|
266
|
-
function devWsDoPort() {
|
|
267
|
-
const port = Number(new URL(DEV_WS_DO_URL).port);
|
|
268
|
-
return port || DEV_PORTS.wsDo;
|
|
269
|
-
}
|
|
270
|
-
// ../shared/src/constants/community.ts
|
|
271
|
-
var MAX_PROFILE_NAME_LENGTH = 100;
|
|
272
|
-
var MAX_MESSAGE_CONTENT_LENGTH = 4000;
|
|
273
|
-
var MAX_ATTACHMENTS_PER_MESSAGE = 10;
|
|
274
|
-
var MAX_ATTACHMENT_SIZE_BYTES = 25 * 1024 * 1024;
|
|
275
|
-
var MAX_SERVER_ICON_SIZE_BYTES = 5 * 1024 * 1024;
|
|
276
|
-
var MAX_ICON_SOURCE_FILE_SIZE_BYTES = 15 * 1024 * 1024;
|
|
277
191
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
278
192
|
var exports_external = {};
|
|
279
193
|
__export(exports_external, {
|
|
@@ -14550,941 +14464,90 @@ function date4(params) {
|
|
|
14550
14464
|
|
|
14551
14465
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
14552
14466
|
config(en_default());
|
|
14553
|
-
// ../shared/src/
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14557
|
-
|
|
14467
|
+
// ../shared/src/db/community-machine-schema.ts
|
|
14468
|
+
var exports_community_machine_schema = {};
|
|
14469
|
+
__export(exports_community_machine_schema, {
|
|
14470
|
+
communityMachineToken: () => communityMachineToken,
|
|
14471
|
+
communityMachineCredential: () => communityMachineCredential,
|
|
14472
|
+
communityMachine: () => communityMachine,
|
|
14473
|
+
communityDiagnosticReport: () => communityDiagnosticReport,
|
|
14474
|
+
communityBotBinding: () => communityBotBinding,
|
|
14475
|
+
communityAgentRunnerKey: () => communityAgentRunnerKey,
|
|
14476
|
+
DIAGNOSTIC_REPORT_FAILURE_CODES: () => DIAGNOSTIC_REPORT_FAILURE_CODES
|
|
14477
|
+
});
|
|
14478
|
+
|
|
14479
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/entity.js
|
|
14480
|
+
var entityKind = Symbol.for("drizzle:entityKind");
|
|
14481
|
+
var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
14482
|
+
function is(value, type) {
|
|
14483
|
+
if (!value || typeof value !== "object") {
|
|
14484
|
+
return false;
|
|
14485
|
+
}
|
|
14486
|
+
if (value instanceof type) {
|
|
14487
|
+
return true;
|
|
14488
|
+
}
|
|
14489
|
+
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
|
14490
|
+
throw new Error(`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);
|
|
14491
|
+
}
|
|
14492
|
+
let cls = Object.getPrototypeOf(value).constructor;
|
|
14493
|
+
if (cls) {
|
|
14494
|
+
while (cls) {
|
|
14495
|
+
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
|
14496
|
+
return true;
|
|
14497
|
+
}
|
|
14498
|
+
cls = Object.getPrototypeOf(cls);
|
|
14499
|
+
}
|
|
14500
|
+
}
|
|
14501
|
+
return false;
|
|
14558
14502
|
}
|
|
14559
14503
|
|
|
14560
|
-
//
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
|
|
14567
|
-
|
|
14504
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/column.js
|
|
14505
|
+
class Column {
|
|
14506
|
+
constructor(table, config2) {
|
|
14507
|
+
this.table = table;
|
|
14508
|
+
this.config = config2;
|
|
14509
|
+
this.name = config2.name;
|
|
14510
|
+
this.keyAsName = config2.keyAsName;
|
|
14511
|
+
this.notNull = config2.notNull;
|
|
14512
|
+
this.default = config2.default;
|
|
14513
|
+
this.defaultFn = config2.defaultFn;
|
|
14514
|
+
this.onUpdateFn = config2.onUpdateFn;
|
|
14515
|
+
this.hasDefault = config2.hasDefault;
|
|
14516
|
+
this.primary = config2.primaryKey;
|
|
14517
|
+
this.isUnique = config2.isUnique;
|
|
14518
|
+
this.uniqueName = config2.uniqueName;
|
|
14519
|
+
this.uniqueType = config2.uniqueType;
|
|
14520
|
+
this.dataType = config2.dataType;
|
|
14521
|
+
this.columnType = config2.columnType;
|
|
14522
|
+
this.generated = config2.generated;
|
|
14523
|
+
this.generatedIdentity = config2.generatedIdentity;
|
|
14568
14524
|
}
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
context: exports_external.unknown().nullable(),
|
|
14596
|
-
type: exports_external.string().default(TASK_TYPES.USER_DM_MESSAGE),
|
|
14597
|
-
contextKey: exports_external.string().nullable().optional(),
|
|
14598
|
-
sessionId: exports_external.string().nullable(),
|
|
14599
|
-
createdAt: exports_external.coerce.date(),
|
|
14600
|
-
dispatchedAt: exports_external.coerce.date().nullable(),
|
|
14601
|
-
startedAt: exports_external.coerce.date().nullable(),
|
|
14602
|
-
completedAt: exports_external.coerce.date().nullable(),
|
|
14603
|
-
error: exports_external.string().nullable(),
|
|
14604
|
-
traceId: exports_external.string().nullable().optional(),
|
|
14605
|
-
parentTaskId: exports_external.string().nullable().optional()
|
|
14606
|
-
});
|
|
14607
|
-
var ColleagueDataApiSchema = exports_external.object({
|
|
14608
|
-
name: exports_external.string(),
|
|
14609
|
-
email: exports_external.string(),
|
|
14610
|
-
description: exports_external.string(),
|
|
14611
|
-
instruction: exports_external.string()
|
|
14612
|
-
});
|
|
14613
|
-
var TaskAgentDataApiSchema = exports_external.object({
|
|
14614
|
-
instructions: exports_external.string(),
|
|
14615
|
-
name: exports_external.string(),
|
|
14616
|
-
runtime_config: exports_external.record(exports_external.string(), exports_external.unknown()).default({}),
|
|
14617
|
-
email_handle: exports_external.string().nullable().optional(),
|
|
14618
|
-
email_addresses: exports_external.array(exports_external.string()).default([]),
|
|
14619
|
-
user_email: exports_external.string().nullable().optional(),
|
|
14620
|
-
user_name: exports_external.string().nullable().optional(),
|
|
14621
|
-
colleagues: exports_external.array(ColleagueDataApiSchema).default([])
|
|
14622
|
-
});
|
|
14623
|
-
var TaskApiBaseSchema = exports_external.object({
|
|
14624
|
-
id: exports_external.string(),
|
|
14625
|
-
agent_id: exports_external.string(),
|
|
14626
|
-
runtime_id: exports_external.string(),
|
|
14627
|
-
conversation_id: exports_external.string(),
|
|
14628
|
-
workspace_id: exports_external.string(),
|
|
14629
|
-
prompt: exports_external.string(),
|
|
14630
|
-
status: exports_external.string(),
|
|
14631
|
-
priority: exports_external.number(),
|
|
14632
|
-
dispatched_at: exports_external.string().nullable(),
|
|
14633
|
-
started_at: exports_external.string().nullable(),
|
|
14634
|
-
completed_at: exports_external.string().nullable(),
|
|
14635
|
-
result: exports_external.unknown().nullable(),
|
|
14636
|
-
error: exports_external.string().nullable(),
|
|
14637
|
-
created_at: exports_external.string(),
|
|
14638
|
-
type: exports_external.string(),
|
|
14639
|
-
context_key: exports_external.string().nullable().optional(),
|
|
14640
|
-
context: exports_external.unknown().nullable().optional(),
|
|
14641
|
-
trace_id: exports_external.string().nullable().optional(),
|
|
14642
|
-
parent_task_id: exports_external.string().nullable().optional(),
|
|
14643
|
-
channel: exports_external.string().nullable().optional()
|
|
14644
|
-
});
|
|
14645
|
-
var TaskSenderApiSchema = exports_external.object({
|
|
14646
|
-
name: exports_external.string(),
|
|
14647
|
-
email: exports_external.string(),
|
|
14648
|
-
is_owner: exports_external.boolean()
|
|
14649
|
-
});
|
|
14650
|
-
var TaskApiSchema = TaskApiBaseSchema.extend({
|
|
14651
|
-
agent: TaskAgentDataApiSchema.nullable().optional(),
|
|
14652
|
-
sender: TaskSenderApiSchema.nullable().optional()
|
|
14653
|
-
});
|
|
14654
|
-
var HeartbeatRequestSchema = exports_external.object({
|
|
14655
|
-
daemon_id: exports_external.string().min(1)
|
|
14656
|
-
});
|
|
14657
|
-
var PollRequestSchema = exports_external.object({
|
|
14658
|
-
daemon_id: exports_external.string().min(1),
|
|
14659
|
-
max_tasks: exports_external.number().int().min(1).default(1),
|
|
14660
|
-
cli_version: exports_external.string().optional()
|
|
14661
|
-
});
|
|
14662
|
-
var FileRequestItemSchema = exports_external.object({
|
|
14663
|
-
id: exports_external.string(),
|
|
14664
|
-
agent_id: exports_external.string(),
|
|
14665
|
-
request_type: exports_external.enum(["tree", "read"]),
|
|
14666
|
-
path: exports_external.string()
|
|
14667
|
-
});
|
|
14668
|
-
var PollMeetingItemSchema = exports_external.object({
|
|
14669
|
-
id: exports_external.string(),
|
|
14670
|
-
meeting_url: exports_external.string(),
|
|
14671
|
-
participants: exports_external.array(exports_external.string()),
|
|
14672
|
-
workspace_id: exports_external.string(),
|
|
14673
|
-
agent_id: exports_external.string(),
|
|
14674
|
-
agent_name: exports_external.string(),
|
|
14675
|
-
title: exports_external.string().optional()
|
|
14676
|
-
});
|
|
14677
|
-
var PollResponseSchema = exports_external.object({
|
|
14678
|
-
tasks: exports_external.array(TaskApiSchema),
|
|
14679
|
-
evicted: exports_external.boolean().optional(),
|
|
14680
|
-
pending_update: exports_external.object({ version: exports_external.string() }).optional(),
|
|
14681
|
-
pending_rescan: exports_external.boolean().optional(),
|
|
14682
|
-
file_requests: exports_external.array(FileRequestItemSchema).optional(),
|
|
14683
|
-
meetings: exports_external.array(PollMeetingItemSchema).optional()
|
|
14684
|
-
});
|
|
14685
|
-
var DaemonPushMessageSchema = exports_external.discriminatedUnion("type", [
|
|
14686
|
-
exports_external.object({ type: exports_external.literal("daemon.tasks"), tasks: exports_external.array(TaskApiSchema) }),
|
|
14687
|
-
exports_external.object({ type: exports_external.literal("daemon.file_requests"), workspaceId: exports_external.string(), requests: exports_external.array(FileRequestItemSchema) }),
|
|
14688
|
-
exports_external.object({ type: exports_external.literal("daemon.meetings"), meetings: exports_external.array(PollMeetingItemSchema) }),
|
|
14689
|
-
exports_external.object({ type: exports_external.literal("daemon.evict"), workspaceId: exports_external.string() }),
|
|
14690
|
-
exports_external.object({ type: exports_external.literal("daemon.update"), version: exports_external.string() }),
|
|
14691
|
-
exports_external.object({ type: exports_external.literal("daemon.rescan") }),
|
|
14692
|
-
exports_external.object({ type: exports_external.literal("daemon.kill"), workspaceId: exports_external.string(), agentId: exports_external.string().min(1), taskId: exports_external.string(), targetTaskId: exports_external.string() })
|
|
14693
|
-
]);
|
|
14694
|
-
var RegisterResponseSchema = exports_external.object({
|
|
14695
|
-
runtimes: exports_external.array(exports_external.object({ id: exports_external.string() }))
|
|
14696
|
-
});
|
|
14697
|
-
var DaemonRuntimeItemSchema = exports_external.object({
|
|
14698
|
-
type: exports_external.string().optional(),
|
|
14699
|
-
provider: exports_external.string().optional(),
|
|
14700
|
-
runtime_mode: exports_external.string().optional(),
|
|
14701
|
-
version: exports_external.string().optional(),
|
|
14702
|
-
status: exports_external.string().optional(),
|
|
14703
|
-
model: exports_external.string().optional()
|
|
14704
|
-
});
|
|
14705
|
-
var ActivateTokenRuntimeSchema = exports_external.object({
|
|
14706
|
-
type: exports_external.string().min(1),
|
|
14707
|
-
version: exports_external.string().optional().default("")
|
|
14708
|
-
});
|
|
14709
|
-
var ActivateTokenRequestSchema = exports_external.object({
|
|
14710
|
-
token: exports_external.string().min(1),
|
|
14711
|
-
hostname: exports_external.string().min(1),
|
|
14712
|
-
runtimes: exports_external.array(ActivateTokenRuntimeSchema).min(1)
|
|
14713
|
-
});
|
|
14714
|
-
var RegisterDaemonRequestSchema = exports_external.object({
|
|
14715
|
-
workspace_id: exports_external.string().min(1).optional(),
|
|
14716
|
-
daemon_id: exports_external.string().min(1),
|
|
14717
|
-
device_name: exports_external.string().optional().default(""),
|
|
14718
|
-
cli_version: exports_external.string().optional().default(""),
|
|
14719
|
-
workspaces_root: exports_external.string().optional().default(""),
|
|
14720
|
-
runtimes: exports_external.array(DaemonRuntimeItemSchema).min(1)
|
|
14721
|
-
});
|
|
14722
|
-
var DeregisterRequestSchema = exports_external.object({
|
|
14723
|
-
daemon_id: exports_external.string().min(1)
|
|
14724
|
-
});
|
|
14725
|
-
var CompleteTaskRequestSchema = exports_external.object({
|
|
14726
|
-
output: exports_external.string().optional(),
|
|
14727
|
-
session_id: exports_external.string().optional(),
|
|
14728
|
-
branch_name: exports_external.string().optional()
|
|
14729
|
-
});
|
|
14730
|
-
var FailTaskRequestSchema = exports_external.object({
|
|
14731
|
-
error: exports_external.string().optional().default("")
|
|
14732
|
-
});
|
|
14733
|
-
var MessageItemSchema = exports_external.object({
|
|
14734
|
-
seq: exports_external.number(),
|
|
14735
|
-
type: exports_external.string(),
|
|
14736
|
-
tool: exports_external.string().optional(),
|
|
14737
|
-
call_id: exports_external.string().optional(),
|
|
14738
|
-
content: exports_external.string().optional(),
|
|
14739
|
-
input: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
14740
|
-
output: exports_external.string().optional()
|
|
14741
|
-
});
|
|
14742
|
-
var ReportMessagesRequestSchema = exports_external.object({
|
|
14743
|
-
messages: exports_external.array(MessageItemSchema)
|
|
14744
|
-
});
|
|
14745
|
-
var RepeatIntervalSchema = exports_external.string().regex(/^\d+(min|hour|day|week|month)$/, {
|
|
14746
|
-
message: "repeat_interval must match <positive_integer><min|hour|day|week|month>"
|
|
14747
|
-
});
|
|
14748
|
-
var CreateCalendarEventRequestSchema = exports_external.object({
|
|
14749
|
-
agent_id: exports_external.string().min(1),
|
|
14750
|
-
title: exports_external.string().min(1),
|
|
14751
|
-
description: exports_external.string().max(20000).optional(),
|
|
14752
|
-
scheduled_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
14753
|
-
message: "scheduled_at must be a valid ISO datetime"
|
|
14754
|
-
}),
|
|
14755
|
-
repeat_interval: RepeatIntervalSchema.optional(),
|
|
14756
|
-
repeat_stop_date: exports_external.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
14757
|
-
conversation_id: exports_external.string().optional()
|
|
14758
|
-
}).refine((data) => !data.repeat_stop_date || !!data.repeat_interval, {
|
|
14759
|
-
message: "repeat_stop_date requires repeat_interval",
|
|
14760
|
-
path: ["repeat_stop_date"]
|
|
14761
|
-
});
|
|
14762
|
-
var UpdateCalendarEventRequestSchema = exports_external.object({
|
|
14763
|
-
title: exports_external.string().min(1).optional(),
|
|
14764
|
-
description: exports_external.string().max(20000).nullable().optional(),
|
|
14765
|
-
agent_id: exports_external.string().min(1).optional(),
|
|
14766
|
-
scheduled_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
14767
|
-
message: "scheduled_at must be a valid ISO datetime"
|
|
14768
|
-
}).optional(),
|
|
14769
|
-
repeat_interval: RepeatIntervalSchema.nullable().optional(),
|
|
14770
|
-
repeat_stop_date: exports_external.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
14771
|
-
scope: exports_external.enum(["this", "following"]).optional(),
|
|
14772
|
-
occurrence_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
14773
|
-
message: "occurrence_at must be a valid ISO datetime"
|
|
14774
|
-
}).optional()
|
|
14775
|
-
}).refine((v) => v.title !== undefined || v.description !== undefined || v.agent_id !== undefined || v.scheduled_at !== undefined || v.repeat_interval !== undefined || v.repeat_stop_date !== undefined, { message: "at least one field is required" });
|
|
14776
|
-
var DeleteCalendarEventRequestSchema = exports_external.object({
|
|
14777
|
-
scope: exports_external.enum(["this", "following"]).optional(),
|
|
14778
|
-
occurrence_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
14779
|
-
message: "occurrence_at must be a valid ISO datetime"
|
|
14780
|
-
}).optional()
|
|
14781
|
-
});
|
|
14782
|
-
var CalendarEventApiSchema = exports_external.object({
|
|
14783
|
-
id: exports_external.string(),
|
|
14784
|
-
agent_id: exports_external.string(),
|
|
14785
|
-
workspace_id: exports_external.string(),
|
|
14786
|
-
title: exports_external.string(),
|
|
14787
|
-
description: exports_external.string().nullable(),
|
|
14788
|
-
scheduled_at: exports_external.string(),
|
|
14789
|
-
occurrence_at: exports_external.string(),
|
|
14790
|
-
collapsed_count: exports_external.number().nullable().optional(),
|
|
14791
|
-
repeat_interval: exports_external.string().nullable(),
|
|
14792
|
-
repeat_stop_at: exports_external.string().nullable(),
|
|
14793
|
-
last_triggered_at: exports_external.string().nullable(),
|
|
14794
|
-
created_at: exports_external.string(),
|
|
14795
|
-
updated_at: exports_external.string()
|
|
14796
|
-
});
|
|
14797
|
-
var IssueStatusSchema = exports_external.enum([
|
|
14798
|
-
IssueStatus.TODO,
|
|
14799
|
-
IssueStatus.IN_PROGRESS,
|
|
14800
|
-
IssueStatus.REVIEW,
|
|
14801
|
-
IssueStatus.DONE,
|
|
14802
|
-
IssueStatus.CLOSED,
|
|
14803
|
-
IssueStatus.CANCELED,
|
|
14804
|
-
IssueStatus.FAILED
|
|
14805
|
-
]);
|
|
14806
|
-
var CreateIssueRequestSchema = exports_external.object({
|
|
14807
|
-
agent_id: exports_external.string().min(1).optional(),
|
|
14808
|
-
title: exports_external.string().min(1, "title is required").max(200),
|
|
14809
|
-
description: exports_external.string().max(20000).optional().default("")
|
|
14810
|
-
});
|
|
14811
|
-
var UpdateIssueRequestSchema = exports_external.object({
|
|
14812
|
-
title: exports_external.string().min(1).max(200).optional(),
|
|
14813
|
-
description: exports_external.string().max(20000).optional(),
|
|
14814
|
-
status: IssueStatusSchema.optional(),
|
|
14815
|
-
agent_id: exports_external.string().min(1).optional()
|
|
14816
|
-
}).refine((v) => v.title !== undefined || v.description !== undefined || v.status !== undefined || v.agent_id !== undefined, { message: "at least one field is required" });
|
|
14817
|
-
var CreateIssueCommentBodySchema = exports_external.object({
|
|
14818
|
-
content: exports_external.string().min(1, "content is required").max(20000)
|
|
14819
|
-
});
|
|
14820
|
-
var IssueCommentApiSchema = exports_external.object({
|
|
14821
|
-
id: exports_external.string(),
|
|
14822
|
-
issue_id: exports_external.string(),
|
|
14823
|
-
workspace_id: exports_external.string(),
|
|
14824
|
-
author_type: exports_external.enum(["user", "agent"]),
|
|
14825
|
-
author_id: exports_external.string(),
|
|
14826
|
-
content: exports_external.string(),
|
|
14827
|
-
created_at: exports_external.string()
|
|
14828
|
-
});
|
|
14829
|
-
var IssueApiSchema = exports_external.object({
|
|
14830
|
-
id: exports_external.string(),
|
|
14831
|
-
workspace_id: exports_external.string(),
|
|
14832
|
-
agent_id: exports_external.string().nullable(),
|
|
14833
|
-
creator_user_id: exports_external.string(),
|
|
14834
|
-
conversation_id: exports_external.string().nullable(),
|
|
14835
|
-
latest_task_id: exports_external.string().nullable(),
|
|
14836
|
-
title: exports_external.string(),
|
|
14837
|
-
description: exports_external.string(),
|
|
14838
|
-
status: IssueStatusSchema,
|
|
14839
|
-
created_at: exports_external.string(),
|
|
14840
|
-
updated_at: exports_external.string(),
|
|
14841
|
-
completed_at: exports_external.string().nullable()
|
|
14842
|
-
});
|
|
14843
|
-
var CreateAgentLinkRequestSchema = exports_external.object({
|
|
14844
|
-
source_agent_id: exports_external.string().min(1, "source_agent_id is required"),
|
|
14845
|
-
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
14846
|
-
instruction: exports_external.string().optional().default("")
|
|
14847
|
-
});
|
|
14848
|
-
var UpdateAgentLinkRequestSchema = exports_external.object({
|
|
14849
|
-
instruction: exports_external.string()
|
|
14850
|
-
});
|
|
14851
|
-
var UpsertAgentLinkRequestSchema = exports_external.object({
|
|
14852
|
-
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
14853
|
-
instruction: exports_external.string()
|
|
14854
|
-
});
|
|
14855
|
-
var AddWhitelistRequestSchema = exports_external.object({
|
|
14856
|
-
email: exports_external.string().email()
|
|
14857
|
-
});
|
|
14858
|
-
var RuntimeConfigSchema = exports_external.object({ model: exports_external.string().max(100).optional() }).passthrough().optional();
|
|
14859
|
-
var CreateAgentRequestSchema = exports_external.object({
|
|
14860
|
-
name: exports_external.string().min(1, "name is required"),
|
|
14861
|
-
description: exports_external.string().optional().default(""),
|
|
14862
|
-
instructions: exports_external.string().optional().default(""),
|
|
14863
|
-
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
14864
|
-
runtime_config: RuntimeConfigSchema,
|
|
14865
|
-
max_concurrent_tasks: exports_external.number().int().optional(),
|
|
14866
|
-
email_handle: exports_external.string().optional(),
|
|
14867
|
-
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
14868
|
-
});
|
|
14869
|
-
var UpdateAgentRequestSchema = exports_external.object({
|
|
14870
|
-
name: exports_external.string().min(1).optional(),
|
|
14871
|
-
description: exports_external.string().optional(),
|
|
14872
|
-
instructions: exports_external.string().optional(),
|
|
14873
|
-
runtime_id: exports_external.string().min(1).optional(),
|
|
14874
|
-
runtime_config: RuntimeConfigSchema,
|
|
14875
|
-
visibility: exports_external.enum(["public", "private"]).optional(),
|
|
14876
|
-
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
14877
|
-
}).refine((v) => v.name !== undefined || v.description !== undefined || v.instructions !== undefined || v.runtime_id !== undefined || v.runtime_config !== undefined || v.visibility !== undefined || v.avatar_url !== undefined, { message: "at least one field is required" });
|
|
14878
|
-
var CreateConversationRequestSchema = exports_external.object({
|
|
14879
|
-
agent_id: exports_external.string().min(1, "agent_id is required"),
|
|
14880
|
-
channel: exports_external.string().optional()
|
|
14881
|
-
});
|
|
14882
|
-
var CreateMessageRequestSchema = exports_external.object({
|
|
14883
|
-
content: exports_external.string().min(1, "content is required"),
|
|
14884
|
-
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
14885
|
-
});
|
|
14886
|
-
var AgentDmRequestSchema = exports_external.object({
|
|
14887
|
-
content: exports_external.string().min(1, "content is required"),
|
|
14888
|
-
task_id: exports_external.string().min(1).optional()
|
|
14889
|
-
});
|
|
14890
|
-
var EmailAttachmentSchema = exports_external.object({
|
|
14891
|
-
key: exports_external.string().min(1),
|
|
14892
|
-
filename: exports_external.string().min(1),
|
|
14893
|
-
size: exports_external.number().int().nonnegative().optional(),
|
|
14894
|
-
contentType: exports_external.string().min(1)
|
|
14895
|
-
});
|
|
14896
|
-
var SendEmailRequestSchema = exports_external.object({
|
|
14897
|
-
agentId: exports_external.string().min(1, "agentId is required"),
|
|
14898
|
-
to: exports_external.string().min(1, "to is required"),
|
|
14899
|
-
subject: exports_external.string().min(1, "subject is required"),
|
|
14900
|
-
htmlBody: exports_external.string().default(""),
|
|
14901
|
-
inReplyTo: exports_external.string().optional(),
|
|
14902
|
-
references: exports_external.string().optional(),
|
|
14903
|
-
attachments: exports_external.array(EmailAttachmentSchema).optional(),
|
|
14904
|
-
customAccountId: exports_external.string().optional(),
|
|
14905
|
-
from: exports_external.string().email().optional(),
|
|
14906
|
-
conversationId: exports_external.string().optional(),
|
|
14907
|
-
traceId: exports_external.string().optional(),
|
|
14908
|
-
sourceTaskId: exports_external.string().optional()
|
|
14909
|
-
});
|
|
14910
|
-
var UpdateEmailStatusRequestSchema = exports_external.object({
|
|
14911
|
-
status: exports_external.enum(["unread", "read", "archived", "sent"])
|
|
14912
|
-
});
|
|
14913
|
-
var MeetingInfoSchema = exports_external.object({
|
|
14914
|
-
title: exports_external.string(),
|
|
14915
|
-
meetingUrl: exports_external.string(),
|
|
14916
|
-
startTime: exports_external.string().nullable(),
|
|
14917
|
-
endTime: exports_external.string().nullable(),
|
|
14918
|
-
attendees: exports_external.array(exports_external.object({ name: exports_external.string(), email: exports_external.string() }))
|
|
14919
|
-
});
|
|
14920
|
-
var EmailNotifyRequestSchema = exports_external.object({
|
|
14921
|
-
agentId: exports_external.string().min(1),
|
|
14922
|
-
workspaceId: exports_external.string().min(1),
|
|
14923
|
-
r2Key: exports_external.string().min(1),
|
|
14924
|
-
from: exports_external.string().min(1),
|
|
14925
|
-
to: exports_external.string().optional(),
|
|
14926
|
-
subject: exports_external.string(),
|
|
14927
|
-
isWhitelisted: exports_external.boolean(),
|
|
14928
|
-
forwarded: exports_external.boolean().optional().default(false),
|
|
14929
|
-
messageId: exports_external.string().optional().default(""),
|
|
14930
|
-
inReplyTo: exports_external.string().optional().default(""),
|
|
14931
|
-
references: exports_external.string().optional().default(""),
|
|
14932
|
-
meetingInfo: MeetingInfoSchema.nullable().optional(),
|
|
14933
|
-
attachments: exports_external.string().optional(),
|
|
14934
|
-
traceId: exports_external.string().optional(),
|
|
14935
|
-
sourceTaskId: exports_external.string().optional(),
|
|
14936
|
-
isInternal: exports_external.boolean().optional().default(false),
|
|
14937
|
-
senderConversationId: exports_external.string().optional(),
|
|
14938
|
-
senderAgentId: exports_external.string().optional()
|
|
14939
|
-
});
|
|
14940
|
-
var CreateEmailAccountSchema = exports_external.object({
|
|
14941
|
-
emailAddress: exports_external.string().email("valid email required"),
|
|
14942
|
-
displayName: exports_external.string().default(""),
|
|
14943
|
-
imapHost: exports_external.string().min(1, "IMAP host is required"),
|
|
14944
|
-
imapPort: exports_external.number().int().min(1).max(65535).default(993),
|
|
14945
|
-
imapUsername: exports_external.string().min(1, "IMAP username is required"),
|
|
14946
|
-
imapPassword: exports_external.string().min(1, "IMAP password is required"),
|
|
14947
|
-
imapTls: exports_external.boolean().default(true),
|
|
14948
|
-
smtpHost: exports_external.string().min(1, "SMTP host is required"),
|
|
14949
|
-
smtpPort: exports_external.number().int().min(1).max(65535).default(587),
|
|
14950
|
-
smtpUsername: exports_external.string().min(1, "SMTP username is required"),
|
|
14951
|
-
smtpPassword: exports_external.string().min(1, "SMTP password is required"),
|
|
14952
|
-
smtpTls: exports_external.number().int().min(0).max(2).default(1),
|
|
14953
|
-
pollIntervalSeconds: exports_external.number().int().min(30).max(3600).default(60)
|
|
14954
|
-
});
|
|
14955
|
-
var UpdateEmailAccountSchema = exports_external.object({
|
|
14956
|
-
emailAddress: exports_external.string().email().optional(),
|
|
14957
|
-
displayName: exports_external.string().optional(),
|
|
14958
|
-
imapHost: exports_external.string().min(1).optional(),
|
|
14959
|
-
imapPort: exports_external.number().int().min(1).max(65535).optional(),
|
|
14960
|
-
imapUsername: exports_external.string().min(1).optional(),
|
|
14961
|
-
imapPassword: exports_external.string().min(1).optional(),
|
|
14962
|
-
imapTls: exports_external.boolean().optional(),
|
|
14963
|
-
smtpHost: exports_external.string().min(1).optional(),
|
|
14964
|
-
smtpPort: exports_external.number().int().min(1).max(65535).optional(),
|
|
14965
|
-
smtpUsername: exports_external.string().min(1).optional(),
|
|
14966
|
-
smtpPassword: exports_external.string().min(1).optional(),
|
|
14967
|
-
smtpTls: exports_external.number().int().min(0).max(2).optional(),
|
|
14968
|
-
pollIntervalSeconds: exports_external.number().int().min(30).max(3600).optional()
|
|
14969
|
-
});
|
|
14970
|
-
var TestEmailConnectionSchema = exports_external.object({
|
|
14971
|
-
imapHost: exports_external.string().min(1),
|
|
14972
|
-
imapPort: exports_external.number().int().min(1).max(65535).default(993),
|
|
14973
|
-
imapUsername: exports_external.string().min(1),
|
|
14974
|
-
imapPassword: exports_external.string().min(1),
|
|
14975
|
-
imapTls: exports_external.boolean().default(true),
|
|
14976
|
-
smtpHost: exports_external.string().min(1),
|
|
14977
|
-
smtpPort: exports_external.number().int().min(1).max(65535).default(587),
|
|
14978
|
-
smtpUsername: exports_external.string().min(1),
|
|
14979
|
-
smtpPassword: exports_external.string().min(1),
|
|
14980
|
-
smtpTls: exports_external.number().int().min(0).max(2).default(1)
|
|
14981
|
-
});
|
|
14982
|
-
var UpdateMemberRequestSchema = exports_external.object({
|
|
14983
|
-
global_instruction: exports_external.string().max(50000).trim()
|
|
14984
|
-
});
|
|
14985
|
-
var CreateWorkspaceRequestSchema = exports_external.object({
|
|
14986
|
-
name: exports_external.string().min(1, "name is required"),
|
|
14987
|
-
slug: exports_external.string().optional().default("").transform(sanitizeSlug)
|
|
14988
|
-
});
|
|
14989
|
-
var UpdateWorkspaceRequestSchema = exports_external.object({
|
|
14990
|
-
name: exports_external.string().min(1, "name is required").max(100).trim().optional(),
|
|
14991
|
-
slug: exports_external.string().min(1, "slug is required").trim().toLowerCase().transform(sanitizeSlug).optional()
|
|
14992
|
-
});
|
|
14993
|
-
var DeleteWorkspaceRequestSchema = exports_external.object({
|
|
14994
|
-
confirm_name: exports_external.string().min(1, "confirm_name is required")
|
|
14995
|
-
});
|
|
14996
|
-
var GrantAgentAccessRequestSchema = exports_external.object({
|
|
14997
|
-
user_id: exports_external.string().min(1, "user_id is required")
|
|
14998
|
-
});
|
|
14999
|
-
var WorkspaceFileBrowseRequestSchema = exports_external.object({
|
|
15000
|
-
request_type: exports_external.enum(["tree", "read"]),
|
|
15001
|
-
path: exports_external.string().default(".")
|
|
15002
|
-
});
|
|
15003
|
-
var WorkspaceFileEntrySchema = exports_external.object({
|
|
15004
|
-
name: exports_external.string(),
|
|
15005
|
-
path: exports_external.string(),
|
|
15006
|
-
isDirectory: exports_external.boolean(),
|
|
15007
|
-
size: exports_external.number(),
|
|
15008
|
-
modifiedAt: exports_external.string()
|
|
15009
|
-
});
|
|
15010
|
-
var WorkspaceFileReportSchema = exports_external.object({
|
|
15011
|
-
request_id: exports_external.string().min(1),
|
|
15012
|
-
entries: exports_external.array(WorkspaceFileEntrySchema).optional(),
|
|
15013
|
-
content: exports_external.string().nullable().optional(),
|
|
15014
|
-
isBinary: exports_external.boolean().optional(),
|
|
15015
|
-
error: exports_external.string().optional(),
|
|
15016
|
-
path: exports_external.string()
|
|
15017
|
-
});
|
|
15018
|
-
var SkillEntrySchema = exports_external.object({
|
|
15019
|
-
name: exports_external.string(),
|
|
15020
|
-
description: exports_external.string(),
|
|
15021
|
-
isGlobal: exports_external.boolean().optional()
|
|
15022
|
-
});
|
|
15023
|
-
var SkillItemSchema = exports_external.object({
|
|
15024
|
-
name: exports_external.string(),
|
|
15025
|
-
description: exports_external.string()
|
|
15026
|
-
});
|
|
15027
|
-
var SkillSyncRequestSchema = exports_external.object({
|
|
15028
|
-
scope: exports_external.enum(["global", "agent"]),
|
|
15029
|
-
agent_id: exports_external.string().min(1).optional(),
|
|
15030
|
-
daemon_id: exports_external.string().min(1).optional(),
|
|
15031
|
-
runtime: exports_external.enum(["claude", "codex", "opencode"]),
|
|
15032
|
-
skills: exports_external.array(SkillItemSchema)
|
|
15033
|
-
});
|
|
15034
|
-
var StudioMemberSchema = exports_external.object({
|
|
15035
|
-
name: exports_external.string().optional(),
|
|
15036
|
-
role: exports_external.enum(["leader", "researcher", "engineer", "assistant"]),
|
|
15037
|
-
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
15038
|
-
runtime_config: exports_external.object({ model: exports_external.string().max(100).optional() }).passthrough().optional(),
|
|
15039
|
-
description: exports_external.string().optional().default(""),
|
|
15040
|
-
instructions: exports_external.string().optional().default(""),
|
|
15041
|
-
avatar_url: exports_external.string().max(2000).nullable().optional(),
|
|
15042
|
-
email_handle: exports_external.string().max(30).optional(),
|
|
15043
|
-
relationship: exports_external.string().optional()
|
|
15044
|
-
});
|
|
15045
|
-
var CreateStudioRequestSchema = exports_external.object({
|
|
15046
|
-
name: exports_external.string().max(100).optional(),
|
|
15047
|
-
scenario: exports_external.string().max(50).optional(),
|
|
15048
|
-
members: exports_external.array(StudioMemberSchema).min(1).max(4)
|
|
15049
|
-
}).refine((v) => v.members.some((m) => m.role === "leader"), { message: "at least one member must have the leader role" });
|
|
15050
|
-
var RecruitAgentRequestSchema = exports_external.object({
|
|
15051
|
-
instructions: exports_external.string().min(1, "instructions is required"),
|
|
15052
|
-
relationship: exports_external.string().min(1, "relationship is required"),
|
|
15053
|
-
name: exports_external.string().optional(),
|
|
15054
|
-
description: exports_external.string().optional().default(""),
|
|
15055
|
-
model: exports_external.string().max(100).optional(),
|
|
15056
|
-
context_key: exports_external.string().optional()
|
|
15057
|
-
});
|
|
15058
|
-
var CreateThreadRequestSchema = exports_external.object({
|
|
15059
|
-
parent_message_id: exports_external.string().min(1),
|
|
15060
|
-
content: exports_external.string().optional().default(""),
|
|
15061
|
-
attachment_ids: exports_external.array(exports_external.string()).optional()
|
|
15062
|
-
});
|
|
15063
|
-
var COMMUNITY_RUNTIME_ID_MAX = 64;
|
|
15064
|
-
var COMMUNITY_RUNTIME_VERSION_MAX = 64;
|
|
15065
|
-
var COMMUNITY_RUNTIME_LIST_MAX = 64;
|
|
15066
|
-
var RUNTIME_ID_RE = /^[A-Za-z0-9._@/-]+$/;
|
|
15067
|
-
var CommunityMachineRuntimeSchema = exports_external.object({
|
|
15068
|
-
id: exports_external.string().min(1).max(COMMUNITY_RUNTIME_ID_MAX).regex(RUNTIME_ID_RE, "invalid runtime id charset"),
|
|
15069
|
-
version: exports_external.string().max(COMMUNITY_RUNTIME_VERSION_MAX).optional(),
|
|
15070
|
-
status: exports_external.enum(["healthy", "unhealthy"]).catch("healthy").default("healthy"),
|
|
15071
|
-
lastError: exports_external.string().max(128).optional(),
|
|
15072
|
-
lastErrorAt: exports_external.string().optional()
|
|
15073
|
-
});
|
|
15074
|
-
var CommunityMachineRuntimeListSchema = exports_external.array(CommunityMachineRuntimeSchema).max(COMMUNITY_RUNTIME_LIST_MAX).transform((list) => {
|
|
15075
|
-
const seen = new Set;
|
|
15076
|
-
const out = [];
|
|
15077
|
-
for (const r of list) {
|
|
15078
|
-
if (seen.has(r.id))
|
|
15079
|
-
continue;
|
|
15080
|
-
seen.add(r.id);
|
|
15081
|
-
out.push(r);
|
|
15082
|
-
}
|
|
15083
|
-
return out;
|
|
15084
|
-
});
|
|
15085
|
-
var CommunityMachineSummarySchema = exports_external.object({
|
|
15086
|
-
id: exports_external.string(),
|
|
15087
|
-
hostname: exports_external.string(),
|
|
15088
|
-
displayName: exports_external.string(),
|
|
15089
|
-
platform: exports_external.string(),
|
|
15090
|
-
arch: exports_external.string(),
|
|
15091
|
-
osRelease: exports_external.string(),
|
|
15092
|
-
daemonVersion: exports_external.string(),
|
|
15093
|
-
lastSeenAt: exports_external.string().nullable(),
|
|
15094
|
-
status: exports_external.enum(["online", "offline"]),
|
|
15095
|
-
availableRuntimes: exports_external.array(CommunityMachineRuntimeSchema).default([]),
|
|
15096
|
-
lastRuntimeError: exports_external.object({
|
|
15097
|
-
requested: exports_external.string(),
|
|
15098
|
-
available: exports_external.array(exports_external.string()),
|
|
15099
|
-
at: exports_external.string()
|
|
15100
|
-
}).optional(),
|
|
15101
|
-
createdAt: exports_external.string(),
|
|
15102
|
-
updatedAt: exports_external.string()
|
|
15103
|
-
});
|
|
15104
|
-
var HostReadyMessageSchema = exports_external.object({
|
|
15105
|
-
type: exports_external.literal("ready"),
|
|
15106
|
-
runtimeReport: CommunityMachineRuntimeListSchema,
|
|
15107
|
-
runningAgents: exports_external.array(exports_external.string()).default([]),
|
|
15108
|
-
hostname: exports_external.string().optional(),
|
|
15109
|
-
platform: exports_external.string().optional(),
|
|
15110
|
-
arch: exports_external.string().optional(),
|
|
15111
|
-
osRelease: exports_external.string().optional(),
|
|
15112
|
-
daemonVersion: exports_external.string().optional()
|
|
15113
|
-
});
|
|
15114
|
-
var CommunityDaemonReadySchema = exports_external.object({
|
|
15115
|
-
runtimeReport: CommunityMachineRuntimeListSchema.optional(),
|
|
15116
|
-
runningAgents: exports_external.array(exports_external.string()).default([]),
|
|
15117
|
-
hostname: exports_external.string().optional(),
|
|
15118
|
-
os: exports_external.string().optional(),
|
|
15119
|
-
arch: exports_external.string().optional(),
|
|
15120
|
-
osRelease: exports_external.string().optional(),
|
|
15121
|
-
daemonVersion: exports_external.string().optional()
|
|
15122
|
-
});
|
|
15123
|
-
var SessionErrorFrameSchema = exports_external.object({
|
|
15124
|
-
type: exports_external.literal("session.error"),
|
|
15125
|
-
code: exports_external.enum(["runtime_not_available"]),
|
|
15126
|
-
agentId: exports_external.string().optional(),
|
|
15127
|
-
launchId: exports_external.string().optional(),
|
|
15128
|
-
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
15129
|
-
});
|
|
15130
|
-
var AgentActivityMessageSchema = exports_external.object({
|
|
15131
|
-
type: exports_external.literal("agent_activity"),
|
|
15132
|
-
agentId: exports_external.string(),
|
|
15133
|
-
state: exports_external.enum(["idle", "starting", "running", "stopping"])
|
|
15134
|
-
});
|
|
15135
|
-
var AgentTypingMessageSchema = exports_external.object({
|
|
15136
|
-
type: exports_external.literal("agent_typing"),
|
|
15137
|
-
agentId: exports_external.string(),
|
|
15138
|
-
channelId: exports_external.string().min(1)
|
|
15139
|
-
});
|
|
15140
|
-
var AgentTypingStopMessageSchema = exports_external.object({
|
|
15141
|
-
type: exports_external.literal("agent_typing_stop"),
|
|
15142
|
-
agentId: exports_external.string(),
|
|
15143
|
-
channelId: exports_external.string().min(1)
|
|
15144
|
-
});
|
|
15145
|
-
var AgentSessionMessageSchema = exports_external.object({
|
|
15146
|
-
type: exports_external.literal("agent_session"),
|
|
15147
|
-
agentId: exports_external.string().min(1),
|
|
15148
|
-
sessionId: exports_external.string().min(1),
|
|
15149
|
-
launchId: exports_external.string().min(1)
|
|
15150
|
-
});
|
|
15151
|
-
var AgentWakeAckMessageSchema = exports_external.object({
|
|
15152
|
-
type: exports_external.literal("agent_wake_ack"),
|
|
15153
|
-
agentId: exports_external.string().min(1),
|
|
15154
|
-
launchId: exports_external.string().min(1),
|
|
15155
|
-
status: exports_external.enum(["ok", "error"]),
|
|
15156
|
-
error: exports_external.object({ code: exports_external.string().optional(), message: exports_external.string().optional() }).optional()
|
|
15157
|
-
});
|
|
15158
|
-
var CommunityPairTokenResponseSchema = exports_external.object({
|
|
15159
|
-
tokenId: exports_external.string(),
|
|
15160
|
-
expiresAt: exports_external.string()
|
|
15161
|
-
});
|
|
15162
|
-
var CommunityDaemonActivateRequestSchema = exports_external.object({
|
|
15163
|
-
hostname: exports_external.string(),
|
|
15164
|
-
platform: exports_external.string(),
|
|
15165
|
-
arch: exports_external.string(),
|
|
15166
|
-
osRelease: exports_external.string().optional(),
|
|
15167
|
-
daemonVersion: exports_external.string().optional(),
|
|
15168
|
-
runtimeReport: CommunityMachineRuntimeListSchema.optional()
|
|
15169
|
-
});
|
|
15170
|
-
var CommunityDaemonActivateResponseSchema = exports_external.object({
|
|
15171
|
-
credential: exports_external.string(),
|
|
15172
|
-
machineId: exports_external.string(),
|
|
15173
|
-
expiresAt: exports_external.string().nullable()
|
|
15174
|
-
});
|
|
15175
|
-
var CommunityDaemonEnrollAgentRequestSchema = exports_external.object({
|
|
15176
|
-
agentId: exports_external.string().min(1).max(128)
|
|
15177
|
-
});
|
|
15178
|
-
var CommunityDaemonEnrollAgentResponseSchema = exports_external.object({
|
|
15179
|
-
runnerKey: exports_external.string(),
|
|
15180
|
-
expiresAt: exports_external.string().nullable()
|
|
15181
|
-
});
|
|
15182
|
-
var isMentionSafeName = (name) => validateCommunityName(name).ok;
|
|
15183
|
-
var MENTION_SAFE_NAME_MSG = "name cannot contain #, @, or line breaks";
|
|
15184
|
-
var BOT_AVATAR_ROUTE_PATTERN = /^\/api\/community\/bots\/[A-Za-z0-9_-]+\/avatar$/;
|
|
15185
|
-
var BotImageUrlSchema = exports_external.string().max(COMMUNITY_BOT_IMAGE_URL_MAX).refine((v) => v.startsWith("https://") || v.startsWith("avatar:") || BOT_AVATAR_ROUTE_PATTERN.test(v), {
|
|
15186
|
-
message: "image must be an https URL, the bot avatar route, or an avatar: config"
|
|
15187
|
-
});
|
|
15188
|
-
var CommunityBotCreateRequestSchema = exports_external.object({
|
|
15189
|
-
name: exports_external.string().trim().min(COMMUNITY_BOT_NAME_MIN).max(COMMUNITY_BOT_NAME_MAX).refine(isMentionSafeName, { message: MENTION_SAFE_NAME_MSG }),
|
|
15190
|
-
description: exports_external.string().max(COMMUNITY_BOT_DESCRIPTION_MAX).optional(),
|
|
15191
|
-
machineId: exports_external.string().min(1),
|
|
15192
|
-
runtime: exports_external.string().min(1),
|
|
15193
|
-
image: BotImageUrlSchema.optional(),
|
|
15194
|
-
model: exports_external.string().trim().min(1).max(100).nullable().optional()
|
|
15195
|
-
});
|
|
15196
|
-
var CommunityBotPatchRequestSchema = exports_external.object({
|
|
15197
|
-
name: exports_external.string().trim().min(COMMUNITY_BOT_NAME_MIN).max(COMMUNITY_BOT_NAME_MAX).refine(isMentionSafeName, { message: MENTION_SAFE_NAME_MSG }).optional(),
|
|
15198
|
-
description: exports_external.string().max(COMMUNITY_BOT_DESCRIPTION_MAX).optional(),
|
|
15199
|
-
image: BotImageUrlSchema.nullable().optional(),
|
|
15200
|
-
model: exports_external.string().trim().min(1).max(100).nullable().optional(),
|
|
15201
|
-
runtime: exports_external.string().trim().min(1).max(COMMUNITY_RUNTIME_ID_MAX).optional()
|
|
15202
|
-
}).refine((v) => v.name !== undefined || v.description !== undefined || v.image !== undefined || v.runtime !== undefined || ("model" in v), {
|
|
15203
|
-
message: "at least one field must be provided"
|
|
15204
|
-
});
|
|
15205
|
-
var CommunityBotAddToServerRequestSchema = exports_external.object({
|
|
15206
|
-
botId: exports_external.string().min(1)
|
|
15207
|
-
});
|
|
15208
|
-
var CommunityAgentMessageContentSchema = exports_external.object({ text: exports_external.string().max(MAX_MESSAGE_CONTENT_LENGTH).default("") }).catchall(exports_external.unknown());
|
|
15209
|
-
var CommunityAgentSeqSchema = exports_external.number().int().min(0);
|
|
15210
|
-
var CommunityAgentPositiveSeqSchema = exports_external.number().int().min(1);
|
|
15211
|
-
var CommunityAgentCursorSchema = exports_external.object({
|
|
15212
|
-
channel: exports_external.string().min(1),
|
|
15213
|
-
seq: CommunityAgentPositiveSeqSchema
|
|
15214
|
-
});
|
|
15215
|
-
var CommunityAgentSendRequestSchema = exports_external.object({
|
|
15216
|
-
channel: exports_external.string().min(1),
|
|
15217
|
-
content: CommunityAgentMessageContentSchema,
|
|
15218
|
-
attachments: exports_external.array(exports_external.string().min(1)).max(MAX_ATTACHMENTS_PER_MESSAGE).default([]),
|
|
15219
|
-
seenUpToSeq: CommunityAgentSeqSchema.optional(),
|
|
15220
|
-
replyToSeq: CommunityAgentPositiveSeqSchema.optional(),
|
|
15221
|
-
nonce: exports_external.string().min(1).max(128).optional()
|
|
15222
|
-
}).refine((d) => d.content.text.trim().length > 0 || d.attachments.length > 0, { message: "message must have text or attachments" });
|
|
15223
|
-
var CommunityAgentAttachmentUploadResponseSchema = exports_external.object({
|
|
15224
|
-
id: exports_external.string(),
|
|
15225
|
-
filename: exports_external.string(),
|
|
15226
|
-
contentType: exports_external.string(),
|
|
15227
|
-
size: exports_external.number()
|
|
15228
|
-
});
|
|
15229
|
-
var CommunityAgentAttachmentDownloadRequestSchema = exports_external.object({
|
|
15230
|
-
id: exports_external.string().min(1)
|
|
15231
|
-
});
|
|
15232
|
-
var CommunityAgentInboxPullRequestSchema = exports_external.object({
|
|
15233
|
-
max: exports_external.number().int().min(1).max(200).optional()
|
|
15234
|
-
});
|
|
15235
|
-
var CommunityAgentAckRequestSchema = exports_external.object({
|
|
15236
|
-
cursors: exports_external.array(CommunityAgentCursorSchema).min(1)
|
|
15237
|
-
});
|
|
15238
|
-
var CommunityAgentReadRequestSchema = exports_external.object({
|
|
15239
|
-
channel: exports_external.string().min(1),
|
|
15240
|
-
before: CommunityAgentSeqSchema.optional(),
|
|
15241
|
-
after: CommunityAgentSeqSchema.optional(),
|
|
15242
|
-
around: CommunityAgentSeqSchema.optional(),
|
|
15243
|
-
limit: exports_external.number().int().min(1).max(200).optional()
|
|
15244
|
-
}).refine((v) => [v.before, v.after, v.around].filter((x) => x !== undefined).length <= 1, { message: "at most one of before/after/around may be supplied" });
|
|
15245
|
-
var CommunityAgentResolveRequestSchema = exports_external.object({
|
|
15246
|
-
channel: exports_external.string().min(1),
|
|
15247
|
-
seq: CommunityAgentSeqSchema
|
|
15248
|
-
});
|
|
15249
|
-
var CommunityAgentListChannelsRequestSchema = exports_external.object({
|
|
15250
|
-
server: exports_external.string().min(1).optional()
|
|
15251
|
-
});
|
|
15252
|
-
var CommunityAgentCreatePostRequestSchema = exports_external.object({
|
|
15253
|
-
forum: exports_external.string().min(1),
|
|
15254
|
-
title: exports_external.string().min(1),
|
|
15255
|
-
content: CommunityAgentMessageContentSchema,
|
|
15256
|
-
attachments: exports_external.array(exports_external.string().min(1)).max(MAX_ATTACHMENTS_PER_MESSAGE).default([]),
|
|
15257
|
-
nonce: exports_external.string().min(1).max(128).optional()
|
|
15258
|
-
}).refine((d) => d.content.text.trim().length > 0 || d.attachments.length > 0, { message: "post must have text or attachments" });
|
|
15259
|
-
var CommunityAgentListMembersRequestSchema = exports_external.object({
|
|
15260
|
-
server: exports_external.string().min(1),
|
|
15261
|
-
limit: exports_external.number().int().positive().optional(),
|
|
15262
|
-
cursor: exports_external.string().min(1).optional()
|
|
15263
|
-
});
|
|
15264
|
-
var CommunityAgentChannelMemberRequestSchema = exports_external.object({
|
|
15265
|
-
channel: exports_external.string().min(1),
|
|
15266
|
-
agentId: exports_external.string().optional()
|
|
15267
|
-
});
|
|
15268
|
-
var CommunityAgentJoinServerRequestSchema = exports_external.object({
|
|
15269
|
-
invite: exports_external.string().min(1)
|
|
15270
|
-
});
|
|
15271
|
-
var CommunityAgentNapRequestSchema = exports_external.object({
|
|
15272
|
-
handoff: exports_external.string().trim().min(1)
|
|
15273
|
-
});
|
|
15274
|
-
var CommunityAgentReactAddRequestSchema = exports_external.object({
|
|
15275
|
-
channel: exports_external.string().min(1),
|
|
15276
|
-
seq: CommunityAgentPositiveSeqSchema,
|
|
15277
|
-
emoji: exports_external.string().min(1)
|
|
15278
|
-
});
|
|
15279
|
-
var CommunityAgentFriendRequestSchema = exports_external.object({
|
|
15280
|
-
username: exports_external.string().min(1)
|
|
15281
|
-
});
|
|
15282
|
-
var CommunityAgentListFriendsSchema = exports_external.object({});
|
|
15283
|
-
var AuditLogCliInvocationPayloadSchema = exports_external.object({
|
|
15284
|
-
subcommand: exports_external.string().min(1)
|
|
15285
|
-
});
|
|
15286
|
-
var AuditLogToolCallPayloadSchema = exports_external.object({
|
|
15287
|
-
name: exports_external.string().min(1),
|
|
15288
|
-
target: exports_external.string().max(240).optional()
|
|
15289
|
-
});
|
|
15290
|
-
var AuditLogThinkingPayloadSchema = exports_external.object({
|
|
15291
|
-
text: exports_external.string(),
|
|
15292
|
-
truncated: exports_external.boolean(),
|
|
15293
|
-
chars: exports_external.number().int().nonnegative()
|
|
15294
|
-
});
|
|
15295
|
-
var AuditLogWakeTriggerPayloadSchema = exports_external.object({
|
|
15296
|
-
messageId: exports_external.string().min(1),
|
|
15297
|
-
channel: exports_external.string().min(1),
|
|
15298
|
-
seq: CommunityAgentPositiveSeqSchema,
|
|
15299
|
-
senderId: exports_external.string().min(1),
|
|
15300
|
-
senderHandle: exports_external.string().min(1),
|
|
15301
|
-
reason: exports_external.enum(["unread", "mention"])
|
|
15302
|
-
});
|
|
15303
|
-
var AuditLogSessionResetPayloadSchema = exports_external.object({
|
|
15304
|
-
trigger: exports_external.enum(["single", "reset_all"])
|
|
15305
|
-
});
|
|
15306
|
-
var AuditLogNapPayloadSchema = exports_external.object({
|
|
15307
|
-
trigger: exports_external.literal("nap")
|
|
15308
|
-
});
|
|
15309
|
-
var AuditLogModelChangedPayloadSchema = exports_external.object({
|
|
15310
|
-
from: exports_external.string().nullable(),
|
|
15311
|
-
to: exports_external.string().nullable()
|
|
15312
|
-
});
|
|
15313
|
-
var AuditLogProviderChangedPayloadSchema = exports_external.object({
|
|
15314
|
-
from: exports_external.string().min(1),
|
|
15315
|
-
to: exports_external.string().min(1)
|
|
15316
|
-
});
|
|
15317
|
-
var AuditLogErrorPayloadSchema = exports_external.object({
|
|
15318
|
-
scope: exports_external.enum(["spawn", "runtime", "exit", "handshake_timeout", "model_switch", "reset"]),
|
|
15319
|
-
code: exports_external.string().min(1).max(120),
|
|
15320
|
-
message: exports_external.string().max(2048),
|
|
15321
|
-
model: exports_external.string().nullable()
|
|
15322
|
-
});
|
|
15323
|
-
var BotAuditEventSchema = exports_external.discriminatedUnion("kind", [
|
|
15324
|
-
exports_external.object({ kind: exports_external.literal("cli_invocation"), payload: AuditLogCliInvocationPayloadSchema }),
|
|
15325
|
-
exports_external.object({ kind: exports_external.literal("tool_call"), payload: AuditLogToolCallPayloadSchema }),
|
|
15326
|
-
exports_external.object({ kind: exports_external.literal("thinking"), payload: AuditLogThinkingPayloadSchema }),
|
|
15327
|
-
exports_external.object({ kind: exports_external.literal("wake_trigger"), payload: AuditLogWakeTriggerPayloadSchema }),
|
|
15328
|
-
exports_external.object({ kind: exports_external.literal("session_reset"), payload: AuditLogSessionResetPayloadSchema }),
|
|
15329
|
-
exports_external.object({ kind: exports_external.literal("nap"), payload: AuditLogNapPayloadSchema }),
|
|
15330
|
-
exports_external.object({ kind: exports_external.literal("model_changed"), payload: AuditLogModelChangedPayloadSchema }),
|
|
15331
|
-
exports_external.object({ kind: exports_external.literal("provider_changed"), payload: AuditLogProviderChangedPayloadSchema }),
|
|
15332
|
-
exports_external.object({ kind: exports_external.literal("error"), payload: AuditLogErrorPayloadSchema })
|
|
15333
|
-
]);
|
|
15334
|
-
var BotAuditEventKindSchema = exports_external.enum([
|
|
15335
|
-
"cli_invocation",
|
|
15336
|
-
"tool_call",
|
|
15337
|
-
"thinking",
|
|
15338
|
-
"wake_trigger",
|
|
15339
|
-
"session_reset",
|
|
15340
|
-
"nap",
|
|
15341
|
-
"model_changed",
|
|
15342
|
-
"provider_changed",
|
|
15343
|
-
"error"
|
|
15344
|
-
]);
|
|
15345
|
-
var HostBotAuditEventFrameSchema = exports_external.object({
|
|
15346
|
-
type: exports_external.literal("bot_audit_event"),
|
|
15347
|
-
agentId: exports_external.string().min(1),
|
|
15348
|
-
sessionId: exports_external.string().nullable().optional(),
|
|
15349
|
-
launchId: exports_external.string().nullable().optional(),
|
|
15350
|
-
event: BotAuditEventSchema
|
|
15351
|
-
});
|
|
15352
|
-
// ../shared/src/community-cli-contract.ts
|
|
15353
|
-
var HostCommandSchema = exports_external.discriminatedUnion("type", [
|
|
15354
|
-
exports_external.object({
|
|
15355
|
-
type: exports_external.literal("agent:wake"),
|
|
15356
|
-
agentId: exports_external.string().min(1),
|
|
15357
|
-
config: exports_external.unknown(),
|
|
15358
|
-
sessionId: exports_external.string().optional(),
|
|
15359
|
-
launchId: exports_external.string().min(1),
|
|
15360
|
-
unreadNotice: exports_external.unknown()
|
|
15361
|
-
}),
|
|
15362
|
-
exports_external.object({
|
|
15363
|
-
type: exports_external.literal("agent:stop"),
|
|
15364
|
-
agentId: exports_external.string().min(1)
|
|
15365
|
-
}),
|
|
15366
|
-
exports_external.object({
|
|
15367
|
-
type: exports_external.literal("agent:reset"),
|
|
15368
|
-
agentId: exports_external.string().min(1),
|
|
15369
|
-
config: exports_external.unknown(),
|
|
15370
|
-
launchId: exports_external.string().min(1)
|
|
15371
|
-
}),
|
|
15372
|
-
exports_external.object({
|
|
15373
|
-
type: exports_external.literal("agent:nap"),
|
|
15374
|
-
agentId: exports_external.string().min(1),
|
|
15375
|
-
config: exports_external.unknown(),
|
|
15376
|
-
launchId: exports_external.string().min(1),
|
|
15377
|
-
handoff: exports_external.string().min(1)
|
|
15378
|
-
}),
|
|
15379
|
-
exports_external.object({
|
|
15380
|
-
type: exports_external.literal("agent:model_switch"),
|
|
15381
|
-
agentId: exports_external.string().min(1),
|
|
15382
|
-
config: exports_external.unknown(),
|
|
15383
|
-
launchId: exports_external.string().min(1)
|
|
15384
|
-
}),
|
|
15385
|
-
exports_external.object({
|
|
15386
|
-
type: exports_external.literal("machine:reset_all"),
|
|
15387
|
-
resets: exports_external.array(exports_external.object({
|
|
15388
|
-
agentId: exports_external.string().min(1),
|
|
15389
|
-
config: exports_external.unknown(),
|
|
15390
|
-
launchId: exports_external.string().min(1)
|
|
15391
|
-
}))
|
|
15392
|
-
}),
|
|
15393
|
-
exports_external.object({
|
|
15394
|
-
type: exports_external.literal("bot:added"),
|
|
15395
|
-
botId: exports_external.string().min(1),
|
|
15396
|
-
name: exports_external.string().optional(),
|
|
15397
|
-
discriminator: exports_external.string().optional(),
|
|
15398
|
-
description: exports_external.string().optional(),
|
|
15399
|
-
ownerName: exports_external.string().optional(),
|
|
15400
|
-
ownerDiscriminator: exports_external.string().optional()
|
|
15401
|
-
}),
|
|
15402
|
-
exports_external.object({
|
|
15403
|
-
type: exports_external.literal("bot:updated"),
|
|
15404
|
-
botId: exports_external.string().min(1),
|
|
15405
|
-
name: exports_external.string().optional(),
|
|
15406
|
-
discriminator: exports_external.string().optional(),
|
|
15407
|
-
description: exports_external.string().optional(),
|
|
15408
|
-
ownerName: exports_external.string().optional(),
|
|
15409
|
-
ownerDiscriminator: exports_external.string().optional()
|
|
15410
|
-
}),
|
|
15411
|
-
exports_external.object({
|
|
15412
|
-
type: exports_external.literal("bot:removed"),
|
|
15413
|
-
botId: exports_external.string().min(1)
|
|
15414
|
-
})
|
|
15415
|
-
]);
|
|
15416
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/entity.js
|
|
15417
|
-
var entityKind = Symbol.for("drizzle:entityKind");
|
|
15418
|
-
var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
15419
|
-
function is(value, type) {
|
|
15420
|
-
if (!value || typeof value !== "object") {
|
|
15421
|
-
return false;
|
|
15422
|
-
}
|
|
15423
|
-
if (value instanceof type) {
|
|
15424
|
-
return true;
|
|
15425
|
-
}
|
|
15426
|
-
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
|
15427
|
-
throw new Error(`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);
|
|
15428
|
-
}
|
|
15429
|
-
let cls = Object.getPrototypeOf(value).constructor;
|
|
15430
|
-
if (cls) {
|
|
15431
|
-
while (cls) {
|
|
15432
|
-
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
|
15433
|
-
return true;
|
|
15434
|
-
}
|
|
15435
|
-
cls = Object.getPrototypeOf(cls);
|
|
15436
|
-
}
|
|
15437
|
-
}
|
|
15438
|
-
return false;
|
|
15439
|
-
}
|
|
15440
|
-
|
|
15441
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/column.js
|
|
15442
|
-
class Column {
|
|
15443
|
-
constructor(table, config2) {
|
|
15444
|
-
this.table = table;
|
|
15445
|
-
this.config = config2;
|
|
15446
|
-
this.name = config2.name;
|
|
15447
|
-
this.keyAsName = config2.keyAsName;
|
|
15448
|
-
this.notNull = config2.notNull;
|
|
15449
|
-
this.default = config2.default;
|
|
15450
|
-
this.defaultFn = config2.defaultFn;
|
|
15451
|
-
this.onUpdateFn = config2.onUpdateFn;
|
|
15452
|
-
this.hasDefault = config2.hasDefault;
|
|
15453
|
-
this.primary = config2.primaryKey;
|
|
15454
|
-
this.isUnique = config2.isUnique;
|
|
15455
|
-
this.uniqueName = config2.uniqueName;
|
|
15456
|
-
this.uniqueType = config2.uniqueType;
|
|
15457
|
-
this.dataType = config2.dataType;
|
|
15458
|
-
this.columnType = config2.columnType;
|
|
15459
|
-
this.generated = config2.generated;
|
|
15460
|
-
this.generatedIdentity = config2.generatedIdentity;
|
|
15461
|
-
}
|
|
15462
|
-
static [entityKind] = "Column";
|
|
15463
|
-
name;
|
|
15464
|
-
keyAsName;
|
|
15465
|
-
primary;
|
|
15466
|
-
notNull;
|
|
15467
|
-
default;
|
|
15468
|
-
defaultFn;
|
|
15469
|
-
onUpdateFn;
|
|
15470
|
-
hasDefault;
|
|
15471
|
-
isUnique;
|
|
15472
|
-
uniqueName;
|
|
15473
|
-
uniqueType;
|
|
15474
|
-
dataType;
|
|
15475
|
-
columnType;
|
|
15476
|
-
enumValues = undefined;
|
|
15477
|
-
generated = undefined;
|
|
15478
|
-
generatedIdentity = undefined;
|
|
15479
|
-
config;
|
|
15480
|
-
mapFromDriverValue(value) {
|
|
15481
|
-
return value;
|
|
15482
|
-
}
|
|
15483
|
-
mapToDriverValue(value) {
|
|
15484
|
-
return value;
|
|
15485
|
-
}
|
|
15486
|
-
shouldDisableInsert() {
|
|
15487
|
-
return this.config.generated !== undefined && this.config.generated.type !== "byDefault";
|
|
14525
|
+
static [entityKind] = "Column";
|
|
14526
|
+
name;
|
|
14527
|
+
keyAsName;
|
|
14528
|
+
primary;
|
|
14529
|
+
notNull;
|
|
14530
|
+
default;
|
|
14531
|
+
defaultFn;
|
|
14532
|
+
onUpdateFn;
|
|
14533
|
+
hasDefault;
|
|
14534
|
+
isUnique;
|
|
14535
|
+
uniqueName;
|
|
14536
|
+
uniqueType;
|
|
14537
|
+
dataType;
|
|
14538
|
+
columnType;
|
|
14539
|
+
enumValues = undefined;
|
|
14540
|
+
generated = undefined;
|
|
14541
|
+
generatedIdentity = undefined;
|
|
14542
|
+
config;
|
|
14543
|
+
mapFromDriverValue(value) {
|
|
14544
|
+
return value;
|
|
14545
|
+
}
|
|
14546
|
+
mapToDriverValue(value) {
|
|
14547
|
+
return value;
|
|
14548
|
+
}
|
|
14549
|
+
shouldDisableInsert() {
|
|
14550
|
+
return this.config.generated !== undefined && this.config.generated.type !== "byDefault";
|
|
15488
14551
|
}
|
|
15489
14552
|
}
|
|
15490
14553
|
|
|
@@ -16082,6 +15145,94 @@ Subquery.prototype.getSQL = function() {
|
|
|
16082
15145
|
return new SQL([this]);
|
|
16083
15146
|
};
|
|
16084
15147
|
|
|
15148
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/alias.js
|
|
15149
|
+
class ColumnAliasProxyHandler {
|
|
15150
|
+
constructor(table) {
|
|
15151
|
+
this.table = table;
|
|
15152
|
+
}
|
|
15153
|
+
static [entityKind] = "ColumnAliasProxyHandler";
|
|
15154
|
+
get(columnObj, prop) {
|
|
15155
|
+
if (prop === "table") {
|
|
15156
|
+
return this.table;
|
|
15157
|
+
}
|
|
15158
|
+
return columnObj[prop];
|
|
15159
|
+
}
|
|
15160
|
+
}
|
|
15161
|
+
|
|
15162
|
+
class TableAliasProxyHandler {
|
|
15163
|
+
constructor(alias, replaceOriginalName) {
|
|
15164
|
+
this.alias = alias;
|
|
15165
|
+
this.replaceOriginalName = replaceOriginalName;
|
|
15166
|
+
}
|
|
15167
|
+
static [entityKind] = "TableAliasProxyHandler";
|
|
15168
|
+
get(target, prop) {
|
|
15169
|
+
if (prop === Table.Symbol.IsAlias) {
|
|
15170
|
+
return true;
|
|
15171
|
+
}
|
|
15172
|
+
if (prop === Table.Symbol.Name) {
|
|
15173
|
+
return this.alias;
|
|
15174
|
+
}
|
|
15175
|
+
if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {
|
|
15176
|
+
return this.alias;
|
|
15177
|
+
}
|
|
15178
|
+
if (prop === ViewBaseConfig) {
|
|
15179
|
+
return {
|
|
15180
|
+
...target[ViewBaseConfig],
|
|
15181
|
+
name: this.alias,
|
|
15182
|
+
isAlias: true
|
|
15183
|
+
};
|
|
15184
|
+
}
|
|
15185
|
+
if (prop === Table.Symbol.Columns) {
|
|
15186
|
+
const columns = target[Table.Symbol.Columns];
|
|
15187
|
+
if (!columns) {
|
|
15188
|
+
return columns;
|
|
15189
|
+
}
|
|
15190
|
+
const proxiedColumns = {};
|
|
15191
|
+
Object.keys(columns).map((key) => {
|
|
15192
|
+
proxiedColumns[key] = new Proxy(columns[key], new ColumnAliasProxyHandler(new Proxy(target, this)));
|
|
15193
|
+
});
|
|
15194
|
+
return proxiedColumns;
|
|
15195
|
+
}
|
|
15196
|
+
const value = target[prop];
|
|
15197
|
+
if (is(value, Column)) {
|
|
15198
|
+
return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(target, this)));
|
|
15199
|
+
}
|
|
15200
|
+
return value;
|
|
15201
|
+
}
|
|
15202
|
+
}
|
|
15203
|
+
|
|
15204
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/sqlite-core/alias.js
|
|
15205
|
+
function alias(table, alias2) {
|
|
15206
|
+
return new Proxy(table, new TableAliasProxyHandler(alias2, false));
|
|
15207
|
+
}
|
|
15208
|
+
|
|
15209
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/sqlite-core/checks.js
|
|
15210
|
+
class CheckBuilder {
|
|
15211
|
+
constructor(name, value) {
|
|
15212
|
+
this.name = name;
|
|
15213
|
+
this.value = value;
|
|
15214
|
+
}
|
|
15215
|
+
static [entityKind] = "SQLiteCheckBuilder";
|
|
15216
|
+
brand;
|
|
15217
|
+
build(table) {
|
|
15218
|
+
return new Check(table, this);
|
|
15219
|
+
}
|
|
15220
|
+
}
|
|
15221
|
+
|
|
15222
|
+
class Check {
|
|
15223
|
+
constructor(table, builder) {
|
|
15224
|
+
this.table = table;
|
|
15225
|
+
this.name = builder.name;
|
|
15226
|
+
this.value = builder.value;
|
|
15227
|
+
}
|
|
15228
|
+
static [entityKind] = "SQLiteCheck";
|
|
15229
|
+
name;
|
|
15230
|
+
value;
|
|
15231
|
+
}
|
|
15232
|
+
function check2(name, value) {
|
|
15233
|
+
return new CheckBuilder(name, value);
|
|
15234
|
+
}
|
|
15235
|
+
|
|
16085
15236
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/utils.js
|
|
16086
15237
|
function getColumnNameAndConfig(a, b) {
|
|
16087
15238
|
return {
|
|
@@ -16091,35 +15242,6 @@ function getColumnNameAndConfig(a, b) {
|
|
|
16091
15242
|
}
|
|
16092
15243
|
var textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
16093
15244
|
|
|
16094
|
-
// ../shared/src/db/community-schema.ts
|
|
16095
|
-
var exports_community_schema = {};
|
|
16096
|
-
__export(exports_community_schema, {
|
|
16097
|
-
communityUserProfile: () => communityUserProfile,
|
|
16098
|
-
communityServerMember: () => communityServerMember,
|
|
16099
|
-
communityServerInvite: () => communityServerInvite,
|
|
16100
|
-
communityServerFolderItem: () => communityServerFolderItem,
|
|
16101
|
-
communityServerFolder: () => communityServerFolder,
|
|
16102
|
-
communityServer: () => communityServer,
|
|
16103
|
-
communityReadState: () => communityReadState,
|
|
16104
|
-
communityReaction: () => communityReaction,
|
|
16105
|
-
communityPin: () => communityPin,
|
|
16106
|
-
communityNotificationSetting: () => communityNotificationSetting,
|
|
16107
|
-
communityMessageTag: () => communityMessageTag,
|
|
16108
|
-
communityMessageSeq: () => communityMessageSeq,
|
|
16109
|
-
communityMessageMark: () => communityMessageMark,
|
|
16110
|
-
communityMessage: () => communityMessage,
|
|
16111
|
-
communityMention: () => communityMention,
|
|
16112
|
-
communityFriendship: () => communityFriendship,
|
|
16113
|
-
communityChannelMember: () => communityChannelMember,
|
|
16114
|
-
communityChannel: () => communityChannel,
|
|
16115
|
-
communityCategory: () => communityCategory,
|
|
16116
|
-
communityBotDailyActivity: () => communityBotDailyActivity,
|
|
16117
|
-
communityBotApprovalRequest: () => communityBotApprovalRequest,
|
|
16118
|
-
communityBotActivityEvent: () => communityBotActivityEvent,
|
|
16119
|
-
communityAuditLog: () => communityAuditLog,
|
|
16120
|
-
communityAttachment: () => communityAttachment
|
|
16121
|
-
});
|
|
16122
|
-
|
|
16123
15245
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_5aa9492b131e5fac58fa98e88e5c0ad3/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
16124
15246
|
class ForeignKeyBuilder {
|
|
16125
15247
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
@@ -16788,48 +15910,130 @@ class PrimaryKey {
|
|
|
16788
15910
|
}
|
|
16789
15911
|
}
|
|
16790
15912
|
|
|
16791
|
-
// ../shared/src/db/community-schema.ts
|
|
16792
|
-
init_nanoid();
|
|
16793
|
-
|
|
15913
|
+
// ../shared/src/db/community-machine-schema.ts
|
|
15914
|
+
init_nanoid();
|
|
15915
|
+
|
|
15916
|
+
// ../shared/src/db/schema.ts
|
|
15917
|
+
var exports_schema = {};
|
|
15918
|
+
__export(exports_schema, {
|
|
15919
|
+
workspaceInvite: () => workspaceInvite,
|
|
15920
|
+
workspaceFileRequest: () => workspaceFileRequest,
|
|
15921
|
+
workspace: () => workspace,
|
|
15922
|
+
verification: () => verification,
|
|
15923
|
+
user: () => user,
|
|
15924
|
+
taskMessage: () => taskMessage,
|
|
15925
|
+
session: () => session,
|
|
15926
|
+
messageFlag: () => messageFlag,
|
|
15927
|
+
message: () => message,
|
|
15928
|
+
member: () => member,
|
|
15929
|
+
meetingSession: () => meetingSession,
|
|
15930
|
+
machineToken: () => machineToken,
|
|
15931
|
+
machine: () => machine,
|
|
15932
|
+
issueComment: () => issueComment,
|
|
15933
|
+
issue: () => issue2,
|
|
15934
|
+
inboxUnread: () => inboxUnread,
|
|
15935
|
+
emails: () => emails,
|
|
15936
|
+
conversationReadState: () => conversationReadState,
|
|
15937
|
+
conversationMap: () => conversationMap,
|
|
15938
|
+
conversation: () => conversation,
|
|
15939
|
+
channel: () => channel,
|
|
15940
|
+
calendarEvent: () => calendarEvent,
|
|
15941
|
+
artifact: () => artifact,
|
|
15942
|
+
agentWhitelist: () => agentWhitelist,
|
|
15943
|
+
agentTaskQueue: () => agentTaskQueue,
|
|
15944
|
+
agentSkill: () => agentSkill,
|
|
15945
|
+
agentSidebarOrder: () => agentSidebarOrder,
|
|
15946
|
+
agentRuntime: () => agentRuntime,
|
|
15947
|
+
agentPin: () => agentPin,
|
|
15948
|
+
agentLink: () => agentLink,
|
|
15949
|
+
agentEmailAccount: () => agentEmailAccount,
|
|
15950
|
+
agentAccess: () => agentAccess,
|
|
15951
|
+
agent: () => agent,
|
|
15952
|
+
account: () => account
|
|
15953
|
+
});
|
|
15954
|
+
init_nanoid();
|
|
15955
|
+
|
|
15956
|
+
// ../shared/src/constants.ts
|
|
15957
|
+
var TaskStatus = {
|
|
15958
|
+
QUEUED: "queued",
|
|
15959
|
+
DISPATCHED: "dispatched",
|
|
15960
|
+
RUNNING: "running",
|
|
15961
|
+
COMPLETED: "completed",
|
|
15962
|
+
FAILED: "failed",
|
|
15963
|
+
CANCELLED: "cancelled",
|
|
15964
|
+
SUPERSEDED: "superseded"
|
|
15965
|
+
};
|
|
15966
|
+
var TERMINAL_TASK_STATUSES = [
|
|
15967
|
+
TaskStatus.COMPLETED,
|
|
15968
|
+
TaskStatus.FAILED,
|
|
15969
|
+
TaskStatus.CANCELLED,
|
|
15970
|
+
TaskStatus.SUPERSEDED
|
|
15971
|
+
];
|
|
15972
|
+
var TASK_TYPES = {
|
|
15973
|
+
USER_DM_MESSAGE: "user_dm_message",
|
|
15974
|
+
EMAIL_NOTIFICATION: "email_notification",
|
|
15975
|
+
CALENDAR_EVENT: "calendar_event",
|
|
15976
|
+
ISSUE_EVENT: "issue_event",
|
|
15977
|
+
KILL_TASK: "kill_task"
|
|
15978
|
+
};
|
|
15979
|
+
var IssueStatus = {
|
|
15980
|
+
TODO: "todo",
|
|
15981
|
+
IN_PROGRESS: "in_progress",
|
|
15982
|
+
REVIEW: "review",
|
|
15983
|
+
DONE: "done",
|
|
15984
|
+
CLOSED: "closed",
|
|
15985
|
+
CANCELED: "canceled",
|
|
15986
|
+
FAILED: "failed"
|
|
15987
|
+
};
|
|
15988
|
+
var ACTIVE_ISSUE_STATUSES = [
|
|
15989
|
+
IssueStatus.TODO,
|
|
15990
|
+
IssueStatus.IN_PROGRESS,
|
|
15991
|
+
IssueStatus.REVIEW
|
|
15992
|
+
];
|
|
15993
|
+
var TERMINAL_ISSUE_STATUSES = [
|
|
15994
|
+
IssueStatus.DONE,
|
|
15995
|
+
IssueStatus.CLOSED,
|
|
15996
|
+
IssueStatus.CANCELED,
|
|
15997
|
+
IssueStatus.FAILED
|
|
15998
|
+
];
|
|
15999
|
+
var POLL_INTERVAL_MS = Number(process.env.POLL_INTERVAL_MS) || 3000;
|
|
16000
|
+
var OFFLINE_THRESHOLD_MS = Number(process.env.OFFLINE_THRESHOLD_MS) || 30000;
|
|
16001
|
+
var COMMUNITY_MACHINE_HEARTBEAT_MS = 30000;
|
|
16002
|
+
var COMMUNITY_MACHINE_OFFLINE_THRESHOLD_MS = 3 * COMMUNITY_MACHINE_HEARTBEAT_MS;
|
|
16003
|
+
var COMMUNITY_MACHINE_PAIR_TOKEN_TTL_MS = 15 * 60000;
|
|
16004
|
+
var EVENT_POLL_INTERVAL_MS = Number(process.env.EVENT_POLL_INTERVAL_MS) || 2000;
|
|
16005
|
+
var MeetingStatus = {
|
|
16006
|
+
PENDING: "pending",
|
|
16007
|
+
SCHEDULED: "scheduled",
|
|
16008
|
+
JOINING: "joining",
|
|
16009
|
+
RECORDING: "recording",
|
|
16010
|
+
COMPLETED: "completed",
|
|
16011
|
+
FAILED: "failed"
|
|
16012
|
+
};
|
|
16013
|
+
var TERMINAL_MEETING_STATUSES = [
|
|
16014
|
+
MeetingStatus.COMPLETED,
|
|
16015
|
+
MeetingStatus.FAILED
|
|
16016
|
+
];
|
|
16017
|
+
var COMMUNITY_BOT_NAME_MIN = 1;
|
|
16018
|
+
var COMMUNITY_BOT_NAME_MAX = 32;
|
|
16019
|
+
var COMMUNITY_BOT_DESCRIPTION_MAX = 1024;
|
|
16020
|
+
var COMMUNITY_BOT_IMAGE_URL_MAX = 2048;
|
|
16021
|
+
var DEV_PORTS = {
|
|
16022
|
+
web: 3000,
|
|
16023
|
+
emailWorker: 8787,
|
|
16024
|
+
wsDo: 8789,
|
|
16025
|
+
wakeWorker: 8790
|
|
16026
|
+
};
|
|
16027
|
+
var DEV_WEB_URL = process.env.ALOOK_SERVER_URL || `http://localhost:${DEV_PORTS.web}`;
|
|
16028
|
+
var DEV_WS_DO_URL = process.env.DEV_WS_DO_URL || `http://localhost:${DEV_PORTS.wsDo}`;
|
|
16029
|
+
var DEV_EMAIL_WORKER_URL = process.env.DEV_EMAIL_WORKER_URL || `http://localhost:${DEV_PORTS.emailWorker}`;
|
|
16030
|
+
var DEV_WAKE_WORKER_URL = process.env.DEV_WAKE_WORKER_URL || `http://localhost:${DEV_PORTS.wakeWorker}`;
|
|
16031
|
+
function devWsDoPort() {
|
|
16032
|
+
const port = Number(new URL(DEV_WS_DO_URL).port);
|
|
16033
|
+
return port || DEV_PORTS.wsDo;
|
|
16034
|
+
}
|
|
16035
|
+
|
|
16794
16036
|
// ../shared/src/db/schema.ts
|
|
16795
|
-
var exports_schema = {};
|
|
16796
|
-
__export(exports_schema, {
|
|
16797
|
-
workspaceInvite: () => workspaceInvite,
|
|
16798
|
-
workspaceFileRequest: () => workspaceFileRequest,
|
|
16799
|
-
workspace: () => workspace,
|
|
16800
|
-
verification: () => verification,
|
|
16801
|
-
user: () => user,
|
|
16802
|
-
taskMessage: () => taskMessage,
|
|
16803
|
-
session: () => session,
|
|
16804
|
-
messageFlag: () => messageFlag,
|
|
16805
|
-
message: () => message,
|
|
16806
|
-
member: () => member,
|
|
16807
|
-
meetingSession: () => meetingSession,
|
|
16808
|
-
machineToken: () => machineToken,
|
|
16809
|
-
machine: () => machine,
|
|
16810
|
-
issueComment: () => issueComment,
|
|
16811
|
-
issue: () => issue2,
|
|
16812
|
-
inboxUnread: () => inboxUnread,
|
|
16813
|
-
emails: () => emails,
|
|
16814
|
-
conversationReadState: () => conversationReadState,
|
|
16815
|
-
conversationMap: () => conversationMap,
|
|
16816
|
-
conversation: () => conversation,
|
|
16817
|
-
channel: () => channel,
|
|
16818
|
-
calendarEvent: () => calendarEvent,
|
|
16819
|
-
artifact: () => artifact,
|
|
16820
|
-
agentWhitelist: () => agentWhitelist,
|
|
16821
|
-
agentTaskQueue: () => agentTaskQueue,
|
|
16822
|
-
agentSkill: () => agentSkill,
|
|
16823
|
-
agentSidebarOrder: () => agentSidebarOrder,
|
|
16824
|
-
agentRuntime: () => agentRuntime,
|
|
16825
|
-
agentPin: () => agentPin,
|
|
16826
|
-
agentLink: () => agentLink,
|
|
16827
|
-
agentEmailAccount: () => agentEmailAccount,
|
|
16828
|
-
agentAccess: () => agentAccess,
|
|
16829
|
-
agent: () => agent,
|
|
16830
|
-
account: () => account
|
|
16831
|
-
});
|
|
16832
|
-
init_nanoid();
|
|
16833
16037
|
var user = sqliteTable("user", {
|
|
16834
16038
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16835
16039
|
name: text("name").notNull().default(""),
|
|
@@ -17302,85 +16506,1177 @@ var conversationMap = sqliteTable("conversation_map", {
|
|
|
17302
16506
|
}, (t) => [
|
|
17303
16507
|
unique("conversation_map_key_workspace").on(t.key, t.workspaceId)
|
|
17304
16508
|
]);
|
|
17305
|
-
var agentLink = sqliteTable("agent_link", {
|
|
17306
|
-
id: text("id").primaryKey().$defaultFn(() => "al_" + nanoid3()),
|
|
17307
|
-
workspaceId: text("workspace_id").notNull(),
|
|
17308
|
-
sourceAgentId: text("source_agent_id").notNull(),
|
|
17309
|
-
targetAgentId: text("target_agent_id").notNull(),
|
|
17310
|
-
instruction: text("instruction").notNull().default(""),
|
|
17311
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17312
|
-
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17313
|
-
}, (t) => [
|
|
17314
|
-
unique("agent_link_ws_source_target").on(t.workspaceId, t.sourceAgentId, t.targetAgentId),
|
|
17315
|
-
index("idx_agent_link_workspace").on(t.workspaceId),
|
|
17316
|
-
foreignKey({
|
|
17317
|
-
columns: [t.sourceAgentId, t.workspaceId],
|
|
17318
|
-
foreignColumns: [agent.id, agent.workspaceId]
|
|
17319
|
-
}).onDelete("cascade"),
|
|
17320
|
-
foreignKey({
|
|
17321
|
-
columns: [t.targetAgentId, t.workspaceId],
|
|
17322
|
-
foreignColumns: [agent.id, agent.workspaceId]
|
|
17323
|
-
}).onDelete("cascade")
|
|
16509
|
+
var agentLink = sqliteTable("agent_link", {
|
|
16510
|
+
id: text("id").primaryKey().$defaultFn(() => "al_" + nanoid3()),
|
|
16511
|
+
workspaceId: text("workspace_id").notNull(),
|
|
16512
|
+
sourceAgentId: text("source_agent_id").notNull(),
|
|
16513
|
+
targetAgentId: text("target_agent_id").notNull(),
|
|
16514
|
+
instruction: text("instruction").notNull().default(""),
|
|
16515
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16516
|
+
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16517
|
+
}, (t) => [
|
|
16518
|
+
unique("agent_link_ws_source_target").on(t.workspaceId, t.sourceAgentId, t.targetAgentId),
|
|
16519
|
+
index("idx_agent_link_workspace").on(t.workspaceId),
|
|
16520
|
+
foreignKey({
|
|
16521
|
+
columns: [t.sourceAgentId, t.workspaceId],
|
|
16522
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
16523
|
+
}).onDelete("cascade"),
|
|
16524
|
+
foreignKey({
|
|
16525
|
+
columns: [t.targetAgentId, t.workspaceId],
|
|
16526
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
16527
|
+
}).onDelete("cascade")
|
|
16528
|
+
]);
|
|
16529
|
+
var conversationReadState = sqliteTable("conversation_read_state", {
|
|
16530
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16531
|
+
conversationId: text("conversation_id").notNull().references(() => conversation.id, { onDelete: "cascade" }),
|
|
16532
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16533
|
+
lastReadAt: text("last_read_at").notNull().default("1970-01-01T00:00:00.000Z"),
|
|
16534
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16535
|
+
}, (t) => [
|
|
16536
|
+
unique("conversation_read_state_conv_user").on(t.conversationId, t.userId),
|
|
16537
|
+
index("idx_conversation_read_state_user").on(t.userId)
|
|
16538
|
+
]);
|
|
16539
|
+
var workspaceFileRequest = sqliteTable("workspace_file_request", {
|
|
16540
|
+
id: text("id").primaryKey().$defaultFn(() => "wfr_" + nanoid3()),
|
|
16541
|
+
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
16542
|
+
agentId: text("agent_id").notNull(),
|
|
16543
|
+
requestType: text("request_type").notNull(),
|
|
16544
|
+
path: text("path").notNull().default("."),
|
|
16545
|
+
status: text("status").notNull().default("pending"),
|
|
16546
|
+
result: text("result"),
|
|
16547
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16548
|
+
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16549
|
+
}, (t) => [
|
|
16550
|
+
index("idx_wfr_workspace_status").on(t.workspaceId, t.status)
|
|
16551
|
+
]);
|
|
16552
|
+
var agentSkill = sqliteTable("agent_skill", {
|
|
16553
|
+
id: text("id").primaryKey().$defaultFn(() => "as_" + nanoid3()),
|
|
16554
|
+
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
16555
|
+
agentId: text("agent_id"),
|
|
16556
|
+
daemonId: text("daemon_id"),
|
|
16557
|
+
runtime: text("runtime").notNull(),
|
|
16558
|
+
name: text("name").notNull(),
|
|
16559
|
+
description: text("description").notNull().default(""),
|
|
16560
|
+
syncedAt: text("synced_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16561
|
+
}, (t) => [
|
|
16562
|
+
unique("agent_skill_ws_runtime_name_agent_daemon").on(t.workspaceId, t.runtime, t.name, t.agentId, t.daemonId),
|
|
16563
|
+
index("idx_as_workspace_runtime").on(t.workspaceId, t.runtime),
|
|
16564
|
+
index("idx_as_agent_runtime").on(t.agentId, t.runtime),
|
|
16565
|
+
foreignKey({
|
|
16566
|
+
columns: [t.agentId, t.workspaceId],
|
|
16567
|
+
foreignColumns: [agent.id, agent.workspaceId]
|
|
16568
|
+
}).onDelete("cascade")
|
|
16569
|
+
]);
|
|
16570
|
+
var inboxUnread = sqliteTable("inbox_unread", {
|
|
16571
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16572
|
+
conversationId: text("conversation_id").notNull().references(() => conversation.id, { onDelete: "cascade" }),
|
|
16573
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16574
|
+
workspaceId: text("workspace_id").notNull(),
|
|
16575
|
+
agentId: text("agent_id").notNull(),
|
|
16576
|
+
taskId: text("task_id").notNull(),
|
|
16577
|
+
taskType: text("task_type").notNull(),
|
|
16578
|
+
taskStatus: text("task_status").notNull(),
|
|
16579
|
+
taskPrompt: text("task_prompt"),
|
|
16580
|
+
completedAt: text("completed_at").notNull(),
|
|
16581
|
+
latestMessageId: text("latest_message_id")
|
|
16582
|
+
}, (t) => [
|
|
16583
|
+
unique("inbox_unread_conv_user").on(t.conversationId, t.userId),
|
|
16584
|
+
index("idx_inbox_unread_user_ws").on(t.userId, t.workspaceId, t.taskType, t.completedAt)
|
|
16585
|
+
]);
|
|
16586
|
+
|
|
16587
|
+
// ../shared/src/db/community-machine-schema.ts
|
|
16588
|
+
var DIAGNOSTIC_REPORT_FAILURE_CODES = [
|
|
16589
|
+
"offline",
|
|
16590
|
+
"timeout",
|
|
16591
|
+
"upload_conflict",
|
|
16592
|
+
"invalid_upload",
|
|
16593
|
+
"diagnostics_unavailable",
|
|
16594
|
+
"collector_busy",
|
|
16595
|
+
"bot_not_bound",
|
|
16596
|
+
"collection_failed",
|
|
16597
|
+
"local_artifact_invalid",
|
|
16598
|
+
"bundle_too_large",
|
|
16599
|
+
"upload_failed",
|
|
16600
|
+
"internal_error"
|
|
16601
|
+
];
|
|
16602
|
+
var communityDiagnosticReport = sqliteTable("community_diagnostic_report", {
|
|
16603
|
+
id: text("id").primaryKey().$defaultFn(() => "dbr_" + nanoid3()),
|
|
16604
|
+
ownerUserId: text("owner_user_id").notNull(),
|
|
16605
|
+
agentId: text("agent_id").notNull(),
|
|
16606
|
+
machineId: text("machine_id").notNull(),
|
|
16607
|
+
clientNonce: text("client_nonce").notNull(),
|
|
16608
|
+
rateBucket: integer2("rate_bucket").notNull(),
|
|
16609
|
+
status: text("status").$type().notNull().default("pending"),
|
|
16610
|
+
failureCode: text("failure_code").$type(),
|
|
16611
|
+
fromMs: integer2("from_ms").notNull(),
|
|
16612
|
+
createdAt: integer2("created_at").notNull(),
|
|
16613
|
+
deadlineAt: integer2("deadline_at").notNull(),
|
|
16614
|
+
completedAt: integer2("completed_at"),
|
|
16615
|
+
r2Key: text("r2_key"),
|
|
16616
|
+
sha256: text("sha256"),
|
|
16617
|
+
sizeBytes: integer2("size_bytes"),
|
|
16618
|
+
uploadedAt: integer2("uploaded_at"),
|
|
16619
|
+
objectExpiresAt: integer2("object_expires_at")
|
|
16620
|
+
}, (t) => [
|
|
16621
|
+
index("idx_community_diagnostic_report_owner_created").on(t.ownerUserId, t.createdAt),
|
|
16622
|
+
index("idx_community_diagnostic_report_machine_status_deadline").on(t.machineId, t.status, t.deadlineAt),
|
|
16623
|
+
uniqueIndex("uq_community_diagnostic_report_owner_nonce").on(t.ownerUserId, t.clientNonce),
|
|
16624
|
+
uniqueIndex("uq_community_diagnostic_report_owner_agent_pending").on(t.ownerUserId, t.agentId).where(sql`status = 'pending'`),
|
|
16625
|
+
uniqueIndex("uq_community_diagnostic_report_owner_rate_bucket").on(t.ownerUserId, t.rateBucket),
|
|
16626
|
+
check2("ck_community_diagnostic_report_id", sql`length(${t.id}) > 4 AND substr(${t.id}, 1, 4) = 'dbr_' AND ${t.id} NOT GLOB '*[^A-Za-z0-9_-]*'`),
|
|
16627
|
+
check2("ck_community_diagnostic_report_nonce", sql`length(${t.clientNonce}) BETWEEN 16 AND 64 AND ${t.clientNonce} NOT GLOB '*[^A-Za-z0-9_-]*'`),
|
|
16628
|
+
check2("ck_community_diagnostic_report_required_epochs", sql`typeof(${t.fromMs}) = 'integer' AND ${t.fromMs} BETWEEN 0 AND 9007199254740991
|
|
16629
|
+
AND typeof(${t.createdAt}) = 'integer' AND ${t.createdAt} BETWEEN 0 AND 9007199254740991
|
|
16630
|
+
AND typeof(${t.deadlineAt}) = 'integer' AND ${t.deadlineAt} BETWEEN 0 AND 9007199254740991
|
|
16631
|
+
AND ${t.fromMs} = ${t.createdAt} - 86400000
|
|
16632
|
+
AND ${t.deadlineAt} = ${t.createdAt} + 600000`),
|
|
16633
|
+
check2("ck_community_diagnostic_report_rate_bucket", sql`typeof(${t.rateBucket}) = 'integer'
|
|
16634
|
+
AND ${t.rateBucket} BETWEEN 0 AND 9007199254740991
|
|
16635
|
+
AND ${t.rateBucket} = CAST(${t.createdAt} / 60000 AS INTEGER)`),
|
|
16636
|
+
check2("ck_community_diagnostic_report_nullable_epochs", sql`(${t.completedAt} IS NULL OR (typeof(${t.completedAt}) = 'integer' AND ${t.completedAt} BETWEEN 0 AND 9007199254740991))
|
|
16637
|
+
AND (${t.uploadedAt} IS NULL OR (typeof(${t.uploadedAt}) = 'integer' AND ${t.uploadedAt} BETWEEN 0 AND 9007199254740991))
|
|
16638
|
+
AND (${t.objectExpiresAt} IS NULL OR (typeof(${t.objectExpiresAt}) = 'integer' AND ${t.objectExpiresAt} BETWEEN 0 AND 9007199254740991))`),
|
|
16639
|
+
check2("ck_community_diagnostic_report_size", sql`${t.sizeBytes} IS NULL OR (typeof(${t.sizeBytes}) = 'integer' AND ${t.sizeBytes} BETWEEN 1 AND 10485760)`),
|
|
16640
|
+
check2("ck_community_diagnostic_report_sha256", sql`${t.sha256} IS NULL OR (length(${t.sha256}) = 64 AND ${t.sha256} NOT GLOB '*[^0-9a-f]*')`),
|
|
16641
|
+
check2("ck_community_diagnostic_report_state", sql`(
|
|
16642
|
+
${t.status} = 'pending'
|
|
16643
|
+
AND ${t.failureCode} IS NULL AND ${t.completedAt} IS NULL
|
|
16644
|
+
AND ${t.r2Key} IS NULL AND ${t.sha256} IS NULL AND ${t.sizeBytes} IS NULL
|
|
16645
|
+
AND ${t.uploadedAt} IS NULL AND ${t.objectExpiresAt} IS NULL
|
|
16646
|
+
) OR (
|
|
16647
|
+
${t.status} = 'failed'
|
|
16648
|
+
AND ${t.failureCode} IN ('offline', 'timeout', 'upload_conflict', 'invalid_upload', 'diagnostics_unavailable', 'collector_busy', 'bot_not_bound', 'collection_failed', 'local_artifact_invalid', 'bundle_too_large', 'upload_failed', 'internal_error')
|
|
16649
|
+
AND ${t.completedAt} IS NOT NULL
|
|
16650
|
+
AND ${t.completedAt} >= ${t.createdAt}
|
|
16651
|
+
AND ${t.r2Key} IS NULL AND ${t.sha256} IS NULL AND ${t.sizeBytes} IS NULL
|
|
16652
|
+
AND ${t.uploadedAt} IS NULL AND ${t.objectExpiresAt} IS NULL
|
|
16653
|
+
) OR (
|
|
16654
|
+
${t.status} = 'uploaded'
|
|
16655
|
+
AND ${t.failureCode} IS NULL AND ${t.completedAt} IS NOT NULL
|
|
16656
|
+
AND ${t.completedAt} >= ${t.createdAt}
|
|
16657
|
+
AND ${t.r2Key} IS NOT NULL
|
|
16658
|
+
AND ${t.r2Key} = 'bug-reports/' || ${t.ownerUserId} || '/' || ${t.id} || '.ndjson.gz'
|
|
16659
|
+
AND ${t.sha256} IS NOT NULL AND ${t.sizeBytes} IS NOT NULL
|
|
16660
|
+
AND ${t.uploadedAt} IS NOT NULL AND ${t.objectExpiresAt} IS NOT NULL
|
|
16661
|
+
AND ${t.completedAt} = ${t.uploadedAt}
|
|
16662
|
+
AND ${t.objectExpiresAt} = ${t.uploadedAt} + 604800000
|
|
16663
|
+
)`)
|
|
16664
|
+
]);
|
|
16665
|
+
var communityMachineToken = sqliteTable("community_machine_token", {
|
|
16666
|
+
id: text("id").primaryKey().$defaultFn(() => "cmt_" + nanoid3(32)),
|
|
16667
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16668
|
+
machineId: text("machine_id"),
|
|
16669
|
+
status: text("status").notNull().default("pending"),
|
|
16670
|
+
expiresAt: text("expires_at").notNull(),
|
|
16671
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16672
|
+
lastUsedAt: text("last_used_at")
|
|
16673
|
+
}, (t) => [
|
|
16674
|
+
index("idx_community_machine_token_user_status").on(t.userId, t.status),
|
|
16675
|
+
uniqueIndex("uq_community_machine_token_user_pending").on(t.userId).where(sql`status = 'pending'`)
|
|
16676
|
+
]);
|
|
16677
|
+
var communityMachine = sqliteTable("community_machine", {
|
|
16678
|
+
id: text("id").primaryKey().$defaultFn(() => "cm_" + nanoid3()),
|
|
16679
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16680
|
+
displayName: text("display_name").notNull().default(""),
|
|
16681
|
+
hostname: text("hostname").notNull().default(""),
|
|
16682
|
+
platform: text("platform").notNull().default(""),
|
|
16683
|
+
arch: text("arch").notNull().default(""),
|
|
16684
|
+
osRelease: text("os_release").notNull().default(""),
|
|
16685
|
+
daemonVersion: text("daemon_version").notNull().default(""),
|
|
16686
|
+
metadata: text("metadata"),
|
|
16687
|
+
availableRuntimes: text("available_runtimes", { mode: "json" }).$type().notNull().default([]),
|
|
16688
|
+
status: text("status").notNull().default("offline"),
|
|
16689
|
+
lastSeenAt: text("last_seen_at"),
|
|
16690
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16691
|
+
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16692
|
+
}, (t) => [
|
|
16693
|
+
index("idx_community_machine_user_last_seen").on(t.userId, t.lastSeenAt),
|
|
16694
|
+
index("idx_community_machine_user_updated").on(t.userId, t.updatedAt),
|
|
16695
|
+
index("idx_community_machine_user_status").on(t.userId, t.status)
|
|
16696
|
+
]);
|
|
16697
|
+
var communityMachineCredential = sqliteTable("community_machine_credential", {
|
|
16698
|
+
id: text("id").primaryKey().$defaultFn(() => "cmkid_" + nanoid3()),
|
|
16699
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16700
|
+
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "cascade" }),
|
|
16701
|
+
credentialHash: text("credential_hash").notNull().unique(),
|
|
16702
|
+
doName: text("do_name").notNull().unique(),
|
|
16703
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16704
|
+
lastUsedAt: text("last_used_at"),
|
|
16705
|
+
revokedAt: text("revoked_at")
|
|
16706
|
+
}, (t) => [
|
|
16707
|
+
index("idx_community_machine_credential_user").on(t.userId),
|
|
16708
|
+
index("idx_community_machine_credential_machine").on(t.machineId)
|
|
16709
|
+
]);
|
|
16710
|
+
var communityBotBinding = sqliteTable("community_bot_binding", {
|
|
16711
|
+
userId: text("user_id").primaryKey().references(() => user.id, { onDelete: "cascade" }),
|
|
16712
|
+
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "restrict" }),
|
|
16713
|
+
runtime: text("runtime").notNull(),
|
|
16714
|
+
modelName: text("model_name"),
|
|
16715
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16716
|
+
}, (t) => [index("idx_community_bot_binding_machine").on(t.machineId)]);
|
|
16717
|
+
var communityAgentRunnerKey = sqliteTable("community_agent_runner_key", {
|
|
16718
|
+
id: text("id").primaryKey().$defaultFn(() => "crkid_" + nanoid3()),
|
|
16719
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
16720
|
+
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "cascade" }),
|
|
16721
|
+
agentId: text("agent_id").notNull(),
|
|
16722
|
+
runnerKeyHash: text("runner_key_hash").notNull().unique(),
|
|
16723
|
+
doName: text("do_name").notNull().unique(),
|
|
16724
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16725
|
+
revokedAt: text("revoked_at")
|
|
16726
|
+
}, (t) => [
|
|
16727
|
+
index("idx_community_agent_runner_key_machine_agent").on(t.machineId, t.agentId)
|
|
16728
|
+
]);
|
|
16729
|
+
|
|
16730
|
+
// ../shared/src/diagnostics-contract.ts
|
|
16731
|
+
var DIAGNOSTIC_REPORT_COLLECTION_WINDOW_MS = 86400000;
|
|
16732
|
+
var DIAGNOSTIC_REPORT_DEADLINE_WINDOW_MS = 600000;
|
|
16733
|
+
var DIAGNOSTIC_COLLECT_SPAN_MS = DIAGNOSTIC_REPORT_COLLECTION_WINDOW_MS + DIAGNOSTIC_REPORT_DEADLINE_WINDOW_MS;
|
|
16734
|
+
var SafeEpochSchema = exports_external.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
16735
|
+
var AgentIdSchema = exports_external.string().min(1).regex(/^[A-Za-z0-9_-]+$/);
|
|
16736
|
+
var DiagnosticReportIdSchema = exports_external.string().regex(/^dbr_[A-Za-z0-9_-]+$/);
|
|
16737
|
+
var DiagnosticReportFailureCodeSchema = exports_external.enum(DIAGNOSTIC_REPORT_FAILURE_CODES);
|
|
16738
|
+
var DiagnosticReportCreateRequestSchema = exports_external.object({
|
|
16739
|
+
clientNonce: exports_external.string().min(16).max(64).regex(/^[A-Za-z0-9_-]+$/)
|
|
16740
|
+
}).strict();
|
|
16741
|
+
var DiagnosticCollectPayloadSchema = exports_external.object({
|
|
16742
|
+
reportId: DiagnosticReportIdSchema,
|
|
16743
|
+
agentId: AgentIdSchema,
|
|
16744
|
+
fromMs: SafeEpochSchema,
|
|
16745
|
+
deadlineAt: SafeEpochSchema
|
|
16746
|
+
}).strict();
|
|
16747
|
+
var DiagnosticCollectCommandSchema = exports_external.object({
|
|
16748
|
+
type: exports_external.literal("diagnostics:collect"),
|
|
16749
|
+
reportId: DiagnosticReportIdSchema,
|
|
16750
|
+
agentId: AgentIdSchema,
|
|
16751
|
+
fromMs: SafeEpochSchema,
|
|
16752
|
+
deadlineAt: SafeEpochSchema
|
|
16753
|
+
}).strict().refine((command) => command.deadlineAt - command.fromMs === DIAGNOSTIC_COLLECT_SPAN_MS, { message: "diagnostic collection span must match v1" });
|
|
16754
|
+
var OwnerDiagnosticReportBase = {
|
|
16755
|
+
reportId: DiagnosticReportIdSchema,
|
|
16756
|
+
deadlineAt: SafeEpochSchema
|
|
16757
|
+
};
|
|
16758
|
+
var OwnerDiagnosticReportSchema = exports_external.discriminatedUnion("status", [
|
|
16759
|
+
exports_external.object({
|
|
16760
|
+
...OwnerDiagnosticReportBase,
|
|
16761
|
+
status: exports_external.literal("pending"),
|
|
16762
|
+
completedAt: exports_external.null(),
|
|
16763
|
+
failureCode: exports_external.null(),
|
|
16764
|
+
objectExpired: exports_external.literal(false)
|
|
16765
|
+
}).strict(),
|
|
16766
|
+
exports_external.object({
|
|
16767
|
+
...OwnerDiagnosticReportBase,
|
|
16768
|
+
status: exports_external.literal("uploaded"),
|
|
16769
|
+
completedAt: SafeEpochSchema,
|
|
16770
|
+
failureCode: exports_external.null(),
|
|
16771
|
+
objectExpired: exports_external.boolean()
|
|
16772
|
+
}).strict(),
|
|
16773
|
+
exports_external.object({
|
|
16774
|
+
...OwnerDiagnosticReportBase,
|
|
16775
|
+
status: exports_external.literal("failed"),
|
|
16776
|
+
completedAt: SafeEpochSchema,
|
|
16777
|
+
failureCode: DiagnosticReportFailureCodeSchema,
|
|
16778
|
+
objectExpired: exports_external.literal(false)
|
|
16779
|
+
}).strict()
|
|
16780
|
+
]);
|
|
16781
|
+
// ../shared/src/constants/community.ts
|
|
16782
|
+
var MAX_PROFILE_NAME_LENGTH = 100;
|
|
16783
|
+
var MAX_MESSAGE_CONTENT_LENGTH = 4000;
|
|
16784
|
+
var MAX_ATTACHMENTS_PER_MESSAGE = 10;
|
|
16785
|
+
var MAX_ATTACHMENT_SIZE_BYTES = 25 * 1024 * 1024;
|
|
16786
|
+
var MAX_SERVER_ICON_SIZE_BYTES = 5 * 1024 * 1024;
|
|
16787
|
+
var MAX_ICON_SOURCE_FILE_SIZE_BYTES = 15 * 1024 * 1024;
|
|
16788
|
+
// ../shared/src/utils/slug.ts
|
|
16789
|
+
init_nanoid();
|
|
16790
|
+
var slugId = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz");
|
|
16791
|
+
function sanitizeSlug(input) {
|
|
16792
|
+
return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/g, "");
|
|
16793
|
+
}
|
|
16794
|
+
|
|
16795
|
+
// ../shared/src/lib/community-name.ts
|
|
16796
|
+
var FORBIDDEN_NAME_CHARS = /[#@\x00-\x1f\x7f-\x9f]/;
|
|
16797
|
+
function validateCommunityName(name) {
|
|
16798
|
+
const trimmed = name.trim();
|
|
16799
|
+
if (!trimmed)
|
|
16800
|
+
return { ok: false, reason: "name cannot be empty" };
|
|
16801
|
+
if (trimmed.length > MAX_PROFILE_NAME_LENGTH) {
|
|
16802
|
+
return { ok: false, reason: `name must be ≤ ${MAX_PROFILE_NAME_LENGTH} characters` };
|
|
16803
|
+
}
|
|
16804
|
+
if (FORBIDDEN_NAME_CHARS.test(trimmed)) {
|
|
16805
|
+
return { ok: false, reason: "name cannot contain #, @, or line breaks" };
|
|
16806
|
+
}
|
|
16807
|
+
return { ok: true };
|
|
16808
|
+
}
|
|
16809
|
+
|
|
16810
|
+
// ../shared/src/schemas.ts
|
|
16811
|
+
var TaskStatusSchema = exports_external.enum([
|
|
16812
|
+
"queued",
|
|
16813
|
+
"dispatched",
|
|
16814
|
+
"running",
|
|
16815
|
+
"completed",
|
|
16816
|
+
"failed",
|
|
16817
|
+
"cancelled",
|
|
16818
|
+
"superseded"
|
|
16819
|
+
]);
|
|
16820
|
+
var ClaimedTaskRowSchema = exports_external.object({
|
|
16821
|
+
id: exports_external.string(),
|
|
16822
|
+
agentId: exports_external.string(),
|
|
16823
|
+
runtimeId: exports_external.string(),
|
|
16824
|
+
workspaceId: exports_external.string(),
|
|
16825
|
+
conversationId: exports_external.string(),
|
|
16826
|
+
prompt: exports_external.string(),
|
|
16827
|
+
status: exports_external.string(),
|
|
16828
|
+
priority: exports_external.coerce.number(),
|
|
16829
|
+
result: exports_external.unknown().nullable(),
|
|
16830
|
+
context: exports_external.unknown().nullable(),
|
|
16831
|
+
type: exports_external.string().default(TASK_TYPES.USER_DM_MESSAGE),
|
|
16832
|
+
contextKey: exports_external.string().nullable().optional(),
|
|
16833
|
+
sessionId: exports_external.string().nullable(),
|
|
16834
|
+
createdAt: exports_external.coerce.date(),
|
|
16835
|
+
dispatchedAt: exports_external.coerce.date().nullable(),
|
|
16836
|
+
startedAt: exports_external.coerce.date().nullable(),
|
|
16837
|
+
completedAt: exports_external.coerce.date().nullable(),
|
|
16838
|
+
error: exports_external.string().nullable(),
|
|
16839
|
+
traceId: exports_external.string().nullable().optional(),
|
|
16840
|
+
parentTaskId: exports_external.string().nullable().optional()
|
|
16841
|
+
});
|
|
16842
|
+
var ColleagueDataApiSchema = exports_external.object({
|
|
16843
|
+
name: exports_external.string(),
|
|
16844
|
+
email: exports_external.string(),
|
|
16845
|
+
description: exports_external.string(),
|
|
16846
|
+
instruction: exports_external.string()
|
|
16847
|
+
});
|
|
16848
|
+
var TaskAgentDataApiSchema = exports_external.object({
|
|
16849
|
+
instructions: exports_external.string(),
|
|
16850
|
+
name: exports_external.string(),
|
|
16851
|
+
runtime_config: exports_external.record(exports_external.string(), exports_external.unknown()).default({}),
|
|
16852
|
+
email_handle: exports_external.string().nullable().optional(),
|
|
16853
|
+
email_addresses: exports_external.array(exports_external.string()).default([]),
|
|
16854
|
+
user_email: exports_external.string().nullable().optional(),
|
|
16855
|
+
user_name: exports_external.string().nullable().optional(),
|
|
16856
|
+
colleagues: exports_external.array(ColleagueDataApiSchema).default([])
|
|
16857
|
+
});
|
|
16858
|
+
var TaskApiBaseSchema = exports_external.object({
|
|
16859
|
+
id: exports_external.string(),
|
|
16860
|
+
agent_id: exports_external.string(),
|
|
16861
|
+
runtime_id: exports_external.string(),
|
|
16862
|
+
conversation_id: exports_external.string(),
|
|
16863
|
+
workspace_id: exports_external.string(),
|
|
16864
|
+
prompt: exports_external.string(),
|
|
16865
|
+
status: exports_external.string(),
|
|
16866
|
+
priority: exports_external.number(),
|
|
16867
|
+
dispatched_at: exports_external.string().nullable(),
|
|
16868
|
+
started_at: exports_external.string().nullable(),
|
|
16869
|
+
completed_at: exports_external.string().nullable(),
|
|
16870
|
+
result: exports_external.unknown().nullable(),
|
|
16871
|
+
error: exports_external.string().nullable(),
|
|
16872
|
+
created_at: exports_external.string(),
|
|
16873
|
+
type: exports_external.string(),
|
|
16874
|
+
context_key: exports_external.string().nullable().optional(),
|
|
16875
|
+
context: exports_external.unknown().nullable().optional(),
|
|
16876
|
+
trace_id: exports_external.string().nullable().optional(),
|
|
16877
|
+
parent_task_id: exports_external.string().nullable().optional(),
|
|
16878
|
+
channel: exports_external.string().nullable().optional()
|
|
16879
|
+
});
|
|
16880
|
+
var TaskSenderApiSchema = exports_external.object({
|
|
16881
|
+
name: exports_external.string(),
|
|
16882
|
+
email: exports_external.string(),
|
|
16883
|
+
is_owner: exports_external.boolean()
|
|
16884
|
+
});
|
|
16885
|
+
var TaskApiSchema = TaskApiBaseSchema.extend({
|
|
16886
|
+
agent: TaskAgentDataApiSchema.nullable().optional(),
|
|
16887
|
+
sender: TaskSenderApiSchema.nullable().optional()
|
|
16888
|
+
});
|
|
16889
|
+
var HeartbeatRequestSchema = exports_external.object({
|
|
16890
|
+
daemon_id: exports_external.string().min(1)
|
|
16891
|
+
});
|
|
16892
|
+
var PollRequestSchema = exports_external.object({
|
|
16893
|
+
daemon_id: exports_external.string().min(1),
|
|
16894
|
+
max_tasks: exports_external.number().int().min(1).default(1),
|
|
16895
|
+
cli_version: exports_external.string().optional()
|
|
16896
|
+
});
|
|
16897
|
+
var FileRequestItemSchema = exports_external.object({
|
|
16898
|
+
id: exports_external.string(),
|
|
16899
|
+
agent_id: exports_external.string(),
|
|
16900
|
+
request_type: exports_external.enum(["tree", "read"]),
|
|
16901
|
+
path: exports_external.string()
|
|
16902
|
+
});
|
|
16903
|
+
var PollMeetingItemSchema = exports_external.object({
|
|
16904
|
+
id: exports_external.string(),
|
|
16905
|
+
meeting_url: exports_external.string(),
|
|
16906
|
+
participants: exports_external.array(exports_external.string()),
|
|
16907
|
+
workspace_id: exports_external.string(),
|
|
16908
|
+
agent_id: exports_external.string(),
|
|
16909
|
+
agent_name: exports_external.string(),
|
|
16910
|
+
title: exports_external.string().optional()
|
|
16911
|
+
});
|
|
16912
|
+
var PollResponseSchema = exports_external.object({
|
|
16913
|
+
tasks: exports_external.array(TaskApiSchema),
|
|
16914
|
+
evicted: exports_external.boolean().optional(),
|
|
16915
|
+
pending_update: exports_external.object({ version: exports_external.string() }).optional(),
|
|
16916
|
+
pending_rescan: exports_external.boolean().optional(),
|
|
16917
|
+
file_requests: exports_external.array(FileRequestItemSchema).optional(),
|
|
16918
|
+
meetings: exports_external.array(PollMeetingItemSchema).optional()
|
|
16919
|
+
});
|
|
16920
|
+
var DaemonPushMessageSchema = exports_external.discriminatedUnion("type", [
|
|
16921
|
+
exports_external.object({ type: exports_external.literal("daemon.tasks"), tasks: exports_external.array(TaskApiSchema) }),
|
|
16922
|
+
exports_external.object({ type: exports_external.literal("daemon.file_requests"), workspaceId: exports_external.string(), requests: exports_external.array(FileRequestItemSchema) }),
|
|
16923
|
+
exports_external.object({ type: exports_external.literal("daemon.meetings"), meetings: exports_external.array(PollMeetingItemSchema) }),
|
|
16924
|
+
exports_external.object({ type: exports_external.literal("daemon.evict"), workspaceId: exports_external.string() }),
|
|
16925
|
+
exports_external.object({ type: exports_external.literal("daemon.update"), version: exports_external.string() }),
|
|
16926
|
+
exports_external.object({ type: exports_external.literal("daemon.rescan") }),
|
|
16927
|
+
exports_external.object({ type: exports_external.literal("daemon.kill"), workspaceId: exports_external.string(), agentId: exports_external.string().min(1), taskId: exports_external.string(), targetTaskId: exports_external.string() })
|
|
17324
16928
|
]);
|
|
17325
|
-
var
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
16929
|
+
var RegisterResponseSchema = exports_external.object({
|
|
16930
|
+
runtimes: exports_external.array(exports_external.object({ id: exports_external.string() }))
|
|
16931
|
+
});
|
|
16932
|
+
var DaemonRuntimeItemSchema = exports_external.object({
|
|
16933
|
+
type: exports_external.string().optional(),
|
|
16934
|
+
provider: exports_external.string().optional(),
|
|
16935
|
+
runtime_mode: exports_external.string().optional(),
|
|
16936
|
+
version: exports_external.string().optional(),
|
|
16937
|
+
status: exports_external.string().optional(),
|
|
16938
|
+
model: exports_external.string().optional()
|
|
16939
|
+
});
|
|
16940
|
+
var ActivateTokenRuntimeSchema = exports_external.object({
|
|
16941
|
+
type: exports_external.string().min(1),
|
|
16942
|
+
version: exports_external.string().optional().default("")
|
|
16943
|
+
});
|
|
16944
|
+
var ActivateTokenRequestSchema = exports_external.object({
|
|
16945
|
+
token: exports_external.string().min(1),
|
|
16946
|
+
hostname: exports_external.string().min(1),
|
|
16947
|
+
runtimes: exports_external.array(ActivateTokenRuntimeSchema).min(1)
|
|
16948
|
+
});
|
|
16949
|
+
var RegisterDaemonRequestSchema = exports_external.object({
|
|
16950
|
+
workspace_id: exports_external.string().min(1).optional(),
|
|
16951
|
+
daemon_id: exports_external.string().min(1),
|
|
16952
|
+
device_name: exports_external.string().optional().default(""),
|
|
16953
|
+
cli_version: exports_external.string().optional().default(""),
|
|
16954
|
+
workspaces_root: exports_external.string().optional().default(""),
|
|
16955
|
+
runtimes: exports_external.array(DaemonRuntimeItemSchema).min(1)
|
|
16956
|
+
});
|
|
16957
|
+
var DeregisterRequestSchema = exports_external.object({
|
|
16958
|
+
daemon_id: exports_external.string().min(1)
|
|
16959
|
+
});
|
|
16960
|
+
var CompleteTaskRequestSchema = exports_external.object({
|
|
16961
|
+
output: exports_external.string().optional(),
|
|
16962
|
+
session_id: exports_external.string().optional(),
|
|
16963
|
+
branch_name: exports_external.string().optional()
|
|
16964
|
+
});
|
|
16965
|
+
var FailTaskRequestSchema = exports_external.object({
|
|
16966
|
+
error: exports_external.string().optional().default("")
|
|
16967
|
+
});
|
|
16968
|
+
var MessageItemSchema = exports_external.object({
|
|
16969
|
+
seq: exports_external.number(),
|
|
16970
|
+
type: exports_external.string(),
|
|
16971
|
+
tool: exports_external.string().optional(),
|
|
16972
|
+
call_id: exports_external.string().optional(),
|
|
16973
|
+
content: exports_external.string().optional(),
|
|
16974
|
+
input: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
16975
|
+
output: exports_external.string().optional()
|
|
16976
|
+
});
|
|
16977
|
+
var ReportMessagesRequestSchema = exports_external.object({
|
|
16978
|
+
messages: exports_external.array(MessageItemSchema)
|
|
16979
|
+
});
|
|
16980
|
+
var RepeatIntervalSchema = exports_external.string().regex(/^\d+(min|hour|day|week|month)$/, {
|
|
16981
|
+
message: "repeat_interval must match <positive_integer><min|hour|day|week|month>"
|
|
16982
|
+
});
|
|
16983
|
+
var CreateCalendarEventRequestSchema = exports_external.object({
|
|
16984
|
+
agent_id: exports_external.string().min(1),
|
|
16985
|
+
title: exports_external.string().min(1),
|
|
16986
|
+
description: exports_external.string().max(20000).optional(),
|
|
16987
|
+
scheduled_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
16988
|
+
message: "scheduled_at must be a valid ISO datetime"
|
|
16989
|
+
}),
|
|
16990
|
+
repeat_interval: RepeatIntervalSchema.optional(),
|
|
16991
|
+
repeat_stop_date: exports_external.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
16992
|
+
conversation_id: exports_external.string().optional()
|
|
16993
|
+
}).refine((data) => !data.repeat_stop_date || !!data.repeat_interval, {
|
|
16994
|
+
message: "repeat_stop_date requires repeat_interval",
|
|
16995
|
+
path: ["repeat_stop_date"]
|
|
16996
|
+
});
|
|
16997
|
+
var UpdateCalendarEventRequestSchema = exports_external.object({
|
|
16998
|
+
title: exports_external.string().min(1).optional(),
|
|
16999
|
+
description: exports_external.string().max(20000).nullable().optional(),
|
|
17000
|
+
agent_id: exports_external.string().min(1).optional(),
|
|
17001
|
+
scheduled_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
17002
|
+
message: "scheduled_at must be a valid ISO datetime"
|
|
17003
|
+
}).optional(),
|
|
17004
|
+
repeat_interval: RepeatIntervalSchema.nullable().optional(),
|
|
17005
|
+
repeat_stop_date: exports_external.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
17006
|
+
scope: exports_external.enum(["this", "following"]).optional(),
|
|
17007
|
+
occurrence_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
17008
|
+
message: "occurrence_at must be a valid ISO datetime"
|
|
17009
|
+
}).optional()
|
|
17010
|
+
}).refine((v) => v.title !== undefined || v.description !== undefined || v.agent_id !== undefined || v.scheduled_at !== undefined || v.repeat_interval !== undefined || v.repeat_stop_date !== undefined, { message: "at least one field is required" });
|
|
17011
|
+
var DeleteCalendarEventRequestSchema = exports_external.object({
|
|
17012
|
+
scope: exports_external.enum(["this", "following"]).optional(),
|
|
17013
|
+
occurrence_at: exports_external.string().min(1).refine((s) => !Number.isNaN(Date.parse(s)), {
|
|
17014
|
+
message: "occurrence_at must be a valid ISO datetime"
|
|
17015
|
+
}).optional()
|
|
17016
|
+
});
|
|
17017
|
+
var CalendarEventApiSchema = exports_external.object({
|
|
17018
|
+
id: exports_external.string(),
|
|
17019
|
+
agent_id: exports_external.string(),
|
|
17020
|
+
workspace_id: exports_external.string(),
|
|
17021
|
+
title: exports_external.string(),
|
|
17022
|
+
description: exports_external.string().nullable(),
|
|
17023
|
+
scheduled_at: exports_external.string(),
|
|
17024
|
+
occurrence_at: exports_external.string(),
|
|
17025
|
+
collapsed_count: exports_external.number().nullable().optional(),
|
|
17026
|
+
repeat_interval: exports_external.string().nullable(),
|
|
17027
|
+
repeat_stop_at: exports_external.string().nullable(),
|
|
17028
|
+
last_triggered_at: exports_external.string().nullable(),
|
|
17029
|
+
created_at: exports_external.string(),
|
|
17030
|
+
updated_at: exports_external.string()
|
|
17031
|
+
});
|
|
17032
|
+
var IssueStatusSchema = exports_external.enum([
|
|
17033
|
+
IssueStatus.TODO,
|
|
17034
|
+
IssueStatus.IN_PROGRESS,
|
|
17035
|
+
IssueStatus.REVIEW,
|
|
17036
|
+
IssueStatus.DONE,
|
|
17037
|
+
IssueStatus.CLOSED,
|
|
17038
|
+
IssueStatus.CANCELED,
|
|
17039
|
+
IssueStatus.FAILED
|
|
17334
17040
|
]);
|
|
17335
|
-
var
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
}
|
|
17346
|
-
|
|
17041
|
+
var CreateIssueRequestSchema = exports_external.object({
|
|
17042
|
+
agent_id: exports_external.string().min(1).optional(),
|
|
17043
|
+
title: exports_external.string().min(1, "title is required").max(200),
|
|
17044
|
+
description: exports_external.string().max(20000).optional().default("")
|
|
17045
|
+
});
|
|
17046
|
+
var UpdateIssueRequestSchema = exports_external.object({
|
|
17047
|
+
title: exports_external.string().min(1).max(200).optional(),
|
|
17048
|
+
description: exports_external.string().max(20000).optional(),
|
|
17049
|
+
status: IssueStatusSchema.optional(),
|
|
17050
|
+
agent_id: exports_external.string().min(1).optional()
|
|
17051
|
+
}).refine((v) => v.title !== undefined || v.description !== undefined || v.status !== undefined || v.agent_id !== undefined, { message: "at least one field is required" });
|
|
17052
|
+
var CreateIssueCommentBodySchema = exports_external.object({
|
|
17053
|
+
content: exports_external.string().min(1, "content is required").max(20000)
|
|
17054
|
+
});
|
|
17055
|
+
var IssueCommentApiSchema = exports_external.object({
|
|
17056
|
+
id: exports_external.string(),
|
|
17057
|
+
issue_id: exports_external.string(),
|
|
17058
|
+
workspace_id: exports_external.string(),
|
|
17059
|
+
author_type: exports_external.enum(["user", "agent"]),
|
|
17060
|
+
author_id: exports_external.string(),
|
|
17061
|
+
content: exports_external.string(),
|
|
17062
|
+
created_at: exports_external.string()
|
|
17063
|
+
});
|
|
17064
|
+
var IssueApiSchema = exports_external.object({
|
|
17065
|
+
id: exports_external.string(),
|
|
17066
|
+
workspace_id: exports_external.string(),
|
|
17067
|
+
agent_id: exports_external.string().nullable(),
|
|
17068
|
+
creator_user_id: exports_external.string(),
|
|
17069
|
+
conversation_id: exports_external.string().nullable(),
|
|
17070
|
+
latest_task_id: exports_external.string().nullable(),
|
|
17071
|
+
title: exports_external.string(),
|
|
17072
|
+
description: exports_external.string(),
|
|
17073
|
+
status: IssueStatusSchema,
|
|
17074
|
+
created_at: exports_external.string(),
|
|
17075
|
+
updated_at: exports_external.string(),
|
|
17076
|
+
completed_at: exports_external.string().nullable()
|
|
17077
|
+
});
|
|
17078
|
+
var CreateAgentLinkRequestSchema = exports_external.object({
|
|
17079
|
+
source_agent_id: exports_external.string().min(1, "source_agent_id is required"),
|
|
17080
|
+
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
17081
|
+
instruction: exports_external.string().optional().default("")
|
|
17082
|
+
});
|
|
17083
|
+
var UpdateAgentLinkRequestSchema = exports_external.object({
|
|
17084
|
+
instruction: exports_external.string()
|
|
17085
|
+
});
|
|
17086
|
+
var UpsertAgentLinkRequestSchema = exports_external.object({
|
|
17087
|
+
target_agent_id: exports_external.string().min(1, "target_agent_id is required"),
|
|
17088
|
+
instruction: exports_external.string()
|
|
17089
|
+
});
|
|
17090
|
+
var AddWhitelistRequestSchema = exports_external.object({
|
|
17091
|
+
email: exports_external.string().email()
|
|
17092
|
+
});
|
|
17093
|
+
var RuntimeConfigSchema = exports_external.object({ model: exports_external.string().max(100).optional() }).passthrough().optional();
|
|
17094
|
+
var CreateAgentRequestSchema = exports_external.object({
|
|
17095
|
+
name: exports_external.string().min(1, "name is required"),
|
|
17096
|
+
description: exports_external.string().optional().default(""),
|
|
17097
|
+
instructions: exports_external.string().optional().default(""),
|
|
17098
|
+
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
17099
|
+
runtime_config: RuntimeConfigSchema,
|
|
17100
|
+
max_concurrent_tasks: exports_external.number().int().optional(),
|
|
17101
|
+
email_handle: exports_external.string().optional(),
|
|
17102
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
17103
|
+
});
|
|
17104
|
+
var UpdateAgentRequestSchema = exports_external.object({
|
|
17105
|
+
name: exports_external.string().min(1).optional(),
|
|
17106
|
+
description: exports_external.string().optional(),
|
|
17107
|
+
instructions: exports_external.string().optional(),
|
|
17108
|
+
runtime_id: exports_external.string().min(1).optional(),
|
|
17109
|
+
runtime_config: RuntimeConfigSchema,
|
|
17110
|
+
visibility: exports_external.enum(["public", "private"]).optional(),
|
|
17111
|
+
avatar_url: exports_external.string().max(2000).nullable().optional()
|
|
17112
|
+
}).refine((v) => v.name !== undefined || v.description !== undefined || v.instructions !== undefined || v.runtime_id !== undefined || v.runtime_config !== undefined || v.visibility !== undefined || v.avatar_url !== undefined, { message: "at least one field is required" });
|
|
17113
|
+
var CreateConversationRequestSchema = exports_external.object({
|
|
17114
|
+
agent_id: exports_external.string().min(1, "agent_id is required"),
|
|
17115
|
+
channel: exports_external.string().optional()
|
|
17116
|
+
});
|
|
17117
|
+
var CreateMessageRequestSchema = exports_external.object({
|
|
17118
|
+
content: exports_external.string().min(1, "content is required"),
|
|
17119
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
17120
|
+
});
|
|
17121
|
+
var AgentDmRequestSchema = exports_external.object({
|
|
17122
|
+
content: exports_external.string().min(1, "content is required"),
|
|
17123
|
+
task_id: exports_external.string().min(1).optional()
|
|
17124
|
+
});
|
|
17125
|
+
var EmailAttachmentSchema = exports_external.object({
|
|
17126
|
+
key: exports_external.string().min(1),
|
|
17127
|
+
filename: exports_external.string().min(1),
|
|
17128
|
+
size: exports_external.number().int().nonnegative().optional(),
|
|
17129
|
+
contentType: exports_external.string().min(1)
|
|
17130
|
+
});
|
|
17131
|
+
var SendEmailRequestSchema = exports_external.object({
|
|
17132
|
+
agentId: exports_external.string().min(1, "agentId is required"),
|
|
17133
|
+
to: exports_external.string().min(1, "to is required"),
|
|
17134
|
+
subject: exports_external.string().min(1, "subject is required"),
|
|
17135
|
+
htmlBody: exports_external.string().default(""),
|
|
17136
|
+
inReplyTo: exports_external.string().optional(),
|
|
17137
|
+
references: exports_external.string().optional(),
|
|
17138
|
+
attachments: exports_external.array(EmailAttachmentSchema).optional(),
|
|
17139
|
+
customAccountId: exports_external.string().optional(),
|
|
17140
|
+
from: exports_external.string().email().optional(),
|
|
17141
|
+
conversationId: exports_external.string().optional(),
|
|
17142
|
+
traceId: exports_external.string().optional(),
|
|
17143
|
+
sourceTaskId: exports_external.string().optional()
|
|
17144
|
+
});
|
|
17145
|
+
var UpdateEmailStatusRequestSchema = exports_external.object({
|
|
17146
|
+
status: exports_external.enum(["unread", "read", "archived", "sent"])
|
|
17147
|
+
});
|
|
17148
|
+
var MeetingInfoSchema = exports_external.object({
|
|
17149
|
+
title: exports_external.string(),
|
|
17150
|
+
meetingUrl: exports_external.string(),
|
|
17151
|
+
startTime: exports_external.string().nullable(),
|
|
17152
|
+
endTime: exports_external.string().nullable(),
|
|
17153
|
+
attendees: exports_external.array(exports_external.object({ name: exports_external.string(), email: exports_external.string() }))
|
|
17154
|
+
});
|
|
17155
|
+
var EmailNotifyRequestSchema = exports_external.object({
|
|
17156
|
+
agentId: exports_external.string().min(1),
|
|
17157
|
+
workspaceId: exports_external.string().min(1),
|
|
17158
|
+
r2Key: exports_external.string().min(1),
|
|
17159
|
+
from: exports_external.string().min(1),
|
|
17160
|
+
to: exports_external.string().optional(),
|
|
17161
|
+
subject: exports_external.string(),
|
|
17162
|
+
isWhitelisted: exports_external.boolean(),
|
|
17163
|
+
forwarded: exports_external.boolean().optional().default(false),
|
|
17164
|
+
messageId: exports_external.string().optional().default(""),
|
|
17165
|
+
inReplyTo: exports_external.string().optional().default(""),
|
|
17166
|
+
references: exports_external.string().optional().default(""),
|
|
17167
|
+
meetingInfo: MeetingInfoSchema.nullable().optional(),
|
|
17168
|
+
attachments: exports_external.string().optional(),
|
|
17169
|
+
traceId: exports_external.string().optional(),
|
|
17170
|
+
sourceTaskId: exports_external.string().optional(),
|
|
17171
|
+
isInternal: exports_external.boolean().optional().default(false),
|
|
17172
|
+
senderConversationId: exports_external.string().optional(),
|
|
17173
|
+
senderAgentId: exports_external.string().optional()
|
|
17174
|
+
});
|
|
17175
|
+
var CreateEmailAccountSchema = exports_external.object({
|
|
17176
|
+
emailAddress: exports_external.string().email("valid email required"),
|
|
17177
|
+
displayName: exports_external.string().default(""),
|
|
17178
|
+
imapHost: exports_external.string().min(1, "IMAP host is required"),
|
|
17179
|
+
imapPort: exports_external.number().int().min(1).max(65535).default(993),
|
|
17180
|
+
imapUsername: exports_external.string().min(1, "IMAP username is required"),
|
|
17181
|
+
imapPassword: exports_external.string().min(1, "IMAP password is required"),
|
|
17182
|
+
imapTls: exports_external.boolean().default(true),
|
|
17183
|
+
smtpHost: exports_external.string().min(1, "SMTP host is required"),
|
|
17184
|
+
smtpPort: exports_external.number().int().min(1).max(65535).default(587),
|
|
17185
|
+
smtpUsername: exports_external.string().min(1, "SMTP username is required"),
|
|
17186
|
+
smtpPassword: exports_external.string().min(1, "SMTP password is required"),
|
|
17187
|
+
smtpTls: exports_external.number().int().min(0).max(2).default(1),
|
|
17188
|
+
pollIntervalSeconds: exports_external.number().int().min(30).max(3600).default(60)
|
|
17189
|
+
});
|
|
17190
|
+
var UpdateEmailAccountSchema = exports_external.object({
|
|
17191
|
+
emailAddress: exports_external.string().email().optional(),
|
|
17192
|
+
displayName: exports_external.string().optional(),
|
|
17193
|
+
imapHost: exports_external.string().min(1).optional(),
|
|
17194
|
+
imapPort: exports_external.number().int().min(1).max(65535).optional(),
|
|
17195
|
+
imapUsername: exports_external.string().min(1).optional(),
|
|
17196
|
+
imapPassword: exports_external.string().min(1).optional(),
|
|
17197
|
+
imapTls: exports_external.boolean().optional(),
|
|
17198
|
+
smtpHost: exports_external.string().min(1).optional(),
|
|
17199
|
+
smtpPort: exports_external.number().int().min(1).max(65535).optional(),
|
|
17200
|
+
smtpUsername: exports_external.string().min(1).optional(),
|
|
17201
|
+
smtpPassword: exports_external.string().min(1).optional(),
|
|
17202
|
+
smtpTls: exports_external.number().int().min(0).max(2).optional(),
|
|
17203
|
+
pollIntervalSeconds: exports_external.number().int().min(30).max(3600).optional()
|
|
17204
|
+
});
|
|
17205
|
+
var TestEmailConnectionSchema = exports_external.object({
|
|
17206
|
+
imapHost: exports_external.string().min(1),
|
|
17207
|
+
imapPort: exports_external.number().int().min(1).max(65535).default(993),
|
|
17208
|
+
imapUsername: exports_external.string().min(1),
|
|
17209
|
+
imapPassword: exports_external.string().min(1),
|
|
17210
|
+
imapTls: exports_external.boolean().default(true),
|
|
17211
|
+
smtpHost: exports_external.string().min(1),
|
|
17212
|
+
smtpPort: exports_external.number().int().min(1).max(65535).default(587),
|
|
17213
|
+
smtpUsername: exports_external.string().min(1),
|
|
17214
|
+
smtpPassword: exports_external.string().min(1),
|
|
17215
|
+
smtpTls: exports_external.number().int().min(0).max(2).default(1)
|
|
17216
|
+
});
|
|
17217
|
+
var UpdateMemberRequestSchema = exports_external.object({
|
|
17218
|
+
global_instruction: exports_external.string().max(50000).trim()
|
|
17219
|
+
});
|
|
17220
|
+
var CreateWorkspaceRequestSchema = exports_external.object({
|
|
17221
|
+
name: exports_external.string().min(1, "name is required"),
|
|
17222
|
+
slug: exports_external.string().optional().default("").transform(sanitizeSlug)
|
|
17223
|
+
});
|
|
17224
|
+
var UpdateWorkspaceRequestSchema = exports_external.object({
|
|
17225
|
+
name: exports_external.string().min(1, "name is required").max(100).trim().optional(),
|
|
17226
|
+
slug: exports_external.string().min(1, "slug is required").trim().toLowerCase().transform(sanitizeSlug).optional()
|
|
17227
|
+
});
|
|
17228
|
+
var DeleteWorkspaceRequestSchema = exports_external.object({
|
|
17229
|
+
confirm_name: exports_external.string().min(1, "confirm_name is required")
|
|
17230
|
+
});
|
|
17231
|
+
var GrantAgentAccessRequestSchema = exports_external.object({
|
|
17232
|
+
user_id: exports_external.string().min(1, "user_id is required")
|
|
17233
|
+
});
|
|
17234
|
+
var WorkspaceFileBrowseRequestSchema = exports_external.object({
|
|
17235
|
+
request_type: exports_external.enum(["tree", "read"]),
|
|
17236
|
+
path: exports_external.string().default(".")
|
|
17237
|
+
});
|
|
17238
|
+
var WorkspaceFileEntrySchema = exports_external.object({
|
|
17239
|
+
name: exports_external.string(),
|
|
17240
|
+
path: exports_external.string(),
|
|
17241
|
+
isDirectory: exports_external.boolean(),
|
|
17242
|
+
size: exports_external.number(),
|
|
17243
|
+
modifiedAt: exports_external.string()
|
|
17244
|
+
});
|
|
17245
|
+
var WorkspaceFileReportSchema = exports_external.object({
|
|
17246
|
+
request_id: exports_external.string().min(1),
|
|
17247
|
+
entries: exports_external.array(WorkspaceFileEntrySchema).optional(),
|
|
17248
|
+
content: exports_external.string().nullable().optional(),
|
|
17249
|
+
isBinary: exports_external.boolean().optional(),
|
|
17250
|
+
error: exports_external.string().optional(),
|
|
17251
|
+
path: exports_external.string()
|
|
17252
|
+
});
|
|
17253
|
+
var SkillEntrySchema = exports_external.object({
|
|
17254
|
+
name: exports_external.string(),
|
|
17255
|
+
description: exports_external.string(),
|
|
17256
|
+
isGlobal: exports_external.boolean().optional()
|
|
17257
|
+
});
|
|
17258
|
+
var SkillItemSchema = exports_external.object({
|
|
17259
|
+
name: exports_external.string(),
|
|
17260
|
+
description: exports_external.string()
|
|
17261
|
+
});
|
|
17262
|
+
var SkillSyncRequestSchema = exports_external.object({
|
|
17263
|
+
scope: exports_external.enum(["global", "agent"]),
|
|
17264
|
+
agent_id: exports_external.string().min(1).optional(),
|
|
17265
|
+
daemon_id: exports_external.string().min(1).optional(),
|
|
17266
|
+
runtime: exports_external.enum(["claude", "codex", "opencode"]),
|
|
17267
|
+
skills: exports_external.array(SkillItemSchema)
|
|
17268
|
+
});
|
|
17269
|
+
var StudioMemberSchema = exports_external.object({
|
|
17270
|
+
name: exports_external.string().optional(),
|
|
17271
|
+
role: exports_external.enum(["leader", "researcher", "engineer", "assistant"]),
|
|
17272
|
+
runtime_id: exports_external.string().min(1, "runtime_id is required"),
|
|
17273
|
+
runtime_config: exports_external.object({ model: exports_external.string().max(100).optional() }).passthrough().optional(),
|
|
17274
|
+
description: exports_external.string().optional().default(""),
|
|
17275
|
+
instructions: exports_external.string().optional().default(""),
|
|
17276
|
+
avatar_url: exports_external.string().max(2000).nullable().optional(),
|
|
17277
|
+
email_handle: exports_external.string().max(30).optional(),
|
|
17278
|
+
relationship: exports_external.string().optional()
|
|
17279
|
+
});
|
|
17280
|
+
var CreateStudioRequestSchema = exports_external.object({
|
|
17281
|
+
name: exports_external.string().max(100).optional(),
|
|
17282
|
+
scenario: exports_external.string().max(50).optional(),
|
|
17283
|
+
members: exports_external.array(StudioMemberSchema).min(1).max(4)
|
|
17284
|
+
}).refine((v) => v.members.some((m) => m.role === "leader"), { message: "at least one member must have the leader role" });
|
|
17285
|
+
var RecruitAgentRequestSchema = exports_external.object({
|
|
17286
|
+
instructions: exports_external.string().min(1, "instructions is required"),
|
|
17287
|
+
relationship: exports_external.string().min(1, "relationship is required"),
|
|
17288
|
+
name: exports_external.string().optional(),
|
|
17289
|
+
description: exports_external.string().optional().default(""),
|
|
17290
|
+
model: exports_external.string().max(100).optional(),
|
|
17291
|
+
context_key: exports_external.string().optional()
|
|
17292
|
+
});
|
|
17293
|
+
var CreateThreadRequestSchema = exports_external.object({
|
|
17294
|
+
parent_message_id: exports_external.string().min(1),
|
|
17295
|
+
content: exports_external.string().optional().default(""),
|
|
17296
|
+
attachment_ids: exports_external.array(exports_external.string()).optional()
|
|
17297
|
+
});
|
|
17298
|
+
var COMMUNITY_RUNTIME_ID_MAX = 64;
|
|
17299
|
+
var COMMUNITY_RUNTIME_VERSION_MAX = 64;
|
|
17300
|
+
var COMMUNITY_RUNTIME_LIST_MAX = 64;
|
|
17301
|
+
var RUNTIME_ID_RE = /^[A-Za-z0-9._@/-]+$/;
|
|
17302
|
+
var CommunityMachineRuntimeSchema = exports_external.object({
|
|
17303
|
+
id: exports_external.string().min(1).max(COMMUNITY_RUNTIME_ID_MAX).regex(RUNTIME_ID_RE, "invalid runtime id charset"),
|
|
17304
|
+
version: exports_external.string().max(COMMUNITY_RUNTIME_VERSION_MAX).optional(),
|
|
17305
|
+
status: exports_external.enum(["healthy", "unhealthy"]).catch("healthy").default("healthy"),
|
|
17306
|
+
lastError: exports_external.string().max(128).optional(),
|
|
17307
|
+
lastErrorAt: exports_external.string().optional()
|
|
17308
|
+
});
|
|
17309
|
+
var CommunityMachineRuntimeListSchema = exports_external.array(CommunityMachineRuntimeSchema).max(COMMUNITY_RUNTIME_LIST_MAX).transform((list) => {
|
|
17310
|
+
const seen = new Set;
|
|
17311
|
+
const out = [];
|
|
17312
|
+
for (const r of list) {
|
|
17313
|
+
if (seen.has(r.id))
|
|
17314
|
+
continue;
|
|
17315
|
+
seen.add(r.id);
|
|
17316
|
+
out.push(r);
|
|
17317
|
+
}
|
|
17318
|
+
return out;
|
|
17319
|
+
});
|
|
17320
|
+
var CommunityMachineSummarySchema = exports_external.object({
|
|
17321
|
+
id: exports_external.string(),
|
|
17322
|
+
hostname: exports_external.string(),
|
|
17323
|
+
displayName: exports_external.string(),
|
|
17324
|
+
platform: exports_external.string(),
|
|
17325
|
+
arch: exports_external.string(),
|
|
17326
|
+
osRelease: exports_external.string(),
|
|
17327
|
+
daemonVersion: exports_external.string(),
|
|
17328
|
+
lastSeenAt: exports_external.string().nullable(),
|
|
17329
|
+
status: exports_external.enum(["online", "offline"]),
|
|
17330
|
+
availableRuntimes: exports_external.array(CommunityMachineRuntimeSchema).default([]),
|
|
17331
|
+
lastRuntimeError: exports_external.object({
|
|
17332
|
+
requested: exports_external.string(),
|
|
17333
|
+
available: exports_external.array(exports_external.string()),
|
|
17334
|
+
at: exports_external.string()
|
|
17335
|
+
}).optional(),
|
|
17336
|
+
createdAt: exports_external.string(),
|
|
17337
|
+
updatedAt: exports_external.string()
|
|
17338
|
+
});
|
|
17339
|
+
var HostReadyMessageSchema = exports_external.object({
|
|
17340
|
+
type: exports_external.literal("ready"),
|
|
17341
|
+
runtimeReport: CommunityMachineRuntimeListSchema,
|
|
17342
|
+
runningAgents: exports_external.array(exports_external.string()).default([]),
|
|
17343
|
+
hostname: exports_external.string().optional(),
|
|
17344
|
+
platform: exports_external.string().optional(),
|
|
17345
|
+
arch: exports_external.string().optional(),
|
|
17346
|
+
osRelease: exports_external.string().optional(),
|
|
17347
|
+
daemonVersion: exports_external.string().optional()
|
|
17348
|
+
});
|
|
17349
|
+
var CommunityDaemonReadySchema = exports_external.object({
|
|
17350
|
+
runtimeReport: CommunityMachineRuntimeListSchema.optional(),
|
|
17351
|
+
runningAgents: exports_external.array(exports_external.string()).default([]),
|
|
17352
|
+
hostname: exports_external.string().optional(),
|
|
17353
|
+
os: exports_external.string().optional(),
|
|
17354
|
+
arch: exports_external.string().optional(),
|
|
17355
|
+
osRelease: exports_external.string().optional(),
|
|
17356
|
+
daemonVersion: exports_external.string().optional()
|
|
17357
|
+
});
|
|
17358
|
+
var SessionErrorFrameSchema = exports_external.object({
|
|
17359
|
+
type: exports_external.literal("session.error"),
|
|
17360
|
+
code: exports_external.enum(["runtime_not_available"]),
|
|
17361
|
+
agentId: exports_external.string().optional(),
|
|
17362
|
+
launchId: exports_external.string().optional(),
|
|
17363
|
+
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
17364
|
+
});
|
|
17365
|
+
var AgentActivityMessageSchema = exports_external.object({
|
|
17366
|
+
type: exports_external.literal("agent_activity"),
|
|
17367
|
+
agentId: exports_external.string(),
|
|
17368
|
+
state: exports_external.enum(["idle", "starting", "running", "stopping"])
|
|
17369
|
+
});
|
|
17370
|
+
var AgentTypingMessageSchema = exports_external.object({
|
|
17371
|
+
type: exports_external.literal("agent_typing"),
|
|
17372
|
+
agentId: exports_external.string(),
|
|
17373
|
+
channelId: exports_external.string().min(1)
|
|
17374
|
+
});
|
|
17375
|
+
var AgentTypingStopMessageSchema = exports_external.object({
|
|
17376
|
+
type: exports_external.literal("agent_typing_stop"),
|
|
17377
|
+
agentId: exports_external.string(),
|
|
17378
|
+
channelId: exports_external.string().min(1)
|
|
17379
|
+
});
|
|
17380
|
+
var AgentSessionMessageSchema = exports_external.object({
|
|
17381
|
+
type: exports_external.literal("agent_session"),
|
|
17382
|
+
agentId: exports_external.string().min(1),
|
|
17383
|
+
sessionId: exports_external.string().min(1),
|
|
17384
|
+
launchId: exports_external.string().min(1)
|
|
17385
|
+
});
|
|
17386
|
+
var AgentWakeAckMessageSchema = exports_external.object({
|
|
17387
|
+
type: exports_external.literal("agent_wake_ack"),
|
|
17388
|
+
agentId: exports_external.string().min(1),
|
|
17389
|
+
launchId: exports_external.string().min(1),
|
|
17390
|
+
status: exports_external.enum(["ok", "error"]),
|
|
17391
|
+
error: exports_external.object({ code: exports_external.string().optional(), message: exports_external.string().optional() }).optional()
|
|
17392
|
+
});
|
|
17393
|
+
var CommunityPairTokenResponseSchema = exports_external.object({
|
|
17394
|
+
tokenId: exports_external.string(),
|
|
17395
|
+
expiresAt: exports_external.string()
|
|
17396
|
+
});
|
|
17397
|
+
var CommunityDaemonActivateRequestSchema = exports_external.object({
|
|
17398
|
+
hostname: exports_external.string(),
|
|
17399
|
+
platform: exports_external.string(),
|
|
17400
|
+
arch: exports_external.string(),
|
|
17401
|
+
osRelease: exports_external.string().optional(),
|
|
17402
|
+
daemonVersion: exports_external.string().optional(),
|
|
17403
|
+
runtimeReport: CommunityMachineRuntimeListSchema.optional()
|
|
17404
|
+
});
|
|
17405
|
+
var CommunityDaemonActivateResponseSchema = exports_external.object({
|
|
17406
|
+
credential: exports_external.string(),
|
|
17407
|
+
machineId: exports_external.string(),
|
|
17408
|
+
expiresAt: exports_external.string().nullable()
|
|
17409
|
+
});
|
|
17410
|
+
var CommunityDaemonEnrollAgentRequestSchema = exports_external.object({
|
|
17411
|
+
agentId: exports_external.string().min(1).max(128)
|
|
17412
|
+
});
|
|
17413
|
+
var CommunityDaemonEnrollAgentResponseSchema = exports_external.object({
|
|
17414
|
+
runnerKey: exports_external.string(),
|
|
17415
|
+
expiresAt: exports_external.string().nullable()
|
|
17416
|
+
});
|
|
17417
|
+
var isMentionSafeName = (name) => validateCommunityName(name).ok;
|
|
17418
|
+
var MENTION_SAFE_NAME_MSG = "name cannot contain #, @, or line breaks";
|
|
17419
|
+
var BOT_AVATAR_ROUTE_PATTERN = /^\/api\/community\/bots\/[A-Za-z0-9_-]+\/avatar$/;
|
|
17420
|
+
var BotImageUrlSchema = exports_external.string().max(COMMUNITY_BOT_IMAGE_URL_MAX).refine((v) => v.startsWith("https://") || v.startsWith("avatar:") || BOT_AVATAR_ROUTE_PATTERN.test(v), {
|
|
17421
|
+
message: "image must be an https URL, the bot avatar route, or an avatar: config"
|
|
17422
|
+
});
|
|
17423
|
+
var CommunityBotCreateRequestSchema = exports_external.object({
|
|
17424
|
+
name: exports_external.string().trim().min(COMMUNITY_BOT_NAME_MIN).max(COMMUNITY_BOT_NAME_MAX).refine(isMentionSafeName, { message: MENTION_SAFE_NAME_MSG }),
|
|
17425
|
+
description: exports_external.string().max(COMMUNITY_BOT_DESCRIPTION_MAX).optional(),
|
|
17426
|
+
machineId: exports_external.string().min(1),
|
|
17427
|
+
runtime: exports_external.string().min(1),
|
|
17428
|
+
image: BotImageUrlSchema.optional(),
|
|
17429
|
+
model: exports_external.string().trim().min(1).max(100).nullable().optional()
|
|
17430
|
+
});
|
|
17431
|
+
var CommunityBotPatchRequestSchema = exports_external.object({
|
|
17432
|
+
name: exports_external.string().trim().min(COMMUNITY_BOT_NAME_MIN).max(COMMUNITY_BOT_NAME_MAX).refine(isMentionSafeName, { message: MENTION_SAFE_NAME_MSG }).optional(),
|
|
17433
|
+
description: exports_external.string().max(COMMUNITY_BOT_DESCRIPTION_MAX).optional(),
|
|
17434
|
+
image: BotImageUrlSchema.nullable().optional(),
|
|
17435
|
+
model: exports_external.string().trim().min(1).max(100).nullable().optional(),
|
|
17436
|
+
runtime: exports_external.string().trim().min(1).max(COMMUNITY_RUNTIME_ID_MAX).optional()
|
|
17437
|
+
}).refine((v) => v.name !== undefined || v.description !== undefined || v.image !== undefined || v.runtime !== undefined || ("model" in v), {
|
|
17438
|
+
message: "at least one field must be provided"
|
|
17439
|
+
});
|
|
17440
|
+
var CommunityBotAddToServerRequestSchema = exports_external.object({
|
|
17441
|
+
botId: exports_external.string().min(1)
|
|
17442
|
+
});
|
|
17443
|
+
var CommunityAgentMessageContentSchema = exports_external.object({ text: exports_external.string().max(MAX_MESSAGE_CONTENT_LENGTH).default("") }).catchall(exports_external.unknown());
|
|
17444
|
+
var CommunityAgentSeqSchema = exports_external.number().int().min(0);
|
|
17445
|
+
var CommunityAgentPositiveSeqSchema = exports_external.number().int().min(1);
|
|
17446
|
+
var CommunityAgentCursorSchema = exports_external.object({
|
|
17447
|
+
channel: exports_external.string().min(1),
|
|
17448
|
+
seq: CommunityAgentPositiveSeqSchema
|
|
17449
|
+
});
|
|
17450
|
+
var CommunityAgentSendRequestSchema = exports_external.object({
|
|
17451
|
+
channel: exports_external.string().min(1),
|
|
17452
|
+
content: CommunityAgentMessageContentSchema,
|
|
17453
|
+
attachments: exports_external.array(exports_external.string().min(1)).max(MAX_ATTACHMENTS_PER_MESSAGE).default([]),
|
|
17454
|
+
seenUpToSeq: CommunityAgentSeqSchema.optional(),
|
|
17455
|
+
replyToSeq: CommunityAgentPositiveSeqSchema.optional(),
|
|
17456
|
+
nonce: exports_external.string().min(1).max(128).optional()
|
|
17457
|
+
}).refine((d) => d.content.text.trim().length > 0 || d.attachments.length > 0, { message: "message must have text or attachments" });
|
|
17458
|
+
var CommunityAgentAttachmentUploadResponseSchema = exports_external.object({
|
|
17459
|
+
id: exports_external.string(),
|
|
17460
|
+
filename: exports_external.string(),
|
|
17461
|
+
contentType: exports_external.string(),
|
|
17462
|
+
size: exports_external.number()
|
|
17463
|
+
});
|
|
17464
|
+
var CommunityAgentAttachmentDownloadRequestSchema = exports_external.object({
|
|
17465
|
+
id: exports_external.string().min(1)
|
|
17466
|
+
});
|
|
17467
|
+
var CommunityAgentInboxPullRequestSchema = exports_external.object({
|
|
17468
|
+
max: exports_external.number().int().min(1).max(200).optional()
|
|
17469
|
+
});
|
|
17470
|
+
var CommunityAgentAckRequestSchema = exports_external.object({
|
|
17471
|
+
cursors: exports_external.array(CommunityAgentCursorSchema).min(1)
|
|
17472
|
+
});
|
|
17473
|
+
var CommunityAgentReadRequestSchema = exports_external.object({
|
|
17474
|
+
channel: exports_external.string().min(1),
|
|
17475
|
+
before: CommunityAgentSeqSchema.optional(),
|
|
17476
|
+
after: CommunityAgentSeqSchema.optional(),
|
|
17477
|
+
around: CommunityAgentSeqSchema.optional(),
|
|
17478
|
+
limit: exports_external.number().int().min(1).max(200).optional()
|
|
17479
|
+
}).refine((v) => [v.before, v.after, v.around].filter((x) => x !== undefined).length <= 1, { message: "at most one of before/after/around may be supplied" });
|
|
17480
|
+
var CommunityAgentResolveRequestSchema = exports_external.object({
|
|
17481
|
+
channel: exports_external.string().min(1),
|
|
17482
|
+
seq: CommunityAgentSeqSchema
|
|
17483
|
+
});
|
|
17484
|
+
var CommunityAgentListChannelsRequestSchema = exports_external.object({
|
|
17485
|
+
server: exports_external.string().min(1).optional()
|
|
17486
|
+
});
|
|
17487
|
+
var CommunityAgentCreatePostRequestSchema = exports_external.object({
|
|
17488
|
+
forum: exports_external.string().min(1),
|
|
17489
|
+
title: exports_external.string().min(1),
|
|
17490
|
+
content: CommunityAgentMessageContentSchema,
|
|
17491
|
+
attachments: exports_external.array(exports_external.string().min(1)).max(MAX_ATTACHMENTS_PER_MESSAGE).default([]),
|
|
17492
|
+
nonce: exports_external.string().min(1).max(128).optional()
|
|
17493
|
+
}).refine((d) => d.content.text.trim().length > 0 || d.attachments.length > 0, { message: "post must have text or attachments" });
|
|
17494
|
+
var CommunityAgentListMembersRequestSchema = exports_external.object({
|
|
17495
|
+
server: exports_external.string().min(1),
|
|
17496
|
+
limit: exports_external.number().int().positive().optional(),
|
|
17497
|
+
cursor: exports_external.string().min(1).optional()
|
|
17498
|
+
});
|
|
17499
|
+
var CommunityAgentChannelMemberRequestSchema = exports_external.object({
|
|
17500
|
+
channel: exports_external.string().min(1),
|
|
17501
|
+
agentId: exports_external.string().optional()
|
|
17502
|
+
});
|
|
17503
|
+
var CommunityAgentJoinServerRequestSchema = exports_external.object({
|
|
17504
|
+
invite: exports_external.string().min(1)
|
|
17505
|
+
});
|
|
17506
|
+
var CommunityAgentNapRequestSchema = exports_external.object({
|
|
17507
|
+
handoff: exports_external.string().trim().min(1)
|
|
17508
|
+
});
|
|
17509
|
+
var CommunityAgentReactAddRequestSchema = exports_external.object({
|
|
17510
|
+
channel: exports_external.string().min(1),
|
|
17511
|
+
seq: CommunityAgentPositiveSeqSchema,
|
|
17512
|
+
emoji: exports_external.string().min(1)
|
|
17513
|
+
});
|
|
17514
|
+
var CommunityAgentFriendRequestSchema = exports_external.object({
|
|
17515
|
+
username: exports_external.string().min(1)
|
|
17516
|
+
});
|
|
17517
|
+
var CommunityAgentListFriendsSchema = exports_external.object({});
|
|
17518
|
+
var AuditLogCliInvocationPayloadSchema = exports_external.object({
|
|
17519
|
+
subcommand: exports_external.string().min(1)
|
|
17520
|
+
});
|
|
17521
|
+
var AuditLogToolCallPayloadSchema = exports_external.object({
|
|
17522
|
+
name: exports_external.string().min(1),
|
|
17523
|
+
target: exports_external.string().max(240).optional()
|
|
17524
|
+
});
|
|
17525
|
+
var AuditLogThinkingPayloadSchema = exports_external.object({
|
|
17526
|
+
text: exports_external.string(),
|
|
17527
|
+
truncated: exports_external.boolean(),
|
|
17528
|
+
chars: exports_external.number().int().nonnegative()
|
|
17529
|
+
});
|
|
17530
|
+
var AuditLogWakeTriggerPayloadSchema = exports_external.object({
|
|
17531
|
+
messageId: exports_external.string().min(1),
|
|
17532
|
+
channel: exports_external.string().min(1),
|
|
17533
|
+
seq: CommunityAgentPositiveSeqSchema,
|
|
17534
|
+
senderId: exports_external.string().min(1),
|
|
17535
|
+
senderHandle: exports_external.string().min(1),
|
|
17536
|
+
reason: exports_external.enum(["unread", "mention"])
|
|
17537
|
+
});
|
|
17538
|
+
var AuditLogSessionResetPayloadSchema = exports_external.object({
|
|
17539
|
+
trigger: exports_external.enum(["single", "reset_all"])
|
|
17540
|
+
});
|
|
17541
|
+
var AuditLogNapPayloadSchema = exports_external.object({
|
|
17542
|
+
trigger: exports_external.literal("nap")
|
|
17543
|
+
});
|
|
17544
|
+
var AuditLogModelChangedPayloadSchema = exports_external.object({
|
|
17545
|
+
from: exports_external.string().nullable(),
|
|
17546
|
+
to: exports_external.string().nullable()
|
|
17547
|
+
});
|
|
17548
|
+
var AuditLogProviderChangedPayloadSchema = exports_external.object({
|
|
17549
|
+
from: exports_external.string().min(1),
|
|
17550
|
+
to: exports_external.string().min(1)
|
|
17551
|
+
});
|
|
17552
|
+
var AuditLogErrorPayloadSchema = exports_external.object({
|
|
17553
|
+
scope: exports_external.enum(["spawn", "runtime", "exit", "handshake_timeout", "model_switch", "reset"]),
|
|
17554
|
+
code: exports_external.string().min(1).max(120),
|
|
17555
|
+
message: exports_external.string().max(2048),
|
|
17556
|
+
model: exports_external.string().nullable()
|
|
17557
|
+
});
|
|
17558
|
+
var BotAuditEventSchema = exports_external.discriminatedUnion("kind", [
|
|
17559
|
+
exports_external.object({ kind: exports_external.literal("cli_invocation"), payload: AuditLogCliInvocationPayloadSchema }),
|
|
17560
|
+
exports_external.object({ kind: exports_external.literal("tool_call"), payload: AuditLogToolCallPayloadSchema }),
|
|
17561
|
+
exports_external.object({ kind: exports_external.literal("thinking"), payload: AuditLogThinkingPayloadSchema }),
|
|
17562
|
+
exports_external.object({ kind: exports_external.literal("wake_trigger"), payload: AuditLogWakeTriggerPayloadSchema }),
|
|
17563
|
+
exports_external.object({ kind: exports_external.literal("session_reset"), payload: AuditLogSessionResetPayloadSchema }),
|
|
17564
|
+
exports_external.object({ kind: exports_external.literal("nap"), payload: AuditLogNapPayloadSchema }),
|
|
17565
|
+
exports_external.object({ kind: exports_external.literal("model_changed"), payload: AuditLogModelChangedPayloadSchema }),
|
|
17566
|
+
exports_external.object({ kind: exports_external.literal("provider_changed"), payload: AuditLogProviderChangedPayloadSchema }),
|
|
17567
|
+
exports_external.object({ kind: exports_external.literal("error"), payload: AuditLogErrorPayloadSchema })
|
|
17347
17568
|
]);
|
|
17348
|
-
var
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
unique("agent_skill_ws_runtime_name_agent_daemon").on(t.workspaceId, t.runtime, t.name, t.agentId, t.daemonId),
|
|
17359
|
-
index("idx_as_workspace_runtime").on(t.workspaceId, t.runtime),
|
|
17360
|
-
index("idx_as_agent_runtime").on(t.agentId, t.runtime),
|
|
17361
|
-
foreignKey({
|
|
17362
|
-
columns: [t.agentId, t.workspaceId],
|
|
17363
|
-
foreignColumns: [agent.id, agent.workspaceId]
|
|
17364
|
-
}).onDelete("cascade")
|
|
17569
|
+
var BotAuditEventKindSchema = exports_external.enum([
|
|
17570
|
+
"cli_invocation",
|
|
17571
|
+
"tool_call",
|
|
17572
|
+
"thinking",
|
|
17573
|
+
"wake_trigger",
|
|
17574
|
+
"session_reset",
|
|
17575
|
+
"nap",
|
|
17576
|
+
"model_changed",
|
|
17577
|
+
"provider_changed",
|
|
17578
|
+
"error"
|
|
17365
17579
|
]);
|
|
17366
|
-
var
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
|
|
17370
|
-
|
|
17371
|
-
|
|
17372
|
-
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
|
|
17580
|
+
var HostBotAuditEventFrameSchema = exports_external.object({
|
|
17581
|
+
type: exports_external.literal("bot_audit_event"),
|
|
17582
|
+
agentId: exports_external.string().min(1),
|
|
17583
|
+
sessionId: exports_external.string().nullable().optional(),
|
|
17584
|
+
launchId: exports_external.string().nullable().optional(),
|
|
17585
|
+
event: BotAuditEventSchema
|
|
17586
|
+
});
|
|
17587
|
+
// ../shared/src/community-cli-contract.ts
|
|
17588
|
+
var HostCommandSchema = exports_external.discriminatedUnion("type", [
|
|
17589
|
+
exports_external.object({
|
|
17590
|
+
type: exports_external.literal("agent:wake"),
|
|
17591
|
+
agentId: exports_external.string().min(1),
|
|
17592
|
+
config: exports_external.unknown(),
|
|
17593
|
+
sessionId: exports_external.string().optional(),
|
|
17594
|
+
launchId: exports_external.string().min(1),
|
|
17595
|
+
unreadNotice: exports_external.unknown()
|
|
17596
|
+
}),
|
|
17597
|
+
exports_external.object({
|
|
17598
|
+
type: exports_external.literal("agent:stop"),
|
|
17599
|
+
agentId: exports_external.string().min(1)
|
|
17600
|
+
}),
|
|
17601
|
+
exports_external.object({
|
|
17602
|
+
type: exports_external.literal("agent:reset"),
|
|
17603
|
+
agentId: exports_external.string().min(1),
|
|
17604
|
+
config: exports_external.unknown(),
|
|
17605
|
+
launchId: exports_external.string().min(1)
|
|
17606
|
+
}),
|
|
17607
|
+
exports_external.object({
|
|
17608
|
+
type: exports_external.literal("agent:nap"),
|
|
17609
|
+
agentId: exports_external.string().min(1),
|
|
17610
|
+
config: exports_external.unknown(),
|
|
17611
|
+
launchId: exports_external.string().min(1),
|
|
17612
|
+
handoff: exports_external.string().min(1)
|
|
17613
|
+
}),
|
|
17614
|
+
exports_external.object({
|
|
17615
|
+
type: exports_external.literal("agent:model_switch"),
|
|
17616
|
+
agentId: exports_external.string().min(1),
|
|
17617
|
+
config: exports_external.unknown(),
|
|
17618
|
+
launchId: exports_external.string().min(1)
|
|
17619
|
+
}),
|
|
17620
|
+
exports_external.object({
|
|
17621
|
+
type: exports_external.literal("machine:reset_all"),
|
|
17622
|
+
resets: exports_external.array(exports_external.object({
|
|
17623
|
+
agentId: exports_external.string().min(1),
|
|
17624
|
+
config: exports_external.unknown(),
|
|
17625
|
+
launchId: exports_external.string().min(1)
|
|
17626
|
+
}))
|
|
17627
|
+
}),
|
|
17628
|
+
exports_external.object({
|
|
17629
|
+
type: exports_external.literal("bot:added"),
|
|
17630
|
+
botId: exports_external.string().min(1),
|
|
17631
|
+
name: exports_external.string().optional(),
|
|
17632
|
+
discriminator: exports_external.string().optional(),
|
|
17633
|
+
description: exports_external.string().optional(),
|
|
17634
|
+
ownerName: exports_external.string().optional(),
|
|
17635
|
+
ownerDiscriminator: exports_external.string().optional()
|
|
17636
|
+
}),
|
|
17637
|
+
exports_external.object({
|
|
17638
|
+
type: exports_external.literal("bot:updated"),
|
|
17639
|
+
botId: exports_external.string().min(1),
|
|
17640
|
+
name: exports_external.string().optional(),
|
|
17641
|
+
discriminator: exports_external.string().optional(),
|
|
17642
|
+
description: exports_external.string().optional(),
|
|
17643
|
+
ownerName: exports_external.string().optional(),
|
|
17644
|
+
ownerDiscriminator: exports_external.string().optional()
|
|
17645
|
+
}),
|
|
17646
|
+
exports_external.object({
|
|
17647
|
+
type: exports_external.literal("bot:removed"),
|
|
17648
|
+
botId: exports_external.string().min(1)
|
|
17649
|
+
}),
|
|
17650
|
+
DiagnosticCollectCommandSchema
|
|
17381
17651
|
]);
|
|
17382
|
-
|
|
17383
17652
|
// ../shared/src/db/community-schema.ts
|
|
17653
|
+
var exports_community_schema = {};
|
|
17654
|
+
__export(exports_community_schema, {
|
|
17655
|
+
communityUserProfile: () => communityUserProfile,
|
|
17656
|
+
communityServerMember: () => communityServerMember,
|
|
17657
|
+
communityServerInvite: () => communityServerInvite,
|
|
17658
|
+
communityServerFolderItem: () => communityServerFolderItem,
|
|
17659
|
+
communityServerFolder: () => communityServerFolder,
|
|
17660
|
+
communityServer: () => communityServer,
|
|
17661
|
+
communityReadState: () => communityReadState,
|
|
17662
|
+
communityReaction: () => communityReaction,
|
|
17663
|
+
communityPin: () => communityPin,
|
|
17664
|
+
communityNotificationSetting: () => communityNotificationSetting,
|
|
17665
|
+
communityMessageTag: () => communityMessageTag,
|
|
17666
|
+
communityMessageSeq: () => communityMessageSeq,
|
|
17667
|
+
communityMessageMark: () => communityMessageMark,
|
|
17668
|
+
communityMessage: () => communityMessage,
|
|
17669
|
+
communityMention: () => communityMention,
|
|
17670
|
+
communityFriendship: () => communityFriendship,
|
|
17671
|
+
communityChannelMember: () => communityChannelMember,
|
|
17672
|
+
communityChannel: () => communityChannel,
|
|
17673
|
+
communityCategory: () => communityCategory,
|
|
17674
|
+
communityBotDailyActivity: () => communityBotDailyActivity,
|
|
17675
|
+
communityBotApprovalRequest: () => communityBotApprovalRequest,
|
|
17676
|
+
communityBotActivityEvent: () => communityBotActivityEvent,
|
|
17677
|
+
communityAttachment: () => communityAttachment
|
|
17678
|
+
});
|
|
17679
|
+
init_nanoid();
|
|
17384
17680
|
var communityServer = sqliteTable("community_server", {
|
|
17385
17681
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17386
17682
|
name: text("name").notNull(),
|
|
@@ -17589,23 +17885,6 @@ var communityNotificationSetting = sqliteTable("community_notification_setting",
|
|
|
17589
17885
|
}),
|
|
17590
17886
|
level: text("level").notNull().default("all")
|
|
17591
17887
|
}, (t) => [index("idx_notification_setting_user").on(t.userId)]);
|
|
17592
|
-
var communityAuditLog = sqliteTable("community_audit_log", {
|
|
17593
|
-
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17594
|
-
serverId: text("server_id").references(() => communityServer.id, {
|
|
17595
|
-
onDelete: "cascade"
|
|
17596
|
-
}),
|
|
17597
|
-
actorId: text("actor_id").references(() => user.id, { onDelete: "set null" }),
|
|
17598
|
-
action: text("action").notNull(),
|
|
17599
|
-
targetType: text("target_type").notNull(),
|
|
17600
|
-
targetId: text("target_id").notNull(),
|
|
17601
|
-
changes: text("changes"),
|
|
17602
|
-
reason: text("reason"),
|
|
17603
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17604
|
-
}, (t) => [
|
|
17605
|
-
index("idx_audit_log_server_created").on(t.serverId, t.createdAt),
|
|
17606
|
-
index("idx_audit_log_server_action").on(t.serverId, t.action),
|
|
17607
|
-
index("idx_audit_log_actor_created").on(t.actorId, t.createdAt)
|
|
17608
|
-
]);
|
|
17609
17888
|
var communityBotApprovalRequest = sqliteTable("community_bot_approval_request", {
|
|
17610
17889
|
id: text("id").primaryKey().$defaultFn(() => "bar_" + nanoid3()),
|
|
17611
17890
|
botId: text("bot_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
@@ -17763,81 +18042,6 @@ var listedMessageProjection = {
|
|
|
17763
18042
|
authorImage: user.image
|
|
17764
18043
|
};
|
|
17765
18044
|
|
|
17766
|
-
// ../shared/src/db/community-machine-schema.ts
|
|
17767
|
-
var exports_community_machine_schema = {};
|
|
17768
|
-
__export(exports_community_machine_schema, {
|
|
17769
|
-
communityMachineToken: () => communityMachineToken,
|
|
17770
|
-
communityMachineCredential: () => communityMachineCredential,
|
|
17771
|
-
communityMachine: () => communityMachine,
|
|
17772
|
-
communityBotBinding: () => communityBotBinding,
|
|
17773
|
-
communityAgentRunnerKey: () => communityAgentRunnerKey
|
|
17774
|
-
});
|
|
17775
|
-
init_nanoid();
|
|
17776
|
-
var communityMachineToken = sqliteTable("community_machine_token", {
|
|
17777
|
-
id: text("id").primaryKey().$defaultFn(() => "cmt_" + nanoid3(32)),
|
|
17778
|
-
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17779
|
-
machineId: text("machine_id"),
|
|
17780
|
-
status: text("status").notNull().default("pending"),
|
|
17781
|
-
expiresAt: text("expires_at").notNull(),
|
|
17782
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17783
|
-
lastUsedAt: text("last_used_at")
|
|
17784
|
-
}, (t) => [
|
|
17785
|
-
index("idx_community_machine_token_user_status").on(t.userId, t.status),
|
|
17786
|
-
uniqueIndex("uq_community_machine_token_user_pending").on(t.userId).where(sql`status = 'pending'`)
|
|
17787
|
-
]);
|
|
17788
|
-
var communityMachine = sqliteTable("community_machine", {
|
|
17789
|
-
id: text("id").primaryKey().$defaultFn(() => "cm_" + nanoid3()),
|
|
17790
|
-
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17791
|
-
displayName: text("display_name").notNull().default(""),
|
|
17792
|
-
hostname: text("hostname").notNull().default(""),
|
|
17793
|
-
platform: text("platform").notNull().default(""),
|
|
17794
|
-
arch: text("arch").notNull().default(""),
|
|
17795
|
-
osRelease: text("os_release").notNull().default(""),
|
|
17796
|
-
daemonVersion: text("daemon_version").notNull().default(""),
|
|
17797
|
-
metadata: text("metadata"),
|
|
17798
|
-
availableRuntimes: text("available_runtimes", { mode: "json" }).$type().notNull().default([]),
|
|
17799
|
-
status: text("status").notNull().default("offline"),
|
|
17800
|
-
lastSeenAt: text("last_seen_at"),
|
|
17801
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17802
|
-
updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17803
|
-
}, (t) => [
|
|
17804
|
-
index("idx_community_machine_user_last_seen").on(t.userId, t.lastSeenAt),
|
|
17805
|
-
index("idx_community_machine_user_updated").on(t.userId, t.updatedAt),
|
|
17806
|
-
index("idx_community_machine_user_status").on(t.userId, t.status)
|
|
17807
|
-
]);
|
|
17808
|
-
var communityMachineCredential = sqliteTable("community_machine_credential", {
|
|
17809
|
-
id: text("id").primaryKey().$defaultFn(() => "cmkid_" + nanoid3()),
|
|
17810
|
-
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17811
|
-
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "cascade" }),
|
|
17812
|
-
credentialHash: text("credential_hash").notNull().unique(),
|
|
17813
|
-
doName: text("do_name").notNull().unique(),
|
|
17814
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17815
|
-
lastUsedAt: text("last_used_at"),
|
|
17816
|
-
revokedAt: text("revoked_at")
|
|
17817
|
-
}, (t) => [
|
|
17818
|
-
index("idx_community_machine_credential_user").on(t.userId),
|
|
17819
|
-
index("idx_community_machine_credential_machine").on(t.machineId)
|
|
17820
|
-
]);
|
|
17821
|
-
var communityBotBinding = sqliteTable("community_bot_binding", {
|
|
17822
|
-
userId: text("user_id").primaryKey().references(() => user.id, { onDelete: "cascade" }),
|
|
17823
|
-
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "restrict" }),
|
|
17824
|
-
runtime: text("runtime").notNull(),
|
|
17825
|
-
modelName: text("model_name"),
|
|
17826
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17827
|
-
}, (t) => [index("idx_community_bot_binding_machine").on(t.machineId)]);
|
|
17828
|
-
var communityAgentRunnerKey = sqliteTable("community_agent_runner_key", {
|
|
17829
|
-
id: text("id").primaryKey().$defaultFn(() => "crkid_" + nanoid3()),
|
|
17830
|
-
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17831
|
-
machineId: text("machine_id").notNull().references(() => communityMachine.id, { onDelete: "cascade" }),
|
|
17832
|
-
agentId: text("agent_id").notNull(),
|
|
17833
|
-
runnerKeyHash: text("runner_key_hash").notNull().unique(),
|
|
17834
|
-
doName: text("do_name").notNull().unique(),
|
|
17835
|
-
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17836
|
-
revokedAt: text("revoked_at")
|
|
17837
|
-
}, (t) => [
|
|
17838
|
-
index("idx_community_agent_runner_key_machine_agent").on(t.machineId, t.agentId)
|
|
17839
|
-
]);
|
|
17840
|
-
|
|
17841
18045
|
// ../shared/src/db/queries/user.ts
|
|
17842
18046
|
var publicUserColumns = {
|
|
17843
18047
|
id: user.id,
|
|
@@ -18404,6 +18608,8 @@ function toAlookAddress(h) {
|
|
|
18404
18608
|
var FTS_KEYWORDS = new Set(["and", "or", "not", "near"]);
|
|
18405
18609
|
// ../shared/src/db/queries/community/server-folder.ts
|
|
18406
18610
|
var FOLDER_ITEM_INSERT_MAX_ROWS = maxRowsPerInsert(3);
|
|
18611
|
+
// ../shared/src/db/queries/community/diagnostic-report.ts
|
|
18612
|
+
var diagnosticOwner = alias(user, "diagnostic_owner");
|
|
18407
18613
|
// ../shared/src/semver.ts
|
|
18408
18614
|
function semverGte(a, b) {
|
|
18409
18615
|
const pa = a.split(".").map(Number);
|
|
@@ -21171,10 +21377,10 @@ function ensureSymlinks(workDir) {
|
|
|
21171
21377
|
const canonicalPath = join5(workDir, CANONICAL_FILE);
|
|
21172
21378
|
if (!existsSync(canonicalPath))
|
|
21173
21379
|
return;
|
|
21174
|
-
for (const
|
|
21175
|
-
if (
|
|
21380
|
+
for (const alias2 of SYMLINK_ALIASES) {
|
|
21381
|
+
if (alias2 === CANONICAL_FILE)
|
|
21176
21382
|
continue;
|
|
21177
|
-
const aliasPath = join5(workDir,
|
|
21383
|
+
const aliasPath = join5(workDir, alias2);
|
|
21178
21384
|
try {
|
|
21179
21385
|
const stat = lstatSync(aliasPath);
|
|
21180
21386
|
if (stat.isSymbolicLink()) {
|
|
@@ -21580,7 +21786,7 @@ function waitForAck(baseDir, contextKey, seq, timeoutMs = 3000) {
|
|
|
21580
21786
|
return new Promise((resolve) => {
|
|
21581
21787
|
const deadline = Date.now() + timeoutMs;
|
|
21582
21788
|
const pollInterval = 100;
|
|
21583
|
-
const
|
|
21789
|
+
const check3 = () => {
|
|
21584
21790
|
try {
|
|
21585
21791
|
if (existsSync2(ackPath)) {
|
|
21586
21792
|
resolve({ acked: true });
|
|
@@ -21601,9 +21807,9 @@ function waitForAck(baseDir, contextKey, seq, timeoutMs = 3000) {
|
|
|
21601
21807
|
resolve({ acked: false, nackReason: "timeout" });
|
|
21602
21808
|
return;
|
|
21603
21809
|
}
|
|
21604
|
-
setTimeout(
|
|
21810
|
+
setTimeout(check3, pollInterval);
|
|
21605
21811
|
};
|
|
21606
|
-
|
|
21812
|
+
check3();
|
|
21607
21813
|
});
|
|
21608
21814
|
}
|
|
21609
21815
|
function readSteerMessage(filePath) {
|
|
@@ -23713,8 +23919,8 @@ var sessionRunnerPath = existsSync4(join12(_dir, "session-runner.js")) ? join12(
|
|
|
23713
23919
|
var meetingRunnerPath = existsSync4(join12(_dir, "meeting-runner.js")) ? join12(_dir, "meeting-runner.js") : join12(_dir, "meeting-runner.ts");
|
|
23714
23920
|
function isCommandAvailable(cmd) {
|
|
23715
23921
|
try {
|
|
23716
|
-
const
|
|
23717
|
-
execSync4(
|
|
23922
|
+
const check3 = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
23923
|
+
execSync4(check3, { stdio: "ignore" });
|
|
23718
23924
|
return true;
|
|
23719
23925
|
} catch {
|
|
23720
23926
|
return false;
|
|
@@ -24830,8 +25036,8 @@ async function handleTask(client, config2, runtimeIndex, task, token, activeTask
|
|
|
24830
25036
|
import { execSync as execSync5 } from "child_process";
|
|
24831
25037
|
function isCommandAvailable2(cmd) {
|
|
24832
25038
|
try {
|
|
24833
|
-
const
|
|
24834
|
-
execSync5(
|
|
25039
|
+
const check3 = process.platform === "win32" ? `where ${cmd}` : `which ${cmd}`;
|
|
25040
|
+
execSync5(check3, { stdio: "ignore" });
|
|
24835
25041
|
return true;
|
|
24836
25042
|
} catch {
|
|
24837
25043
|
return false;
|