robotrock 1.1.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +2 -2
  2. package/dist/agent-admin.d.ts +82 -0
  3. package/dist/agent-admin.js +938 -0
  4. package/dist/agent-admin.js.map +1 -0
  5. package/dist/ai/index.d.ts +6 -5
  6. package/dist/ai/index.js +407 -188
  7. package/dist/ai/index.js.map +1 -1
  8. package/dist/ai/trigger.d.ts +4 -3
  9. package/dist/ai/trigger.js +407 -188
  10. package/dist/ai/trigger.js.map +1 -1
  11. package/dist/ai/workflow.d.ts +4 -3
  12. package/dist/ai/workflow.js +404 -185
  13. package/dist/ai/workflow.js.map +1 -1
  14. package/dist/auth-headers-qL-ZeEtd.d.ts +13 -0
  15. package/dist/{client-XTnFHGFE.d.ts → client-YO9Y1rkH.d.ts} +29 -17
  16. package/dist/eve/agent/index.d.ts +11 -35
  17. package/dist/eve/agent/index.js +678 -146
  18. package/dist/eve/agent/index.js.map +1 -1
  19. package/dist/eve/index.d.ts +5 -2
  20. package/dist/eve/index.js +195 -2
  21. package/dist/eve/index.js.map +1 -1
  22. package/dist/eve/tools/admin/assign-tasks.d.ts +39 -0
  23. package/dist/eve/tools/admin/assign-tasks.js +1060 -0
  24. package/dist/eve/tools/admin/assign-tasks.js.map +1 -0
  25. package/dist/eve/tools/admin/manage-groups.d.ts +53 -0
  26. package/dist/eve/tools/admin/manage-groups.js +1218 -0
  27. package/dist/eve/tools/admin/manage-groups.js.map +1 -0
  28. package/dist/eve/tools/admin/manage-team-members.d.ts +45 -0
  29. package/dist/eve/tools/admin/manage-team-members.js +1160 -0
  30. package/dist/eve/tools/admin/manage-team-members.js.map +1 -0
  31. package/dist/eve/tools/admin/query-tasks.d.ts +71 -0
  32. package/dist/eve/tools/admin/query-tasks.js +1161 -0
  33. package/dist/eve/tools/admin/query-tasks.js.map +1 -0
  34. package/dist/eve/tools/catalog/search-products.d.ts +57 -0
  35. package/dist/eve/tools/catalog/search-products.js +94 -0
  36. package/dist/eve/tools/catalog/search-products.js.map +1 -0
  37. package/dist/eve/tools/identity/index.d.ts +2 -0
  38. package/dist/eve/tools/identity/index.js +117 -27
  39. package/dist/eve/tools/identity/index.js.map +1 -1
  40. package/dist/eve/tools/identity/my-access.d.ts +6 -46
  41. package/dist/eve/tools/identity/my-access.js +91 -10
  42. package/dist/eve/tools/identity/my-access.js.map +1 -1
  43. package/dist/eve/tools/identity/whoami.d.ts +7 -8
  44. package/dist/eve/tools/identity/whoami.js +33 -17
  45. package/dist/eve/tools/identity/whoami.js.map +1 -1
  46. package/dist/eve/tools/inbox/create-task.d.ts +5 -4
  47. package/dist/eve/tools/inbox/create-task.js +365 -137
  48. package/dist/eve/tools/inbox/create-task.js.map +1 -1
  49. package/dist/eve/tools/inbox/index.d.ts +1 -0
  50. package/dist/eve/tools/inbox/index.js +365 -137
  51. package/dist/eve/tools/inbox/index.js.map +1 -1
  52. package/dist/eve/tools/index.d.ts +7 -0
  53. package/dist/eve/tools/index.js +1362 -168
  54. package/dist/eve/tools/index.js.map +1 -1
  55. package/dist/{index-BL9qKHA8.d.ts → index-DoQN48Bm.d.ts} +61 -2
  56. package/dist/index.d.ts +6 -3
  57. package/dist/index.js +325 -119
  58. package/dist/index.js.map +1 -1
  59. package/dist/schemas/index.d.ts +6 -1
  60. package/dist/schemas/index.js +177 -48
  61. package/dist/schemas/index.js.map +1 -1
  62. package/dist/{tool-approval-bridge-C4bTm8vu.d.ts → tool-approval-bridge-aMA79Z1B.d.ts} +1 -1
  63. package/dist/tool-reply-guidance-C3qrT1In.d.ts +25 -0
  64. package/dist/trigger/index.d.ts +2 -1
  65. package/dist/trigger/index.js +310 -108
  66. package/dist/trigger/index.js.map +1 -1
  67. package/dist/{trigger-Dn0DFiyU.d.ts → trigger-CXrbKVCL.d.ts} +2 -2
  68. package/dist/workflow/index.d.ts +2 -1
  69. package/dist/workflow/index.js +310 -108
  70. package/dist/workflow/index.js.map +1 -1
  71. package/package.json +30 -6
@@ -0,0 +1,13 @@
1
+ type RobotRockAuthConfig = {
2
+ kind: "apiKey";
3
+ apiKey: string;
4
+ actingUserId?: string;
5
+ } | {
6
+ kind: "agentService";
7
+ token: string;
8
+ tenantSlug: string;
9
+ connectionId: string;
10
+ actingUserId?: string;
11
+ };
12
+
13
+ export type { RobotRockAuthConfig as R };
@@ -1,15 +1,7 @@
1
- import { TaskContextInput, AssignToInput as AssignToInput$1, TaskPriority, ThreadUpdateStatus, TaskResponse, Task, ThreadUpdate, TaskContextFormatVersion, DiscriminatedApprovalResult } from './schemas/index.js';
2
- import { AssignToInput, AgentChatSeedMessage, AgentChatStageHitlBody, AgentChatAuditInputBody, AgentChatLinkTaskBody } from '@robotrock/core';
3
-
4
- type RobotRockAuthConfig = {
5
- kind: "apiKey";
6
- apiKey: string;
7
- } | {
8
- kind: "agentService";
9
- token: string;
10
- tenantSlug: string;
11
- connectionId: string;
12
- };
1
+ import { TaskContextInput, AssignToInput, TaskPriority, ThreadUpdateStatus, TaskResponse, Task, ThreadUpdate, TaskContextFormatVersion, DiscriminatedApprovalResult } from './schemas/index.js';
2
+ import { AgentChatSeedMessage, AgentChatStageHitlBody, AgentChatAuditInputBody, AgentChatAuditToolBody, AgentChatLinkTaskBody, listTasksQuerySchema, AgentAdminTaskSummary } from '@robotrock/core';
3
+ import { z } from 'zod';
4
+ import { R as RobotRockAuthConfig } from './auth-headers-qL-ZeEtd.js';
13
5
 
14
6
  /** A chat created via {@link ChatsApi.create}. */
15
7
  type CreatedChat = {
@@ -32,8 +24,8 @@ type CreateChatInput = {
32
24
  connectionId?: string;
33
25
  /** Inbox app bucket. Overrides the client `app` when set. */
34
26
  app?: string;
35
- /** Assign to tenant users (email) and/or groups (slug). Narrows inbox visibility. */
36
- assignTo?: AssignToInput;
27
+ /** Email of the user who owns the chat. Required unless `parentChatId` is set. */
28
+ ownerEmail?: string;
37
29
  /** Chat title shown in the inbox. */
38
30
  title: string;
39
31
  /** Seed messages to preload the conversation. Defaults to a welcome message. */
@@ -45,12 +37,13 @@ type CloseChatOptions = {
45
37
  /** Optional human-readable reason recorded on the audit trail. */
46
38
  reason?: string;
47
39
  };
40
+ type LogChatToolExecutionInput = AgentChatAuditToolBody;
48
41
  type LogChatInputSubmissionInput = AgentChatAuditInputBody;
49
42
  type StageChatHitlRequestsInput = AgentChatStageHitlBody;
50
43
  type LinkChatTaskInput = AgentChatLinkTaskBody;
51
44
  type StagedChatHitlRequest = StageChatHitlRequestsInput["requests"][number];
52
45
  interface ChatsApi {
53
- /** Create one or more agent chats and assign them (task-style). */
46
+ /** Create an agent chat owned by a single user. */
54
47
  create(input: CreateChatInput): Promise<CreateChatResult>;
55
48
  /** Close (archive) a chat by its public chatId — e.g. when an agent is done. */
56
49
  close(chatId: string, options?: CloseChatOptions): Promise<void>;
@@ -60,6 +53,8 @@ interface ChatsApi {
60
53
  getStagedHitlRequests(eveSessionId: string): Promise<StagedChatHitlRequest[]>;
61
54
  /** Log an Eve HITL choice to the RobotRock chat audit trail. */
62
55
  logInputSubmission(input: LogChatInputSubmissionInput): Promise<void>;
56
+ /** Log a mutating Eve tool execution to the RobotRock chat audit trail. */
57
+ logToolExecution(input: LogChatToolExecutionInput): Promise<void>;
63
58
  /** Link an inbox task to the originating Eve chat session. */
64
59
  linkTask(input: LinkChatTaskInput): Promise<void>;
65
60
  }
@@ -139,7 +134,7 @@ type SendToHumanInput<A extends readonly SendToHumanActionInput[] = readonly Sen
139
134
  /** Optional idempotency key to prevent duplicate tasks */
140
135
  idempotencyKey?: string;
141
136
  /** Assign to tenant users (email) and/or groups (slug). Narrows inbox visibility. */
142
- assignTo?: AssignToInput$1;
137
+ assignTo?: AssignToInput;
143
138
  /**
144
139
  * Groups related tasks together in the inbox. Omit to let the server generate
145
140
  * one (returned as `task.threadId`) and reuse it on later tasks in the thread.
@@ -186,6 +181,11 @@ type SendToHumanResult<A extends readonly SendToHumanActionInput[] = readonly Se
186
181
  task: TaskResponse["task"];
187
182
  } & DiscriminatedApprovalResult<A>);
188
183
 
184
+ type ListTasksInput = z.infer<typeof listTasksQuerySchema>;
185
+ type SearchTasksInput = {
186
+ q: string;
187
+ limit?: number;
188
+ };
189
189
  /** Task CRUD surface, exposed as `client.tasks`. */
190
190
  interface TasksApi {
191
191
  /** Create a task via POST /v1 without waiting for a human response. */
@@ -196,6 +196,16 @@ interface TasksApi {
196
196
  cancel(taskId: string): Promise<void>;
197
197
  /** Log a status update against a thread. */
198
198
  sendUpdate(input: SendUpdateInput): Promise<ThreadUpdate>;
199
+ /** List tasks in the workspace for this API key. */
200
+ list(input?: ListTasksInput): Promise<{
201
+ items: AgentAdminTaskSummary[];
202
+ nextCursor: string | null;
203
+ }>;
204
+ /** Search tasks by type, name, description, or id. */
205
+ search(input: SearchTasksInput): Promise<{
206
+ items: AgentAdminTaskSummary[];
207
+ total: number;
208
+ }>;
199
209
  }
200
210
  /**
201
211
  * RobotRock API client for creating and querying human-in-the-loop tasks and
@@ -241,8 +251,10 @@ declare class RobotRock {
241
251
  private getTaskById;
242
252
  private sendThreadUpdate;
243
253
  private cancelTaskRequest;
254
+ private listTasksRequest;
255
+ private searchTasksRequest;
244
256
  }
245
257
  declare function createClient(config: RobotRockConfig): RobotRock;
246
258
  declare function attachWebhookToActions(actions: readonly SendToHumanActionInput[], webhook: RobotRockWebhookConfig): TaskContextInput["actions"];
247
259
 
248
- export { type ChatsApi as C, RobotRock as R, type SendToHumanActionInput as S, type TasksApi as T, type SendToHumanInput as a, type RobotRockConfig as b, type CloseChatOptions as c, type CreateChatInput as d, type CreateChatResult as e, type CreatedChat as f, type RobotRockAdvancedConfig as g, type RobotRockPollingClientConfig as h, type RobotRockPollingOptions as i, type RobotRockWebhookClientConfig as j, type RobotRockWebhookConfig as k, type SendToHumanResult as l, type SendToHumanValidUntil as m, type SendUpdateInput as n, type StageChatHitlRequestsInput as o, type StagedChatHitlRequest as p, attachWebhookToActions as q, createChatsApi as r, createClient as s };
260
+ export { type ChatsApi as C, type ListTasksInput as L, RobotRock as R, type SendToHumanActionInput as S, type TasksApi as T, type SendToHumanInput as a, type RobotRockConfig as b, type CloseChatOptions as c, type CreateChatInput as d, type CreateChatResult as e, type CreatedChat as f, type RobotRockAdvancedConfig as g, type RobotRockPollingClientConfig as h, type RobotRockPollingOptions as i, type RobotRockWebhookClientConfig as j, type RobotRockWebhookConfig as k, type SearchTasksInput as l, type SendToHumanResult as m, type SendToHumanValidUntil as n, type SendUpdateInput as o, type StageChatHitlRequestsInput as p, type StagedChatHitlRequest as q, attachWebhookToActions as r, createChatsApi as s, createClient as t };
@@ -1,16 +1,19 @@
1
1
  export { a as TenantCaller, T as TenantRole, i as isAdminCaller, r as requireAdminCaller, b as requireTenantCaller, t as tryResolveTenantCaller } from '../../tenant-5YKDrdC-.js';
2
2
  import { AuthFn, vercelOidc } from 'eve/channels/auth';
3
3
  import * as eve_channels_eve from 'eve/channels/eve';
4
- import { R as RobotRock, p as StagedChatHitlRequest, a as SendToHumanInput, S as SendToHumanActionInput, e as CreateChatResult } from '../../client-XTnFHGFE.js';
4
+ import { R as RobotRock, q as StagedChatHitlRequest, a as SendToHumanInput, S as SendToHumanActionInput, e as CreateChatResult } from '../../client-YO9Y1rkH.js';
5
5
  import { SessionContext } from 'eve/context';
6
6
  import { TaskPriority } from '../../schemas/index.js';
7
- import * as node_modules_eve_dist_src_protocol_message_js from 'node_modules/eve/dist/src/protocol/message.js';
8
- import { HookContext } from 'eve/hooks';
7
+ import { HookDefinition } from 'eve/hooks';
8
+ export { AgentAdminApi, createAgentAdminApi, createBoundAgentAdminClient, requireBoundAgentAdminClient } from '../../agent-admin.js';
9
9
  export { ROBOTROCK_PLATFORM_USER_CONTEXT_PUBLIC_KEY_URL } from '@robotrock/core/eve/platform-user-context-public-key';
10
- export { R as ROBOTROCK_READY_HOOK_SLUG } from '../../index-BL9qKHA8.js';
10
+ export { R as ROBOTROCK_READY_HOOK_SLUG } from '../../index-DoQN48Bm.js';
11
11
  export { ROBOTROCK_USER_CONTEXT_AUDIENCE, ROBOTROCK_USER_CONTEXT_ISSUER } from '@robotrock/core/eve/user-context-jwt';
12
12
  import '@robotrock/core';
13
13
  import 'zod';
14
+ import '../../auth-headers-qL-ZeEtd.js';
15
+ import '@robotrock/core/schemas';
16
+ import '../../tool-reply-guidance-C3qrT1In.js';
14
17
 
15
18
  /** Header carrying the dashboard user-context JWT on proxied Eve requests. */
16
19
  declare const ROBOTROCK_USER_CONTEXT_HEADER = "x-robotrock-user-token";
@@ -97,7 +100,7 @@ declare function resolveTaskHandledWebhookUrl(baseUrl: string): string;
97
100
  declare function createRobotRockTask(input: CreateRobotRockTaskInput, ctx: SessionContext): Promise<{
98
101
  taskId: string;
99
102
  threadId: string;
100
- status: "pending" | "open";
103
+ status: "open" | "pending";
101
104
  validUntil: string;
102
105
  submittedAt: string;
103
106
  }>;
@@ -137,10 +140,7 @@ type CreateRobotRockCronChatInput = {
137
140
  text: string;
138
141
  }[];
139
142
  agentIdentifier?: string;
140
- assignTo?: {
141
- users?: string[];
142
- groups?: string[];
143
- };
143
+ ownerEmail: string;
144
144
  };
145
145
  /** Create an inbox chat from an Eve schedule via the RobotRock API. */
146
146
  declare function createRobotRockCronChat(input: CreateRobotRockCronChatInput): Promise<CreateChatResult>;
@@ -157,32 +157,8 @@ declare function defineRobotRockReadyHook(): {};
157
157
 
158
158
  /** Reset logged idempotency keys (tests only). */
159
159
  declare function resetRobotrockChatAuditIdempotencyKeys(): void;
160
- declare const robotrockChatAuditHook: {
161
- events: {
162
- "input.requested"(event: node_modules_eve_dist_src_protocol_message_js.InputRequestedStreamEvent & {
163
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
164
- }, ctx: HookContext): Promise<void>;
165
- "message.received"(event: node_modules_eve_dist_src_protocol_message_js.MessageReceivedStreamEvent & {
166
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
167
- }, ctx: HookContext): Promise<void>;
168
- "action.result"(event: node_modules_eve_dist_src_protocol_message_js.ActionResultStreamEvent & {
169
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
170
- }, ctx: HookContext): Promise<void>;
171
- };
172
- };
160
+ declare const robotrockChatAuditHook: HookDefinition;
173
161
  /** Alias for agents that prefer a factory name. */
174
- declare function defineRobotRockChatAuditHook(): {
175
- events: {
176
- "input.requested"(event: node_modules_eve_dist_src_protocol_message_js.InputRequestedStreamEvent & {
177
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
178
- }, ctx: HookContext): Promise<void>;
179
- "message.received"(event: node_modules_eve_dist_src_protocol_message_js.MessageReceivedStreamEvent & {
180
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
181
- }, ctx: HookContext): Promise<void>;
182
- "action.result"(event: node_modules_eve_dist_src_protocol_message_js.ActionResultStreamEvent & {
183
- readonly meta?: node_modules_eve_dist_src_protocol_message_js.HandleMessageStreamEventMeta;
184
- }, ctx: HookContext): Promise<void>;
185
- };
186
- };
162
+ declare function defineRobotRockChatAuditHook(): HookDefinition;
187
163
 
188
164
  export { type CreateRobotRockCronChatInput, type CreateRobotRockTaskInput, ROBOTROCK_USER_CONTEXT_HEADER, type RobotRockChatAuditPayload, type RobotRockTaskActionInput, type RobotRockTaskAssignToInput, type RobotRockTaskContextInput, type RobotRockTaskToolInput, type RobotrockEveChannelOptions, type RobotrockUserContextAuthOptions, buildRobotRockTaskPayload, createRobotRockCronChat, createRobotRockTask, defineRobotRockChatAuditHook, defineRobotRockReadyHook, eveSelfServiceAuth, fetchRobotRockStagedHitl, postRobotRockChatInputAudit, postRobotRockLinkChatTask, postRobotRockStageHitl, resetBoundClientAuthWarning, resetChatAuditWarnings, resetRobotrockChatAuditIdempotencyKeys, resolvePlatformUserContextPublicKeyPem, resolveTaskHandledWebhookUrl, robotrockAgentServiceAuth, robotrockChatAuditHook, robotrockEveChannel, robotrockReadyHook, robotrockUserContextAuth, tryCreateBoundRobotRockClient };