robotrock 1.0.0 → 1.1.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/ai/index.d.ts +5 -5
- package/dist/ai/index.js +285 -47
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/trigger.d.ts +3 -3
- package/dist/ai/trigger.js +285 -47
- package/dist/ai/trigger.js.map +1 -1
- package/dist/ai/workflow.d.ts +3 -3
- package/dist/ai/workflow.js +285 -47
- package/dist/ai/workflow.js.map +1 -1
- package/dist/{client-CzVmjXpz.d.ts → client-XTnFHGFE.d.ts} +34 -5
- package/dist/eve/agent/index.d.ts +188 -0
- package/dist/eve/agent/index.js +2322 -0
- package/dist/eve/agent/index.js.map +1 -0
- package/dist/eve/index.d.ts +5 -0
- package/dist/eve/index.js +446 -0
- package/dist/eve/index.js.map +1 -0
- package/dist/eve/tools/identity/index.d.ts +6 -0
- package/dist/eve/tools/identity/index.js +144 -0
- package/dist/eve/tools/identity/index.js.map +1 -0
- package/dist/eve/tools/identity/my-access.d.ts +58 -0
- package/dist/eve/tools/identity/my-access.js +106 -0
- package/dist/eve/tools/identity/my-access.js.map +1 -0
- package/dist/eve/tools/identity/whoami.d.ts +45 -0
- package/dist/eve/tools/identity/whoami.js +101 -0
- package/dist/eve/tools/identity/whoami.js.map +1 -0
- package/dist/eve/tools/inbox/create-task.d.ts +113 -0
- package/dist/eve/tools/inbox/create-task.js +1557 -0
- package/dist/eve/tools/inbox/create-task.js.map +1 -0
- package/dist/eve/tools/inbox/index.d.ts +5 -0
- package/dist/eve/tools/inbox/index.js +1557 -0
- package/dist/eve/tools/inbox/index.js.map +1 -0
- package/dist/eve/tools/index.d.ts +17 -0
- package/dist/eve/tools/index.js +1654 -0
- package/dist/eve/tools/index.js.map +1 -0
- package/dist/index-BL9qKHA8.d.ts +141 -0
- package/dist/index.d.ts +5 -44
- package/dist/index.js +541 -42
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.js +75 -12
- package/dist/schemas/index.js.map +1 -1
- package/dist/tenant-5YKDrdC-.d.ts +23 -0
- package/dist/{tool-approval-bridge-DbwUEBHv.d.ts → tool-approval-bridge-C4bTm8vu.d.ts} +1 -1
- package/dist/trigger/index.d.ts +1 -1
- package/dist/trigger/index.js +256 -42
- package/dist/trigger/index.js.map +1 -1
- package/dist/{trigger-BCKBbAV7.d.ts → trigger-Dn0DFiyU.d.ts} +2 -2
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.js +256 -42
- package/dist/workflow/index.js.map +1 -1
- package/package.json +44 -7
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { TaskContextInput, AssignToInput as AssignToInput$1, TaskPriority, ThreadUpdateStatus, TaskResponse, Task, ThreadUpdate, TaskContextFormatVersion, DiscriminatedApprovalResult } from './schemas/index.js';
|
|
2
|
-
import { AssignToInput, AgentChatSeedMessage } from '@robotrock/core';
|
|
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
|
+
};
|
|
3
13
|
|
|
4
14
|
/** A chat created via {@link ChatsApi.create}. */
|
|
5
15
|
type CreatedChat = {
|
|
@@ -35,11 +45,23 @@ type CloseChatOptions = {
|
|
|
35
45
|
/** Optional human-readable reason recorded on the audit trail. */
|
|
36
46
|
reason?: string;
|
|
37
47
|
};
|
|
48
|
+
type LogChatInputSubmissionInput = AgentChatAuditInputBody;
|
|
49
|
+
type StageChatHitlRequestsInput = AgentChatStageHitlBody;
|
|
50
|
+
type LinkChatTaskInput = AgentChatLinkTaskBody;
|
|
51
|
+
type StagedChatHitlRequest = StageChatHitlRequestsInput["requests"][number];
|
|
38
52
|
interface ChatsApi {
|
|
39
53
|
/** Create one or more agent chats and assign them (task-style). */
|
|
40
54
|
create(input: CreateChatInput): Promise<CreateChatResult>;
|
|
41
55
|
/** Close (archive) a chat by its public chatId — e.g. when an agent is done. */
|
|
42
56
|
close(chatId: string, options?: CloseChatOptions): Promise<void>;
|
|
57
|
+
/** Persist pending Eve HITL requests on the chat for durable audit logging. */
|
|
58
|
+
stageHitlRequests(input: StageChatHitlRequestsInput): Promise<void>;
|
|
59
|
+
/** Read pending Eve HITL requests staged on the chat. */
|
|
60
|
+
getStagedHitlRequests(eveSessionId: string): Promise<StagedChatHitlRequest[]>;
|
|
61
|
+
/** Log an Eve HITL choice to the RobotRock chat audit trail. */
|
|
62
|
+
logInputSubmission(input: LogChatInputSubmissionInput): Promise<void>;
|
|
63
|
+
/** Link an inbox task to the originating Eve chat session. */
|
|
64
|
+
linkTask(input: LinkChatTaskInput): Promise<void>;
|
|
43
65
|
}
|
|
44
66
|
/**
|
|
45
67
|
* Build the `client.chats` namespace. Mirrors the `client.tasks` surface for the
|
|
@@ -47,7 +69,7 @@ interface ChatsApi {
|
|
|
47
69
|
*/
|
|
48
70
|
declare function createChatsApi(config: {
|
|
49
71
|
baseUrl: string;
|
|
50
|
-
|
|
72
|
+
auth: RobotRockAuthConfig;
|
|
51
73
|
app?: string;
|
|
52
74
|
}): ChatsApi;
|
|
53
75
|
|
|
@@ -71,8 +93,14 @@ type RobotRockAdvancedConfig = {
|
|
|
71
93
|
contextVersion?: TaskContextFormatVersion;
|
|
72
94
|
};
|
|
73
95
|
type RobotRockClientBaseConfig = {
|
|
74
|
-
/** Optional override for API key. Falls back to ROBOTROCK_API_KEY. */
|
|
96
|
+
/** Optional override for API key. Falls back to ROBOTROCK_API_KEY when agentService is unset. */
|
|
75
97
|
apiKey?: string;
|
|
98
|
+
/** Hosted-agent service auth (mutually exclusive with apiKey). */
|
|
99
|
+
agentService?: {
|
|
100
|
+
token: string;
|
|
101
|
+
tenantSlug: string;
|
|
102
|
+
connectionId: string;
|
|
103
|
+
};
|
|
76
104
|
/**
|
|
77
105
|
* Base URL for the RobotRock API
|
|
78
106
|
* @default "https://api.robotrock.io/v1"
|
|
@@ -175,7 +203,7 @@ interface TasksApi {
|
|
|
175
203
|
* `sendToHuman` verb stays top-level.
|
|
176
204
|
*/
|
|
177
205
|
declare class RobotRock {
|
|
178
|
-
private readonly
|
|
206
|
+
private readonly auth;
|
|
179
207
|
private readonly baseUrl;
|
|
180
208
|
private readonly app?;
|
|
181
209
|
private readonly agentVersion?;
|
|
@@ -187,6 +215,7 @@ declare class RobotRock {
|
|
|
187
215
|
/** Chat CRUD: `create`, `close`. */
|
|
188
216
|
readonly chats: ChatsApi;
|
|
189
217
|
constructor(config: RobotRockConfig);
|
|
218
|
+
private authHeaders;
|
|
190
219
|
private createTaskRequest;
|
|
191
220
|
sendToHuman<const A extends readonly SendToHumanActionInput[]>(task: SendToHumanWithAppInput<A>): Promise<SendToHumanResult<A>>;
|
|
192
221
|
/**
|
|
@@ -216,4 +245,4 @@ declare class RobotRock {
|
|
|
216
245
|
declare function createClient(config: RobotRockConfig): RobotRock;
|
|
217
246
|
declare function attachWebhookToActions(actions: readonly SendToHumanActionInput[], webhook: RobotRockWebhookConfig): TaskContextInput["actions"];
|
|
218
247
|
|
|
219
|
-
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,
|
|
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 };
|
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
import { AuthFn, vercelOidc } from 'eve/channels/auth';
|
|
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';
|
|
5
|
+
import { SessionContext } from 'eve/context';
|
|
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';
|
|
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';
|
|
11
|
+
export { ROBOTROCK_USER_CONTEXT_AUDIENCE, ROBOTROCK_USER_CONTEXT_ISSUER } from '@robotrock/core/eve/user-context-jwt';
|
|
12
|
+
import '@robotrock/core';
|
|
13
|
+
import 'zod';
|
|
14
|
+
|
|
15
|
+
/** Header carrying the dashboard user-context JWT on proxied Eve requests. */
|
|
16
|
+
declare const ROBOTROCK_USER_CONTEXT_HEADER = "x-robotrock-user-token";
|
|
17
|
+
|
|
18
|
+
type RobotrockUserContextAuthOptions = {
|
|
19
|
+
publicKeyPem?: string | (() => Promise<string | null>);
|
|
20
|
+
hmacSecret?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Verifies the short-lived user-context JWT minted by the RobotRock dashboard
|
|
24
|
+
* Eve proxy (`X-RobotRock-User-Token`). Hosted tenants use RS256 platform JWTs;
|
|
25
|
+
* self-hosted deployments use per-connection HMAC secrets.
|
|
26
|
+
*/
|
|
27
|
+
declare function robotrockUserContextAuth(options?: RobotrockUserContextAuthOptions): AuthFn<Request>;
|
|
28
|
+
/**
|
|
29
|
+
* Bearer `ras_*` service token for RobotRock platform reachability probes
|
|
30
|
+
* (`GET /eve/v1/info` during verify and tenant connect).
|
|
31
|
+
*/
|
|
32
|
+
declare function robotrockAgentServiceAuth(): AuthFn<Request>;
|
|
33
|
+
/** Bearer token used by the RobotRock webhook resume self-call. */
|
|
34
|
+
declare function eveSelfServiceAuth(): AuthFn<Request>;
|
|
35
|
+
|
|
36
|
+
/** Resolve the platform RS256 public key used to verify dashboard user-context JWTs. */
|
|
37
|
+
declare function resolvePlatformUserContextPublicKeyPem(): Promise<string | null>;
|
|
38
|
+
|
|
39
|
+
type RobotrockEveChannelOptions = {
|
|
40
|
+
/** Your existing webapp auth — stacked after RobotRock user-context auth. */
|
|
41
|
+
auth?: AuthFn<Request>[];
|
|
42
|
+
/** Include RobotRock user-context + service auth. @default true */
|
|
43
|
+
robotrock?: boolean;
|
|
44
|
+
/** Include localDev() fallback. @default true when NODE_ENV !== "production" */
|
|
45
|
+
localDev?: boolean;
|
|
46
|
+
/** Optional Vercel OIDC allowlist (dashboard ↔ agent on Vercel). */
|
|
47
|
+
vercelOidc?: Parameters<typeof vercelOidc>[0] | false;
|
|
48
|
+
/** Options passed to robotrockUserContextAuth when robotrock is enabled. */
|
|
49
|
+
userContextAuth?: RobotrockUserContextAuthOptions;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Compose the default Eve HTTP channel with RobotRock dashboard auth stacked
|
|
53
|
+
* alongside optional existing webapp authenticators.
|
|
54
|
+
*/
|
|
55
|
+
declare function robotrockEveChannel(options?: RobotrockEveChannelOptions): eve_channels_eve.EveChannel;
|
|
56
|
+
|
|
57
|
+
/** Create a RobotRock client bound to the current Eve session tenant context. */
|
|
58
|
+
declare function tryCreateBoundRobotRockClient(ctx: SessionContext): RobotRock | null;
|
|
59
|
+
/** Reset missing-auth warning (tests only). */
|
|
60
|
+
declare function resetBoundClientAuthWarning(): void;
|
|
61
|
+
|
|
62
|
+
type RobotRockChatAuditPayload = {
|
|
63
|
+
eveSessionId: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
actionId: string;
|
|
66
|
+
actionTitle?: string;
|
|
67
|
+
prompt?: string;
|
|
68
|
+
data?: Record<string, unknown>;
|
|
69
|
+
idempotencyKey?: string;
|
|
70
|
+
requestId?: string;
|
|
71
|
+
toolCallId?: string;
|
|
72
|
+
};
|
|
73
|
+
/** Observe-only audit POST — never throws. */
|
|
74
|
+
declare function postRobotRockChatInputAudit(ctx: SessionContext, payload: RobotRockChatAuditPayload): Promise<void>;
|
|
75
|
+
/** Persist pending HITL requests across Eve durable waits — never throws. */
|
|
76
|
+
declare function postRobotRockStageHitl(ctx: SessionContext, input: {
|
|
77
|
+
eveSessionId: string;
|
|
78
|
+
requests: StagedChatHitlRequest[];
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
/** Load staged HITL requests from Convex — returns [] on failure. */
|
|
81
|
+
declare function fetchRobotRockStagedHitl(ctx: SessionContext, eveSessionId: string): Promise<StagedChatHitlRequest[]>;
|
|
82
|
+
/** Register an inbox task with its originating Eve chat session — never throws. */
|
|
83
|
+
declare function postRobotRockLinkChatTask(ctx: SessionContext, input: {
|
|
84
|
+
eveSessionId: string;
|
|
85
|
+
publicTaskId: string;
|
|
86
|
+
toolCallId: string;
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
/** Reset audit warning flags (tests only). */
|
|
89
|
+
declare function resetChatAuditWarnings(): void;
|
|
90
|
+
|
|
91
|
+
type CreateRobotRockTaskInput = SendToHumanInput<readonly SendToHumanActionInput[]> & {
|
|
92
|
+
app?: string;
|
|
93
|
+
};
|
|
94
|
+
/** Resolve the webhook URL RobotRock calls when a delegated inbox task is handled. */
|
|
95
|
+
declare function resolveTaskHandledWebhookUrl(baseUrl: string): string;
|
|
96
|
+
/** Create an inbox task via POST /v1 without waiting for a human response. */
|
|
97
|
+
declare function createRobotRockTask(input: CreateRobotRockTaskInput, ctx: SessionContext): Promise<{
|
|
98
|
+
taskId: string;
|
|
99
|
+
threadId: string;
|
|
100
|
+
status: "pending" | "open";
|
|
101
|
+
validUntil: string;
|
|
102
|
+
submittedAt: string;
|
|
103
|
+
}>;
|
|
104
|
+
type RobotRockTaskActionInput = {
|
|
105
|
+
id: string;
|
|
106
|
+
title: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
};
|
|
109
|
+
type RobotRockTaskAssignToInput = {
|
|
110
|
+
users?: string[];
|
|
111
|
+
groups?: string[];
|
|
112
|
+
};
|
|
113
|
+
type RobotRockTaskContextInput = {
|
|
114
|
+
data?: Record<string, unknown>;
|
|
115
|
+
ui?: Record<string, unknown>;
|
|
116
|
+
};
|
|
117
|
+
type RobotRockTaskToolInput = {
|
|
118
|
+
type: string;
|
|
119
|
+
name: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
actions: RobotRockTaskActionInput[];
|
|
122
|
+
assignTo?: RobotRockTaskAssignToInput;
|
|
123
|
+
context?: RobotRockTaskContextInput;
|
|
124
|
+
validUntilHours?: number;
|
|
125
|
+
priority?: TaskPriority;
|
|
126
|
+
updateMessage?: string;
|
|
127
|
+
app?: string;
|
|
128
|
+
};
|
|
129
|
+
declare function buildRobotRockTaskPayload(input: RobotRockTaskToolInput, options?: {
|
|
130
|
+
requestedByEmail?: string;
|
|
131
|
+
}): CreateRobotRockTaskInput;
|
|
132
|
+
|
|
133
|
+
type CreateRobotRockCronChatInput = {
|
|
134
|
+
title: string;
|
|
135
|
+
messages: {
|
|
136
|
+
role: "user" | "assistant";
|
|
137
|
+
text: string;
|
|
138
|
+
}[];
|
|
139
|
+
agentIdentifier?: string;
|
|
140
|
+
assignTo?: {
|
|
141
|
+
users?: string[];
|
|
142
|
+
groups?: string[];
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
/** Create an inbox chat from an Eve schedule via the RobotRock API. */
|
|
146
|
+
declare function createRobotRockCronChat(input: CreateRobotRockCronChatInput): Promise<CreateChatResult>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Marker hook for RobotRock dashboard auto-detection.
|
|
150
|
+
*
|
|
151
|
+
* RobotRock reads `GET /eve/v1/info` on connect and treats deployments with a
|
|
152
|
+
* hook slug `robotrock-ready` as RobotRock-ready.
|
|
153
|
+
*/
|
|
154
|
+
declare const robotrockReadyHook: {};
|
|
155
|
+
/** Alias for agents that prefer a factory name. */
|
|
156
|
+
declare function defineRobotRockReadyHook(): {};
|
|
157
|
+
|
|
158
|
+
/** Reset logged idempotency keys (tests only). */
|
|
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
|
+
};
|
|
173
|
+
/** 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
|
+
};
|
|
187
|
+
|
|
188
|
+
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 };
|