robotrock 1.3.3 → 1.4.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/README.md +32 -0
- package/dist/agent-admin.d.ts +5 -0
- package/dist/agent-admin.js +75 -2
- package/dist/agent-admin.js.map +1 -1
- package/dist/ai/index.d.ts +5 -5
- package/dist/ai/index.js +128 -4
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/trigger.d.ts +3 -3
- package/dist/ai/trigger.js +128 -4
- package/dist/ai/trigger.js.map +1 -1
- package/dist/ai/workflow.d.ts +3 -3
- package/dist/ai/workflow.js +128 -4
- package/dist/ai/workflow.js.map +1 -1
- package/dist/{client-CZ5eWH5v.d.ts → client-BxbxttFH.d.ts} +19 -1
- package/dist/eve/agent/index.d.ts +4 -3
- package/dist/eve/agent/index.js +736 -414
- package/dist/eve/agent/index.js.map +1 -1
- package/dist/eve/index.d.ts +4 -3
- package/dist/eve/index.js +437 -45
- package/dist/eve/index.js.map +1 -1
- package/dist/eve/tools/admin/assign-tasks.d.ts +40 -8
- package/dist/eve/tools/admin/assign-tasks.js +328 -66
- package/dist/eve/tools/admin/assign-tasks.js.map +1 -1
- package/dist/eve/tools/admin/get-workspace-usage.d.ts +71 -0
- package/dist/eve/tools/admin/get-workspace-usage.js +1353 -0
- package/dist/eve/tools/admin/get-workspace-usage.js.map +1 -0
- package/dist/eve/tools/admin/manage-groups.d.ts +122 -8
- package/dist/eve/tools/admin/manage-groups.js +348 -94
- package/dist/eve/tools/admin/manage-groups.js.map +1 -1
- package/dist/eve/tools/admin/manage-team-members.d.ts +86 -8
- package/dist/eve/tools/admin/manage-team-members.js +318 -72
- package/dist/eve/tools/admin/manage-team-members.js.map +1 -1
- package/dist/eve/tools/admin/query-tasks.d.ts +82 -8
- package/dist/eve/tools/admin/query-tasks.js +360 -113
- package/dist/eve/tools/admin/query-tasks.js.map +1 -1
- package/dist/eve/tools/catalog/generate-image.d.ts +64 -0
- package/dist/eve/tools/catalog/generate-image.js +2065 -0
- package/dist/eve/tools/catalog/generate-image.js.map +1 -0
- package/dist/eve/tools/catalog/generate-random-chart.d.ts +71 -0
- package/dist/eve/tools/catalog/generate-random-chart.js +372 -0
- package/dist/eve/tools/catalog/generate-random-chart.js.map +1 -0
- package/dist/eve/tools/catalog/search-products.d.ts +36 -44
- package/dist/eve/tools/catalog/search-products.js +237 -33
- package/dist/eve/tools/catalog/search-products.js.map +1 -1
- package/dist/eve/tools/identity/index.d.ts +2 -2
- package/dist/eve/tools/identity/index.js +35 -44
- package/dist/eve/tools/identity/index.js.map +1 -1
- package/dist/eve/tools/identity/my-access.d.ts +90 -6
- package/dist/eve/tools/identity/my-access.js +35 -44
- package/dist/eve/tools/identity/my-access.js.map +1 -1
- package/dist/eve/tools/identity/whoami.d.ts +1 -1
- package/dist/eve/tools/identity/whoami.js.map +1 -1
- package/dist/eve/tools/inbox/create-task.d.ts +1 -1
- package/dist/eve/tools/inbox/create-task.js +119 -2
- package/dist/eve/tools/inbox/create-task.js.map +1 -1
- package/dist/eve/tools/inbox/index.d.ts +1 -1
- package/dist/eve/tools/inbox/index.js +119 -2
- package/dist/eve/tools/inbox/index.js.map +1 -1
- package/dist/eve/tools/index.d.ts +5 -2
- package/dist/eve/tools/index.js +932 -288
- package/dist/eve/tools/index.js.map +1 -1
- package/dist/index-Drj0Rzf_.d.ts +905 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +335 -20
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.js +67 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/{tool-approval-bridge-DnGaRES4.d.ts → tool-approval-bridge-Cz7qQUpw.d.ts} +1 -1
- package/dist/{tool-reply-guidance-C3qrT1In.d.ts → tool-reply-guidance-CJko9liH.d.ts} +5 -2
- package/dist/tool-result-ui-meta-KT0VafEO.d.ts +52 -0
- package/dist/trigger/index.d.ts +1 -1
- package/dist/trigger/index.js +118 -2
- package/dist/trigger/index.js.map +1 -1
- package/dist/{trigger--qTIK0s6.d.ts → trigger-C1ooSegc.d.ts} +2 -2
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.js +118 -2
- package/dist/workflow/index.js.map +1 -1
- package/package.json +21 -4
- package/dist/index-DePyAbTI.d.ts +0 -203
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { R as RobotRock, b as RobotRockConfig } from './client-
|
|
2
|
-
export { C as ChatsApi, c as CloseChatOptions, d as CreateChatInput, e as CreateChatResult, f as CreatedChat, L as ListTasksInput, g as RobotRockAdvancedConfig, h as RobotRockPollingClientConfig, i as RobotRockPollingOptions, j as RobotRockWebhookClientConfig, k as RobotRockWebhookConfig, l as SearchTasksInput, S as SendToHumanActionInput, a as SendToHumanInput, m as SendToHumanResult, n as SendToHumanValidUntil, o as SendUpdateInput, p as StageChatHitlRequestsInput, q as StagedChatHitlRequest, T as TasksApi, r as attachWebhookToActions, s as createChatsApi, t as createClient } from './client-
|
|
1
|
+
import { R as RobotRock, b as RobotRockConfig } from './client-BxbxttFH.js';
|
|
2
|
+
export { C as ChatsApi, c as CloseChatOptions, d as CreateChatInput, e as CreateChatResult, f as CreatedChat, L as ListTasksInput, g as RobotRockAdvancedConfig, h as RobotRockPollingClientConfig, i as RobotRockPollingOptions, j as RobotRockWebhookClientConfig, k as RobotRockWebhookConfig, l as SearchTasksInput, S as SendToHumanActionInput, a as SendToHumanInput, m as SendToHumanResult, n as SendToHumanValidUntil, o as SendUpdateInput, p as StageChatHitlRequestsInput, q as StagedChatHitlRequest, T as TasksApi, r as attachWebhookToActions, s as createChatsApi, t as createClient } from './client-BxbxttFH.js';
|
|
3
3
|
export { AgentChatSeedMessage, CreateAgentChatBody, CreateAgentChatBodyInput, agentChatSeedMessageSchema, createAgentChatBodySchema } from '@robotrock/core';
|
|
4
4
|
import { Task, DiscriminatedApprovalResult } from './schemas/index.js';
|
|
5
5
|
export { AgentTelemetry, AgentTelemetryInput, ApprovalResult, AssignToInput, CreateTaskBody, CreateTaskBodyInput, DEFAULT_TASK_PRIORITY, DEFAULT_THREAD_UPDATE_STATUS, Handler, InferActionData, LOWEST_TASK_PRIORITY, TASK_CONTEXT_FORMAT_VERSION, TASK_PRIORITY_RANK, TaskAction, TaskContext, TaskContextFormatVersion, TaskContextInput, TaskPriority, TaskResponse, TaskResult, TaskStatus, ThreadUpdate, ThreadUpdateBody, ThreadUpdateBodyInput, ThreadUpdateInput, ThreadUpdateResponse, ThreadUpdateSource, ThreadUpdateStatus, TriggerHandler, TupleElementIndices, WebhookHandler, agentTelemetrySchema, assignToSchema, createTaskBodySchema, taskContextSchema, taskPriorities, taskPrioritySchema, threadUpdateBodySchema, threadUpdateInputSchema, threadUpdateStatusSchema, threadUpdateStatuses } from './schemas/index.js';
|
|
6
|
-
export { D as DEFAULT_TOOL_DISPLAY_LABELS, E as EVE_INPUT_OTHER_CHOICE_ID, a as EVE_INPUT_OTHER_CHOICE_LABEL, b as EVE_INPUT_SUBMIT_ACTION_ID, c as EveInputOption, d as EveInputRequest, e as EveInputRequestDisplay, f as EveInputResponse, R as ROBOTROCK_READY_HOOK_SLUG, g as RobotRockWebhookError, h as RobotRockWebhookErrorCode, i as RobotRockWebhookPayload, V as VerifyRobotRockWebhookOptions, j as buildTaskHandledResumeMessage, k as eveInputRequestTaskType, l as eveInputRequestToActions, m as formatEveApprovalTitle, n as getToolDisplayLabel, o as normalizeEveSelectFormData, r as resolveEveInputDisplay, s as setToolDisplayLabelOverrides, t as taskHandledToEveInputResponse, v as verifyRobotRockWebhook } from './index-
|
|
6
|
+
export { D as DEFAULT_TOOL_DISPLAY_LABELS, E as EVE_INPUT_OTHER_CHOICE_ID, a as EVE_INPUT_OTHER_CHOICE_LABEL, b as EVE_INPUT_SUBMIT_ACTION_ID, c as EveInputOption, d as EveInputRequest, e as EveInputRequestDisplay, f as EveInputResponse, R as ROBOTROCK_READY_HOOK_SLUG, g as RobotRockWebhookError, h as RobotRockWebhookErrorCode, i as RobotRockWebhookPayload, V as VerifyRobotRockWebhookOptions, j as buildTaskHandledResumeMessage, k as eveInputRequestTaskType, l as eveInputRequestToActions, m as formatEveApprovalTitle, n as getToolDisplayLabel, o as normalizeEveSelectFormData, r as resolveEveInputDisplay, s as setToolDisplayLabelOverrides, t as taskHandledToEveInputResponse, v as verifyRobotRockWebhook } from './index-Drj0Rzf_.js';
|
|
7
7
|
export { E as EndRobotRockHumanWaitSpanOptions, b as RobotRockCreatedTask, c as RobotRockHandledOtelInput, a as RobotRockHandlerWebhookPayload, d as RobotRockHumanWaitOtelSession, e as RobotRockOtelHandle, f as RobotRockOtelRecordOptions, R as RobotRockPlatformOtelFields, g as beginRobotRockHumanWaitOtel, h as captureRobotRockOtelHandle, i as endRobotRockHumanWaitSpan, j as finishRobotRockHumanWaitOtel, r as recordRobotRockHandledToOtel, s as shouldRecordRobotRockOtel, k as startRobotRockHumanWaitSpan, l as stripPlatformOtelFields, t as toRobotRockHandledOtelInput } from './otel-platform-DzHyHkGk.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import './chat-correlation-BsHD-tOQ.js';
|
|
10
10
|
import '@robotrock/core/schemas';
|
|
11
|
-
import './tool-
|
|
11
|
+
import './tool-result-ui-meta-KT0VafEO.js';
|
|
12
|
+
import './tool-reply-guidance-CJko9liH.js';
|
|
12
13
|
import '@opentelemetry/api';
|
|
13
14
|
|
|
14
15
|
declare class RobotRockError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
// src/schemas/index.ts
|
|
2
2
|
import { z as z4 } from "zod";
|
|
3
3
|
|
|
4
|
+
// ../core/src/utils/decode-html-entities.ts
|
|
5
|
+
function decodeHtmlEntities(value) {
|
|
6
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(/&#(\d+);/g, (_, code) => String.fromCharCode(Number(code))).replace(
|
|
7
|
+
/&#x([0-9a-f]+);/gi,
|
|
8
|
+
(_, code) => String.fromCharCode(parseInt(code, 16))
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
// ../core/src/utils/safe-url.ts
|
|
5
13
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set([
|
|
6
14
|
"localhost",
|
|
@@ -445,6 +453,40 @@ var agentChatLinkTaskBodySchema = z.object({
|
|
|
445
453
|
publicTaskId: z.string().min(1),
|
|
446
454
|
toolCallId: z.string().min(1)
|
|
447
455
|
});
|
|
456
|
+
var AGENT_FILE_TAGS_MAX = 20;
|
|
457
|
+
var AGENT_FILE_TAG_MAX_LENGTH = 64;
|
|
458
|
+
function normalizeAgentFileTags(tags) {
|
|
459
|
+
if (!tags?.length) return void 0;
|
|
460
|
+
const seen = /* @__PURE__ */ new Set();
|
|
461
|
+
const out = [];
|
|
462
|
+
for (const raw of tags) {
|
|
463
|
+
const tag = raw.trim().toLowerCase().slice(0, AGENT_FILE_TAG_MAX_LENGTH);
|
|
464
|
+
if (!tag || seen.has(tag)) continue;
|
|
465
|
+
seen.add(tag);
|
|
466
|
+
out.push(tag);
|
|
467
|
+
if (out.length >= AGENT_FILE_TAGS_MAX) break;
|
|
468
|
+
}
|
|
469
|
+
return out.length > 0 ? out : void 0;
|
|
470
|
+
}
|
|
471
|
+
var agentChatUploadImageBodySchema = z.object({
|
|
472
|
+
mediaType: z.string().min(1),
|
|
473
|
+
/** Raw base64 (no data: URL prefix). */
|
|
474
|
+
base64: z.string().min(1),
|
|
475
|
+
chatId: z.string().min(1).optional(),
|
|
476
|
+
publicTaskId: z.string().min(1).optional(),
|
|
477
|
+
source: z.string().min(1).optional(),
|
|
478
|
+
/** Display / search name (e.g. `sunset-robot.png`). */
|
|
479
|
+
filename: z.string().min(1).max(255).optional(),
|
|
480
|
+
/** Human-readable description (e.g. generation prompt). */
|
|
481
|
+
description: z.string().min(1).max(2e3).optional(),
|
|
482
|
+
/**
|
|
483
|
+
* Optional labels for later grouping/filtering.
|
|
484
|
+
* Normalized to lowercase trimmed unique strings (max 20, 64 chars each).
|
|
485
|
+
*/
|
|
486
|
+
tags: z.array(z.string().min(1).max(AGENT_FILE_TAG_MAX_LENGTH)).max(AGENT_FILE_TAGS_MAX).optional().transform((tags) => normalizeAgentFileTags(tags))
|
|
487
|
+
}).refine((data) => Boolean(data.chatId || data.publicTaskId), {
|
|
488
|
+
message: "Provide chatId and/or publicTaskId"
|
|
489
|
+
});
|
|
448
490
|
|
|
449
491
|
// ../core/src/schemas/tool-result-display.ts
|
|
450
492
|
import { z as z2 } from "zod";
|
|
@@ -473,7 +515,8 @@ var tenantRoleSchema = z3.enum(["admin", "member"]);
|
|
|
473
515
|
var agentAdminUserSchema = z3.object({
|
|
474
516
|
id: z3.string(),
|
|
475
517
|
email: z3.string().email(),
|
|
476
|
-
name: z3.string()
|
|
518
|
+
name: z3.string(),
|
|
519
|
+
profilePictureUrl: z3.string().nullable().optional()
|
|
477
520
|
});
|
|
478
521
|
var agentAdminMemberSchema = z3.object({
|
|
479
522
|
userId: z3.string(),
|
|
@@ -558,6 +601,37 @@ var assignTasksBodySchema = z3.object({
|
|
|
558
601
|
{ message: "assignTo needs at least one user email or group slug." }
|
|
559
602
|
)
|
|
560
603
|
});
|
|
604
|
+
var agentAdminPlanLimitsSchema = z3.object({
|
|
605
|
+
tasksPerDay: z3.number(),
|
|
606
|
+
members: z3.number(),
|
|
607
|
+
apiKeys: z3.number(),
|
|
608
|
+
groups: z3.number(),
|
|
609
|
+
auditLogRetention: z3.number(),
|
|
610
|
+
rateLimitPerSecond: z3.number(),
|
|
611
|
+
taskRetentionDays: z3.number()
|
|
612
|
+
});
|
|
613
|
+
var agentAdminUsageSchema = z3.object({
|
|
614
|
+
workspace: z3.string(),
|
|
615
|
+
planName: z3.string(),
|
|
616
|
+
planType: z3.string(),
|
|
617
|
+
trialState: z3.enum(["none", "active", "expired"]),
|
|
618
|
+
daysRemaining: z3.number().nullable(),
|
|
619
|
+
isPaidPro: z3.boolean(),
|
|
620
|
+
subscriptionStatus: z3.string().nullable(),
|
|
621
|
+
tasksToday: z3.number(),
|
|
622
|
+
maxTasksPerDay: z3.number().nullable(),
|
|
623
|
+
tasksResetAt: z3.number(),
|
|
624
|
+
openTasks: z3.number(),
|
|
625
|
+
totalTasks: z3.number(),
|
|
626
|
+
seatsCurrent: z3.number(),
|
|
627
|
+
seatsMax: z3.number().nullable(),
|
|
628
|
+
groupsCurrent: z3.number(),
|
|
629
|
+
groupsMax: z3.number().nullable(),
|
|
630
|
+
apiKeysCurrent: z3.number(),
|
|
631
|
+
apiKeysMax: z3.number().nullable(),
|
|
632
|
+
rateLimitPerSecond: z3.number(),
|
|
633
|
+
limits: agentAdminPlanLimitsSchema
|
|
634
|
+
});
|
|
561
635
|
|
|
562
636
|
// src/schemas/index.ts
|
|
563
637
|
var handlerUrlSchema2 = z4.string().refine((url) => isAllowedHandlerUrl(url), {
|
|
@@ -870,7 +944,11 @@ function resolveRobotRockAuthConfig(overrides) {
|
|
|
870
944
|
"RobotRock auth is required. Set ROBOTROCK_API_KEY, ROBOTROCK_AGENT_SERVICE_TOKEN with tenant context, or pass auth when creating the client."
|
|
871
945
|
);
|
|
872
946
|
}
|
|
873
|
-
return {
|
|
947
|
+
return {
|
|
948
|
+
kind: "apiKey",
|
|
949
|
+
apiKey,
|
|
950
|
+
...overrides?.actingUserId?.trim() ? { actingUserId: overrides.actingUserId.trim() } : {}
|
|
951
|
+
};
|
|
874
952
|
}
|
|
875
953
|
|
|
876
954
|
// src/chat-correlation.ts
|
|
@@ -1064,6 +1142,51 @@ function createChatsApi(config) {
|
|
|
1064
1142
|
data
|
|
1065
1143
|
);
|
|
1066
1144
|
}
|
|
1145
|
+
},
|
|
1146
|
+
async uploadImage(input) {
|
|
1147
|
+
const validation = agentChatUploadImageBodySchema.safeParse(input);
|
|
1148
|
+
if (!validation.success) {
|
|
1149
|
+
throw new RobotRockError(
|
|
1150
|
+
`Invalid image upload: ${validation.error.issues[0]?.message}`,
|
|
1151
|
+
400,
|
|
1152
|
+
validation.error.issues
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
const response = await fetch(`${config.baseUrl}/agent-chats/images`, {
|
|
1156
|
+
method: "POST",
|
|
1157
|
+
headers: headers(),
|
|
1158
|
+
body: JSON.stringify(validation.data)
|
|
1159
|
+
});
|
|
1160
|
+
const data = await parseResponseBody(response);
|
|
1161
|
+
if (!response.ok) {
|
|
1162
|
+
throw new RobotRockError(
|
|
1163
|
+
getErrorMessage(data, "Failed to upload chat image"),
|
|
1164
|
+
response.status,
|
|
1165
|
+
data
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
const uploaded = data;
|
|
1169
|
+
if (typeof uploaded.storageId !== "string" || typeof uploaded.url !== "string" || typeof uploaded.mediaType !== "string") {
|
|
1170
|
+
throw new RobotRockError(
|
|
1171
|
+
"Image upload returned an invalid response",
|
|
1172
|
+
500,
|
|
1173
|
+
data
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
return {
|
|
1177
|
+
storageId: uploaded.storageId,
|
|
1178
|
+
url: uploaded.url,
|
|
1179
|
+
mediaType: uploaded.mediaType,
|
|
1180
|
+
...typeof uploaded.chatId === "string" ? { chatId: uploaded.chatId } : {},
|
|
1181
|
+
...typeof uploaded.publicTaskId === "string" ? { publicTaskId: uploaded.publicTaskId } : {},
|
|
1182
|
+
...typeof uploaded.filename === "string" ? { filename: uploaded.filename } : {},
|
|
1183
|
+
...typeof uploaded.description === "string" ? { description: uploaded.description } : {},
|
|
1184
|
+
...Array.isArray(uploaded.tags) ? {
|
|
1185
|
+
tags: uploaded.tags.filter(
|
|
1186
|
+
(tag) => typeof tag === "string"
|
|
1187
|
+
)
|
|
1188
|
+
} : {}
|
|
1189
|
+
};
|
|
1067
1190
|
}
|
|
1068
1191
|
};
|
|
1069
1192
|
}
|
|
@@ -1133,6 +1256,7 @@ var RobotRock = class {
|
|
|
1133
1256
|
}
|
|
1134
1257
|
this.auth = resolveRobotRockAuthConfig({
|
|
1135
1258
|
...apiKey ? { apiKey } : {},
|
|
1259
|
+
...config.actingUserId ? { actingUserId: config.actingUserId } : {},
|
|
1136
1260
|
...agentService ? { agentService } : {}
|
|
1137
1261
|
});
|
|
1138
1262
|
this.chatCorrelation = config.chatCorrelation;
|
|
@@ -1574,6 +1698,9 @@ function readStringField(data, key) {
|
|
|
1574
1698
|
const trimmed = value.trim();
|
|
1575
1699
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
1576
1700
|
}
|
|
1701
|
+
function decodeDisplayText(value) {
|
|
1702
|
+
return decodeHtmlEntities(value);
|
|
1703
|
+
}
|
|
1577
1704
|
function resolveEveInputDisplay(request, toolName) {
|
|
1578
1705
|
if (request.display) {
|
|
1579
1706
|
return request.display;
|
|
@@ -1590,11 +1717,12 @@ function confirmationActions(request) {
|
|
|
1590
1717
|
const options = request.options && request.options.length > 0 ? request.options : CONFIRMATION_DEFAULT_OPTIONS;
|
|
1591
1718
|
return options.map((option) => ({
|
|
1592
1719
|
id: option.id,
|
|
1593
|
-
title: option.label,
|
|
1594
|
-
...option.description ? { description: option.description } : {}
|
|
1720
|
+
title: decodeDisplayText(option.label),
|
|
1721
|
+
...option.description ? { description: decodeDisplayText(option.description) } : {}
|
|
1595
1722
|
}));
|
|
1596
1723
|
}
|
|
1597
1724
|
function textSubmitAction(prompt) {
|
|
1725
|
+
const decodedPrompt = decodeDisplayText(prompt);
|
|
1598
1726
|
return {
|
|
1599
1727
|
id: EVE_INPUT_SUBMIT_ACTION_ID,
|
|
1600
1728
|
title: "Submit",
|
|
@@ -1610,7 +1738,7 @@ function textSubmitAction(prompt) {
|
|
|
1610
1738
|
},
|
|
1611
1739
|
ui: {
|
|
1612
1740
|
answer: {
|
|
1613
|
-
"ui:title":
|
|
1741
|
+
"ui:title": decodedPrompt.trim() || "Your answer",
|
|
1614
1742
|
"ui:widget": "textarea"
|
|
1615
1743
|
}
|
|
1616
1744
|
}
|
|
@@ -1619,15 +1747,15 @@ function textSubmitAction(prompt) {
|
|
|
1619
1747
|
function selectPerOptionActions(options) {
|
|
1620
1748
|
return options.map((option) => ({
|
|
1621
1749
|
id: option.id,
|
|
1622
|
-
title: option.label,
|
|
1623
|
-
...option.description ? { description: option.description } : {}
|
|
1750
|
+
title: decodeDisplayText(option.label),
|
|
1751
|
+
...option.description ? { description: decodeDisplayText(option.description) } : {}
|
|
1624
1752
|
}));
|
|
1625
1753
|
}
|
|
1626
1754
|
function selectFormAction(request) {
|
|
1627
1755
|
const options = request.options ?? [];
|
|
1628
1756
|
const allowFreeform = request.allowFreeform === true;
|
|
1629
1757
|
const enumValues = options.map((option) => option.id);
|
|
1630
|
-
const enumNames = options.map((option) => option.label);
|
|
1758
|
+
const enumNames = options.map((option) => decodeDisplayText(option.label));
|
|
1631
1759
|
if (allowFreeform) {
|
|
1632
1760
|
enumValues.push(EVE_INPUT_OTHER_CHOICE_ID);
|
|
1633
1761
|
enumNames.push(EVE_INPUT_OTHER_CHOICE_LABEL);
|
|
@@ -1786,9 +1914,12 @@ var DEFAULT_TOOL_DISPLAY_LABELS = {
|
|
|
1786
1914
|
whoami: "Who am I",
|
|
1787
1915
|
create_robotrock_task: "Create a RobotRock task",
|
|
1788
1916
|
search_products: "Search products",
|
|
1917
|
+
generate_random_chart: "Generate random chart",
|
|
1918
|
+
generate_image: "Generate image",
|
|
1789
1919
|
manage_team_members: "Manage team members",
|
|
1790
1920
|
manage_groups: "Manage groups",
|
|
1791
|
-
query_tasks: "Query tasks"
|
|
1921
|
+
query_tasks: "Query tasks",
|
|
1922
|
+
get_workspace_usage: "Get workspace usage"
|
|
1792
1923
|
};
|
|
1793
1924
|
var toolDisplayLabelOverrides = {};
|
|
1794
1925
|
function setToolDisplayLabelOverrides(overrides) {
|
|
@@ -1811,11 +1942,195 @@ function getToolDisplayLabel(toolName) {
|
|
|
1811
1942
|
function formatEveApprovalTitle(request, toolName) {
|
|
1812
1943
|
const display = resolveEveInputDisplay(request, toolName);
|
|
1813
1944
|
if (display !== "confirmation" || !toolName) {
|
|
1814
|
-
return request.prompt;
|
|
1945
|
+
return decodeHtmlEntities(request.prompt);
|
|
1815
1946
|
}
|
|
1816
1947
|
return `Approve: ${getToolDisplayLabel(toolName)}`;
|
|
1817
1948
|
}
|
|
1818
1949
|
|
|
1950
|
+
// src/eve/tool-result-ui-meta.ts
|
|
1951
|
+
var TOOL_RESULT_UI_ENTITY_ID_RE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
1952
|
+
|
|
1953
|
+
// src/eve/entity-schemas.ts
|
|
1954
|
+
import { z as z6 } from "zod";
|
|
1955
|
+
var toolResultUiMetaSchema = z6.object({
|
|
1956
|
+
present: z6.boolean().optional(),
|
|
1957
|
+
entity: z6.string().regex(TOOL_RESULT_UI_ENTITY_ID_RE).optional(),
|
|
1958
|
+
rowsPath: z6.string().min(1).optional(),
|
|
1959
|
+
layout: z6.enum(["list", "chart", "table"]).optional()
|
|
1960
|
+
}).strict();
|
|
1961
|
+
var agentOnlyFields = {
|
|
1962
|
+
replyGuidance: z6.string().optional(),
|
|
1963
|
+
ui: toolResultUiMetaSchema.optional(),
|
|
1964
|
+
uiHint: z6.enum(["list", "chart", "table"]).optional()
|
|
1965
|
+
};
|
|
1966
|
+
function withAgentOnlyFields(shape) {
|
|
1967
|
+
return z6.object({
|
|
1968
|
+
...shape,
|
|
1969
|
+
...agentOnlyFields
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
var productEntityRowSchema = z6.object({
|
|
1973
|
+
id: z6.string().min(1),
|
|
1974
|
+
name: z6.string().min(1),
|
|
1975
|
+
price: z6.number(),
|
|
1976
|
+
currency: z6.string().min(1),
|
|
1977
|
+
inStock: z6.boolean(),
|
|
1978
|
+
url: z6.string().min(1)
|
|
1979
|
+
});
|
|
1980
|
+
var metricPointEntityRowSchema = z6.object({
|
|
1981
|
+
date: z6.string().optional(),
|
|
1982
|
+
category: z6.string().optional(),
|
|
1983
|
+
label: z6.string().optional()
|
|
1984
|
+
}).catchall(z6.union([z6.string(), z6.number()]));
|
|
1985
|
+
var memberEntityRowSchema = z6.object({
|
|
1986
|
+
name: z6.string(),
|
|
1987
|
+
email: z6.string(),
|
|
1988
|
+
role: z6.string(),
|
|
1989
|
+
membershipKind: z6.string(),
|
|
1990
|
+
profilePictureUrl: z6.string().nullable()
|
|
1991
|
+
});
|
|
1992
|
+
var taskEntityRowSchema = z6.object({
|
|
1993
|
+
id: z6.string().min(1),
|
|
1994
|
+
name: z6.string().min(1),
|
|
1995
|
+
status: z6.string().min(1),
|
|
1996
|
+
type: z6.string().nullable(),
|
|
1997
|
+
description: z6.string().nullable(),
|
|
1998
|
+
validUntil: z6.number(),
|
|
1999
|
+
createdAt: z6.number(),
|
|
2000
|
+
url: z6.string().min(1),
|
|
2001
|
+
threadPriority: z6.string().nullable().optional()
|
|
2002
|
+
});
|
|
2003
|
+
var groupEntityRowSchema = z6.object({
|
|
2004
|
+
name: z6.string().min(1),
|
|
2005
|
+
slug: z6.string().min(1),
|
|
2006
|
+
description: z6.string().nullable(),
|
|
2007
|
+
memberCount: z6.number().nullable(),
|
|
2008
|
+
url: z6.string().min(1)
|
|
2009
|
+
});
|
|
2010
|
+
var groupDetailEntitySchema = z6.object({
|
|
2011
|
+
name: z6.string().min(1),
|
|
2012
|
+
slug: z6.string().min(1),
|
|
2013
|
+
description: z6.string().nullable(),
|
|
2014
|
+
url: z6.string().min(1),
|
|
2015
|
+
members: z6.array(
|
|
2016
|
+
z6.object({
|
|
2017
|
+
name: z6.string(),
|
|
2018
|
+
email: z6.string(),
|
|
2019
|
+
profilePictureUrl: z6.string().nullable()
|
|
2020
|
+
})
|
|
2021
|
+
)
|
|
2022
|
+
});
|
|
2023
|
+
var statusEntityRowSchema = z6.object({
|
|
2024
|
+
id: z6.string().min(1),
|
|
2025
|
+
name: z6.string().min(1),
|
|
2026
|
+
status: z6.string().min(1),
|
|
2027
|
+
url: z6.string().min(1),
|
|
2028
|
+
type: z6.string().nullable().optional(),
|
|
2029
|
+
description: z6.string().nullable().optional()
|
|
2030
|
+
});
|
|
2031
|
+
var agentAdminErrorResultSchema = z6.object({
|
|
2032
|
+
ok: z6.literal(false),
|
|
2033
|
+
status: z6.number().optional(),
|
|
2034
|
+
message: z6.string(),
|
|
2035
|
+
response: z6.unknown().optional()
|
|
2036
|
+
});
|
|
2037
|
+
var agentAdminMutationResultSchema = z6.object({
|
|
2038
|
+
...agentOnlyFields
|
|
2039
|
+
}).passthrough();
|
|
2040
|
+
var searchProductsOutputSchema = withAgentOnlyFields({
|
|
2041
|
+
items: z6.array(productEntityRowSchema)
|
|
2042
|
+
});
|
|
2043
|
+
var generateRandomChartOutputSchema = withAgentOnlyFields({
|
|
2044
|
+
title: z6.string().min(1),
|
|
2045
|
+
axis: z6.enum(["time", "category"]),
|
|
2046
|
+
series: z6.array(metricPointEntityRowSchema)
|
|
2047
|
+
});
|
|
2048
|
+
var generateImageOutputSchema = withAgentOnlyFields({
|
|
2049
|
+
prompt: z6.string().min(1),
|
|
2050
|
+
mediaType: z6.string().min(1),
|
|
2051
|
+
model: z6.string().min(1),
|
|
2052
|
+
storageId: z6.string().min(1),
|
|
2053
|
+
url: z6.string().min(1),
|
|
2054
|
+
/** @deprecated Legacy sessions only — prefer storageId/url. */
|
|
2055
|
+
base64: z6.string().min(1).optional()
|
|
2056
|
+
});
|
|
2057
|
+
var manageTeamMembersListOutputSchema = withAgentOnlyFields({
|
|
2058
|
+
members: z6.array(memberEntityRowSchema)
|
|
2059
|
+
});
|
|
2060
|
+
var manageTeamMembersDetailOutputSchema = withAgentOnlyFields(
|
|
2061
|
+
memberEntityRowSchema.shape
|
|
2062
|
+
);
|
|
2063
|
+
var manageTeamMembersOutputSchema = z6.union([
|
|
2064
|
+
manageTeamMembersListOutputSchema,
|
|
2065
|
+
manageTeamMembersDetailOutputSchema,
|
|
2066
|
+
agentAdminMutationResultSchema,
|
|
2067
|
+
agentAdminErrorResultSchema
|
|
2068
|
+
]);
|
|
2069
|
+
var manageGroupsListOutputSchema = withAgentOnlyFields({
|
|
2070
|
+
groups: z6.array(groupEntityRowSchema)
|
|
2071
|
+
});
|
|
2072
|
+
var manageGroupsDetailOutputSchema = withAgentOnlyFields(
|
|
2073
|
+
groupDetailEntitySchema.shape
|
|
2074
|
+
);
|
|
2075
|
+
var manageGroupsSummaryOutputSchema = withAgentOnlyFields(
|
|
2076
|
+
groupEntityRowSchema.shape
|
|
2077
|
+
);
|
|
2078
|
+
var manageGroupsOutputSchema = z6.union([
|
|
2079
|
+
manageGroupsListOutputSchema,
|
|
2080
|
+
manageGroupsDetailOutputSchema,
|
|
2081
|
+
manageGroupsSummaryOutputSchema,
|
|
2082
|
+
agentAdminMutationResultSchema,
|
|
2083
|
+
agentAdminErrorResultSchema
|
|
2084
|
+
]);
|
|
2085
|
+
var queryTasksListOutputSchema = withAgentOnlyFields({
|
|
2086
|
+
items: z6.array(taskEntityRowSchema),
|
|
2087
|
+
nextCursor: z6.string().nullable().optional()
|
|
2088
|
+
});
|
|
2089
|
+
var queryTasksDetailOutputSchema = withAgentOnlyFields({
|
|
2090
|
+
id: z6.string().nullable(),
|
|
2091
|
+
status: z6.string().nullable(),
|
|
2092
|
+
type: z6.string().nullable(),
|
|
2093
|
+
name: z6.string().nullable(),
|
|
2094
|
+
description: z6.string().nullable(),
|
|
2095
|
+
validUntil: z6.number().nullable(),
|
|
2096
|
+
createdAt: z6.number().nullable(),
|
|
2097
|
+
url: z6.string().min(1).nullable()
|
|
2098
|
+
});
|
|
2099
|
+
var queryTasksOutputSchema = z6.union([
|
|
2100
|
+
queryTasksListOutputSchema,
|
|
2101
|
+
queryTasksDetailOutputSchema,
|
|
2102
|
+
agentAdminErrorResultSchema
|
|
2103
|
+
]);
|
|
2104
|
+
var assignTasksOutputSchema = z6.union([
|
|
2105
|
+
withAgentOnlyFields({
|
|
2106
|
+
results: z6.array(statusEntityRowSchema)
|
|
2107
|
+
}),
|
|
2108
|
+
agentAdminErrorResultSchema
|
|
2109
|
+
]);
|
|
2110
|
+
var workspaceUsageEntitySchema = z6.object({
|
|
2111
|
+
workspace: z6.string(),
|
|
2112
|
+
plan: z6.string(),
|
|
2113
|
+
planType: z6.string(),
|
|
2114
|
+
trialState: z6.string(),
|
|
2115
|
+
daysRemaining: z6.number().nullable(),
|
|
2116
|
+
isPaidPro: z6.boolean(),
|
|
2117
|
+
subscriptionStatus: z6.string(),
|
|
2118
|
+
tasksToday: z6.string(),
|
|
2119
|
+
tasksResetAt: z6.string(),
|
|
2120
|
+
openTasks: z6.number(),
|
|
2121
|
+
totalTasks: z6.number(),
|
|
2122
|
+
seats: z6.string(),
|
|
2123
|
+
groups: z6.string(),
|
|
2124
|
+
apiKeys: z6.string(),
|
|
2125
|
+
rateLimitPerSecond: z6.number()
|
|
2126
|
+
});
|
|
2127
|
+
var getWorkspaceUsageOutputSchema = z6.union([
|
|
2128
|
+
withAgentOnlyFields({
|
|
2129
|
+
usage: workspaceUsageEntitySchema
|
|
2130
|
+
}),
|
|
2131
|
+
agentAdminErrorResultSchema
|
|
2132
|
+
]);
|
|
2133
|
+
|
|
1819
2134
|
// src/eve/resume-message.ts
|
|
1820
2135
|
function buildTaskHandledResumeMessage(payload) {
|
|
1821
2136
|
const handledBy = payload.handledBy?.trim() || "someone";
|
|
@@ -1828,18 +2143,18 @@ var ROBOTROCK_READY_HOOK_SLUG = "robotrock-ready";
|
|
|
1828
2143
|
|
|
1829
2144
|
// src/webhook.ts
|
|
1830
2145
|
import { createHmac, timingSafeEqual } from "crypto";
|
|
1831
|
-
import { z as
|
|
2146
|
+
import { z as z7 } from "zod";
|
|
1832
2147
|
var ROBOTROCK_SIGNATURE_HEADER = "x-robotrock-signature";
|
|
1833
|
-
var robotRockWebhookPayloadBodySchema =
|
|
1834
|
-
taskId:
|
|
1835
|
-
action:
|
|
1836
|
-
id:
|
|
1837
|
-
title:
|
|
1838
|
-
data:
|
|
2148
|
+
var robotRockWebhookPayloadBodySchema = z7.object({
|
|
2149
|
+
taskId: z7.string().min(1),
|
|
2150
|
+
action: z7.object({
|
|
2151
|
+
id: z7.string().min(1),
|
|
2152
|
+
title: z7.string().min(1),
|
|
2153
|
+
data: z7.unknown()
|
|
1839
2154
|
}),
|
|
1840
|
-
handledBy:
|
|
1841
|
-
handledAt:
|
|
1842
|
-
handlerType:
|
|
2155
|
+
handledBy: z7.string().min(1).optional(),
|
|
2156
|
+
handledAt: z7.string().min(1),
|
|
2157
|
+
handlerType: z7.string().min(1)
|
|
1843
2158
|
});
|
|
1844
2159
|
var RobotRockWebhookError = class extends Error {
|
|
1845
2160
|
constructor(message, code, details) {
|