robotrock 1.3.4 → 1.5.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.
Files changed (80) hide show
  1. package/README.md +11 -1
  2. package/dist/agent-admin.d.ts +5 -0
  3. package/dist/agent-admin.js +75 -2
  4. package/dist/agent-admin.js.map +1 -1
  5. package/dist/ai/index.d.ts +5 -5
  6. package/dist/ai/index.js +120 -4
  7. package/dist/ai/index.js.map +1 -1
  8. package/dist/ai/trigger.d.ts +3 -3
  9. package/dist/ai/trigger.js +120 -4
  10. package/dist/ai/trigger.js.map +1 -1
  11. package/dist/ai/workflow.d.ts +3 -3
  12. package/dist/ai/workflow.js +120 -4
  13. package/dist/ai/workflow.js.map +1 -1
  14. package/dist/{client-CZ5eWH5v.d.ts → client-BxbxttFH.d.ts} +19 -1
  15. package/dist/eve/agent/index.d.ts +4 -4
  16. package/dist/eve/agent/index.js +577 -261
  17. package/dist/eve/agent/index.js.map +1 -1
  18. package/dist/eve/index.d.ts +4 -4
  19. package/dist/eve/index.js +507 -7
  20. package/dist/eve/index.js.map +1 -1
  21. package/dist/eve/tools/admin/assign-tasks.d.ts +40 -19
  22. package/dist/eve/tools/admin/assign-tasks.js +334 -25
  23. package/dist/eve/tools/admin/assign-tasks.js.map +1 -1
  24. package/dist/eve/tools/admin/get-workspace-usage.d.ts +71 -0
  25. package/dist/eve/tools/admin/get-workspace-usage.js +1365 -0
  26. package/dist/eve/tools/admin/get-workspace-usage.js.map +1 -0
  27. package/dist/eve/tools/admin/manage-groups.d.ts +122 -7
  28. package/dist/eve/tools/admin/manage-groups.js +350 -31
  29. package/dist/eve/tools/admin/manage-groups.js.map +1 -1
  30. package/dist/eve/tools/admin/manage-team-members.d.ts +86 -7
  31. package/dist/eve/tools/admin/manage-team-members.js +318 -16
  32. package/dist/eve/tools/admin/manage-team-members.js.map +1 -1
  33. package/dist/eve/tools/admin/query-tasks.d.ts +82 -7
  34. package/dist/eve/tools/admin/query-tasks.js +363 -40
  35. package/dist/eve/tools/admin/query-tasks.js.map +1 -1
  36. package/dist/eve/tools/catalog/generate-image.d.ts +64 -0
  37. package/dist/eve/tools/catalog/generate-image.js +2077 -0
  38. package/dist/eve/tools/catalog/generate-image.js.map +1 -0
  39. package/dist/eve/tools/catalog/generate-random-chart.d.ts +77 -0
  40. package/dist/eve/tools/catalog/generate-random-chart.js +411 -0
  41. package/dist/eve/tools/catalog/generate-random-chart.js.map +1 -0
  42. package/dist/eve/tools/catalog/search-products.d.ts +36 -43
  43. package/dist/eve/tools/catalog/search-products.js +253 -6
  44. package/dist/eve/tools/catalog/search-products.js.map +1 -1
  45. package/dist/eve/tools/identity/index.d.ts +2 -1
  46. package/dist/eve/tools/identity/index.js +26 -6
  47. package/dist/eve/tools/identity/index.js.map +1 -1
  48. package/dist/eve/tools/identity/my-access.d.ts +88 -3
  49. package/dist/eve/tools/identity/my-access.js +26 -6
  50. package/dist/eve/tools/identity/my-access.js.map +1 -1
  51. package/dist/eve/tools/identity/whoami.d.ts +1 -1
  52. package/dist/eve/tools/identity/whoami.js.map +1 -1
  53. package/dist/eve/tools/inbox/create-task.d.ts +1 -1
  54. package/dist/eve/tools/inbox/create-task.js +119 -2
  55. package/dist/eve/tools/inbox/create-task.js.map +1 -1
  56. package/dist/eve/tools/inbox/index.d.ts +1 -1
  57. package/dist/eve/tools/inbox/index.js +119 -2
  58. package/dist/eve/tools/inbox/index.js.map +1 -1
  59. package/dist/eve/tools/index.d.ts +5 -2
  60. package/dist/eve/tools/index.js +964 -115
  61. package/dist/eve/tools/index.js.map +1 -1
  62. package/dist/index-amkHKVGs.d.ts +1054 -0
  63. package/dist/index.d.ts +5 -5
  64. package/dist/index.js +328 -13
  65. package/dist/index.js.map +1 -1
  66. package/dist/schemas/index.js +67 -1
  67. package/dist/schemas/index.js.map +1 -1
  68. package/dist/{tool-approval-bridge-DnGaRES4.d.ts → tool-approval-bridge-Cz7qQUpw.d.ts} +1 -1
  69. package/dist/{tool-reply-guidance-C3qrT1In.d.ts → tool-reply-guidance-CJko9liH.d.ts} +5 -2
  70. package/dist/tool-result-ui-meta-KT0VafEO.d.ts +52 -0
  71. package/dist/trigger/index.d.ts +1 -1
  72. package/dist/trigger/index.js +118 -2
  73. package/dist/trigger/index.js.map +1 -1
  74. package/dist/{trigger--qTIK0s6.d.ts → trigger-C1ooSegc.d.ts} +2 -2
  75. package/dist/workflow/index.d.ts +1 -1
  76. package/dist/workflow/index.js +118 -2
  77. package/dist/workflow/index.js.map +1 -1
  78. package/package.json +21 -4
  79. package/dist/index-Blq0XoAr.d.ts +0 -204
  80. package/dist/tool-ui-hint-CMpug5sC.d.ts +0 -13
@@ -1,5 +1,4 @@
1
1
  import * as eve_tools from 'eve/tools';
2
- import { T as ToolResultWithReplyGuidance } from '../../../tool-reply-guidance-C3qrT1In.js';
3
2
  import { z } from 'zod';
4
3
 
5
4
  declare const QUERY_TASKS_TOOL_NAME = "query_tasks";
@@ -43,11 +42,49 @@ declare function defineQueryTasksTool(): eve_tools.ToolDefinition<{
43
42
  cursor?: string | undefined;
44
43
  taskId?: string | undefined;
45
44
  query?: string | undefined;
46
- }, ToolResultWithReplyGuidance<Record<string, unknown>> | {
45
+ }, {
47
46
  ok: false;
48
- status: number;
49
47
  message: string;
50
- response: unknown;
48
+ status?: number | undefined;
49
+ response?: unknown;
50
+ } | {
51
+ items: {
52
+ id: string;
53
+ name: string;
54
+ status: string;
55
+ type: string | null;
56
+ description: string | null;
57
+ validUntil: number;
58
+ createdAt: number;
59
+ url: string;
60
+ threadPriority?: string | null | undefined;
61
+ }[];
62
+ nextCursor?: string | null | undefined;
63
+ replyGuidance?: string | undefined;
64
+ ui?: {
65
+ present?: boolean | undefined;
66
+ entity?: string | undefined;
67
+ rowsPath?: string | undefined;
68
+ layout?: "list" | "chart" | "table" | undefined;
69
+ } | undefined;
70
+ uiHint?: "list" | "chart" | "table" | undefined;
71
+ } | {
72
+ id: string | null;
73
+ status: string | null;
74
+ type: string | null;
75
+ name: string | null;
76
+ description: string | null;
77
+ validUntil: number | null;
78
+ createdAt: number | null;
79
+ url: string | null;
80
+ replyGuidance?: string | undefined;
81
+ ui?: {
82
+ present?: boolean | undefined;
83
+ entity?: string | undefined;
84
+ rowsPath?: string | undefined;
85
+ layout?: "list" | "chart" | "table" | undefined;
86
+ } | undefined;
87
+ uiHint?: "list" | "chart" | "table" | undefined;
51
88
  }>;
52
89
  declare const queryTasksTool: eve_tools.ToolDefinition<{
53
90
  action: "list" | "search" | "get";
@@ -60,11 +97,49 @@ declare const queryTasksTool: eve_tools.ToolDefinition<{
60
97
  cursor?: string | undefined;
61
98
  taskId?: string | undefined;
62
99
  query?: string | undefined;
63
- }, ToolResultWithReplyGuidance<Record<string, unknown>> | {
100
+ }, {
64
101
  ok: false;
65
- status: number;
66
102
  message: string;
67
- response: unknown;
103
+ status?: number | undefined;
104
+ response?: unknown;
105
+ } | {
106
+ items: {
107
+ id: string;
108
+ name: string;
109
+ status: string;
110
+ type: string | null;
111
+ description: string | null;
112
+ validUntil: number;
113
+ createdAt: number;
114
+ url: string;
115
+ threadPriority?: string | null | undefined;
116
+ }[];
117
+ nextCursor?: string | null | undefined;
118
+ replyGuidance?: string | undefined;
119
+ ui?: {
120
+ present?: boolean | undefined;
121
+ entity?: string | undefined;
122
+ rowsPath?: string | undefined;
123
+ layout?: "list" | "chart" | "table" | undefined;
124
+ } | undefined;
125
+ uiHint?: "list" | "chart" | "table" | undefined;
126
+ } | {
127
+ id: string | null;
128
+ status: string | null;
129
+ type: string | null;
130
+ name: string | null;
131
+ description: string | null;
132
+ validUntil: number | null;
133
+ createdAt: number | null;
134
+ url: string | null;
135
+ replyGuidance?: string | undefined;
136
+ ui?: {
137
+ present?: boolean | undefined;
138
+ entity?: string | undefined;
139
+ rowsPath?: string | undefined;
140
+ layout?: "list" | "chart" | "table" | undefined;
141
+ } | undefined;
142
+ uiHint?: "list" | "chart" | "table" | undefined;
68
143
  }>;
69
144
 
70
145
  export { QUERY_TASKS_TOOL_NAME, defineQueryTasksTool, queryTasksInputSchema, queryTasksTool };
@@ -1,6 +1,6 @@
1
1
  // src/eve/tools/admin/query-tasks.ts
2
2
  import { defineTool } from "eve/tools";
3
- import { z as z5 } from "zod";
3
+ import { z as z6 } from "zod";
4
4
 
5
5
  // src/http.ts
6
6
  var RobotRockError = class extends Error {
@@ -493,6 +493,40 @@ var agentChatLinkTaskBodySchema = z.object({
493
493
  publicTaskId: z.string().min(1),
494
494
  toolCallId: z.string().min(1)
495
495
  });
496
+ var AGENT_FILE_TAGS_MAX = 20;
497
+ var AGENT_FILE_TAG_MAX_LENGTH = 64;
498
+ function normalizeAgentFileTags(tags) {
499
+ if (!tags?.length) return void 0;
500
+ const seen = /* @__PURE__ */ new Set();
501
+ const out = [];
502
+ for (const raw of tags) {
503
+ const tag = raw.trim().toLowerCase().slice(0, AGENT_FILE_TAG_MAX_LENGTH);
504
+ if (!tag || seen.has(tag)) continue;
505
+ seen.add(tag);
506
+ out.push(tag);
507
+ if (out.length >= AGENT_FILE_TAGS_MAX) break;
508
+ }
509
+ return out.length > 0 ? out : void 0;
510
+ }
511
+ var agentChatUploadImageBodySchema = z.object({
512
+ mediaType: z.string().min(1),
513
+ /** Raw base64 (no data: URL prefix). */
514
+ base64: z.string().min(1),
515
+ chatId: z.string().min(1).optional(),
516
+ publicTaskId: z.string().min(1).optional(),
517
+ source: z.string().min(1).optional(),
518
+ /** Display / search name (e.g. `sunset-robot.png`). */
519
+ filename: z.string().min(1).max(255).optional(),
520
+ /** Human-readable description (e.g. generation prompt). */
521
+ description: z.string().min(1).max(2e3).optional(),
522
+ /**
523
+ * Optional labels for later grouping/filtering.
524
+ * Normalized to lowercase trimmed unique strings (max 20, 64 chars each).
525
+ */
526
+ tags: z.array(z.string().min(1).max(AGENT_FILE_TAG_MAX_LENGTH)).max(AGENT_FILE_TAGS_MAX).optional().transform((tags) => normalizeAgentFileTags(tags))
527
+ }).refine((data) => Boolean(data.chatId || data.publicTaskId), {
528
+ message: "Provide chatId and/or publicTaskId"
529
+ });
496
530
 
497
531
  // ../core/src/schemas/tool-result-display.ts
498
532
  import { z as z2 } from "zod";
@@ -521,7 +555,8 @@ var tenantRoleSchema = z3.enum(["admin", "member"]);
521
555
  var agentAdminUserSchema = z3.object({
522
556
  id: z3.string(),
523
557
  email: z3.string().email(),
524
- name: z3.string()
558
+ name: z3.string(),
559
+ profilePictureUrl: z3.string().nullable().optional()
525
560
  });
526
561
  var agentAdminMemberSchema = z3.object({
527
562
  userId: z3.string(),
@@ -606,6 +641,37 @@ var assignTasksBodySchema = z3.object({
606
641
  { message: "assignTo needs at least one user email or group slug." }
607
642
  )
608
643
  });
644
+ var agentAdminPlanLimitsSchema = z3.object({
645
+ tasksPerDay: z3.number(),
646
+ members: z3.number(),
647
+ apiKeys: z3.number(),
648
+ groups: z3.number(),
649
+ auditLogRetention: z3.number(),
650
+ rateLimitPerSecond: z3.number(),
651
+ taskRetentionDays: z3.number()
652
+ });
653
+ var agentAdminUsageSchema = z3.object({
654
+ workspace: z3.string(),
655
+ planName: z3.string(),
656
+ planType: z3.string(),
657
+ trialState: z3.enum(["none", "active", "expired"]),
658
+ daysRemaining: z3.number().nullable(),
659
+ isPaidPro: z3.boolean(),
660
+ subscriptionStatus: z3.string().nullable(),
661
+ tasksToday: z3.number(),
662
+ maxTasksPerDay: z3.number().nullable(),
663
+ tasksResetAt: z3.number(),
664
+ openTasks: z3.number(),
665
+ totalTasks: z3.number(),
666
+ seatsCurrent: z3.number(),
667
+ seatsMax: z3.number().nullable(),
668
+ groupsCurrent: z3.number(),
669
+ groupsMax: z3.number().nullable(),
670
+ apiKeysCurrent: z3.number(),
671
+ apiKeysMax: z3.number().nullable(),
672
+ rateLimitPerSecond: z3.number(),
673
+ limits: agentAdminPlanLimitsSchema
674
+ });
609
675
 
610
676
  // ../core/src/handler-retry.ts
611
677
  var HANDLER_RETRY_DELAYS_MS = [
@@ -701,7 +767,11 @@ function resolveRobotRockAuthConfig(overrides) {
701
767
  "RobotRock auth is required. Set ROBOTROCK_API_KEY, ROBOTROCK_AGENT_SERVICE_TOKEN with tenant context, or pass auth when creating the client."
702
768
  );
703
769
  }
704
- return { kind: "apiKey", apiKey };
770
+ return {
771
+ kind: "apiKey",
772
+ apiKey,
773
+ ...overrides?.actingUserId?.trim() ? { actingUserId: overrides.actingUserId.trim() } : {}
774
+ };
705
775
  }
706
776
 
707
777
  // src/eve/agent/attributes.ts
@@ -837,6 +907,9 @@ async function agentAdminFetch(config, path, init) {
837
907
  }
838
908
  function createAgentAdminApi(config) {
839
909
  return {
910
+ usage: {
911
+ get: () => agentAdminFetch(config, "/usage")
912
+ },
840
913
  members: {
841
914
  list: () => agentAdminFetch(config, "/members"),
842
915
  get: (memberRef) => agentAdminFetch(config, `/members/${encodeURIComponent(memberRef)}`),
@@ -979,6 +1052,9 @@ function requireBoundAgentAdminClient(ctx) {
979
1052
  return createBoundAgentAdminClient(ctx);
980
1053
  }
981
1054
 
1055
+ // src/eve/entity-schemas.ts
1056
+ import { z as z5 } from "zod";
1057
+
982
1058
  // src/eve/tool-ui-hint.ts
983
1059
  var TOOL_UI_HINT_FIELD = "uiHint";
984
1060
  function withUiHint(result, hint) {
@@ -988,6 +1064,223 @@ function withUiHint(result, hint) {
988
1064
  };
989
1065
  }
990
1066
 
1067
+ // src/eve/tool-result-ui-meta.ts
1068
+ var TOOL_UI_FIELD = "ui";
1069
+ var TOOL_RESULT_UI_ENTITY_ID_RE = /^[a-z][a-z0-9_]{0,63}$/;
1070
+ function withToolUi(result, ui) {
1071
+ const existing = typeof result[TOOL_UI_FIELD] === "object" && result[TOOL_UI_FIELD] !== null && !Array.isArray(result[TOOL_UI_FIELD]) ? result[TOOL_UI_FIELD] : {};
1072
+ return {
1073
+ ...result,
1074
+ [TOOL_UI_FIELD]: {
1075
+ ...existing,
1076
+ ...ui
1077
+ }
1078
+ };
1079
+ }
1080
+
1081
+ // src/eve/entity-schemas.ts
1082
+ function buildTenantTaskUrl(tenantSlug, task) {
1083
+ const q = new URLSearchParams();
1084
+ if (task.app && task.app !== "default") {
1085
+ q.set("app", task.app);
1086
+ }
1087
+ if (task.type?.trim()) {
1088
+ q.set("type", task.type.trim());
1089
+ }
1090
+ q.set("selected", task.id);
1091
+ return `/${tenantSlug}/inbox?${q.toString()}`;
1092
+ }
1093
+ var toolResultUiMetaSchema = z5.object({
1094
+ present: z5.boolean().optional(),
1095
+ entity: z5.string().regex(TOOL_RESULT_UI_ENTITY_ID_RE).optional(),
1096
+ rowsPath: z5.string().min(1).optional(),
1097
+ layout: z5.enum(["list", "chart", "table"]).optional()
1098
+ }).strict();
1099
+ var agentOnlyFields = {
1100
+ replyGuidance: z5.string().optional(),
1101
+ ui: toolResultUiMetaSchema.optional(),
1102
+ uiHint: z5.enum(["list", "chart", "table"]).optional()
1103
+ };
1104
+ function withAgentOnlyFields(shape) {
1105
+ return z5.object({
1106
+ ...shape,
1107
+ ...agentOnlyFields
1108
+ });
1109
+ }
1110
+ var productEntityRowSchema = z5.object({
1111
+ id: z5.string().min(1),
1112
+ name: z5.string().min(1),
1113
+ price: z5.number(),
1114
+ currency: z5.string().min(1),
1115
+ inStock: z5.boolean(),
1116
+ url: z5.string().min(1)
1117
+ });
1118
+ var metricPointEntityRowSchema = z5.object({
1119
+ date: z5.string().optional().describe("X-axis value when xKey is date/time"),
1120
+ category: z5.string().optional().describe("X-axis value when xKey is category"),
1121
+ label: z5.string().optional().describe("X-axis value when xKey is label")
1122
+ }).catchall(z5.union([z5.string(), z5.number()])).describe(
1123
+ "Wide chart point: x-axis field + numeric columns named by yKeys (one series per column)"
1124
+ );
1125
+ var toolChartResultSchema = withAgentOnlyFields({
1126
+ title: z5.string().min(1).optional().describe("Chart title shown above the plot"),
1127
+ description: z5.string().min(1).optional().describe("Optional short subtitle"),
1128
+ type: z5.enum(["line", "bar", "area"]).describe("TRL/shadcn chart variant (time series \u2192 line, categories \u2192 bar)"),
1129
+ xKey: z5.string().min(1).describe('Field on each series row for the x-axis, e.g. "date" or "category"'),
1130
+ yKeys: z5.array(z5.string().min(1)).min(1).describe(
1131
+ 'Numeric series column names on each row, e.g. ["NL","BE"] or ["created","handled"]'
1132
+ ),
1133
+ series: z5.array(metricPointEntityRowSchema).describe(
1134
+ "Wide-format points only \u2014 one object per x value with yKeys as numeric fields"
1135
+ )
1136
+ });
1137
+ var memberEntityRowSchema = z5.object({
1138
+ name: z5.string(),
1139
+ email: z5.string(),
1140
+ role: z5.string(),
1141
+ membershipKind: z5.string(),
1142
+ profilePictureUrl: z5.string().nullable()
1143
+ });
1144
+ var taskEntityRowSchema = z5.object({
1145
+ id: z5.string().min(1),
1146
+ name: z5.string().min(1),
1147
+ status: z5.string().min(1),
1148
+ type: z5.string().nullable(),
1149
+ description: z5.string().nullable(),
1150
+ validUntil: z5.number(),
1151
+ createdAt: z5.number(),
1152
+ url: z5.string().min(1),
1153
+ threadPriority: z5.string().nullable().optional()
1154
+ });
1155
+ var groupEntityRowSchema = z5.object({
1156
+ name: z5.string().min(1),
1157
+ slug: z5.string().min(1),
1158
+ description: z5.string().nullable(),
1159
+ memberCount: z5.number().nullable(),
1160
+ url: z5.string().min(1)
1161
+ });
1162
+ var groupDetailEntitySchema = z5.object({
1163
+ name: z5.string().min(1),
1164
+ slug: z5.string().min(1),
1165
+ description: z5.string().nullable(),
1166
+ url: z5.string().min(1),
1167
+ members: z5.array(
1168
+ z5.object({
1169
+ name: z5.string(),
1170
+ email: z5.string(),
1171
+ profilePictureUrl: z5.string().nullable()
1172
+ })
1173
+ )
1174
+ });
1175
+ var statusEntityRowSchema = z5.object({
1176
+ id: z5.string().min(1),
1177
+ name: z5.string().min(1),
1178
+ status: z5.string().min(1),
1179
+ url: z5.string().min(1),
1180
+ type: z5.string().nullable().optional(),
1181
+ description: z5.string().nullable().optional()
1182
+ });
1183
+ var agentAdminErrorResultSchema = z5.object({
1184
+ ok: z5.literal(false),
1185
+ status: z5.number().optional(),
1186
+ message: z5.string(),
1187
+ response: z5.unknown().optional()
1188
+ });
1189
+ var agentAdminMutationResultSchema = z5.object({
1190
+ ...agentOnlyFields
1191
+ }).passthrough();
1192
+ var searchProductsOutputSchema = withAgentOnlyFields({
1193
+ items: z5.array(productEntityRowSchema)
1194
+ });
1195
+ var generateRandomChartOutputSchema = toolChartResultSchema.extend({
1196
+ title: z5.string().min(1)
1197
+ });
1198
+ var generateImageOutputSchema = withAgentOnlyFields({
1199
+ prompt: z5.string().min(1),
1200
+ mediaType: z5.string().min(1),
1201
+ model: z5.string().min(1),
1202
+ storageId: z5.string().min(1),
1203
+ url: z5.string().min(1),
1204
+ /** @deprecated Legacy sessions only — prefer storageId/url. */
1205
+ base64: z5.string().min(1).optional()
1206
+ });
1207
+ var manageTeamMembersListOutputSchema = withAgentOnlyFields({
1208
+ members: z5.array(memberEntityRowSchema)
1209
+ });
1210
+ var manageTeamMembersDetailOutputSchema = withAgentOnlyFields(
1211
+ memberEntityRowSchema.shape
1212
+ );
1213
+ var manageTeamMembersOutputSchema = z5.union([
1214
+ manageTeamMembersListOutputSchema,
1215
+ manageTeamMembersDetailOutputSchema,
1216
+ agentAdminMutationResultSchema,
1217
+ agentAdminErrorResultSchema
1218
+ ]);
1219
+ var manageGroupsListOutputSchema = withAgentOnlyFields({
1220
+ groups: z5.array(groupEntityRowSchema)
1221
+ });
1222
+ var manageGroupsDetailOutputSchema = withAgentOnlyFields(
1223
+ groupDetailEntitySchema.shape
1224
+ );
1225
+ var manageGroupsSummaryOutputSchema = withAgentOnlyFields(
1226
+ groupEntityRowSchema.shape
1227
+ );
1228
+ var manageGroupsOutputSchema = z5.union([
1229
+ manageGroupsListOutputSchema,
1230
+ manageGroupsDetailOutputSchema,
1231
+ manageGroupsSummaryOutputSchema,
1232
+ agentAdminMutationResultSchema,
1233
+ agentAdminErrorResultSchema
1234
+ ]);
1235
+ var queryTasksListOutputSchema = withAgentOnlyFields({
1236
+ items: z5.array(taskEntityRowSchema),
1237
+ nextCursor: z5.string().nullable().optional()
1238
+ });
1239
+ var queryTasksDetailOutputSchema = withAgentOnlyFields({
1240
+ id: z5.string().nullable(),
1241
+ status: z5.string().nullable(),
1242
+ type: z5.string().nullable(),
1243
+ name: z5.string().nullable(),
1244
+ description: z5.string().nullable(),
1245
+ validUntil: z5.number().nullable(),
1246
+ createdAt: z5.number().nullable(),
1247
+ url: z5.string().min(1).nullable()
1248
+ });
1249
+ var queryTasksOutputSchema = z5.union([
1250
+ queryTasksListOutputSchema,
1251
+ queryTasksDetailOutputSchema,
1252
+ agentAdminErrorResultSchema
1253
+ ]);
1254
+ var assignTasksOutputSchema = z5.union([
1255
+ withAgentOnlyFields({
1256
+ results: z5.array(statusEntityRowSchema)
1257
+ }),
1258
+ agentAdminErrorResultSchema
1259
+ ]);
1260
+ var workspaceUsageEntitySchema = z5.object({
1261
+ workspace: z5.string(),
1262
+ plan: z5.string(),
1263
+ planType: z5.string(),
1264
+ trialState: z5.string(),
1265
+ daysRemaining: z5.number().nullable(),
1266
+ isPaidPro: z5.boolean(),
1267
+ subscriptionStatus: z5.string(),
1268
+ tasksToday: z5.string(),
1269
+ tasksResetAt: z5.string(),
1270
+ openTasks: z5.number(),
1271
+ totalTasks: z5.number(),
1272
+ seats: z5.string(),
1273
+ groups: z5.string(),
1274
+ apiKeys: z5.string(),
1275
+ rateLimitPerSecond: z5.number()
1276
+ });
1277
+ var getWorkspaceUsageOutputSchema = z5.union([
1278
+ withAgentOnlyFields({
1279
+ usage: workspaceUsageEntitySchema
1280
+ }),
1281
+ agentAdminErrorResultSchema
1282
+ ]);
1283
+
991
1284
  // src/eve/tool-reply-guidance.ts
992
1285
  var TOOL_REPLY_GUIDANCE_FIELD = "replyGuidance";
993
1286
  var QUERY_TASKS_LIST_REPLY_GUIDANCE = "Tasks render as a list card in chat. Do not restate task names, ids, or statuses from the list. Only add context not shown (e.g. filters applied, recommended next action).";
@@ -1001,67 +1294,89 @@ function withReplyGuidance(result, guidance) {
1001
1294
 
1002
1295
  // src/eve/tool-display-format.ts
1003
1296
  function formatToolObjectResult(data, options) {
1004
- const withGuidance = withReplyGuidance(data, options.replyGuidance);
1297
+ let result = withReplyGuidance(
1298
+ data,
1299
+ options.replyGuidance
1300
+ );
1301
+ if (options.ui) {
1302
+ result = withToolUi(result, options.ui);
1303
+ }
1005
1304
  if (options.uiHint) {
1006
- return withUiHint(withGuidance, options.uiHint);
1305
+ result = withUiHint(result, options.uiHint);
1007
1306
  }
1008
- return withGuidance;
1307
+ return result;
1009
1308
  }
1010
1309
 
1011
1310
  // src/eve/tools/admin/format-tasks-list.ts
1012
1311
  function resolveTaskCardLabel(task) {
1013
1312
  return task.name?.trim() || task.description?.trim() || task.type?.trim() || task.id?.trim() || "Untitled task";
1014
1313
  }
1314
+ function serializeTaskRow(task, tenantSlug) {
1315
+ return {
1316
+ id: task.id,
1317
+ name: resolveTaskCardLabel(task),
1318
+ status: task.status,
1319
+ type: task.type,
1320
+ description: task.description,
1321
+ validUntil: task.validUntil,
1322
+ createdAt: task.createdAt,
1323
+ threadPriority: task.threadPriority,
1324
+ url: buildTenantTaskUrl(tenantSlug, {
1325
+ id: task.id,
1326
+ type: task.type
1327
+ })
1328
+ };
1329
+ }
1015
1330
  function formatTasksListResult(items, options) {
1016
1331
  const payload = {
1017
- items: items.map((task) => ({
1018
- id: task.id,
1019
- name: resolveTaskCardLabel(task),
1020
- status: task.status,
1021
- type: task.type,
1022
- description: task.description
1023
- }))
1332
+ items: items.map((task) => serializeTaskRow(task, options.tenantSlug))
1024
1333
  };
1025
- if (options?.nextCursor) {
1334
+ if (options.nextCursor) {
1026
1335
  payload.nextCursor = options.nextCursor;
1027
1336
  }
1028
1337
  return formatToolObjectResult(payload, {
1029
- replyGuidance: QUERY_TASKS_LIST_REPLY_GUIDANCE
1338
+ replyGuidance: QUERY_TASKS_LIST_REPLY_GUIDANCE,
1339
+ ui: { layout: "list", entity: "task", rowsPath: "items" }
1030
1340
  });
1031
1341
  }
1032
- function formatTaskSearchResult(items) {
1033
- return formatTasksListResult(items);
1342
+ function formatTaskSearchResult(items, options) {
1343
+ return formatTasksListResult(items, options);
1034
1344
  }
1035
- function formatTaskDetailResult(task) {
1345
+ function formatTaskDetailResult(task, options) {
1346
+ const id = typeof task.id === "string" ? task.id : null;
1347
+ const type = typeof task.type === "string" ? task.type : null;
1348
+ const url = id !== null ? buildTenantTaskUrl(options.tenantSlug, { id, type }) : null;
1036
1349
  return formatToolObjectResult(
1037
1350
  {
1038
- id: task.id ?? null,
1039
- status: task.status ?? null,
1040
- type: task.type ?? null,
1041
- name: task.name ?? null,
1042
- description: task.description ?? null,
1043
- validUntil: task.validUntil ?? null,
1044
- createdAt: task.createdAt ?? null
1351
+ id,
1352
+ status: typeof task.status === "string" ? task.status : null,
1353
+ type,
1354
+ name: typeof task.name === "string" ? task.name : null,
1355
+ description: typeof task.description === "string" ? task.description : null,
1356
+ validUntil: typeof task.validUntil === "number" ? task.validUntil : null,
1357
+ createdAt: typeof task.createdAt === "number" ? task.createdAt : null,
1358
+ url
1045
1359
  },
1046
1360
  {
1047
- replyGuidance: QUERY_TASKS_DETAIL_REPLY_GUIDANCE
1361
+ replyGuidance: QUERY_TASKS_DETAIL_REPLY_GUIDANCE,
1362
+ ui: { entity: "task" }
1048
1363
  }
1049
1364
  );
1050
1365
  }
1051
1366
 
1052
1367
  // src/eve/tools/admin/query-tasks.ts
1053
1368
  var QUERY_TASKS_TOOL_NAME = "query_tasks";
1054
- var queryTasksInputSchema = z5.object({
1055
- action: z5.enum(["list", "get", "search"]),
1056
- statusFilter: z5.enum(["all", "open", "handled", "expired"]).optional().describe("Filter by task status for list."),
1057
- typeFilter: z5.string().optional(),
1058
- appFilter: z5.string().optional(),
1059
- sortField: z5.enum(["type", "date", "status", "validUntil"]).optional(),
1060
- sortDirection: z5.enum(["asc", "desc"]).optional(),
1061
- limit: z5.number().int().positive().max(100).optional(),
1062
- cursor: z5.string().optional(),
1063
- taskId: z5.string().min(1).optional().describe("Public task id or Convex tasks table id for get."),
1064
- query: z5.string().min(1).optional().describe("Search type, name, description, or id for search.")
1369
+ var queryTasksInputSchema = z6.object({
1370
+ action: z6.enum(["list", "get", "search"]),
1371
+ statusFilter: z6.enum(["all", "open", "handled", "expired"]).optional().describe("Filter by task status for list."),
1372
+ typeFilter: z6.string().optional(),
1373
+ appFilter: z6.string().optional(),
1374
+ sortField: z6.enum(["type", "date", "status", "validUntil"]).optional(),
1375
+ sortDirection: z6.enum(["asc", "desc"]).optional(),
1376
+ limit: z6.number().int().positive().max(100).optional(),
1377
+ cursor: z6.string().optional(),
1378
+ taskId: z6.string().min(1).optional().describe("Public task id or Convex tasks table id for get."),
1379
+ query: z6.string().min(1).optional().describe("Search type, name, description, or id for search.")
1065
1380
  }).superRefine((input, ctx) => {
1066
1381
  switch (input.action) {
1067
1382
  case "get":
@@ -1086,10 +1401,13 @@ var queryTasksInputSchema = z5.object({
1086
1401
  });
1087
1402
  function defineQueryTasksTool() {
1088
1403
  return defineTool({
1089
- description: "Tenant-admin tool to list, fetch detail, or search inbox tasks in the workspace. Requires tenant admin access. Call get_my_access in the same turn before this tool to verify admin access (the check renders as its own chat tool card). Results render as chat UI cards \u2014 do not restate task names, ids, or statuses in your reply.",
1404
+ description: "Tenant-admin tool to list, fetch detail, or search inbox tasks in the workspace. Requires tenant admin access. Call get_my_access in the same turn before this tool to verify admin access (the check stays a compact success marker unless it is the only presentable result). Results render as chat UI cards \u2014 do not restate task names, ids, or statuses in your reply.",
1090
1405
  inputSchema: queryTasksInputSchema,
1406
+ outputSchema: queryTasksOutputSchema,
1091
1407
  async execute(input, ctx) {
1408
+ const caller = requireAdminCaller(ctx);
1092
1409
  const api = requireBoundAgentAdminClient(ctx);
1410
+ const tenantSlug = caller.tenantSlug;
1093
1411
  try {
1094
1412
  switch (input.action) {
1095
1413
  case "list": {
@@ -1103,17 +1421,22 @@ function defineQueryTasksTool() {
1103
1421
  cursor: input.cursor
1104
1422
  });
1105
1423
  return formatTasksListResult(result.items, {
1424
+ tenantSlug,
1106
1425
  nextCursor: result.nextCursor
1107
1426
  });
1108
1427
  }
1109
1428
  case "get": {
1110
1429
  const result = await api.tasks.get(input.taskId);
1111
- return formatTaskDetailResult(result.task);
1430
+ return formatTaskDetailResult(
1431
+ result.task,
1432
+ { tenantSlug }
1433
+ );
1112
1434
  }
1113
1435
  case "search": {
1114
1436
  const result = await api.tasks.search(input.query, input.limit);
1115
1437
  return formatTaskSearchResult(
1116
- result.items
1438
+ result.items,
1439
+ { tenantSlug }
1117
1440
  );
1118
1441
  }
1119
1442
  }