@agentrix/shared 2.34.1 → 2.35.0
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/{errors-DxB8EzbU.d.cts → errors-DC4QxaMi.d.cts} +117 -35
- package/dist/index.cjs +87 -4
- package/dist/index.d.cts +211 -33
- package/dist/node.d.cts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -359,6 +359,7 @@ const StartTaskRequestSchema = zod.z.object({
|
|
|
359
359
|
model: zod.z.string().min(1).optional(),
|
|
360
360
|
// Optional model selected for this task
|
|
361
361
|
repositoryId: zod.z.string().optional(),
|
|
362
|
+
workspaceId: zod.z.string().optional(),
|
|
362
363
|
baseBranch: zod.z.string().optional(),
|
|
363
364
|
// Base branch for the repository
|
|
364
365
|
workerExecutionMode: WorkerExecutionModeSchema.optional(),
|
|
@@ -388,14 +389,14 @@ const StartTaskRequestSchema = zod.z.object({
|
|
|
388
389
|
// Link task to a git issue on creation
|
|
389
390
|
branchName: zod.z.string().optional()
|
|
390
391
|
// Explicit branch name override (e.g. issue/42/code)
|
|
391
|
-
}).refine((data) => data.machineId || data.cloudId || data.parentTaskId || data.sourceTaskId, {
|
|
392
|
-
message: "Must provide either machineId, cloudId, parentTaskId, or sourceTaskId"
|
|
392
|
+
}).refine((data) => data.machineId || data.cloudId || data.workspaceId || data.parentTaskId || data.sourceTaskId, {
|
|
393
|
+
message: "Must provide either machineId, cloudId, workspaceId, parentTaskId, or sourceTaskId"
|
|
393
394
|
}).refine(
|
|
394
395
|
(data) => {
|
|
395
396
|
if (data.parentTaskId || data.sourceTaskId) {
|
|
396
397
|
return true;
|
|
397
398
|
}
|
|
398
|
-
if (data.machineId) {
|
|
399
|
+
if (data.machineId || data.workspaceId) {
|
|
399
400
|
return !!data.encryptedMessage && !!data.dataEncryptionKey && !data.message;
|
|
400
401
|
}
|
|
401
402
|
if (data.cloudId) {
|
|
@@ -422,6 +423,7 @@ const StartTaskResponseSchema = zod.z.object({
|
|
|
422
423
|
cloudId: zod.z.string().nullable(),
|
|
423
424
|
model: zod.z.string().nullable().optional(),
|
|
424
425
|
repositoryId: zod.z.string().nullable(),
|
|
426
|
+
workspaceId: zod.z.string().nullable().optional(),
|
|
425
427
|
baseBranch: zod.z.string().nullable(),
|
|
426
428
|
branchName: zod.z.string().nullable(),
|
|
427
429
|
branchBinding: TaskBranchBindingSchema.default("none"),
|
|
@@ -458,6 +460,7 @@ const TaskItemSchema = zod.z.object({
|
|
|
458
460
|
cloudId: zod.z.string().nullable(),
|
|
459
461
|
model: zod.z.string().nullable().optional(),
|
|
460
462
|
repositoryId: zod.z.string().nullable(),
|
|
463
|
+
workspaceId: zod.z.string().nullable().optional(),
|
|
461
464
|
baseBranch: zod.z.string().nullable(),
|
|
462
465
|
branchName: zod.z.string().nullable(),
|
|
463
466
|
// Explicit branch name override (e.g. issue/42/code)
|
|
@@ -768,6 +771,7 @@ const ChatSchema = zod.z.object({
|
|
|
768
771
|
type: ChatTypeSchema,
|
|
769
772
|
title: zod.z.string().nullable().optional(),
|
|
770
773
|
bindRepoId: zod.z.string().nullable().optional(),
|
|
774
|
+
bindWorkspaceId: zod.z.string().nullable().optional(),
|
|
771
775
|
createdAt: zod.z.string(),
|
|
772
776
|
// ISO 8601 string
|
|
773
777
|
updatedAt: zod.z.string()
|
|
@@ -821,6 +825,54 @@ const EnsureRepoChatRequestSchema = zod.z.object({
|
|
|
821
825
|
repositoryId: zod.z.string().min(1)
|
|
822
826
|
});
|
|
823
827
|
const EnsureRepoChatResponseSchema = ChatWithMembersSchema;
|
|
828
|
+
const EnsureWorkspaceChatRequestSchema = zod.z.object({
|
|
829
|
+
workspaceId: zod.z.string().min(1)
|
|
830
|
+
});
|
|
831
|
+
const EnsureWorkspaceChatResponseSchema = ChatWithMembersSchema;
|
|
832
|
+
|
|
833
|
+
const WorkspacePathStatusSchema = zod.z.enum(["active", "missing", "permission_lost"]);
|
|
834
|
+
const WorkspaceSchema = zod.z.object({
|
|
835
|
+
id: IdSchema,
|
|
836
|
+
userId: zod.z.string(),
|
|
837
|
+
machineId: zod.z.string(),
|
|
838
|
+
chatId: zod.z.string().nullable(),
|
|
839
|
+
name: zod.z.string(),
|
|
840
|
+
path: zod.z.string(),
|
|
841
|
+
normalizedPath: zod.z.string(),
|
|
842
|
+
pathStatus: WorkspacePathStatusSchema,
|
|
843
|
+
lastCheckedAt: DateSchema.nullable(),
|
|
844
|
+
lastUsedAt: DateSchema.nullable(),
|
|
845
|
+
deletedAt: DateSchema.nullable(),
|
|
846
|
+
createdAt: DateSchema,
|
|
847
|
+
updatedAt: DateSchema
|
|
848
|
+
});
|
|
849
|
+
const ListWorkspacesResponseSchema = zod.z.object({
|
|
850
|
+
workspaces: zod.z.array(WorkspaceSchema)
|
|
851
|
+
});
|
|
852
|
+
const CreateWorkspaceRequestSchema = zod.z.object({
|
|
853
|
+
machineId: zod.z.string().min(1),
|
|
854
|
+
name: zod.z.string().min(1).max(200),
|
|
855
|
+
path: zod.z.string().min(1),
|
|
856
|
+
normalizedPath: zod.z.string().min(1).optional()
|
|
857
|
+
});
|
|
858
|
+
const CreateWorkspaceResponseSchema = zod.z.object({
|
|
859
|
+
workspace: WorkspaceSchema
|
|
860
|
+
});
|
|
861
|
+
const UpdateWorkspacePathStatusRequestSchema = zod.z.object({
|
|
862
|
+
pathStatus: WorkspacePathStatusSchema
|
|
863
|
+
});
|
|
864
|
+
const SyncMachineWorkspacePathStatusesRequestSchema = zod.z.object({
|
|
865
|
+
statuses: zod.z.array(zod.z.object({
|
|
866
|
+
workspaceId: zod.z.string().min(1),
|
|
867
|
+
pathStatus: WorkspacePathStatusSchema
|
|
868
|
+
}))
|
|
869
|
+
});
|
|
870
|
+
const UpdateWorkspaceResponseSchema = zod.z.object({
|
|
871
|
+
workspace: WorkspaceSchema
|
|
872
|
+
});
|
|
873
|
+
const SyncMachineWorkspacePathStatusesResponseSchema = zod.z.object({
|
|
874
|
+
workspaces: zod.z.array(WorkspaceSchema)
|
|
875
|
+
});
|
|
824
876
|
|
|
825
877
|
const AgentTypeSchema = zod.z.enum(["claude", "codex", "companion"]);
|
|
826
878
|
const DisplayConfigKeysSchema = zod.z.object({
|
|
@@ -2345,7 +2397,14 @@ const RpcResponseSchema = zod.z.object({
|
|
|
2345
2397
|
const EventBaseSchema$1 = zod.z.object({
|
|
2346
2398
|
eventId: zod.z.string()
|
|
2347
2399
|
});
|
|
2348
|
-
const MachineControlActionSchema = zod.z.enum([
|
|
2400
|
+
const MachineControlActionSchema = zod.z.enum([
|
|
2401
|
+
"ping",
|
|
2402
|
+
"upgrade-cli",
|
|
2403
|
+
"pick-directory",
|
|
2404
|
+
"validate-directory",
|
|
2405
|
+
"list-directory",
|
|
2406
|
+
"create-directory"
|
|
2407
|
+
]);
|
|
2349
2408
|
const MachineControlTargetSchema = zod.z.object({
|
|
2350
2409
|
machineId: zod.z.string().min(1),
|
|
2351
2410
|
cloudId: zod.z.string().min(1).optional()
|
|
@@ -2947,6 +3006,8 @@ const baseTaskSchema = EventBaseSchema.extend({
|
|
|
2947
3006
|
// Worker lifecycle mode: loop (default) or oneshot
|
|
2948
3007
|
repositoryId: zod.z.string().optional(),
|
|
2949
3008
|
// Existing repository ID (used to skip auto-association)
|
|
3009
|
+
workspaceId: zod.z.string().optional(),
|
|
3010
|
+
// Workspace ID for machine-bound local directory tasks
|
|
2950
3011
|
repositorySourceType: zod.z.enum(["temporary", "directory", "git-server"]).optional().default("temporary"),
|
|
2951
3012
|
// Repository source type (determines workspace mode)
|
|
2952
3013
|
gitServerId: zod.z.string().optional(),
|
|
@@ -3558,6 +3619,15 @@ const SeqSyncResponseEventDataSchema = zod.z.object({
|
|
|
3558
3619
|
eventId: zod.z.string(),
|
|
3559
3620
|
tasks: zod.z.array(zod.z.object({ taskId: zod.z.string(), latestSeq: zod.z.number() }))
|
|
3560
3621
|
});
|
|
3622
|
+
const WorkspaceCacheUpdateEventDataSchema = zod.z.object({
|
|
3623
|
+
eventId: zod.z.string(),
|
|
3624
|
+
machineId: zod.z.string(),
|
|
3625
|
+
action: zod.z.enum(["replace", "upsert", "remove"]),
|
|
3626
|
+
workspace: WorkspaceSchema.optional(),
|
|
3627
|
+
workspaces: zod.z.array(WorkspaceSchema).optional(),
|
|
3628
|
+
workspaceId: zod.z.string().optional(),
|
|
3629
|
+
updatedAt: zod.z.string()
|
|
3630
|
+
});
|
|
3561
3631
|
const EventSchemaMap = {
|
|
3562
3632
|
// App events
|
|
3563
3633
|
"app-alive": AppAliveEventSchema,
|
|
@@ -3569,6 +3639,7 @@ const EventSchemaMap = {
|
|
|
3569
3639
|
"machine-control-command": MachineControlCommandSchema,
|
|
3570
3640
|
"machine-control-progress": MachineControlProgressSchema,
|
|
3571
3641
|
"machine-control-updated": MachineControlUpdatedSchema,
|
|
3642
|
+
"workspace-cache-update": WorkspaceCacheUpdateEventDataSchema,
|
|
3572
3643
|
// Worker events
|
|
3573
3644
|
"worker-initializing": WorkerInitializingSchema,
|
|
3574
3645
|
"worker-initialized": WorkerInitializedSchema,
|
|
@@ -4290,6 +4361,8 @@ exports.CreateResourceRequestSchema = CreateResourceRequestSchema;
|
|
|
4290
4361
|
exports.CreateSubscriptionPlanRequestSchema = CreateSubscriptionPlanRequestSchema;
|
|
4291
4362
|
exports.CreateTaskShareResponseSchema = CreateTaskShareResponseSchema;
|
|
4292
4363
|
exports.CreateTaskShareSchema = CreateTaskShareSchema;
|
|
4364
|
+
exports.CreateWorkspaceRequestSchema = CreateWorkspaceRequestSchema;
|
|
4365
|
+
exports.CreateWorkspaceResponseSchema = CreateWorkspaceResponseSchema;
|
|
4293
4366
|
exports.CreditExhaustedEventSchema = CreditExhaustedEventSchema;
|
|
4294
4367
|
exports.CreditsBucketSchema = CreditsBucketSchema;
|
|
4295
4368
|
exports.CreditsPackageSchema = CreditsPackageSchema;
|
|
@@ -4322,6 +4395,8 @@ exports.EnsureIssueRootTaskRequestSchema = EnsureIssueRootTaskRequestSchema;
|
|
|
4322
4395
|
exports.EnsureIssueRootTaskResponseSchema = EnsureIssueRootTaskResponseSchema;
|
|
4323
4396
|
exports.EnsureRepoChatRequestSchema = EnsureRepoChatRequestSchema;
|
|
4324
4397
|
exports.EnsureRepoChatResponseSchema = EnsureRepoChatResponseSchema;
|
|
4398
|
+
exports.EnsureWorkspaceChatRequestSchema = EnsureWorkspaceChatRequestSchema;
|
|
4399
|
+
exports.EnsureWorkspaceChatResponseSchema = EnsureWorkspaceChatResponseSchema;
|
|
4325
4400
|
exports.EnvironmentVariableSchema = EnvironmentVariableSchema;
|
|
4326
4401
|
exports.EventAckSchema = EventAckSchema;
|
|
4327
4402
|
exports.EventSchemaMap = EventSchemaMap;
|
|
@@ -4421,6 +4496,7 @@ exports.ListTasksResponseSchema = ListTasksResponseSchema;
|
|
|
4421
4496
|
exports.ListTransactionsQuerySchema = ListTransactionsQuerySchema;
|
|
4422
4497
|
exports.ListTransactionsResponseSchema = ListTransactionsResponseSchema;
|
|
4423
4498
|
exports.ListUserInboxResponseSchema = ListUserInboxResponseSchema;
|
|
4499
|
+
exports.ListWorkspacesResponseSchema = ListWorkspacesResponseSchema;
|
|
4424
4500
|
exports.LocalMachineSchema = LocalMachineSchema;
|
|
4425
4501
|
exports.LogoutResponseSchema = LogoutResponseSchema;
|
|
4426
4502
|
exports.MachineActionPendingSchema = MachineActionPendingSchema;
|
|
@@ -4552,6 +4628,8 @@ exports.SyncLocalMachineResponseSchema = SyncLocalMachineResponseSchema;
|
|
|
4552
4628
|
exports.SyncMachineModelsRequestSchema = SyncMachineModelsRequestSchema;
|
|
4553
4629
|
exports.SyncMachineModelsResponseSchema = SyncMachineModelsResponseSchema;
|
|
4554
4630
|
exports.SyncMachineRequestSchema = SyncMachineRequestSchema;
|
|
4631
|
+
exports.SyncMachineWorkspacePathStatusesRequestSchema = SyncMachineWorkspacePathStatusesRequestSchema;
|
|
4632
|
+
exports.SyncMachineWorkspacePathStatusesResponseSchema = SyncMachineWorkspacePathStatusesResponseSchema;
|
|
4555
4633
|
exports.SyncStreamTypeSchema = SyncStreamTypeSchema;
|
|
4556
4634
|
exports.SystemMessageSchema = SystemMessageSchema;
|
|
4557
4635
|
exports.TaskAgentInfoSchema = TaskAgentInfoSchema;
|
|
@@ -4606,6 +4684,8 @@ exports.UpdateTaskTitleRequestSchema = UpdateTaskTitleRequestSchema;
|
|
|
4606
4684
|
exports.UpdateTaskTitleResponseSchema = UpdateTaskTitleResponseSchema;
|
|
4607
4685
|
exports.UpdateUserProfileRequestSchema = UpdateUserProfileRequestSchema;
|
|
4608
4686
|
exports.UpdateUserProfileResponseSchema = UpdateUserProfileResponseSchema;
|
|
4687
|
+
exports.UpdateWorkspacePathStatusRequestSchema = UpdateWorkspacePathStatusRequestSchema;
|
|
4688
|
+
exports.UpdateWorkspaceResponseSchema = UpdateWorkspaceResponseSchema;
|
|
4609
4689
|
exports.UploadUrlResultSchema = UploadUrlResultSchema;
|
|
4610
4690
|
exports.UserBalanceResponseSchema = UserBalanceResponseSchema;
|
|
4611
4691
|
exports.UserBasicInfoSchema = UserBasicInfoSchema;
|
|
@@ -4632,11 +4712,14 @@ exports.WorkerRunningSchema = WorkerRunningSchema;
|
|
|
4632
4712
|
exports.WorkerStatusRequestSchema = WorkerStatusRequestSchema;
|
|
4633
4713
|
exports.WorkerStatusSnapshotSchema = WorkerStatusSnapshotSchema;
|
|
4634
4714
|
exports.WorkerStatusValueSchema = WorkerStatusValueSchema;
|
|
4715
|
+
exports.WorkspaceCacheUpdateEventDataSchema = WorkspaceCacheUpdateEventDataSchema;
|
|
4635
4716
|
exports.WorkspaceFileMutationOperationSchema = WorkspaceFileMutationOperationSchema;
|
|
4636
4717
|
exports.WorkspaceFileMutationRequestSchema = WorkspaceFileMutationRequestSchema;
|
|
4637
4718
|
exports.WorkspaceFileMutationResponseSchema = WorkspaceFileMutationResponseSchema;
|
|
4638
4719
|
exports.WorkspaceFileRequestSchema = WorkspaceFileRequestSchema;
|
|
4639
4720
|
exports.WorkspaceFileResponseSchema = WorkspaceFileResponseSchema;
|
|
4721
|
+
exports.WorkspacePathStatusSchema = WorkspacePathStatusSchema;
|
|
4722
|
+
exports.WorkspaceSchema = WorkspaceSchema;
|
|
4640
4723
|
exports.baseTaskSchema = baseTaskSchema;
|
|
4641
4724
|
exports.buildRtcChunkFrame = buildRtcChunkFrame;
|
|
4642
4725
|
exports.cancelTaskRequestSchema = cancelTaskRequestSchema;
|