robotrock 0.9.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 +18 -7
- package/dist/ai/index.js +852 -115
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/trigger.d.ts +4 -3
- package/dist/ai/trigger.js +810 -115
- package/dist/ai/trigger.js.map +1 -1
- package/dist/ai/workflow.d.ts +15 -4
- package/dist/ai/workflow.js +729 -115
- package/dist/ai/workflow.js.map +1 -1
- package/dist/client-XTnFHGFE.d.ts +248 -0
- 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 +12 -44
- package/dist/index.js +793 -97
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +11 -1
- package/dist/schemas/index.js +126 -8
- package/dist/schemas/index.js.map +1 -1
- package/dist/tenant-5YKDrdC-.d.ts +23 -0
- package/dist/{tool-approval-bridge-G765kMJR.d.ts → tool-approval-bridge-C4bTm8vu.d.ts} +93 -2
- package/dist/trigger/index.d.ts +2 -1
- package/dist/trigger/index.js +495 -87
- package/dist/trigger/index.js.map +1 -1
- package/dist/{trigger-D0shjqk0.d.ts → trigger-Dn0DFiyU.d.ts} +64 -3
- package/dist/workflow/index.d.ts +2 -1
- package/dist/workflow/index.js +496 -88
- package/dist/workflow/index.js.map +1 -1
- package/package.json +44 -7
- package/dist/client-Cy7YLxms.d.ts +0 -145
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "robotrock",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Human-in-the-loop approval workflows for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,6 +30,38 @@
|
|
|
30
30
|
"./ai/workflow": {
|
|
31
31
|
"types": "./dist/ai/workflow.d.ts",
|
|
32
32
|
"import": "./dist/ai/workflow.js"
|
|
33
|
+
},
|
|
34
|
+
"./eve": {
|
|
35
|
+
"types": "./dist/eve/index.d.ts",
|
|
36
|
+
"import": "./dist/eve/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./eve/agent": {
|
|
39
|
+
"types": "./dist/eve/agent/index.d.ts",
|
|
40
|
+
"import": "./dist/eve/agent/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./eve/tools": {
|
|
43
|
+
"types": "./dist/eve/tools/index.d.ts",
|
|
44
|
+
"import": "./dist/eve/tools/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./eve/tools/inbox": {
|
|
47
|
+
"types": "./dist/eve/tools/inbox/index.d.ts",
|
|
48
|
+
"import": "./dist/eve/tools/inbox/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./eve/tools/inbox/create-task": {
|
|
51
|
+
"types": "./dist/eve/tools/inbox/create-task.d.ts",
|
|
52
|
+
"import": "./dist/eve/tools/inbox/create-task.js"
|
|
53
|
+
},
|
|
54
|
+
"./eve/tools/identity": {
|
|
55
|
+
"types": "./dist/eve/tools/identity/index.d.ts",
|
|
56
|
+
"import": "./dist/eve/tools/identity/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./eve/tools/identity/whoami": {
|
|
59
|
+
"types": "./dist/eve/tools/identity/whoami.d.ts",
|
|
60
|
+
"import": "./dist/eve/tools/identity/whoami.js"
|
|
61
|
+
},
|
|
62
|
+
"./eve/tools/identity/my-access": {
|
|
63
|
+
"types": "./dist/eve/tools/identity/my-access.d.ts",
|
|
64
|
+
"import": "./dist/eve/tools/identity/my-access.js"
|
|
33
65
|
}
|
|
34
66
|
},
|
|
35
67
|
"files": [
|
|
@@ -66,20 +98,22 @@
|
|
|
66
98
|
"zod": "^4.4.3"
|
|
67
99
|
},
|
|
68
100
|
"devDependencies": {
|
|
69
|
-
"@opentelemetry/api": "^1.9.
|
|
70
|
-
"@trigger.dev/sdk": "4.
|
|
71
|
-
"@types/node": "^26.
|
|
72
|
-
"ai": "^7.0.
|
|
101
|
+
"@opentelemetry/api": "^1.9.1",
|
|
102
|
+
"@trigger.dev/sdk": "4.5.3",
|
|
103
|
+
"@types/node": "^26.1.1",
|
|
104
|
+
"ai": "^7.0.19",
|
|
73
105
|
"eslint": "^10.6.0",
|
|
106
|
+
"eve": "^0.22.4",
|
|
74
107
|
"tsup": "^8.5.1",
|
|
75
108
|
"typescript": "^6.0.3",
|
|
76
|
-
"workflow": "^4.
|
|
109
|
+
"workflow": "^4.6.0"
|
|
77
110
|
},
|
|
78
111
|
"peerDependencies": {
|
|
79
112
|
"@opentelemetry/api": "^1.9.0",
|
|
80
113
|
"@trigger.dev/sdk": "^3.0.0 || ^4.0.0",
|
|
81
114
|
"ai": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
82
|
-
"workflow": "^4.0.0"
|
|
115
|
+
"workflow": "^4.0.0",
|
|
116
|
+
"eve": "^0.22.0"
|
|
83
117
|
},
|
|
84
118
|
"peerDependenciesMeta": {
|
|
85
119
|
"@opentelemetry/api": {
|
|
@@ -93,6 +127,9 @@
|
|
|
93
127
|
},
|
|
94
128
|
"workflow": {
|
|
95
129
|
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"eve": {
|
|
132
|
+
"optional": true
|
|
96
133
|
}
|
|
97
134
|
}
|
|
98
135
|
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { TaskContextFormatVersion, TaskContextInput, AssignToInput, TaskPriority, ThreadUpdateStatus, TaskResponse, DiscriminatedApprovalResult, Task, ThreadUpdate } from './schemas/index.js';
|
|
2
|
-
|
|
3
|
-
type RobotRockWebhookConfig = {
|
|
4
|
-
url: string;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
};
|
|
7
|
-
interface RobotRockPollingOptions {
|
|
8
|
-
/** Poll interval when no webhook is configured (ms). @default 2000 */
|
|
9
|
-
intervalMs?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Max time to poll when no webhook is configured (ms).
|
|
12
|
-
* Polling also stops when the task's `validUntil` passes, whichever is sooner.
|
|
13
|
-
* @default 86400000 (24h)
|
|
14
|
-
*/
|
|
15
|
-
timeoutMs?: number;
|
|
16
|
-
}
|
|
17
|
-
/** Advanced client settings rarely changed by integrators. */
|
|
18
|
-
type RobotRockAdvancedConfig = {
|
|
19
|
-
/** Task context wire format version sent on every request. @default 2 */
|
|
20
|
-
contextVersion?: TaskContextFormatVersion;
|
|
21
|
-
};
|
|
22
|
-
type RobotRockClientBaseConfig = {
|
|
23
|
-
/** Optional override for API key. Falls back to ROBOTROCK_API_KEY. */
|
|
24
|
-
apiKey?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Base URL for the RobotRock API
|
|
27
|
-
* @default "https://api.robotrock.io/v1"
|
|
28
|
-
*/
|
|
29
|
-
baseUrl?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Default inbox app bucket for every task from this client.
|
|
32
|
-
* When omitted, the API uses your API key name.
|
|
33
|
-
*/
|
|
34
|
-
app?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Agent release version (semver, git SHA, deploy tag).
|
|
37
|
-
* Defaults to `AGENT_VERSION` or `ROBOTROCK_AGENT_VERSION` from env when omitted.
|
|
38
|
-
*/
|
|
39
|
-
version?: string;
|
|
40
|
-
/** Advanced settings (context wire format, etc.). */
|
|
41
|
-
advanced?: RobotRockAdvancedConfig;
|
|
42
|
-
};
|
|
43
|
-
/** Client config with a webhook (mutually exclusive with `polling`). */
|
|
44
|
-
type RobotRockWebhookClientConfig = RobotRockClientBaseConfig & {
|
|
45
|
-
webhook: RobotRockWebhookConfig;
|
|
46
|
-
polling?: never;
|
|
47
|
-
};
|
|
48
|
-
/** Client config without a webhook; optional `polling` controls the wait loop. */
|
|
49
|
-
type RobotRockPollingClientConfig = RobotRockClientBaseConfig & {
|
|
50
|
-
webhook?: never;
|
|
51
|
-
polling?: RobotRockPollingOptions;
|
|
52
|
-
};
|
|
53
|
-
type RobotRockConfig = RobotRockWebhookClientConfig | RobotRockPollingClientConfig;
|
|
54
|
-
type SendToHumanActionInput = Omit<TaskContextInput["actions"][number], "handlers">;
|
|
55
|
-
type SendToHumanValidUntil = Date | string;
|
|
56
|
-
type SendToHumanInput<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = Omit<TaskContextInput, "app" | "actions" | "contextVersion" | "version" | "validUntil"> & {
|
|
57
|
-
actions: A;
|
|
58
|
-
/** Task deadline; serialized to an ISO 8601 string on the wire. */
|
|
59
|
-
validUntil?: SendToHumanValidUntil;
|
|
60
|
-
/** Optional idempotency key to prevent duplicate tasks */
|
|
61
|
-
idempotencyKey?: string;
|
|
62
|
-
/** Assign to tenant users (email) and/or groups (slug). Narrows inbox visibility. */
|
|
63
|
-
assignTo?: AssignToInput;
|
|
64
|
-
/**
|
|
65
|
-
* Groups related tasks together in the inbox. Omit to let the server generate
|
|
66
|
-
* one (returned as `task.threadId`) and reuse it on later tasks in the thread.
|
|
67
|
-
*/
|
|
68
|
-
threadId?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Optional thread priority. When set, applies to the whole thread and
|
|
71
|
-
* overwrites any previous priority. Omit on later tasks to leave unchanged.
|
|
72
|
-
*/
|
|
73
|
-
priority?: TaskPriority;
|
|
74
|
-
/**
|
|
75
|
-
* Optional initial status update logged against the task's thread. Shows in
|
|
76
|
-
* the inbox status bar and the thread update log.
|
|
77
|
-
*/
|
|
78
|
-
update?: {
|
|
79
|
-
/** A short status update (1-2 sentences). */
|
|
80
|
-
message: string;
|
|
81
|
-
/** Lifecycle status for the icon/color in the status bar. @default "info" */
|
|
82
|
-
status?: ThreadUpdateStatus;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Agent release version override. When omitted, uses the client `version`.
|
|
86
|
-
* Used for statistics and feedback analysis.
|
|
87
|
-
*/
|
|
88
|
-
version?: string;
|
|
89
|
-
};
|
|
90
|
-
type SendToHumanWithAppInput<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = (SendToHumanInput<A> | Readonly<SendToHumanInput<A>>) & {
|
|
91
|
-
/** Inbox app bucket. Overrides the client `app` when set. */
|
|
92
|
-
app?: string;
|
|
93
|
-
};
|
|
94
|
-
type SendUpdateInput = {
|
|
95
|
-
/** The thread to log the update against (from `task.threadId`). */
|
|
96
|
-
threadId: string;
|
|
97
|
-
/** A short status update (1-2 sentences). */
|
|
98
|
-
message: string;
|
|
99
|
-
/** Lifecycle status for the icon/color in the status bar. @default "info" */
|
|
100
|
-
status?: ThreadUpdateStatus;
|
|
101
|
-
};
|
|
102
|
-
type SendToHumanResult<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = {
|
|
103
|
-
mode: "created";
|
|
104
|
-
task: TaskResponse["task"];
|
|
105
|
-
} | ({
|
|
106
|
-
mode: "handled";
|
|
107
|
-
task: TaskResponse["task"];
|
|
108
|
-
} & DiscriminatedApprovalResult<A>);
|
|
109
|
-
declare class RobotRockError extends Error {
|
|
110
|
-
readonly statusCode: number;
|
|
111
|
-
readonly response?: unknown | undefined;
|
|
112
|
-
constructor(message: string, statusCode: number, response?: unknown | undefined);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* RobotRock API client for creating and querying human-in-the-loop tasks.
|
|
116
|
-
*/
|
|
117
|
-
declare class RobotRock {
|
|
118
|
-
private readonly apiKey;
|
|
119
|
-
private readonly baseUrl;
|
|
120
|
-
private readonly app?;
|
|
121
|
-
private readonly agentVersion?;
|
|
122
|
-
private readonly contextVersion;
|
|
123
|
-
private readonly webhook?;
|
|
124
|
-
private readonly polling;
|
|
125
|
-
constructor(config: RobotRockConfig);
|
|
126
|
-
/**
|
|
127
|
-
* Create a task via POST /v1 without waiting for a human response.
|
|
128
|
-
*/
|
|
129
|
-
createTask<const A extends readonly SendToHumanActionInput[]>(task: SendToHumanWithAppInput<A>): Promise<TaskResponse["task"]>;
|
|
130
|
-
sendToHuman<const A extends readonly SendToHumanActionInput[]>(task: SendToHumanWithAppInput<A>): Promise<SendToHumanResult<A>>;
|
|
131
|
-
/**
|
|
132
|
-
* Get a task by public task id (returned as `task.taskId` from {@link sendToHuman}).
|
|
133
|
-
*/
|
|
134
|
-
getTask(taskId: string): Promise<Task | null>;
|
|
135
|
-
/**
|
|
136
|
-
* Log a status update against a thread. The update shows in the inbox status
|
|
137
|
-
* bar and thread update log for every task in the thread.
|
|
138
|
-
*/
|
|
139
|
-
sendUpdate({ threadId, message, status }: SendUpdateInput): Promise<ThreadUpdate>;
|
|
140
|
-
cancelTask(taskId: string): Promise<void>;
|
|
141
|
-
}
|
|
142
|
-
declare function createClient(config: RobotRockConfig): RobotRock;
|
|
143
|
-
declare function attachWebhookToActions(actions: readonly SendToHumanActionInput[], webhook: RobotRockWebhookConfig): TaskContextInput["actions"];
|
|
144
|
-
|
|
145
|
-
export { RobotRock as R, type SendToHumanActionInput as S, type SendToHumanInput as a, type RobotRockConfig as b, type RobotRockAdvancedConfig as c, RobotRockError as d, type RobotRockPollingClientConfig as e, type RobotRockPollingOptions as f, type RobotRockWebhookClientConfig as g, type RobotRockWebhookConfig as h, type SendToHumanResult as i, type SendToHumanValidUntil as j, type SendUpdateInput as k, attachWebhookToActions as l, createClient as m };
|