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.
- package/README.md +11 -1
- 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 +120 -4
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/trigger.d.ts +3 -3
- package/dist/ai/trigger.js +120 -4
- package/dist/ai/trigger.js.map +1 -1
- package/dist/ai/workflow.d.ts +3 -3
- package/dist/ai/workflow.js +120 -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 -4
- package/dist/eve/agent/index.js +577 -261
- package/dist/eve/agent/index.js.map +1 -1
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +507 -7
- package/dist/eve/index.js.map +1 -1
- package/dist/eve/tools/admin/assign-tasks.d.ts +40 -19
- package/dist/eve/tools/admin/assign-tasks.js +334 -25
- 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 +1365 -0
- package/dist/eve/tools/admin/get-workspace-usage.js.map +1 -0
- package/dist/eve/tools/admin/manage-groups.d.ts +122 -7
- package/dist/eve/tools/admin/manage-groups.js +350 -31
- package/dist/eve/tools/admin/manage-groups.js.map +1 -1
- package/dist/eve/tools/admin/manage-team-members.d.ts +86 -7
- package/dist/eve/tools/admin/manage-team-members.js +318 -16
- package/dist/eve/tools/admin/manage-team-members.js.map +1 -1
- package/dist/eve/tools/admin/query-tasks.d.ts +82 -7
- package/dist/eve/tools/admin/query-tasks.js +363 -40
- 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 +2077 -0
- package/dist/eve/tools/catalog/generate-image.js.map +1 -0
- package/dist/eve/tools/catalog/generate-random-chart.d.ts +77 -0
- package/dist/eve/tools/catalog/generate-random-chart.js +411 -0
- package/dist/eve/tools/catalog/generate-random-chart.js.map +1 -0
- package/dist/eve/tools/catalog/search-products.d.ts +36 -43
- package/dist/eve/tools/catalog/search-products.js +253 -6
- package/dist/eve/tools/catalog/search-products.js.map +1 -1
- package/dist/eve/tools/identity/index.d.ts +2 -1
- package/dist/eve/tools/identity/index.js +26 -6
- package/dist/eve/tools/identity/index.js.map +1 -1
- package/dist/eve/tools/identity/my-access.d.ts +88 -3
- package/dist/eve/tools/identity/my-access.js +26 -6
- 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 +964 -115
- package/dist/eve/tools/index.js.map +1 -1
- package/dist/index-amkHKVGs.d.ts +1054 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +328 -13
- 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-Blq0XoAr.d.ts +0 -204
- package/dist/tool-ui-hint-CMpug5sC.d.ts +0 -13
package/dist/eve/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as ChatToolAuditInput, p as ChatToolAuditPayload, 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, q as EveInputActionSubmission, u as EveInputAuditContext, c as EveInputOption, d as EveInputRequest, e as EveInputRequestDisplay, f as EveInputResponse, F as
|
|
2
|
-
export {
|
|
3
|
-
export { A as ADMIN_MUTATION_REPLY_GUIDANCE, C as CREATE_INBOX_TASK_REPLY_GUIDANCE, D as DEPLOY_RELEASE_REPLY_GUIDANCE, G as GET_WEATHER_REPLY_GUIDANCE, M as MANAGE_GROUPS_DETAIL_REPLY_GUIDANCE,
|
|
4
|
-
import '../client-
|
|
1
|
+
export { C as ChatToolAuditInput, p as ChatToolAuditPayload, 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, q as EveInputActionSubmission, u as EveInputAuditContext, c as EveInputOption, d as EveInputRequest, e as EveInputRequestDisplay, f as EveInputResponse, F as FormatToolChartResultOptions, w as FormatToolListResultOptions, x as FormatToolObjectResultOptions, y as FormatToolQueryResultOptions, G as GroupEntityRow, M as MemberEntityRow, z as MetricPointEntityRow, P as PivotLongFormatToWideChartSeriesArgs, A as ProductEntityRow, R as ROBOTROCK_READY_HOOK_SLUG, S as StatusEntityRow, T as TaskEntityRow, B as ToolChartResult, H as ToolChartResultData, I as ToolChartType, J as ToolDisplayResultOptions, K as agentAdminErrorResultSchema, L as agentAdminMutationResultSchema, N as assignTasksOutputSchema, O as buildChatToolAuditPayload, Q as buildEveInputAuditSubmissionData, j as buildTaskHandledResumeMessage, U as buildTenantGroupUrl, W as buildTenantTaskUrl, k as eveInputRequestTaskType, l as eveInputRequestToActions, X as eveInputResponseToActionSubmission, m as formatEveApprovalTitle, Y as formatToolChartResult, Z as formatToolChartResultFromLong, _ as formatToolListResult, $ as formatToolObjectResult, a0 as formatToolQueryResult, a1 as generateImageOutputSchema, a2 as generateRandomChartOutputSchema, n as getToolDisplayLabel, a3 as getWorkspaceUsageOutputSchema, a4 as groupDetailEntitySchema, a5 as groupEntityRowSchema, a6 as inferToolChartType, a7 as isAgentAdminErrorResult, a8 as isEveApprovalInputRequest, a9 as manageGroupsDetailOutputSchema, aa as manageGroupsListOutputSchema, ab as manageGroupsOutputSchema, ac as manageGroupsSummaryOutputSchema, ad as manageTeamMembersDetailOutputSchema, ae as manageTeamMembersListOutputSchema, af as manageTeamMembersOutputSchema, ag as memberEntityRowSchema, ah as metricPointEntityRowSchema, o as normalizeEveSelectFormData, ai as parseEveAskQuestionToolOutput, aj as pivotLongFormatToWideChartSeries, ak as productEntityRowSchema, al as queryTasksDetailOutputSchema, am as queryTasksListOutputSchema, an as queryTasksOutputSchema, ao as resolveEveFreeformTextToInputResponse, r as resolveEveInputDisplay, ap as sanitizeToolAuditInput, aq as searchProductsOutputSchema, s as setToolDisplayLabelOverrides, ar as shouldAuditToolExecution, as as statusEntityRowSchema, at as taskEntityRowSchema, t as taskHandledToEveInputResponse, au as toolChartResultSchema, av as toolDisplayResult, aw as toolResultUiMetaSchema, ax as workspaceUsageEntitySchema } from '../index-amkHKVGs.js';
|
|
2
|
+
export { c as TOOL_RESULT_UI_ENTITIES, d as TOOL_RESULT_UI_ENTITY_ID_RE, e as TOOL_UI_FIELD, f as TOOL_UI_HINT_FIELD, b as ToolResultUiEntity, g as ToolResultUiLayout, T as ToolResultUiMeta, a as ToolUiHint, h as extractToolResultUiMeta, i as extractToolUiHint, j as isToolResultUiEntity, k as isToolResultUiEntityId, l as isToolUiHint, m as legacyPatternToLayout, u as uiHintToLayout, w as withToolUi, n as withUiHint } from '../tool-result-ui-meta-KT0VafEO.js';
|
|
3
|
+
export { A as ADMIN_MUTATION_REPLY_GUIDANCE, C as CREATE_INBOX_TASK_REPLY_GUIDANCE, D as DEPLOY_RELEASE_REPLY_GUIDANCE, G as GENERATE_IMAGE_REPLY_GUIDANCE, a as GENERATE_RANDOM_CHART_REPLY_GUIDANCE, b as GET_WEATHER_REPLY_GUIDANCE, c as GET_WORKSPACE_USAGE_REPLY_GUIDANCE, M as MANAGE_GROUPS_DETAIL_REPLY_GUIDANCE, d as MANAGE_GROUPS_LIST_REPLY_GUIDANCE, e as MANAGE_TEAM_MEMBERS_DETAIL_REPLY_GUIDANCE, f as MANAGE_TEAM_MEMBERS_LIST_REPLY_GUIDANCE, g as MY_ACCESS_REPLY_GUIDANCE, Q as QUERY_TASKS_DETAIL_REPLY_GUIDANCE, h as QUERY_TASKS_LIST_REPLY_GUIDANCE, R as REFUND_CHARGE_REPLY_GUIDANCE, S as SEARCH_PRODUCTS_REPLY_GUIDANCE, i as TOOL_REPLY_GUIDANCE_FIELD, T as ToolResultWithReplyGuidance, W as WHOAMI_REPLY_GUIDANCE, s as stripAgentOnlyToolFields, w as withReplyGuidance } from '../tool-reply-guidance-CJko9liH.js';
|
|
4
|
+
import '../client-BxbxttFH.js';
|
|
5
5
|
import '../schemas/index.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import '@robotrock/core';
|
package/dist/eve/index.js
CHANGED
|
@@ -463,9 +463,12 @@ var DEFAULT_TOOL_DISPLAY_LABELS = {
|
|
|
463
463
|
whoami: "Who am I",
|
|
464
464
|
create_robotrock_task: "Create a RobotRock task",
|
|
465
465
|
search_products: "Search products",
|
|
466
|
+
generate_random_chart: "Generate random chart",
|
|
467
|
+
generate_image: "Generate image",
|
|
466
468
|
manage_team_members: "Manage team members",
|
|
467
469
|
manage_groups: "Manage groups",
|
|
468
|
-
query_tasks: "Query tasks"
|
|
470
|
+
query_tasks: "Query tasks",
|
|
471
|
+
get_workspace_usage: "Get workspace usage"
|
|
469
472
|
};
|
|
470
473
|
var toolDisplayLabelOverrides = {};
|
|
471
474
|
function setToolDisplayLabelOverrides(overrides) {
|
|
@@ -518,12 +521,113 @@ function extractToolUiHint(output) {
|
|
|
518
521
|
return isToolUiHint(hint) ? hint : void 0;
|
|
519
522
|
}
|
|
520
523
|
|
|
524
|
+
// src/eve/tool-result-ui-meta.ts
|
|
525
|
+
var TOOL_UI_FIELD = "ui";
|
|
526
|
+
var TOOL_RESULT_UI_ENTITY_ID_RE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
527
|
+
var TOOL_RESULT_UI_ENTITIES = [
|
|
528
|
+
"product",
|
|
529
|
+
"member",
|
|
530
|
+
"task",
|
|
531
|
+
"group",
|
|
532
|
+
"status",
|
|
533
|
+
"object"
|
|
534
|
+
];
|
|
535
|
+
function isToolResultUiEntityId(value) {
|
|
536
|
+
return typeof value === "string" && TOOL_RESULT_UI_ENTITY_ID_RE.test(value);
|
|
537
|
+
}
|
|
538
|
+
function isToolResultUiEntity(value) {
|
|
539
|
+
return isToolResultUiEntityId(value);
|
|
540
|
+
}
|
|
541
|
+
function uiHintToLayout(hint) {
|
|
542
|
+
return hint;
|
|
543
|
+
}
|
|
544
|
+
function legacyPatternToLayout(pattern) {
|
|
545
|
+
switch (pattern) {
|
|
546
|
+
case "chart":
|
|
547
|
+
return "chart";
|
|
548
|
+
case "table":
|
|
549
|
+
return "table";
|
|
550
|
+
case "list":
|
|
551
|
+
case "query":
|
|
552
|
+
return "list";
|
|
553
|
+
default:
|
|
554
|
+
return void 0;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function readPresent(value) {
|
|
558
|
+
return typeof value === "boolean" ? value : void 0;
|
|
559
|
+
}
|
|
560
|
+
function readRowsPath(value) {
|
|
561
|
+
if (typeof value !== "string") {
|
|
562
|
+
return void 0;
|
|
563
|
+
}
|
|
564
|
+
const trimmed = value.trim();
|
|
565
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
566
|
+
}
|
|
567
|
+
function readEntity(value) {
|
|
568
|
+
if (!isToolResultUiEntityId(value)) {
|
|
569
|
+
return void 0;
|
|
570
|
+
}
|
|
571
|
+
return value;
|
|
572
|
+
}
|
|
573
|
+
function extractToolResultUiMeta(output) {
|
|
574
|
+
if (typeof output !== "object" || output === null || Array.isArray(output)) {
|
|
575
|
+
return void 0;
|
|
576
|
+
}
|
|
577
|
+
const record = output;
|
|
578
|
+
const rawUi = record[TOOL_UI_FIELD];
|
|
579
|
+
const meta = {};
|
|
580
|
+
if (typeof rawUi === "object" && rawUi !== null && !Array.isArray(rawUi)) {
|
|
581
|
+
const ui = rawUi;
|
|
582
|
+
const present = readPresent(ui.present);
|
|
583
|
+
if (present !== void 0) {
|
|
584
|
+
meta.present = present;
|
|
585
|
+
}
|
|
586
|
+
const entity = readEntity(ui.entity);
|
|
587
|
+
if (entity) {
|
|
588
|
+
meta.entity = entity;
|
|
589
|
+
}
|
|
590
|
+
const rowsPath = readRowsPath(ui.rowsPath);
|
|
591
|
+
if (rowsPath) {
|
|
592
|
+
meta.rowsPath = rowsPath;
|
|
593
|
+
}
|
|
594
|
+
if (isToolUiHint(ui.layout)) {
|
|
595
|
+
meta.layout = ui.layout;
|
|
596
|
+
} else if (typeof ui.pattern === "string") {
|
|
597
|
+
const fromPattern = legacyPatternToLayout(ui.pattern);
|
|
598
|
+
if (fromPattern) {
|
|
599
|
+
meta.layout = fromPattern;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (!meta.layout && isToolUiHint(record.uiHint)) {
|
|
604
|
+
meta.layout = uiHintToLayout(record.uiHint);
|
|
605
|
+
}
|
|
606
|
+
if (meta.present === void 0 && meta.entity === void 0 && meta.rowsPath === void 0 && meta.layout === void 0) {
|
|
607
|
+
return void 0;
|
|
608
|
+
}
|
|
609
|
+
return meta;
|
|
610
|
+
}
|
|
611
|
+
function withToolUi(result, ui) {
|
|
612
|
+
const existing = typeof result[TOOL_UI_FIELD] === "object" && result[TOOL_UI_FIELD] !== null && !Array.isArray(result[TOOL_UI_FIELD]) ? result[TOOL_UI_FIELD] : {};
|
|
613
|
+
return {
|
|
614
|
+
...result,
|
|
615
|
+
[TOOL_UI_FIELD]: {
|
|
616
|
+
...existing,
|
|
617
|
+
...ui
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
|
|
521
622
|
// src/eve/tool-reply-guidance.ts
|
|
522
623
|
var TOOL_REPLY_GUIDANCE_FIELD = "replyGuidance";
|
|
523
624
|
var WHOAMI_REPLY_GUIDANCE = "The dashboard shows a profile card with name, email, workspace, role, and groups. Do not restate those in your reply. Only add context not in the card (e.g. permissions, refund approval rules, missing group membership).";
|
|
524
|
-
var MY_ACCESS_REPLY_GUIDANCE = "Access details may render in chat UI. Do not restate role, groups, or admin capabilities if already visible. Only explain what the user can or cannot do for their question (e.g. finance group required for refunds \u2265 $10,000). When access.tenantAdmin is false and the user needs manageTeam, manageGroups,
|
|
625
|
+
var MY_ACCESS_REPLY_GUIDANCE = "Access details may render in chat UI. Do not restate role, groups, or admin capabilities if already visible. Only explain what the user can or cannot do for their question (e.g. finance group required for refunds \u2265 $10,000). When access.tenantAdmin is false and the user needs manageTeam, manageGroups, query-tasks, or workspace-usage capabilities, explain briefly then call ask_question to offer sending an admin request to tenant admins \u2014 do not tell them to find an admin manually without offering delegation first.";
|
|
626
|
+
var GET_WORKSPACE_USAGE_REPLY_GUIDANCE = "Workspace plan and usage render as a card in chat. Do not restate plan name, task counts, seats, groups, API keys, or rate limits from the card. Only add context not shown (e.g. upgrade options, that LLM token/cost meters are not tracked, or next steps). Never invent token or dollar spend numbers.";
|
|
525
627
|
var CREATE_INBOX_TASK_REPLY_GUIDANCE = "A task card shows title, assignee, and inbox status in chat. Do not restate task ID, assignee, or delegation details from the card. Only mention next steps or answer the user's question.";
|
|
526
628
|
var SEARCH_PRODUCTS_REPLY_GUIDANCE = "Product results render as a list card in chat. Do not restate product names, prices, or SKUs. Only add context not in the list (e.g. no matches, recommendations).";
|
|
629
|
+
var GENERATE_RANDOM_CHART_REPLY_GUIDANCE = "Chart metrics render as a chart card in chat. Do not restate series values, dates, or categories from the chart. Only add brief context (e.g. that this is demo data).";
|
|
630
|
+
var GENERATE_IMAGE_REPLY_GUIDANCE = "The generated image renders in chat UI. Do not describe the image pixels or restate the prompt. Only add a short acknowledgement or next-step question if useful.";
|
|
527
631
|
var MANAGE_TEAM_MEMBERS_LIST_REPLY_GUIDANCE = "Team members render as a list card in chat. Do not restate names, emails, or roles from the list. Only add context not shown (e.g. duplicates, next admin actions).";
|
|
528
632
|
var MANAGE_TEAM_MEMBERS_DETAIL_REPLY_GUIDANCE = "Team member details render in chat UI. Do not restate name, email, or role from the card. Only add next steps or policy context.";
|
|
529
633
|
var MANAGE_GROUPS_LIST_REPLY_GUIDANCE = "Groups render as a list card in chat. Do not restate group names, slugs, or descriptions from the list. Use slug (not internal id) for get, update, delete, and membership actions. Only add context not shown.";
|
|
@@ -547,27 +651,377 @@ function stripAgentOnlyToolFields(output) {
|
|
|
547
651
|
const record = { ...output };
|
|
548
652
|
delete record[TOOL_REPLY_GUIDANCE_FIELD];
|
|
549
653
|
delete record[TOOL_UI_HINT_FIELD];
|
|
654
|
+
delete record[TOOL_UI_FIELD];
|
|
550
655
|
return record;
|
|
551
656
|
}
|
|
552
657
|
|
|
553
658
|
// src/eve/tool-display-format.ts
|
|
554
659
|
function formatToolObjectResult(data, options) {
|
|
555
|
-
|
|
660
|
+
let result = withReplyGuidance(
|
|
661
|
+
data,
|
|
662
|
+
options.replyGuidance
|
|
663
|
+
);
|
|
664
|
+
if (options.ui) {
|
|
665
|
+
result = withToolUi(result, options.ui);
|
|
666
|
+
}
|
|
556
667
|
if (options.uiHint) {
|
|
557
|
-
|
|
668
|
+
result = withUiHint(result, options.uiHint);
|
|
558
669
|
}
|
|
559
|
-
return
|
|
670
|
+
return result;
|
|
560
671
|
}
|
|
561
672
|
function formatToolListResult(listKey, items, options) {
|
|
673
|
+
const ui = {
|
|
674
|
+
...options.ui,
|
|
675
|
+
layout: "list",
|
|
676
|
+
rowsPath: listKey,
|
|
677
|
+
...options.entity ? { entity: options.entity } : {},
|
|
678
|
+
...options.present !== void 0 ? { present: options.present } : {}
|
|
679
|
+
};
|
|
562
680
|
return withUiHint(
|
|
563
|
-
|
|
681
|
+
withToolUi(
|
|
682
|
+
withReplyGuidance({ [listKey]: items }, options.replyGuidance),
|
|
683
|
+
ui
|
|
684
|
+
),
|
|
564
685
|
"list"
|
|
565
686
|
);
|
|
566
687
|
}
|
|
688
|
+
function formatToolQueryResult(meta, rows, options) {
|
|
689
|
+
const rowsPath = options.rowsPath ?? options.ui?.rowsPath ?? "rows";
|
|
690
|
+
const ui = {
|
|
691
|
+
...options.ui,
|
|
692
|
+
layout: options.ui?.layout ?? "list",
|
|
693
|
+
rowsPath,
|
|
694
|
+
...options.entity ? { entity: options.entity } : {},
|
|
695
|
+
...options.present !== void 0 ? { present: options.present } : {}
|
|
696
|
+
};
|
|
697
|
+
return withToolUi(
|
|
698
|
+
withReplyGuidance(
|
|
699
|
+
{
|
|
700
|
+
...meta,
|
|
701
|
+
[rowsPath]: rows
|
|
702
|
+
},
|
|
703
|
+
options.replyGuidance
|
|
704
|
+
),
|
|
705
|
+
ui
|
|
706
|
+
);
|
|
707
|
+
}
|
|
567
708
|
function isAgentAdminErrorResult(result) {
|
|
568
709
|
return typeof result === "object" && result !== null && result.ok === false && typeof result.message === "string";
|
|
569
710
|
}
|
|
570
711
|
|
|
712
|
+
// src/eve/tool-chart-format.ts
|
|
713
|
+
var TIME_X_AXIS_KEY_PATTERN = /^(date|time|timestamp|month|day|week|period)$/i;
|
|
714
|
+
var MAX_SERIES_DEFAULT = 20;
|
|
715
|
+
function isNumericValue(value) {
|
|
716
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
717
|
+
}
|
|
718
|
+
function isNonEmptyString(value) {
|
|
719
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
720
|
+
}
|
|
721
|
+
function inferToolChartType(xKey) {
|
|
722
|
+
return TIME_X_AXIS_KEY_PATTERN.test(xKey) ? "line" : "bar";
|
|
723
|
+
}
|
|
724
|
+
function pivotLongFormatToWideChartSeries(args) {
|
|
725
|
+
const maxSeries = args.maxSeries ?? MAX_SERIES_DEFAULT;
|
|
726
|
+
const yKeys = [];
|
|
727
|
+
const seen = /* @__PURE__ */ new Set();
|
|
728
|
+
const byX = /* @__PURE__ */ new Map();
|
|
729
|
+
const xOrder = [];
|
|
730
|
+
for (const row of args.rows) {
|
|
731
|
+
const xRaw = row[args.xKey];
|
|
732
|
+
const seriesRaw = row[args.seriesKey];
|
|
733
|
+
const valueRaw = row[args.valueKey];
|
|
734
|
+
if (xRaw == null || xRaw === "") {
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
if (!isNonEmptyString(seriesRaw) || !isNumericValue(valueRaw)) {
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
const seriesValue = seriesRaw.trim();
|
|
741
|
+
if (!seen.has(seriesValue)) {
|
|
742
|
+
if (yKeys.length >= maxSeries) {
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
seen.add(seriesValue);
|
|
746
|
+
yKeys.push(seriesValue);
|
|
747
|
+
}
|
|
748
|
+
const xValue = String(xRaw);
|
|
749
|
+
let point = byX.get(xValue);
|
|
750
|
+
if (!point) {
|
|
751
|
+
point = {
|
|
752
|
+
[args.xKey]: typeof xRaw === "number" ? xRaw : xValue
|
|
753
|
+
};
|
|
754
|
+
byX.set(xValue, point);
|
|
755
|
+
xOrder.push(xValue);
|
|
756
|
+
}
|
|
757
|
+
point[seriesValue] = valueRaw;
|
|
758
|
+
}
|
|
759
|
+
return {
|
|
760
|
+
yKeys,
|
|
761
|
+
series: xOrder.map((x) => byX.get(x))
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
function formatToolChartResult(chart, options) {
|
|
765
|
+
if (!chart.xKey.trim()) {
|
|
766
|
+
throw new Error("formatToolChartResult: xKey is required");
|
|
767
|
+
}
|
|
768
|
+
const yKeys = chart.yKeys.map((key) => key.trim()).filter((key) => key.length > 0);
|
|
769
|
+
if (yKeys.length === 0) {
|
|
770
|
+
throw new Error("formatToolChartResult: yKeys must include at least one series key");
|
|
771
|
+
}
|
|
772
|
+
const data = {
|
|
773
|
+
...chart.title?.trim() ? { title: chart.title.trim() } : {},
|
|
774
|
+
...chart.description?.trim() ? { description: chart.description.trim() } : {},
|
|
775
|
+
type: chart.type ?? inferToolChartType(chart.xKey),
|
|
776
|
+
xKey: chart.xKey.trim(),
|
|
777
|
+
yKeys,
|
|
778
|
+
series: chart.series.map((row) => ({ ...row }))
|
|
779
|
+
};
|
|
780
|
+
const ui = {
|
|
781
|
+
...options.ui,
|
|
782
|
+
layout: "chart",
|
|
783
|
+
rowsPath: "series",
|
|
784
|
+
entity: options.entity ?? options.ui?.entity ?? "metric_point",
|
|
785
|
+
present: options.present ?? options.ui?.present ?? true
|
|
786
|
+
};
|
|
787
|
+
return withUiHint(
|
|
788
|
+
withToolUi(withReplyGuidance(data, options.replyGuidance), ui),
|
|
789
|
+
"chart"
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
function formatToolChartResultFromLong(input, options) {
|
|
793
|
+
const pivoted = pivotLongFormatToWideChartSeries({
|
|
794
|
+
rows: input.rows,
|
|
795
|
+
xKey: input.xKey,
|
|
796
|
+
seriesKey: input.seriesKey,
|
|
797
|
+
valueKey: input.valueKey,
|
|
798
|
+
maxSeries: input.maxSeries
|
|
799
|
+
});
|
|
800
|
+
if (pivoted.yKeys.length === 0) {
|
|
801
|
+
throw new Error(
|
|
802
|
+
"formatToolChartResultFromLong: no series values found after pivot"
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
return formatToolChartResult(
|
|
806
|
+
{
|
|
807
|
+
title: input.title,
|
|
808
|
+
description: input.description,
|
|
809
|
+
type: input.type,
|
|
810
|
+
xKey: input.xKey,
|
|
811
|
+
yKeys: pivoted.yKeys,
|
|
812
|
+
series: pivoted.series
|
|
813
|
+
},
|
|
814
|
+
options
|
|
815
|
+
);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// src/eve/entity-schemas.ts
|
|
819
|
+
import { z } from "zod";
|
|
820
|
+
function buildTenantTaskUrl(tenantSlug, task) {
|
|
821
|
+
const q = new URLSearchParams();
|
|
822
|
+
if (task.app && task.app !== "default") {
|
|
823
|
+
q.set("app", task.app);
|
|
824
|
+
}
|
|
825
|
+
if (task.type?.trim()) {
|
|
826
|
+
q.set("type", task.type.trim());
|
|
827
|
+
}
|
|
828
|
+
q.set("selected", task.id);
|
|
829
|
+
return `/${tenantSlug}/inbox?${q.toString()}`;
|
|
830
|
+
}
|
|
831
|
+
function buildTenantGroupUrl(tenantSlug, slug) {
|
|
832
|
+
return `/${tenantSlug}/team/groups/${slug}`;
|
|
833
|
+
}
|
|
834
|
+
var toolResultUiMetaSchema = z.object({
|
|
835
|
+
present: z.boolean().optional(),
|
|
836
|
+
entity: z.string().regex(TOOL_RESULT_UI_ENTITY_ID_RE).optional(),
|
|
837
|
+
rowsPath: z.string().min(1).optional(),
|
|
838
|
+
layout: z.enum(["list", "chart", "table"]).optional()
|
|
839
|
+
}).strict();
|
|
840
|
+
var agentOnlyFields = {
|
|
841
|
+
replyGuidance: z.string().optional(),
|
|
842
|
+
ui: toolResultUiMetaSchema.optional(),
|
|
843
|
+
uiHint: z.enum(["list", "chart", "table"]).optional()
|
|
844
|
+
};
|
|
845
|
+
function withAgentOnlyFields(shape) {
|
|
846
|
+
return z.object({
|
|
847
|
+
...shape,
|
|
848
|
+
...agentOnlyFields
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
var productEntityRowSchema = z.object({
|
|
852
|
+
id: z.string().min(1),
|
|
853
|
+
name: z.string().min(1),
|
|
854
|
+
price: z.number(),
|
|
855
|
+
currency: z.string().min(1),
|
|
856
|
+
inStock: z.boolean(),
|
|
857
|
+
url: z.string().min(1)
|
|
858
|
+
});
|
|
859
|
+
var metricPointEntityRowSchema = z.object({
|
|
860
|
+
date: z.string().optional().describe("X-axis value when xKey is date/time"),
|
|
861
|
+
category: z.string().optional().describe("X-axis value when xKey is category"),
|
|
862
|
+
label: z.string().optional().describe("X-axis value when xKey is label")
|
|
863
|
+
}).catchall(z.union([z.string(), z.number()])).describe(
|
|
864
|
+
"Wide chart point: x-axis field + numeric columns named by yKeys (one series per column)"
|
|
865
|
+
);
|
|
866
|
+
var toolChartResultSchema = withAgentOnlyFields({
|
|
867
|
+
title: z.string().min(1).optional().describe("Chart title shown above the plot"),
|
|
868
|
+
description: z.string().min(1).optional().describe("Optional short subtitle"),
|
|
869
|
+
type: z.enum(["line", "bar", "area"]).describe("TRL/shadcn chart variant (time series \u2192 line, categories \u2192 bar)"),
|
|
870
|
+
xKey: z.string().min(1).describe('Field on each series row for the x-axis, e.g. "date" or "category"'),
|
|
871
|
+
yKeys: z.array(z.string().min(1)).min(1).describe(
|
|
872
|
+
'Numeric series column names on each row, e.g. ["NL","BE"] or ["created","handled"]'
|
|
873
|
+
),
|
|
874
|
+
series: z.array(metricPointEntityRowSchema).describe(
|
|
875
|
+
"Wide-format points only \u2014 one object per x value with yKeys as numeric fields"
|
|
876
|
+
)
|
|
877
|
+
});
|
|
878
|
+
var memberEntityRowSchema = z.object({
|
|
879
|
+
name: z.string(),
|
|
880
|
+
email: z.string(),
|
|
881
|
+
role: z.string(),
|
|
882
|
+
membershipKind: z.string(),
|
|
883
|
+
profilePictureUrl: z.string().nullable()
|
|
884
|
+
});
|
|
885
|
+
var taskEntityRowSchema = z.object({
|
|
886
|
+
id: z.string().min(1),
|
|
887
|
+
name: z.string().min(1),
|
|
888
|
+
status: z.string().min(1),
|
|
889
|
+
type: z.string().nullable(),
|
|
890
|
+
description: z.string().nullable(),
|
|
891
|
+
validUntil: z.number(),
|
|
892
|
+
createdAt: z.number(),
|
|
893
|
+
url: z.string().min(1),
|
|
894
|
+
threadPriority: z.string().nullable().optional()
|
|
895
|
+
});
|
|
896
|
+
var groupEntityRowSchema = z.object({
|
|
897
|
+
name: z.string().min(1),
|
|
898
|
+
slug: z.string().min(1),
|
|
899
|
+
description: z.string().nullable(),
|
|
900
|
+
memberCount: z.number().nullable(),
|
|
901
|
+
url: z.string().min(1)
|
|
902
|
+
});
|
|
903
|
+
var groupDetailEntitySchema = z.object({
|
|
904
|
+
name: z.string().min(1),
|
|
905
|
+
slug: z.string().min(1),
|
|
906
|
+
description: z.string().nullable(),
|
|
907
|
+
url: z.string().min(1),
|
|
908
|
+
members: z.array(
|
|
909
|
+
z.object({
|
|
910
|
+
name: z.string(),
|
|
911
|
+
email: z.string(),
|
|
912
|
+
profilePictureUrl: z.string().nullable()
|
|
913
|
+
})
|
|
914
|
+
)
|
|
915
|
+
});
|
|
916
|
+
var statusEntityRowSchema = z.object({
|
|
917
|
+
id: z.string().min(1),
|
|
918
|
+
name: z.string().min(1),
|
|
919
|
+
status: z.string().min(1),
|
|
920
|
+
url: z.string().min(1),
|
|
921
|
+
type: z.string().nullable().optional(),
|
|
922
|
+
description: z.string().nullable().optional()
|
|
923
|
+
});
|
|
924
|
+
var agentAdminErrorResultSchema = z.object({
|
|
925
|
+
ok: z.literal(false),
|
|
926
|
+
status: z.number().optional(),
|
|
927
|
+
message: z.string(),
|
|
928
|
+
response: z.unknown().optional()
|
|
929
|
+
});
|
|
930
|
+
var agentAdminMutationResultSchema = z.object({
|
|
931
|
+
...agentOnlyFields
|
|
932
|
+
}).passthrough();
|
|
933
|
+
var searchProductsOutputSchema = withAgentOnlyFields({
|
|
934
|
+
items: z.array(productEntityRowSchema)
|
|
935
|
+
});
|
|
936
|
+
var generateRandomChartOutputSchema = toolChartResultSchema.extend({
|
|
937
|
+
title: z.string().min(1)
|
|
938
|
+
});
|
|
939
|
+
var generateImageOutputSchema = withAgentOnlyFields({
|
|
940
|
+
prompt: z.string().min(1),
|
|
941
|
+
mediaType: z.string().min(1),
|
|
942
|
+
model: z.string().min(1),
|
|
943
|
+
storageId: z.string().min(1),
|
|
944
|
+
url: z.string().min(1),
|
|
945
|
+
/** @deprecated Legacy sessions only — prefer storageId/url. */
|
|
946
|
+
base64: z.string().min(1).optional()
|
|
947
|
+
});
|
|
948
|
+
var manageTeamMembersListOutputSchema = withAgentOnlyFields({
|
|
949
|
+
members: z.array(memberEntityRowSchema)
|
|
950
|
+
});
|
|
951
|
+
var manageTeamMembersDetailOutputSchema = withAgentOnlyFields(
|
|
952
|
+
memberEntityRowSchema.shape
|
|
953
|
+
);
|
|
954
|
+
var manageTeamMembersOutputSchema = z.union([
|
|
955
|
+
manageTeamMembersListOutputSchema,
|
|
956
|
+
manageTeamMembersDetailOutputSchema,
|
|
957
|
+
agentAdminMutationResultSchema,
|
|
958
|
+
agentAdminErrorResultSchema
|
|
959
|
+
]);
|
|
960
|
+
var manageGroupsListOutputSchema = withAgentOnlyFields({
|
|
961
|
+
groups: z.array(groupEntityRowSchema)
|
|
962
|
+
});
|
|
963
|
+
var manageGroupsDetailOutputSchema = withAgentOnlyFields(
|
|
964
|
+
groupDetailEntitySchema.shape
|
|
965
|
+
);
|
|
966
|
+
var manageGroupsSummaryOutputSchema = withAgentOnlyFields(
|
|
967
|
+
groupEntityRowSchema.shape
|
|
968
|
+
);
|
|
969
|
+
var manageGroupsOutputSchema = z.union([
|
|
970
|
+
manageGroupsListOutputSchema,
|
|
971
|
+
manageGroupsDetailOutputSchema,
|
|
972
|
+
manageGroupsSummaryOutputSchema,
|
|
973
|
+
agentAdminMutationResultSchema,
|
|
974
|
+
agentAdminErrorResultSchema
|
|
975
|
+
]);
|
|
976
|
+
var queryTasksListOutputSchema = withAgentOnlyFields({
|
|
977
|
+
items: z.array(taskEntityRowSchema),
|
|
978
|
+
nextCursor: z.string().nullable().optional()
|
|
979
|
+
});
|
|
980
|
+
var queryTasksDetailOutputSchema = withAgentOnlyFields({
|
|
981
|
+
id: z.string().nullable(),
|
|
982
|
+
status: z.string().nullable(),
|
|
983
|
+
type: z.string().nullable(),
|
|
984
|
+
name: z.string().nullable(),
|
|
985
|
+
description: z.string().nullable(),
|
|
986
|
+
validUntil: z.number().nullable(),
|
|
987
|
+
createdAt: z.number().nullable(),
|
|
988
|
+
url: z.string().min(1).nullable()
|
|
989
|
+
});
|
|
990
|
+
var queryTasksOutputSchema = z.union([
|
|
991
|
+
queryTasksListOutputSchema,
|
|
992
|
+
queryTasksDetailOutputSchema,
|
|
993
|
+
agentAdminErrorResultSchema
|
|
994
|
+
]);
|
|
995
|
+
var assignTasksOutputSchema = z.union([
|
|
996
|
+
withAgentOnlyFields({
|
|
997
|
+
results: z.array(statusEntityRowSchema)
|
|
998
|
+
}),
|
|
999
|
+
agentAdminErrorResultSchema
|
|
1000
|
+
]);
|
|
1001
|
+
var workspaceUsageEntitySchema = z.object({
|
|
1002
|
+
workspace: z.string(),
|
|
1003
|
+
plan: z.string(),
|
|
1004
|
+
planType: z.string(),
|
|
1005
|
+
trialState: z.string(),
|
|
1006
|
+
daysRemaining: z.number().nullable(),
|
|
1007
|
+
isPaidPro: z.boolean(),
|
|
1008
|
+
subscriptionStatus: z.string(),
|
|
1009
|
+
tasksToday: z.string(),
|
|
1010
|
+
tasksResetAt: z.string(),
|
|
1011
|
+
openTasks: z.number(),
|
|
1012
|
+
totalTasks: z.number(),
|
|
1013
|
+
seats: z.string(),
|
|
1014
|
+
groups: z.string(),
|
|
1015
|
+
apiKeys: z.string(),
|
|
1016
|
+
rateLimitPerSecond: z.number()
|
|
1017
|
+
});
|
|
1018
|
+
var getWorkspaceUsageOutputSchema = z.union([
|
|
1019
|
+
withAgentOnlyFields({
|
|
1020
|
+
usage: workspaceUsageEntitySchema
|
|
1021
|
+
}),
|
|
1022
|
+
agentAdminErrorResultSchema
|
|
1023
|
+
]);
|
|
1024
|
+
|
|
571
1025
|
// src/eve/resume-message.ts
|
|
572
1026
|
function buildTaskHandledResumeMessage(payload) {
|
|
573
1027
|
const handledBy = payload.handledBy?.trim() || "someone";
|
|
@@ -585,7 +1039,10 @@ export {
|
|
|
585
1039
|
EVE_INPUT_OTHER_CHOICE_ID,
|
|
586
1040
|
EVE_INPUT_OTHER_CHOICE_LABEL,
|
|
587
1041
|
EVE_INPUT_SUBMIT_ACTION_ID,
|
|
1042
|
+
GENERATE_IMAGE_REPLY_GUIDANCE,
|
|
1043
|
+
GENERATE_RANDOM_CHART_REPLY_GUIDANCE,
|
|
588
1044
|
GET_WEATHER_REPLY_GUIDANCE,
|
|
1045
|
+
GET_WORKSPACE_USAGE_REPLY_GUIDANCE,
|
|
589
1046
|
MANAGE_GROUPS_DETAIL_REPLY_GUIDANCE,
|
|
590
1047
|
MANAGE_GROUPS_LIST_REPLY_GUIDANCE,
|
|
591
1048
|
MANAGE_TEAM_MEMBERS_DETAIL_REPLY_GUIDANCE,
|
|
@@ -597,33 +1054,76 @@ export {
|
|
|
597
1054
|
ROBOTROCK_READY_HOOK_SLUG,
|
|
598
1055
|
SEARCH_PRODUCTS_REPLY_GUIDANCE,
|
|
599
1056
|
TOOL_REPLY_GUIDANCE_FIELD,
|
|
1057
|
+
TOOL_RESULT_UI_ENTITIES,
|
|
1058
|
+
TOOL_RESULT_UI_ENTITY_ID_RE,
|
|
1059
|
+
TOOL_UI_FIELD,
|
|
600
1060
|
TOOL_UI_HINT_FIELD,
|
|
601
1061
|
WHOAMI_REPLY_GUIDANCE,
|
|
1062
|
+
agentAdminErrorResultSchema,
|
|
1063
|
+
agentAdminMutationResultSchema,
|
|
1064
|
+
assignTasksOutputSchema,
|
|
602
1065
|
buildChatToolAuditPayload,
|
|
603
1066
|
buildEveInputAuditSubmissionData,
|
|
604
1067
|
buildTaskHandledResumeMessage,
|
|
1068
|
+
buildTenantGroupUrl,
|
|
1069
|
+
buildTenantTaskUrl,
|
|
605
1070
|
eveInputRequestTaskType,
|
|
606
1071
|
eveInputRequestToActions,
|
|
607
1072
|
eveInputResponseToActionSubmission,
|
|
1073
|
+
extractToolResultUiMeta,
|
|
608
1074
|
extractToolUiHint,
|
|
609
1075
|
formatEveApprovalTitle,
|
|
1076
|
+
formatToolChartResult,
|
|
1077
|
+
formatToolChartResultFromLong,
|
|
610
1078
|
formatToolListResult,
|
|
611
1079
|
formatToolObjectResult,
|
|
1080
|
+
formatToolQueryResult,
|
|
1081
|
+
generateImageOutputSchema,
|
|
1082
|
+
generateRandomChartOutputSchema,
|
|
612
1083
|
getToolDisplayLabel,
|
|
1084
|
+
getWorkspaceUsageOutputSchema,
|
|
1085
|
+
groupDetailEntitySchema,
|
|
1086
|
+
groupEntityRowSchema,
|
|
1087
|
+
inferToolChartType,
|
|
613
1088
|
isAgentAdminErrorResult,
|
|
614
1089
|
isEveApprovalInputRequest,
|
|
1090
|
+
isToolResultUiEntity,
|
|
1091
|
+
isToolResultUiEntityId,
|
|
615
1092
|
isToolUiHint,
|
|
1093
|
+
legacyPatternToLayout,
|
|
1094
|
+
manageGroupsDetailOutputSchema,
|
|
1095
|
+
manageGroupsListOutputSchema,
|
|
1096
|
+
manageGroupsOutputSchema,
|
|
1097
|
+
manageGroupsSummaryOutputSchema,
|
|
1098
|
+
manageTeamMembersDetailOutputSchema,
|
|
1099
|
+
manageTeamMembersListOutputSchema,
|
|
1100
|
+
manageTeamMembersOutputSchema,
|
|
1101
|
+
memberEntityRowSchema,
|
|
1102
|
+
metricPointEntityRowSchema,
|
|
616
1103
|
normalizeEveSelectFormData,
|
|
617
1104
|
parseEveAskQuestionToolOutput,
|
|
1105
|
+
pivotLongFormatToWideChartSeries,
|
|
1106
|
+
productEntityRowSchema,
|
|
1107
|
+
queryTasksDetailOutputSchema,
|
|
1108
|
+
queryTasksListOutputSchema,
|
|
1109
|
+
queryTasksOutputSchema,
|
|
618
1110
|
resolveEveFreeformTextToInputResponse,
|
|
619
1111
|
resolveEveInputDisplay,
|
|
620
1112
|
sanitizeToolAuditInput,
|
|
1113
|
+
searchProductsOutputSchema,
|
|
621
1114
|
setToolDisplayLabelOverrides,
|
|
622
1115
|
shouldAuditToolExecution,
|
|
1116
|
+
statusEntityRowSchema,
|
|
623
1117
|
stripAgentOnlyToolFields,
|
|
1118
|
+
taskEntityRowSchema,
|
|
624
1119
|
taskHandledToEveInputResponse,
|
|
1120
|
+
toolChartResultSchema,
|
|
625
1121
|
toolDisplayResult,
|
|
1122
|
+
toolResultUiMetaSchema,
|
|
1123
|
+
uiHintToLayout,
|
|
626
1124
|
withReplyGuidance,
|
|
627
|
-
|
|
1125
|
+
withToolUi,
|
|
1126
|
+
withUiHint,
|
|
1127
|
+
workspaceUsageEntitySchema
|
|
628
1128
|
};
|
|
629
1129
|
//# sourceMappingURL=index.js.map
|