robotrock 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-admin.d.ts +82 -0
- package/dist/agent-admin.js +938 -0
- package/dist/agent-admin.js.map +1 -0
- package/dist/ai/index.d.ts +6 -5
- package/dist/ai/index.js +407 -188
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/trigger.d.ts +4 -3
- package/dist/ai/trigger.js +407 -188
- package/dist/ai/trigger.js.map +1 -1
- package/dist/ai/workflow.d.ts +4 -3
- package/dist/ai/workflow.js +404 -185
- package/dist/ai/workflow.js.map +1 -1
- package/dist/auth-headers-qL-ZeEtd.d.ts +13 -0
- package/dist/{client-XTnFHGFE.d.ts → client-YO9Y1rkH.d.ts} +29 -17
- package/dist/eve/agent/index.d.ts +11 -35
- package/dist/eve/agent/index.js +678 -146
- package/dist/eve/agent/index.js.map +1 -1
- package/dist/eve/index.d.ts +5 -2
- package/dist/eve/index.js +195 -2
- package/dist/eve/index.js.map +1 -1
- package/dist/eve/tools/admin/assign-tasks.d.ts +39 -0
- package/dist/eve/tools/admin/assign-tasks.js +1060 -0
- package/dist/eve/tools/admin/assign-tasks.js.map +1 -0
- package/dist/eve/tools/admin/manage-groups.d.ts +53 -0
- package/dist/eve/tools/admin/manage-groups.js +1218 -0
- package/dist/eve/tools/admin/manage-groups.js.map +1 -0
- package/dist/eve/tools/admin/manage-team-members.d.ts +45 -0
- package/dist/eve/tools/admin/manage-team-members.js +1160 -0
- package/dist/eve/tools/admin/manage-team-members.js.map +1 -0
- package/dist/eve/tools/admin/query-tasks.d.ts +71 -0
- package/dist/eve/tools/admin/query-tasks.js +1161 -0
- package/dist/eve/tools/admin/query-tasks.js.map +1 -0
- package/dist/eve/tools/catalog/search-products.d.ts +57 -0
- package/dist/eve/tools/catalog/search-products.js +94 -0
- package/dist/eve/tools/catalog/search-products.js.map +1 -0
- package/dist/eve/tools/identity/index.d.ts +2 -0
- package/dist/eve/tools/identity/index.js +117 -27
- package/dist/eve/tools/identity/index.js.map +1 -1
- package/dist/eve/tools/identity/my-access.d.ts +6 -46
- package/dist/eve/tools/identity/my-access.js +91 -10
- package/dist/eve/tools/identity/my-access.js.map +1 -1
- package/dist/eve/tools/identity/whoami.d.ts +7 -8
- package/dist/eve/tools/identity/whoami.js +33 -17
- package/dist/eve/tools/identity/whoami.js.map +1 -1
- package/dist/eve/tools/inbox/create-task.d.ts +5 -4
- package/dist/eve/tools/inbox/create-task.js +365 -137
- package/dist/eve/tools/inbox/create-task.js.map +1 -1
- package/dist/eve/tools/inbox/index.d.ts +1 -0
- package/dist/eve/tools/inbox/index.js +365 -137
- package/dist/eve/tools/inbox/index.js.map +1 -1
- package/dist/eve/tools/index.d.ts +7 -0
- package/dist/eve/tools/index.js +1362 -168
- package/dist/eve/tools/index.js.map +1 -1
- package/dist/{index-BL9qKHA8.d.ts → index-DoQN48Bm.d.ts} +61 -2
- package/dist/index.d.ts +6 -3
- package/dist/index.js +325 -119
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +6 -1
- package/dist/schemas/index.js +177 -48
- package/dist/schemas/index.js.map +1 -1
- package/dist/{tool-approval-bridge-C4bTm8vu.d.ts → tool-approval-bridge-aMA79Z1B.d.ts} +1 -1
- package/dist/tool-reply-guidance-C3qrT1In.d.ts +25 -0
- package/dist/trigger/index.d.ts +2 -1
- package/dist/trigger/index.js +310 -108
- package/dist/trigger/index.js.map +1 -1
- package/dist/{trigger-Dn0DFiyU.d.ts → trigger-CXrbKVCL.d.ts} +2 -2
- package/dist/workflow/index.d.ts +2 -1
- package/dist/workflow/index.js +310 -108
- package/dist/workflow/index.js.map +1 -1
- package/package.json +28 -4
package/dist/ai/trigger.js
CHANGED
|
@@ -329,7 +329,7 @@ function refineContextPublicUrls(data, ctx) {
|
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
var safeUrlSchema, handlerUrlSchema, jsonSchema7Schema, uiSchemaSchema, webhookHandlerSchema, triggerHandlerSchema, handlerSchema, taskActionInputSchema, taskActionSchema, uiFieldSchemaSchema, contextUiSchema, contextDataSchema, TASK_CONTEXT_FORMAT_VERSION, taskContextObjectBaseSchema, taskContextObjectSchema, taskContextSchema, assignToSchema, threadUpdateMessageSchema, threadUpdateStatuses, threadUpdateStatusSchema, threadUpdateInputSchema, taskPriorities, taskPrioritySchema, agentTelemetrySchema, createTaskBodySchema, agentChatSeedActionSchema, agentChatSeedMessageSchema, eveAgentChatTransportSchema, createAgentChatBodySchema, agentChatAuditInputBodySchema, eveHitlStagedOptionSchema, agentChatStageHitlBodySchema, agentChatLinkTaskBodySchema;
|
|
332
|
+
var safeUrlSchema, handlerUrlSchema, jsonSchema7Schema, uiSchemaSchema, webhookHandlerSchema, triggerHandlerSchema, handlerSchema, taskActionInputSchema, taskActionSchema, uiFieldSchemaSchema, contextUiSchema, contextDataSchema, TASK_CONTEXT_FORMAT_VERSION, taskContextObjectBaseSchema, taskContextObjectSchema, taskContextSchema, assignToSchema, threadUpdateMessageSchema, threadUpdateStatuses, threadUpdateStatusSchema, threadUpdateInputSchema, taskPriorities, taskPrioritySchema, agentTelemetrySchema, createTaskBodySchema, agentChatSeedActionSchema, agentChatSeedMessageSchema, eveAgentChatTransportSchema, createAgentChatBodySchema, agentChatAuditToolBodySchema, agentChatAuditInputBodySchema, eveHitlStagedOptionSchema, agentChatStageHitlBodySchema, agentChatLinkTaskBodySchema;
|
|
333
333
|
var init_task = __esm({
|
|
334
334
|
"../core/src/schemas/task.ts"() {
|
|
335
335
|
"use strict";
|
|
@@ -502,13 +502,27 @@ var init_task = __esm({
|
|
|
502
502
|
eveConnectionId: z.string().min(1).optional(),
|
|
503
503
|
/** Source application id; groups the chat under an inbox section. */
|
|
504
504
|
app: z.string().min(1).optional(),
|
|
505
|
-
|
|
505
|
+
/** Email of the user who owns the chat. Required unless `parentChatId` is set. */
|
|
506
|
+
ownerEmail: z.string().email().optional(),
|
|
506
507
|
title: z.string().min(1),
|
|
507
508
|
messages: z.array(agentChatSeedMessageSchema).default([]),
|
|
508
509
|
/** Provenance label stored on the session ("cron" | "agent" | ...). */
|
|
509
510
|
source: z.string().min(1).optional()
|
|
510
511
|
}).refine((data) => Boolean(data.agentIdentifier || data.parentChatId), {
|
|
511
512
|
message: "Provide either agentIdentifier or parentChatId"
|
|
513
|
+
}).refine((data) => Boolean(data.ownerEmail || data.parentChatId), {
|
|
514
|
+
message: "Provide ownerEmail unless parentChatId is set"
|
|
515
|
+
});
|
|
516
|
+
agentChatAuditToolBodySchema = z.object({
|
|
517
|
+
eveSessionId: z.string().min(1),
|
|
518
|
+
userId: z.string().min(1),
|
|
519
|
+
toolCallId: z.string().min(1),
|
|
520
|
+
toolName: z.string().min(1),
|
|
521
|
+
input: z.record(z.string(), z.unknown()).default({}),
|
|
522
|
+
success: z.boolean(),
|
|
523
|
+
status: z.enum(["completed", "failed", "rejected"]),
|
|
524
|
+
error: z.string().optional(),
|
|
525
|
+
idempotencyKey: z.string().optional()
|
|
512
526
|
});
|
|
513
527
|
agentChatAuditInputBodySchema = z.object({
|
|
514
528
|
eveSessionId: z.string().min(1),
|
|
@@ -557,6 +571,132 @@ var init_json_schema = __esm({
|
|
|
557
571
|
}
|
|
558
572
|
});
|
|
559
573
|
|
|
574
|
+
// ../core/src/schemas/tool-result-display.ts
|
|
575
|
+
import { z as z2 } from "zod";
|
|
576
|
+
var toolDisplayMetadataSchema, toolDisplayEnvelopeSchema;
|
|
577
|
+
var init_tool_result_display = __esm({
|
|
578
|
+
"../core/src/schemas/tool-result-display.ts"() {
|
|
579
|
+
"use strict";
|
|
580
|
+
toolDisplayMetadataSchema = z2.object({
|
|
581
|
+
widget: z2.string().optional(),
|
|
582
|
+
title: z2.string().optional(),
|
|
583
|
+
description: z2.string().optional()
|
|
584
|
+
});
|
|
585
|
+
toolDisplayEnvelopeSchema = z2.object({
|
|
586
|
+
display: toolDisplayMetadataSchema.optional(),
|
|
587
|
+
data: z2.record(z2.string(), z2.unknown()),
|
|
588
|
+
ui: z2.record(
|
|
589
|
+
z2.string(),
|
|
590
|
+
z2.object({
|
|
591
|
+
"ui:widget": z2.string().optional(),
|
|
592
|
+
"ui:title": z2.string().optional(),
|
|
593
|
+
"ui:description": z2.string().optional(),
|
|
594
|
+
"ui:options": z2.record(z2.string(), z2.unknown()).optional()
|
|
595
|
+
}).passthrough()
|
|
596
|
+
).optional()
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
// ../core/src/schemas/agent-admin.ts
|
|
602
|
+
import { z as z3 } from "zod";
|
|
603
|
+
var tenantRoleSchema, agentAdminUserSchema, agentAdminMemberSchema, agentAdminGroupSchema, agentAdminGroupDetailSchema, agentAdminTaskSummarySchema, inviteMemberBodySchema, updateMemberRoleBodySchema, createGroupBodySchema, updateGroupBodySchema, addGroupMemberBodySchema, listTasksQuerySchema, searchTasksQuerySchema, assignTasksResultSchema, assignTasksResponseSchema, assignTasksBodySchema;
|
|
604
|
+
var init_agent_admin = __esm({
|
|
605
|
+
"../core/src/schemas/agent-admin.ts"() {
|
|
606
|
+
"use strict";
|
|
607
|
+
init_task();
|
|
608
|
+
tenantRoleSchema = z3.enum(["admin", "member"]);
|
|
609
|
+
agentAdminUserSchema = z3.object({
|
|
610
|
+
id: z3.string(),
|
|
611
|
+
email: z3.string().email(),
|
|
612
|
+
name: z3.string()
|
|
613
|
+
});
|
|
614
|
+
agentAdminMemberSchema = z3.object({
|
|
615
|
+
userId: z3.string(),
|
|
616
|
+
role: z3.string(),
|
|
617
|
+
membershipKind: z3.enum(["team", "assignee"]),
|
|
618
|
+
hasLoggedIn: z3.boolean(),
|
|
619
|
+
user: agentAdminUserSchema
|
|
620
|
+
});
|
|
621
|
+
agentAdminGroupSchema = z3.object({
|
|
622
|
+
id: z3.string(),
|
|
623
|
+
name: z3.string(),
|
|
624
|
+
slug: z3.string(),
|
|
625
|
+
description: z3.string().nullable(),
|
|
626
|
+
memberCount: z3.number().optional()
|
|
627
|
+
});
|
|
628
|
+
agentAdminGroupDetailSchema = agentAdminGroupSchema.extend({
|
|
629
|
+
members: z3.array(
|
|
630
|
+
z3.object({
|
|
631
|
+
userId: z3.string(),
|
|
632
|
+
user: agentAdminUserSchema
|
|
633
|
+
})
|
|
634
|
+
)
|
|
635
|
+
});
|
|
636
|
+
agentAdminTaskSummarySchema = z3.object({
|
|
637
|
+
id: z3.string(),
|
|
638
|
+
convexId: z3.string(),
|
|
639
|
+
status: z3.string(),
|
|
640
|
+
type: z3.string().nullable(),
|
|
641
|
+
name: z3.string().nullable(),
|
|
642
|
+
description: z3.string().nullable(),
|
|
643
|
+
validUntil: z3.number(),
|
|
644
|
+
createdAt: z3.number(),
|
|
645
|
+
threadPriority: z3.string().nullable(),
|
|
646
|
+
handledByUserId: z3.string().nullable()
|
|
647
|
+
});
|
|
648
|
+
inviteMemberBodySchema = z3.object({
|
|
649
|
+
email: z3.string().email(),
|
|
650
|
+
role: tenantRoleSchema.optional()
|
|
651
|
+
});
|
|
652
|
+
updateMemberRoleBodySchema = z3.object({
|
|
653
|
+
role: tenantRoleSchema
|
|
654
|
+
});
|
|
655
|
+
createGroupBodySchema = z3.object({
|
|
656
|
+
name: z3.string().min(1),
|
|
657
|
+
description: z3.string().optional()
|
|
658
|
+
});
|
|
659
|
+
updateGroupBodySchema = z3.object({
|
|
660
|
+
name: z3.string().min(1).optional(),
|
|
661
|
+
description: z3.string().optional()
|
|
662
|
+
});
|
|
663
|
+
addGroupMemberBodySchema = z3.object({
|
|
664
|
+
userId: z3.string().min(1).describe("Convex user id or member email.")
|
|
665
|
+
});
|
|
666
|
+
listTasksQuerySchema = z3.object({
|
|
667
|
+
statusFilter: z3.enum(["all", "open", "handled", "expired"]).optional(),
|
|
668
|
+
typeFilter: z3.string().optional(),
|
|
669
|
+
appFilter: z3.string().optional(),
|
|
670
|
+
sortField: z3.enum(["type", "date", "status", "validUntil"]).optional(),
|
|
671
|
+
sortDirection: z3.enum(["asc", "desc"]).optional(),
|
|
672
|
+
limit: z3.coerce.number().int().positive().max(100).optional(),
|
|
673
|
+
cursor: z3.string().optional()
|
|
674
|
+
});
|
|
675
|
+
searchTasksQuerySchema = z3.object({
|
|
676
|
+
q: z3.string().min(1),
|
|
677
|
+
limit: z3.coerce.number().int().positive().max(100).optional()
|
|
678
|
+
});
|
|
679
|
+
assignTasksResultSchema = z3.object({
|
|
680
|
+
taskId: z3.string(),
|
|
681
|
+
success: z3.boolean(),
|
|
682
|
+
message: z3.string().optional(),
|
|
683
|
+
name: z3.string().nullable().optional(),
|
|
684
|
+
description: z3.string().nullable().optional(),
|
|
685
|
+
type: z3.string().nullable().optional()
|
|
686
|
+
});
|
|
687
|
+
assignTasksResponseSchema = z3.object({
|
|
688
|
+
results: z3.array(assignTasksResultSchema)
|
|
689
|
+
});
|
|
690
|
+
assignTasksBodySchema = z3.object({
|
|
691
|
+
taskIds: z3.array(z3.string().min(1)).min(1).max(100),
|
|
692
|
+
assignTo: assignToSchema.refine(
|
|
693
|
+
(value) => (value.users?.length ?? 0) > 0 || (value.groups?.length ?? 0) > 0,
|
|
694
|
+
{ message: "assignTo needs at least one user email or group slug." }
|
|
695
|
+
)
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
|
|
560
700
|
// ../core/src/schemas/index.ts
|
|
561
701
|
var init_schemas = __esm({
|
|
562
702
|
"../core/src/schemas/index.ts"() {
|
|
@@ -564,11 +704,13 @@ var init_schemas = __esm({
|
|
|
564
704
|
init_task();
|
|
565
705
|
init_json_schema();
|
|
566
706
|
init_context_urls();
|
|
707
|
+
init_tool_result_display();
|
|
708
|
+
init_agent_admin();
|
|
567
709
|
}
|
|
568
710
|
});
|
|
569
711
|
|
|
570
712
|
// src/schemas/index.ts
|
|
571
|
-
import { z as
|
|
713
|
+
import { z as z4 } from "zod";
|
|
572
714
|
function normalizeTaskContextVersion2(data) {
|
|
573
715
|
const { version: legacyVersion, contextVersion, ...rest } = data;
|
|
574
716
|
return {
|
|
@@ -580,7 +722,7 @@ function refineContextPublicUrls2(data, ctx) {
|
|
|
580
722
|
const error = validateContextPublicUrls(data.context);
|
|
581
723
|
if (error) {
|
|
582
724
|
ctx.addIssue({
|
|
583
|
-
code:
|
|
725
|
+
code: z4.ZodIssueCode.custom,
|
|
584
726
|
message: error,
|
|
585
727
|
path: ["context"]
|
|
586
728
|
});
|
|
@@ -592,61 +734,61 @@ var init_schemas2 = __esm({
|
|
|
592
734
|
"use strict";
|
|
593
735
|
init_utils();
|
|
594
736
|
init_schemas();
|
|
595
|
-
handlerUrlSchema2 =
|
|
737
|
+
handlerUrlSchema2 = z4.string().refine((url) => isAllowedHandlerUrl(url), {
|
|
596
738
|
message: HANDLER_URL_ERROR
|
|
597
739
|
});
|
|
598
|
-
jsonSchema7Schema2 =
|
|
740
|
+
jsonSchema7Schema2 = z4.custom(
|
|
599
741
|
(val) => typeof val === "object" && val !== null,
|
|
600
742
|
{ message: "Must be a valid JSON Schema object" }
|
|
601
743
|
);
|
|
602
|
-
uiSchemaSchema2 =
|
|
744
|
+
uiSchemaSchema2 = z4.custom((val) => typeof val === "object" && val !== null, {
|
|
603
745
|
message: "Must be a valid UiSchema object"
|
|
604
746
|
});
|
|
605
|
-
webhookHandlerSchema2 =
|
|
606
|
-
type:
|
|
747
|
+
webhookHandlerSchema2 = z4.object({
|
|
748
|
+
type: z4.literal("webhook"),
|
|
607
749
|
url: handlerUrlSchema2,
|
|
608
|
-
headers:
|
|
750
|
+
headers: z4.record(z4.string(), z4.string())
|
|
609
751
|
});
|
|
610
752
|
triggerHandlerSchema2 = webhookHandlerSchema2.extend({
|
|
611
|
-
type:
|
|
612
|
-
tokenId:
|
|
753
|
+
type: z4.literal("trigger"),
|
|
754
|
+
tokenId: z4.string().min(1)
|
|
613
755
|
});
|
|
614
|
-
handlerSchema2 =
|
|
615
|
-
taskActionInputSchema2 =
|
|
616
|
-
id:
|
|
617
|
-
title:
|
|
618
|
-
description:
|
|
756
|
+
handlerSchema2 = z4.discriminatedUnion("type", [webhookHandlerSchema2, triggerHandlerSchema2]);
|
|
757
|
+
taskActionInputSchema2 = z4.object({
|
|
758
|
+
id: z4.string().min(1),
|
|
759
|
+
title: z4.string().min(1),
|
|
760
|
+
description: z4.string().optional(),
|
|
619
761
|
schema: jsonSchema7Schema2.optional(),
|
|
620
762
|
ui: uiSchemaSchema2.optional(),
|
|
621
|
-
data:
|
|
763
|
+
data: z4.record(z4.string(), z4.unknown()).optional()
|
|
622
764
|
});
|
|
623
765
|
taskActionSchema2 = taskActionInputSchema2.extend({
|
|
624
|
-
handlers:
|
|
766
|
+
handlers: z4.array(handlerSchema2).min(1).optional()
|
|
625
767
|
});
|
|
626
|
-
uiFieldSchemaSchema2 =
|
|
627
|
-
"ui:widget":
|
|
628
|
-
"ui:title":
|
|
629
|
-
"ui:description":
|
|
630
|
-
"ui:options":
|
|
631
|
-
items:
|
|
768
|
+
uiFieldSchemaSchema2 = z4.object({
|
|
769
|
+
"ui:widget": z4.string().optional(),
|
|
770
|
+
"ui:title": z4.string().optional(),
|
|
771
|
+
"ui:description": z4.string().optional(),
|
|
772
|
+
"ui:options": z4.record(z4.string(), z4.unknown()).optional(),
|
|
773
|
+
items: z4.lazy(() => z4.record(z4.string(), uiFieldSchemaSchema2)).optional()
|
|
632
774
|
}).passthrough();
|
|
633
|
-
contextUiSchema2 =
|
|
634
|
-
contextDataSchema2 =
|
|
635
|
-
data:
|
|
775
|
+
contextUiSchema2 = z4.record(z4.string(), uiFieldSchemaSchema2).optional();
|
|
776
|
+
contextDataSchema2 = z4.object({
|
|
777
|
+
data: z4.record(z4.string(), z4.unknown()),
|
|
636
778
|
ui: contextUiSchema2
|
|
637
779
|
}).optional();
|
|
638
780
|
TASK_CONTEXT_FORMAT_VERSION2 = 2;
|
|
639
|
-
taskContextObjectBaseSchema2 =
|
|
640
|
-
app:
|
|
641
|
-
type:
|
|
642
|
-
name:
|
|
643
|
-
description:
|
|
644
|
-
validUntil:
|
|
781
|
+
taskContextObjectBaseSchema2 = z4.object({
|
|
782
|
+
app: z4.string().min(1).optional(),
|
|
783
|
+
type: z4.string().min(1),
|
|
784
|
+
name: z4.string().min(1),
|
|
785
|
+
description: z4.string().optional(),
|
|
786
|
+
validUntil: z4.string().optional(),
|
|
645
787
|
context: contextDataSchema2,
|
|
646
|
-
contextVersion:
|
|
788
|
+
contextVersion: z4.literal(2).optional(),
|
|
647
789
|
/** @deprecated Use `contextVersion`. Accepted on ingest only. */
|
|
648
|
-
version:
|
|
649
|
-
actions:
|
|
790
|
+
version: z4.literal(2).optional(),
|
|
791
|
+
actions: z4.array(taskActionSchema2).min(1, "At least one action is required")
|
|
650
792
|
});
|
|
651
793
|
taskContextObjectSchema2 = taskContextObjectBaseSchema2.transform(
|
|
652
794
|
normalizeTaskContextVersion2
|
|
@@ -654,9 +796,9 @@ var init_schemas2 = __esm({
|
|
|
654
796
|
taskContextSchema2 = taskContextObjectSchema2.superRefine(
|
|
655
797
|
refineContextPublicUrls2
|
|
656
798
|
);
|
|
657
|
-
assignToSchema2 =
|
|
658
|
-
users:
|
|
659
|
-
groups:
|
|
799
|
+
assignToSchema2 = z4.object({
|
|
800
|
+
users: z4.array(z4.string().email()).optional(),
|
|
801
|
+
groups: z4.array(z4.string().min(1)).optional()
|
|
660
802
|
}).refine(
|
|
661
803
|
(data) => {
|
|
662
804
|
const groups = data.groups ?? [];
|
|
@@ -667,7 +809,7 @@ var init_schemas2 = __esm({
|
|
|
667
809
|
},
|
|
668
810
|
{ message: 'Cannot combine "all" with other group slugs' }
|
|
669
811
|
);
|
|
670
|
-
threadUpdateMessageSchema2 =
|
|
812
|
+
threadUpdateMessageSchema2 = z4.string().min(1).max(500);
|
|
671
813
|
threadUpdateStatuses2 = [
|
|
672
814
|
"info",
|
|
673
815
|
"queued",
|
|
@@ -677,15 +819,15 @@ var init_schemas2 = __esm({
|
|
|
677
819
|
"failed",
|
|
678
820
|
"cancelled"
|
|
679
821
|
];
|
|
680
|
-
threadUpdateStatusSchema2 =
|
|
681
|
-
threadUpdateInputSchema2 =
|
|
822
|
+
threadUpdateStatusSchema2 = z4.enum(threadUpdateStatuses2);
|
|
823
|
+
threadUpdateInputSchema2 = z4.object({
|
|
682
824
|
message: threadUpdateMessageSchema2,
|
|
683
825
|
status: threadUpdateStatusSchema2.optional()
|
|
684
826
|
});
|
|
685
827
|
taskPriorities2 = ["low", "normal", "high", "urgent"];
|
|
686
|
-
taskPrioritySchema2 =
|
|
687
|
-
agentTelemetrySchema2 =
|
|
688
|
-
version:
|
|
828
|
+
taskPrioritySchema2 = z4.enum(taskPriorities2);
|
|
829
|
+
agentTelemetrySchema2 = z4.object({
|
|
830
|
+
version: z4.string().min(1)
|
|
689
831
|
});
|
|
690
832
|
createTaskBodySchema2 = taskContextObjectBaseSchema2.extend({
|
|
691
833
|
assignTo: assignToSchema2.optional(),
|
|
@@ -693,7 +835,7 @@ var init_schemas2 = __esm({
|
|
|
693
835
|
* Groups related tasks together. When omitted, the server generates one and
|
|
694
836
|
* returns it so the caller can reuse it on later tasks in the same thread.
|
|
695
837
|
*/
|
|
696
|
-
threadId:
|
|
838
|
+
threadId: z4.string().min(1).optional(),
|
|
697
839
|
/**
|
|
698
840
|
* Optional thread priority. When set, applies to the whole thread and
|
|
699
841
|
* overwrites any previous priority. Omit on later tasks to leave unchanged.
|
|
@@ -710,92 +852,6 @@ var init_schemas2 = __esm({
|
|
|
710
852
|
}
|
|
711
853
|
});
|
|
712
854
|
|
|
713
|
-
// src/approval-result.ts
|
|
714
|
-
function toDiscriminatedApprovalResult(actions, task2) {
|
|
715
|
-
void actions;
|
|
716
|
-
if (!task2.handled) {
|
|
717
|
-
throw new Error("Task has no handled result");
|
|
718
|
-
}
|
|
719
|
-
return {
|
|
720
|
-
actionId: task2.handled.action.id,
|
|
721
|
-
data: task2.handled.action.data,
|
|
722
|
-
handledBy: task2.handled.handledBy,
|
|
723
|
-
handledAt: new Date(task2.handledAt ?? Date.now()),
|
|
724
|
-
taskId: task2.id
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
var TaskTimeoutError, TaskExpiredError;
|
|
728
|
-
var init_approval_result = __esm({
|
|
729
|
-
"src/approval-result.ts"() {
|
|
730
|
-
"use strict";
|
|
731
|
-
TaskTimeoutError = class extends Error {
|
|
732
|
-
constructor(message) {
|
|
733
|
-
super(message);
|
|
734
|
-
this.name = "TaskTimeoutError";
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
TaskExpiredError = class extends Error {
|
|
738
|
-
constructor(message) {
|
|
739
|
-
super(message);
|
|
740
|
-
this.name = "TaskExpiredError";
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
|
|
746
|
-
// src/http.ts
|
|
747
|
-
async function parseResponseBody(response) {
|
|
748
|
-
const contentType = response.headers.get("content-type") ?? "";
|
|
749
|
-
const bodyText = await response.text();
|
|
750
|
-
if (!bodyText) {
|
|
751
|
-
return null;
|
|
752
|
-
}
|
|
753
|
-
if (contentType.toLowerCase().includes("application/json")) {
|
|
754
|
-
try {
|
|
755
|
-
return JSON.parse(bodyText);
|
|
756
|
-
} catch {
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
try {
|
|
760
|
-
return JSON.parse(bodyText);
|
|
761
|
-
} catch {
|
|
762
|
-
return bodyText;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
function getErrorMessage(data, fallback) {
|
|
766
|
-
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
767
|
-
const record = data;
|
|
768
|
-
const maybeMessage = record.message;
|
|
769
|
-
const maybeHint = record.hint;
|
|
770
|
-
if (typeof maybeMessage === "string" && maybeMessage.trim()) {
|
|
771
|
-
if (typeof maybeHint === "string" && maybeHint.trim()) {
|
|
772
|
-
return `${maybeMessage.trim()} ${maybeHint.trim()}`;
|
|
773
|
-
}
|
|
774
|
-
return maybeMessage;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
if (typeof data === "string" && data.trim()) {
|
|
778
|
-
const compact = data.replace(/\s+/g, " ").trim();
|
|
779
|
-
const snippet = compact.length > 180 ? `${compact.slice(0, 180)}...` : compact;
|
|
780
|
-
return `${fallback}. Server returned non-JSON response: ${snippet}`;
|
|
781
|
-
}
|
|
782
|
-
return fallback;
|
|
783
|
-
}
|
|
784
|
-
var RobotRockError;
|
|
785
|
-
var init_http = __esm({
|
|
786
|
-
"src/http.ts"() {
|
|
787
|
-
"use strict";
|
|
788
|
-
RobotRockError = class extends Error {
|
|
789
|
-
constructor(message, statusCode, response) {
|
|
790
|
-
super(message);
|
|
791
|
-
this.statusCode = statusCode;
|
|
792
|
-
this.response = response;
|
|
793
|
-
this.name = "RobotRockError";
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
});
|
|
798
|
-
|
|
799
855
|
// ../core/src/types/task.ts
|
|
800
856
|
var init_task2 = __esm({
|
|
801
857
|
"../core/src/types/task.ts"() {
|
|
@@ -895,7 +951,7 @@ var init_app_url = __esm({
|
|
|
895
951
|
});
|
|
896
952
|
|
|
897
953
|
// ../core/src/attribution/index.ts
|
|
898
|
-
import { z as
|
|
954
|
+
import { z as z5 } from "zod";
|
|
899
955
|
var ATTRIBUTION_COOKIE_MAX_AGE, attributionSchema;
|
|
900
956
|
var init_attribution = __esm({
|
|
901
957
|
"../core/src/attribution/index.ts"() {
|
|
@@ -903,16 +959,16 @@ var init_attribution = __esm({
|
|
|
903
959
|
init_app_url();
|
|
904
960
|
init_app_url();
|
|
905
961
|
ATTRIBUTION_COOKIE_MAX_AGE = 60 * 60 * 24 * 90;
|
|
906
|
-
attributionSchema =
|
|
907
|
-
utmSource:
|
|
908
|
-
utmMedium:
|
|
909
|
-
utmCampaign:
|
|
910
|
-
utmContent:
|
|
911
|
-
utmTerm:
|
|
912
|
-
gclid:
|
|
913
|
-
landingUrl:
|
|
914
|
-
referrer:
|
|
915
|
-
capturedAt:
|
|
962
|
+
attributionSchema = z5.object({
|
|
963
|
+
utmSource: z5.string().optional(),
|
|
964
|
+
utmMedium: z5.string().optional(),
|
|
965
|
+
utmCampaign: z5.string().optional(),
|
|
966
|
+
utmContent: z5.string().optional(),
|
|
967
|
+
utmTerm: z5.string().optional(),
|
|
968
|
+
gclid: z5.string().optional(),
|
|
969
|
+
landingUrl: z5.string().optional(),
|
|
970
|
+
referrer: z5.string().optional(),
|
|
971
|
+
capturedAt: z5.number()
|
|
916
972
|
});
|
|
917
973
|
}
|
|
918
974
|
});
|
|
@@ -941,18 +997,112 @@ var init_src = __esm({
|
|
|
941
997
|
}
|
|
942
998
|
});
|
|
943
999
|
|
|
1000
|
+
// src/approval-result.ts
|
|
1001
|
+
function toDiscriminatedApprovalResult(actions, task2) {
|
|
1002
|
+
void actions;
|
|
1003
|
+
if (!task2.handled) {
|
|
1004
|
+
throw new Error("Task has no handled result");
|
|
1005
|
+
}
|
|
1006
|
+
return {
|
|
1007
|
+
actionId: task2.handled.action.id,
|
|
1008
|
+
data: task2.handled.action.data,
|
|
1009
|
+
handledBy: task2.handled.handledBy,
|
|
1010
|
+
handledAt: new Date(task2.handledAt ?? Date.now()),
|
|
1011
|
+
taskId: task2.id
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
var TaskTimeoutError, TaskExpiredError;
|
|
1015
|
+
var init_approval_result = __esm({
|
|
1016
|
+
"src/approval-result.ts"() {
|
|
1017
|
+
"use strict";
|
|
1018
|
+
TaskTimeoutError = class extends Error {
|
|
1019
|
+
constructor(message) {
|
|
1020
|
+
super(message);
|
|
1021
|
+
this.name = "TaskTimeoutError";
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
TaskExpiredError = class extends Error {
|
|
1025
|
+
constructor(message) {
|
|
1026
|
+
super(message);
|
|
1027
|
+
this.name = "TaskExpiredError";
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
|
|
1033
|
+
// src/http.ts
|
|
1034
|
+
async function parseResponseBody(response) {
|
|
1035
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
1036
|
+
const bodyText = await response.text();
|
|
1037
|
+
if (!bodyText) {
|
|
1038
|
+
return null;
|
|
1039
|
+
}
|
|
1040
|
+
if (contentType.toLowerCase().includes("application/json")) {
|
|
1041
|
+
try {
|
|
1042
|
+
return JSON.parse(bodyText);
|
|
1043
|
+
} catch {
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
try {
|
|
1047
|
+
return JSON.parse(bodyText);
|
|
1048
|
+
} catch {
|
|
1049
|
+
return bodyText;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
function getErrorMessage(data, fallback) {
|
|
1053
|
+
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
1054
|
+
const record = data;
|
|
1055
|
+
const maybeMessage = record.message;
|
|
1056
|
+
const maybeHint = record.hint;
|
|
1057
|
+
if (typeof maybeMessage === "string" && maybeMessage.trim()) {
|
|
1058
|
+
if (typeof maybeHint === "string" && maybeHint.trim()) {
|
|
1059
|
+
return `${maybeMessage.trim()} ${maybeHint.trim()}`;
|
|
1060
|
+
}
|
|
1061
|
+
return maybeMessage;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (typeof data === "string" && data.trim()) {
|
|
1065
|
+
const compact = data.replace(/\s+/g, " ").trim();
|
|
1066
|
+
const snippet = compact.length > 180 ? `${compact.slice(0, 180)}...` : compact;
|
|
1067
|
+
return `${fallback}. Server returned non-JSON response: ${snippet}`;
|
|
1068
|
+
}
|
|
1069
|
+
return fallback;
|
|
1070
|
+
}
|
|
1071
|
+
var RobotRockError;
|
|
1072
|
+
var init_http = __esm({
|
|
1073
|
+
"src/http.ts"() {
|
|
1074
|
+
"use strict";
|
|
1075
|
+
RobotRockError = class extends Error {
|
|
1076
|
+
constructor(message, statusCode, response) {
|
|
1077
|
+
super(message);
|
|
1078
|
+
this.statusCode = statusCode;
|
|
1079
|
+
this.response = response;
|
|
1080
|
+
this.name = "RobotRockError";
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
|
|
944
1086
|
// src/auth-headers.ts
|
|
945
1087
|
function buildRobotRockAuthHeaders(auth) {
|
|
946
1088
|
if (auth.kind === "apiKey") {
|
|
947
|
-
|
|
1089
|
+
const headers2 = {
|
|
948
1090
|
"X-Api-Key": auth.apiKey
|
|
949
1091
|
};
|
|
1092
|
+
if (auth.actingUserId?.trim()) {
|
|
1093
|
+
headers2[ROBOTROCK_ACTING_USER_ID_HEADER] = auth.actingUserId.trim();
|
|
1094
|
+
}
|
|
1095
|
+
return headers2;
|
|
950
1096
|
}
|
|
951
|
-
|
|
1097
|
+
const headers = {
|
|
952
1098
|
Authorization: `Bearer ${auth.token}`,
|
|
953
1099
|
"X-RobotRock-Tenant-Slug": auth.tenantSlug,
|
|
954
1100
|
"X-RobotRock-Connection-Id": auth.connectionId
|
|
955
1101
|
};
|
|
1102
|
+
if (auth.actingUserId?.trim()) {
|
|
1103
|
+
headers[ROBOTROCK_ACTING_USER_ID_HEADER] = auth.actingUserId.trim();
|
|
1104
|
+
}
|
|
1105
|
+
return headers;
|
|
956
1106
|
}
|
|
957
1107
|
function resolveRobotRockAuthConfig(overrides) {
|
|
958
1108
|
if (overrides?.agentService) {
|
|
@@ -969,9 +1119,11 @@ function resolveRobotRockAuthConfig(overrides) {
|
|
|
969
1119
|
}
|
|
970
1120
|
return { kind: "apiKey", apiKey };
|
|
971
1121
|
}
|
|
1122
|
+
var ROBOTROCK_ACTING_USER_ID_HEADER;
|
|
972
1123
|
var init_auth_headers = __esm({
|
|
973
1124
|
"src/auth-headers.ts"() {
|
|
974
1125
|
"use strict";
|
|
1126
|
+
ROBOTROCK_ACTING_USER_ID_HEADER = "x-robotrock-acting-user-id";
|
|
975
1127
|
}
|
|
976
1128
|
});
|
|
977
1129
|
|
|
@@ -1101,6 +1253,29 @@ function createChatsApi(config) {
|
|
|
1101
1253
|
);
|
|
1102
1254
|
}
|
|
1103
1255
|
},
|
|
1256
|
+
async logToolExecution(input) {
|
|
1257
|
+
const validation = agentChatAuditToolBodySchema.safeParse(input);
|
|
1258
|
+
if (!validation.success) {
|
|
1259
|
+
throw new RobotRockError(
|
|
1260
|
+
`Invalid audit tool input: ${validation.error.issues[0]?.message}`,
|
|
1261
|
+
400,
|
|
1262
|
+
validation.error.issues
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
const response = await fetch(`${config.baseUrl}/agent-chats/audit-tool`, {
|
|
1266
|
+
method: "POST",
|
|
1267
|
+
headers: headers(),
|
|
1268
|
+
body: JSON.stringify(validation.data)
|
|
1269
|
+
});
|
|
1270
|
+
if (!response.ok) {
|
|
1271
|
+
const data = await parseResponseBody(response);
|
|
1272
|
+
throw new RobotRockError(
|
|
1273
|
+
getErrorMessage(data, "Failed to log chat tool execution"),
|
|
1274
|
+
response.status,
|
|
1275
|
+
data
|
|
1276
|
+
);
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1104
1279
|
async linkTask(input) {
|
|
1105
1280
|
const validation = agentChatLinkTaskBodySchema.safeParse(input);
|
|
1106
1281
|
if (!validation.success) {
|
|
@@ -1217,6 +1392,7 @@ var init_client = __esm({
|
|
|
1217
1392
|
"src/client.ts"() {
|
|
1218
1393
|
"use strict";
|
|
1219
1394
|
init_schemas2();
|
|
1395
|
+
init_src();
|
|
1220
1396
|
init_approval_result();
|
|
1221
1397
|
init_http();
|
|
1222
1398
|
init_src();
|
|
@@ -1264,7 +1440,9 @@ var init_client = __esm({
|
|
|
1264
1440
|
create: (task2) => this.createTaskRequest(task2),
|
|
1265
1441
|
get: (taskId) => this.getTaskById(taskId),
|
|
1266
1442
|
cancel: (taskId) => this.cancelTaskRequest(taskId),
|
|
1267
|
-
sendUpdate: (input) => this.sendThreadUpdate(input)
|
|
1443
|
+
sendUpdate: (input) => this.sendThreadUpdate(input),
|
|
1444
|
+
list: (input) => this.listTasksRequest(input),
|
|
1445
|
+
search: (input) => this.searchTasksRequest(input)
|
|
1268
1446
|
};
|
|
1269
1447
|
this.chats = createChatsApi({
|
|
1270
1448
|
baseUrl: this.baseUrl,
|
|
@@ -1461,6 +1639,47 @@ var init_client = __esm({
|
|
|
1461
1639
|
);
|
|
1462
1640
|
}
|
|
1463
1641
|
}
|
|
1642
|
+
async listTasksRequest(input) {
|
|
1643
|
+
const params = new URLSearchParams();
|
|
1644
|
+
for (const [key, value] of Object.entries(input ?? {})) {
|
|
1645
|
+
if (value !== void 0 && value !== "") {
|
|
1646
|
+
params.set(key, String(value));
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
const suffix = params.size > 0 ? `?${params.toString()}` : "";
|
|
1650
|
+
const response = await fetch(`${this.baseUrl}/tasks${suffix}`, {
|
|
1651
|
+
method: "GET",
|
|
1652
|
+
headers: this.authHeaders()
|
|
1653
|
+
});
|
|
1654
|
+
const data = await parseResponseBody(response);
|
|
1655
|
+
if (!response.ok) {
|
|
1656
|
+
throw new RobotRockError(
|
|
1657
|
+
getErrorMessage(data, "Failed to list tasks"),
|
|
1658
|
+
response.status,
|
|
1659
|
+
data
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
return data;
|
|
1663
|
+
}
|
|
1664
|
+
async searchTasksRequest(input) {
|
|
1665
|
+
const params = new URLSearchParams({ q: input.q });
|
|
1666
|
+
if (input.limit !== void 0) {
|
|
1667
|
+
params.set("limit", String(input.limit));
|
|
1668
|
+
}
|
|
1669
|
+
const response = await fetch(`${this.baseUrl}/tasks/search?${params.toString()}`, {
|
|
1670
|
+
method: "GET",
|
|
1671
|
+
headers: this.authHeaders()
|
|
1672
|
+
});
|
|
1673
|
+
const data = await parseResponseBody(response);
|
|
1674
|
+
if (!response.ok) {
|
|
1675
|
+
throw new RobotRockError(
|
|
1676
|
+
getErrorMessage(data, "Failed to search tasks"),
|
|
1677
|
+
response.status,
|
|
1678
|
+
data
|
|
1679
|
+
);
|
|
1680
|
+
}
|
|
1681
|
+
return data;
|
|
1682
|
+
}
|
|
1464
1683
|
};
|
|
1465
1684
|
}
|
|
1466
1685
|
});
|
|
@@ -2022,7 +2241,7 @@ var init_workflow = __esm({
|
|
|
2022
2241
|
import { tool } from "ai";
|
|
2023
2242
|
|
|
2024
2243
|
// src/ai/approve-by-human-tool-core.ts
|
|
2025
|
-
import { z as
|
|
2244
|
+
import { z as z6 } from "zod";
|
|
2026
2245
|
|
|
2027
2246
|
// src/ai/context.ts
|
|
2028
2247
|
init_client();
|
|
@@ -2169,11 +2388,11 @@ function toHumanToolResult(result) {
|
|
|
2169
2388
|
}
|
|
2170
2389
|
|
|
2171
2390
|
// src/ai/approve-by-human-tool-core.ts
|
|
2172
|
-
var approveByHumanInputSchema =
|
|
2173
|
-
type:
|
|
2174
|
-
name:
|
|
2175
|
-
description:
|
|
2176
|
-
contextSummary:
|
|
2391
|
+
var approveByHumanInputSchema = z6.object({
|
|
2392
|
+
type: z6.string().optional().describe("Task type slug; defaults to ai-approval"),
|
|
2393
|
+
name: z6.string().describe("Short title for the approval request"),
|
|
2394
|
+
description: z6.string().describe("What needs approval and the consequences of approving or declining"),
|
|
2395
|
+
contextSummary: z6.string().optional().describe("Optional markdown summary shown to the reviewer")
|
|
2177
2396
|
});
|
|
2178
2397
|
function resolveApproveByHumanToolConfig(clientOrContext, maybeOptions = {}) {
|
|
2179
2398
|
const isDurable = typeof clientOrContext === "object" && clientOrContext !== null && "mode" in clientOrContext && (clientOrContext.mode === "trigger" || clientOrContext.mode === "workflow");
|
|
@@ -2223,16 +2442,16 @@ import { tool as tool2 } from "ai";
|
|
|
2223
2442
|
|
|
2224
2443
|
// src/ai/create-send-to-human-tool-core.ts
|
|
2225
2444
|
init_schemas2();
|
|
2226
|
-
import { z as
|
|
2227
|
-
var sendToHumanToolInputSchema =
|
|
2228
|
-
type:
|
|
2229
|
-
name:
|
|
2230
|
-
description:
|
|
2231
|
-
context:
|
|
2232
|
-
data:
|
|
2233
|
-
ui:
|
|
2445
|
+
import { z as z7 } from "zod";
|
|
2446
|
+
var sendToHumanToolInputSchema = z7.object({
|
|
2447
|
+
type: z7.string().describe("Task type slug shown in the RobotRock inbox"),
|
|
2448
|
+
name: z7.string().describe("Short title for the human reviewer"),
|
|
2449
|
+
description: z7.string().optional().describe("What you need from the human and why you cannot proceed alone"),
|
|
2450
|
+
context: z7.object({
|
|
2451
|
+
data: z7.record(z7.string(), z7.unknown()).optional(),
|
|
2452
|
+
ui: z7.record(z7.string(), z7.unknown()).optional()
|
|
2234
2453
|
}).optional().describe("Optional structured context for the inbox UI"),
|
|
2235
|
-
validUntil:
|
|
2454
|
+
validUntil: z7.string().datetime().optional().describe("Optional ISO deadline for the task"),
|
|
2236
2455
|
assignTo: assignToSchema2.optional().describe(
|
|
2237
2456
|
"Assign to tenant member emails and/or group slugs; narrows who sees the task in the inbox"
|
|
2238
2457
|
)
|
|
@@ -2286,12 +2505,12 @@ import { tool as tool3 } from "ai";
|
|
|
2286
2505
|
// src/ai/create-send-update-tool-core.ts
|
|
2287
2506
|
init_schemas2();
|
|
2288
2507
|
init_client();
|
|
2289
|
-
import { z as
|
|
2290
|
-
var sendUpdateToolInputSchema =
|
|
2291
|
-
threadId:
|
|
2508
|
+
import { z as z8 } from "zod";
|
|
2509
|
+
var sendUpdateToolInputSchema = z8.object({
|
|
2510
|
+
threadId: z8.string().optional().describe(
|
|
2292
2511
|
"Thread to post the update to. Use the `threadId` returned by a prior send-to-human task. Omit only when a session threadId is configured on the tool."
|
|
2293
2512
|
),
|
|
2294
|
-
message:
|
|
2513
|
+
message: z8.string().describe("Short progress update (1-2 sentences) shown in the inbox status bar"),
|
|
2295
2514
|
status: threadUpdateStatusSchema2.optional().describe(
|
|
2296
2515
|
"Lifecycle status driving the status-bar icon/color: info, queued, running, waiting, succeeded, failed, cancelled"
|
|
2297
2516
|
)
|
|
@@ -2351,25 +2570,25 @@ function createSendUpdateTool(clientOrOptions, maybeOptions = {}) {
|
|
|
2351
2570
|
import { tool as tool4 } from "ai";
|
|
2352
2571
|
|
|
2353
2572
|
// src/ai/request-action-input-tool-core.ts
|
|
2354
|
-
import { z as
|
|
2355
|
-
var requestActionInputActionSchema =
|
|
2356
|
-
id:
|
|
2573
|
+
import { z as z9 } from "zod";
|
|
2574
|
+
var requestActionInputActionSchema = z9.object({
|
|
2575
|
+
id: z9.string().min(1).optional().describe(
|
|
2357
2576
|
"Stable action identifier echoed in tool output (e.g. pick-blog-topic). Strongly recommended \u2014 auto-derived from title when omitted."
|
|
2358
2577
|
),
|
|
2359
|
-
title:
|
|
2360
|
-
description:
|
|
2361
|
-
schema:
|
|
2362
|
-
ui:
|
|
2578
|
+
title: z9.string().min(1),
|
|
2579
|
+
description: z9.string().optional(),
|
|
2580
|
+
schema: z9.record(z9.string(), z9.unknown()).optional().describe("JSON Schema object for the human feedback form"),
|
|
2581
|
+
ui: z9.record(z9.string(), z9.unknown()).optional().describe(
|
|
2363
2582
|
'RJSF ui schema overrides (ui:widget, ui:enumNames, etc.). Use ui:widget "radio" for 2\u20136 discrete choices rendered as tappable cards.'
|
|
2364
2583
|
),
|
|
2365
|
-
data:
|
|
2584
|
+
data: z9.record(z9.string(), z9.unknown()).optional().describe("Optional default form field values")
|
|
2366
2585
|
});
|
|
2367
|
-
var requestActionInputToolOutputSchema =
|
|
2368
|
-
actionId:
|
|
2369
|
-
data:
|
|
2586
|
+
var requestActionInputToolOutputSchema = z9.object({
|
|
2587
|
+
actionId: z9.string().min(1),
|
|
2588
|
+
data: z9.record(z9.string(), z9.unknown())
|
|
2370
2589
|
});
|
|
2371
|
-
var requestActionInputToolInputSchema =
|
|
2372
|
-
prompt:
|
|
2590
|
+
var requestActionInputToolInputSchema = z9.object({
|
|
2591
|
+
prompt: z9.string().optional().describe("Optional heading shown above the action widget in chat"),
|
|
2373
2592
|
action: requestActionInputActionSchema.describe(
|
|
2374
2593
|
"Action widget config: JSON Schema form fields and optional RJSF ui overrides (same shape as RobotRock inbox actions)"
|
|
2375
2594
|
)
|
|
@@ -2393,24 +2612,24 @@ function requestActionInputTool(options = {}) {
|
|
|
2393
2612
|
import { tool as tool5 } from "ai";
|
|
2394
2613
|
|
|
2395
2614
|
// src/ai/report-status-tool-core.ts
|
|
2396
|
-
import { z as
|
|
2397
|
-
var reportStatusPhaseSchema =
|
|
2615
|
+
import { z as z10 } from "zod";
|
|
2616
|
+
var reportStatusPhaseSchema = z10.enum([
|
|
2398
2617
|
"info",
|
|
2399
2618
|
"running",
|
|
2400
2619
|
"waiting",
|
|
2401
2620
|
"succeeded",
|
|
2402
2621
|
"failed"
|
|
2403
2622
|
]);
|
|
2404
|
-
var reportStatusToolInputSchema =
|
|
2405
|
-
message:
|
|
2623
|
+
var reportStatusToolInputSchema = z10.object({
|
|
2624
|
+
message: z10.string().min(1).describe(
|
|
2406
2625
|
"Short progress update shown in chat (1-2 sentences). Use while researching, drafting, or waiting on external work."
|
|
2407
2626
|
),
|
|
2408
2627
|
phase: reportStatusPhaseSchema.optional().describe(
|
|
2409
2628
|
"Lifecycle phase for the status marker. Defaults to running. Use succeeded or failed when a step finishes."
|
|
2410
2629
|
)
|
|
2411
2630
|
});
|
|
2412
|
-
var reportStatusToolOutputSchema =
|
|
2413
|
-
message:
|
|
2631
|
+
var reportStatusToolOutputSchema = z10.object({
|
|
2632
|
+
message: z10.string().min(1),
|
|
2414
2633
|
phase: reportStatusPhaseSchema
|
|
2415
2634
|
});
|
|
2416
2635
|
function normalizeReportStatusToolInput(input) {
|
|
@@ -2698,9 +2917,9 @@ async function runWithRobotRockApprovals(options) {
|
|
|
2698
2917
|
import { tool as tool6 } from "ai";
|
|
2699
2918
|
|
|
2700
2919
|
// src/ai/close-chat-tool-core.ts
|
|
2701
|
-
import { z as
|
|
2702
|
-
var closeChatToolInputSchema =
|
|
2703
|
-
reason:
|
|
2920
|
+
import { z as z11 } from "zod";
|
|
2921
|
+
var closeChatToolInputSchema = z11.object({
|
|
2922
|
+
reason: z11.string().optional().describe(
|
|
2704
2923
|
"Short reason the conversation is being closed (recorded on the audit trail)."
|
|
2705
2924
|
)
|
|
2706
2925
|
});
|