@agentrix/shared 1.0.2 → 1.0.4
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.cjs +54 -4
- package/dist/index.d.cts +596 -127
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -245,6 +245,8 @@ const TaskItemSchema = zod.z.object({
|
|
|
245
245
|
// Task title (can be set by worker)
|
|
246
246
|
agentSessionId: zod.z.string().nullable(),
|
|
247
247
|
dataEncryptionKey: zod.z.string().nullable(),
|
|
248
|
+
cwd: zod.z.string().nullable(),
|
|
249
|
+
// Current working directory from CLI worker
|
|
248
250
|
pullRequestNumber: zod.z.number().nullable(),
|
|
249
251
|
pullRequestUrl: zod.z.string().nullable(),
|
|
250
252
|
pullRequestState: zod.z.enum(["open", "closed", "merged"]).nullable(),
|
|
@@ -261,8 +263,27 @@ const TaskItemSchema = zod.z.object({
|
|
|
261
263
|
updatedAt: zod.z.string()
|
|
262
264
|
// ISO 8601 string
|
|
263
265
|
});
|
|
266
|
+
const ListTasksRequestSchema = zod.z.object({
|
|
267
|
+
chatId: zod.z.string(),
|
|
268
|
+
archived: zod.z.preprocess(
|
|
269
|
+
(val) => {
|
|
270
|
+
if (typeof val === "string") {
|
|
271
|
+
return val === "true";
|
|
272
|
+
}
|
|
273
|
+
return val;
|
|
274
|
+
},
|
|
275
|
+
zod.z.boolean().optional().default(false)
|
|
276
|
+
),
|
|
277
|
+
// true = completed only, false = non-completed
|
|
278
|
+
cursor: zod.z.string().optional(),
|
|
279
|
+
// base64 encoded cursor: "updatedAt:taskId"
|
|
280
|
+
limit: zod.z.coerce.number().min(1).max(100).optional().default(20)
|
|
281
|
+
});
|
|
264
282
|
const ListTasksResponseSchema = zod.z.object({
|
|
265
|
-
tasks: zod.z.array(TaskItemSchema)
|
|
283
|
+
tasks: zod.z.array(TaskItemSchema),
|
|
284
|
+
nextCursor: zod.z.string().nullable(),
|
|
285
|
+
// null if no more results
|
|
286
|
+
hasMore: zod.z.boolean()
|
|
266
287
|
});
|
|
267
288
|
const ResumeTaskRequestSchema = zod.z.object({
|
|
268
289
|
taskId: zod.z.string(),
|
|
@@ -366,6 +387,16 @@ const CreateMergeRequestResponseSchema = zod.z.object({
|
|
|
366
387
|
reason: zod.z.string().optional()
|
|
367
388
|
// failed-reason
|
|
368
389
|
});
|
|
390
|
+
const ArchiveTaskRequestSchema = zod.z.object({});
|
|
391
|
+
const ArchiveTaskResponseSchema = zod.z.object({
|
|
392
|
+
success: zod.z.boolean(),
|
|
393
|
+
task: TaskItemSchema
|
|
394
|
+
});
|
|
395
|
+
const UnarchiveTaskRequestSchema = zod.z.object({});
|
|
396
|
+
const UnarchiveTaskResponseSchema = zod.z.object({
|
|
397
|
+
success: zod.z.boolean(),
|
|
398
|
+
task: TaskItemSchema
|
|
399
|
+
});
|
|
369
400
|
|
|
370
401
|
const ChatMemberSchema = zod.z.object({
|
|
371
402
|
id: IdSchema,
|
|
@@ -480,6 +511,8 @@ const LocalMachineSchema = zod.z.object({
|
|
|
480
511
|
approval: zod.z.string(),
|
|
481
512
|
dataEncryptionKey: zod.z.string(),
|
|
482
513
|
// per-user sealed-box key (base64)
|
|
514
|
+
controlPort: zod.z.number().nullable(),
|
|
515
|
+
// CLI control server port for browser detection
|
|
483
516
|
createdAt: zod.z.string(),
|
|
484
517
|
// ISO 8601 string
|
|
485
518
|
updatedAt: zod.z.string()
|
|
@@ -588,7 +621,9 @@ const RepositorySchema = zod.z.object({
|
|
|
588
621
|
description: zod.z.string().nullable(),
|
|
589
622
|
url: zod.z.string().url(),
|
|
590
623
|
createdAt: DateSchema,
|
|
591
|
-
updatedAt: DateSchema
|
|
624
|
+
updatedAt: DateSchema,
|
|
625
|
+
gitServerId: zod.z.string()
|
|
626
|
+
// Git server ID (github, gitlab, etc.)
|
|
592
627
|
});
|
|
593
628
|
const ListRepositoriesResponseSchema = zod.z.object({
|
|
594
629
|
repositories: zod.z.array(RepositorySchema)
|
|
@@ -845,7 +880,8 @@ const ApiServerAliveEventSchema = EventBaseSchema.extend({
|
|
|
845
880
|
});
|
|
846
881
|
const MachineAliveEventSchema = EventBaseSchema.extend({
|
|
847
882
|
machineId: zod.z.string(),
|
|
848
|
-
timestamp: zod.z.string()
|
|
883
|
+
timestamp: zod.z.string(),
|
|
884
|
+
controlPort: zod.z.number().optional()
|
|
849
885
|
});
|
|
850
886
|
const ShutdownMachineSchema = EventBaseSchema.extend({
|
|
851
887
|
machineId: zod.z.string(),
|
|
@@ -994,6 +1030,12 @@ const ChangeTaskTitleEventSchema = EventBaseSchema.extend({
|
|
|
994
1030
|
taskId: zod.z.string(),
|
|
995
1031
|
title: zod.z.string()
|
|
996
1032
|
});
|
|
1033
|
+
const TaskStateChangeEventSchema = EventBaseSchema.extend({
|
|
1034
|
+
taskId: zod.z.string(),
|
|
1035
|
+
chatId: zod.z.string(),
|
|
1036
|
+
state: zod.z.string(),
|
|
1037
|
+
updatedAt: zod.z.string()
|
|
1038
|
+
});
|
|
997
1039
|
const CreditExhaustedEventSchema = EventBaseSchema.extend({});
|
|
998
1040
|
const WorkspaceFileRequestSchema = EventBaseSchema.extend({
|
|
999
1041
|
taskId: zod.z.string(),
|
|
@@ -1050,7 +1092,8 @@ const WorkspaceFileResponseSchema = EventBaseSchema.extend({
|
|
|
1050
1092
|
});
|
|
1051
1093
|
const UpdateTaskAgentSessionIdEventSchema = EventBaseSchema.extend({
|
|
1052
1094
|
taskId: zod.z.string(),
|
|
1053
|
-
agentSessionId: zod.z.string()
|
|
1095
|
+
agentSessionId: zod.z.string(),
|
|
1096
|
+
cwd: zod.z.string().optional()
|
|
1054
1097
|
});
|
|
1055
1098
|
const MergeRequestEventSchema = EventBaseSchema.extend({
|
|
1056
1099
|
taskId: zod.z.string(),
|
|
@@ -1116,6 +1159,7 @@ const EventSchemaMap = {
|
|
|
1116
1159
|
"stop-task": StopTaskSchema,
|
|
1117
1160
|
"task-message": TaskMessageSchema,
|
|
1118
1161
|
"change-task-title": ChangeTaskTitleEventSchema,
|
|
1162
|
+
"task-state-change": TaskStateChangeEventSchema,
|
|
1119
1163
|
"update-task-agent-session-id": UpdateTaskAgentSessionIdEventSchema,
|
|
1120
1164
|
// Artifacts events
|
|
1121
1165
|
"task-artifacts-updated": TaskArtifactsUpdatedEventSchema,
|
|
@@ -1790,6 +1834,8 @@ exports.ApiErrorSchema = ApiErrorSchema;
|
|
|
1790
1834
|
exports.ApiServerAliveEventSchema = ApiServerAliveEventSchema;
|
|
1791
1835
|
exports.AppAliveEventSchema = AppAliveEventSchema;
|
|
1792
1836
|
exports.ApprovalStatusResponseSchema = ApprovalStatusResponseSchema;
|
|
1837
|
+
exports.ArchiveTaskRequestSchema = ArchiveTaskRequestSchema;
|
|
1838
|
+
exports.ArchiveTaskResponseSchema = ArchiveTaskResponseSchema;
|
|
1793
1839
|
exports.BillingStatsResponseSchema = BillingStatsResponseSchema;
|
|
1794
1840
|
exports.BranchSchema = BranchSchema;
|
|
1795
1841
|
exports.CancelTaskRequestSchema = CancelTaskRequestSchema;
|
|
@@ -1864,6 +1910,7 @@ exports.ListOAuthServersResponseSchema = ListOAuthServersResponseSchema;
|
|
|
1864
1910
|
exports.ListPackagesQuerySchema = ListPackagesQuerySchema;
|
|
1865
1911
|
exports.ListPackagesResponseSchema = ListPackagesResponseSchema;
|
|
1866
1912
|
exports.ListRepositoriesResponseSchema = ListRepositoriesResponseSchema;
|
|
1913
|
+
exports.ListTasksRequestSchema = ListTasksRequestSchema;
|
|
1867
1914
|
exports.ListTasksResponseSchema = ListTasksResponseSchema;
|
|
1868
1915
|
exports.ListTransactionsQuerySchema = ListTransactionsQuerySchema;
|
|
1869
1916
|
exports.ListTransactionsResponseSchema = ListTransactionsResponseSchema;
|
|
@@ -1921,10 +1968,13 @@ exports.SystemMessageSchema = SystemMessageSchema;
|
|
|
1921
1968
|
exports.TaskArtifactsUpdatedEventSchema = TaskArtifactsUpdatedEventSchema;
|
|
1922
1969
|
exports.TaskItemSchema = TaskItemSchema;
|
|
1923
1970
|
exports.TaskMessageSchema = TaskMessageSchema;
|
|
1971
|
+
exports.TaskStateChangeEventSchema = TaskStateChangeEventSchema;
|
|
1924
1972
|
exports.TaskTransactionsResponseSchema = TaskTransactionsResponseSchema;
|
|
1925
1973
|
exports.ToggleOAuthServerRequestSchema = ToggleOAuthServerRequestSchema;
|
|
1926
1974
|
exports.ToggleOAuthServerResponseSchema = ToggleOAuthServerResponseSchema;
|
|
1927
1975
|
exports.TransactionSchema = TransactionSchema;
|
|
1976
|
+
exports.UnarchiveTaskRequestSchema = UnarchiveTaskRequestSchema;
|
|
1977
|
+
exports.UnarchiveTaskResponseSchema = UnarchiveTaskResponseSchema;
|
|
1928
1978
|
exports.UpdateAgentRequestSchema = UpdateAgentRequestSchema;
|
|
1929
1979
|
exports.UpdateAgentResponseSchema = UpdateAgentResponseSchema;
|
|
1930
1980
|
exports.UpdateOAuthServerRequestSchema = UpdateOAuthServerRequestSchema;
|