robotrock 0.8.5 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { R as RobotRock, a as SendToHumanInput, S as SendToHumanActionInput, j as SendUpdateInput } from './client-D-XEBOWd.js';
2
+ import { R as RobotRock, a as SendToHumanInput, S as SendToHumanActionInput, n as SendUpdateInput } from './client-CzVmjXpz.js';
3
3
  import { DiscriminatedApprovalResult, ThreadUpdate } from './schemas/index.js';
4
4
  import { ToolApprovalResponse } from 'ai';
5
5
 
@@ -46,6 +46,14 @@ declare function sendToHumanForAi<A extends readonly SendToHumanActionInput[] =
46
46
  * issue the request directly.
47
47
  */
48
48
  declare function sendUpdateForAi(context: RobotRockAiContext, payload: SendUpdateInput): Promise<ThreadUpdate>;
49
+ /**
50
+ * Close an agent chat from a chat-agent tool. Idempotent server-side, so all
51
+ * modes resolve a client and call `chats.close` directly (no durable step).
52
+ */
53
+ declare function closeChatForAi(context: RobotRockAiContext, payload: {
54
+ chatId: string;
55
+ reason?: string;
56
+ }): Promise<void>;
49
57
  declare function approveByHumanForAi(context: RobotRockAiContext, payload: Omit<SendToHumanInput, "actions"> & {
50
58
  app?: string;
51
59
  }): Promise<DiscriminatedApprovalResult<typeof APPROVE_BY_HUMAN_ACTIONS$1>>;
@@ -212,6 +220,89 @@ type SendUpdateToolDefinition = {
212
220
  execute: (input: SendUpdateToolInput) => Promise<SendUpdateToolResult>;
213
221
  };
214
222
 
223
+ declare const REQUEST_ACTION_INPUT_TOOL_NAME: "requestActionInput";
224
+ /** Stable slug when the model omits `action.id` (common LLM mistake). */
225
+ declare function defaultRequestActionInputActionId(title: string): string;
226
+ declare function normalizeRequestActionInputToolInput(input: z.input<typeof requestActionInputToolInputSchema>): RequestActionInputToolInput;
227
+ declare const requestActionInputToolOutputSchema: z.ZodObject<{
228
+ actionId: z.ZodString;
229
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
230
+ }, z.core.$strip>;
231
+ type RequestActionInputToolOutput = z.infer<typeof requestActionInputToolOutputSchema>;
232
+ declare const requestActionInputToolInputSchema: z.ZodObject<{
233
+ prompt: z.ZodOptional<z.ZodString>;
234
+ action: z.ZodObject<{
235
+ id: z.ZodOptional<z.ZodString>;
236
+ title: z.ZodString;
237
+ description: z.ZodOptional<z.ZodString>;
238
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ ui: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
240
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
241
+ }, z.core.$strip>;
242
+ }, z.core.$strip>;
243
+ type RequestActionInputToolInput = z.infer<typeof requestActionInputToolInputSchema>;
244
+ type RequestActionInputToolOptions = {
245
+ description?: string;
246
+ toolName?: string;
247
+ };
248
+ type RequestActionInputToolDefinition = {
249
+ description: string;
250
+ inputSchema: typeof requestActionInputToolInputSchema;
251
+ outputSchema: typeof requestActionInputToolOutputSchema;
252
+ };
253
+ declare function buildRequestActionInputToolDefinition(options?: RequestActionInputToolOptions): RequestActionInputToolDefinition;
254
+ declare function isRequestActionInputToolPart(part: {
255
+ type?: string;
256
+ }, toolName?: string): boolean;
257
+
258
+ declare const REPORT_STATUS_TOOL_NAME: "reportStatus";
259
+ declare const reportStatusPhaseSchema: z.ZodEnum<{
260
+ info: "info";
261
+ running: "running";
262
+ waiting: "waiting";
263
+ succeeded: "succeeded";
264
+ failed: "failed";
265
+ }>;
266
+ type ReportStatusPhase = z.infer<typeof reportStatusPhaseSchema>;
267
+ declare const reportStatusToolInputSchema: z.ZodObject<{
268
+ message: z.ZodString;
269
+ phase: z.ZodOptional<z.ZodEnum<{
270
+ info: "info";
271
+ running: "running";
272
+ waiting: "waiting";
273
+ succeeded: "succeeded";
274
+ failed: "failed";
275
+ }>>;
276
+ }, z.core.$strip>;
277
+ declare const reportStatusToolOutputSchema: z.ZodObject<{
278
+ message: z.ZodString;
279
+ phase: z.ZodEnum<{
280
+ info: "info";
281
+ running: "running";
282
+ waiting: "waiting";
283
+ succeeded: "succeeded";
284
+ failed: "failed";
285
+ }>;
286
+ }, z.core.$strip>;
287
+ type ReportStatusToolInput = z.infer<typeof reportStatusToolInputSchema>;
288
+ type ReportStatusToolOutput = z.infer<typeof reportStatusToolOutputSchema>;
289
+ type ReportStatusToolOptions = {
290
+ description?: string;
291
+ toolName?: string;
292
+ };
293
+ type ReportStatusToolDefinition = {
294
+ description: string;
295
+ inputSchema: typeof reportStatusToolInputSchema;
296
+ outputSchema: typeof reportStatusToolOutputSchema;
297
+ execute: (input: ReportStatusToolInput) => Promise<ReportStatusToolOutput>;
298
+ };
299
+ declare function normalizeReportStatusToolInput(input: z.input<typeof reportStatusToolInputSchema>): ReportStatusToolInput;
300
+ declare function executeReportStatusTool(input: ReportStatusToolInput): Promise<ReportStatusToolOutput>;
301
+ declare function buildReportStatusToolDefinition(options?: ReportStatusToolOptions): ReportStatusToolDefinition;
302
+ declare function isReportStatusToolPart(part: {
303
+ type?: string;
304
+ }, toolName?: string): boolean;
305
+
215
306
  type RobotRockToolApprovalDecision = "user-approval" | undefined;
216
307
  /**
217
308
  * AI SDK 7+: pass the return value to `toolApproval` on `generateText`, `streamText`, or `ToolLoopAgent`.
@@ -244,4 +335,4 @@ declare function resolveToolApprovalsViaRobotRock(clientOrContext: RobotRock | R
244
335
  */
245
336
  declare function runWithRobotRockApprovals<T>(options: RunWithRobotRockApprovalsOptions<T>): Promise<T>;
246
337
 
247
- export { type ApproveByHumanToolDurableOptions as A, createRobotRockAiTriggerContext as B, type CreateSendToHumanToolOptions as C, normalizeRobotRockAiContext as D, sendToHumanForAi as E, type FormatToolApprovalTaskOptions as F, sendToHumanToolInputSchema as G, type HumanToolResult as H, sendUpdateForAi as I, sendUpdateToolInputSchema as J, type RobotRockAiWorkflowContext as R, type SendToHumanToolDefinition as S, type ToolApprovalRequestPart as T, type ApproveByHumanToolOptions as a, type ApproveByHumanToolDefinition as b, type CreateSendUpdateToolOptions as c, type SendUpdateToolDefinition as d, type CreateSendToHumanToolDurableOptions as e, type CreateSendUpdateToolDurableOptions as f, type RobotRockAiContext as g, type RobotRockAiMode as h, type RobotRockAiPollingContext as i, type RobotRockAiTriggerContext as j, applyRobotRockToolApprovalToTools as k, createRobotRockAiWorkflowContext as l, createRobotRockNeedsApproval as m, createRobotRockToolApproval as n, runWithRobotRockApprovals as o, type RobotRockToolCallInfo as p, APPROVE_BY_HUMAN_ACTIONS as q, resolveToolApprovalsViaRobotRock as r, type ResolveToolApprovalsOptions as s, type RobotRockToolApprovalConfig as t, type RobotRockToolApprovalDecision as u, type RunWithRobotRockApprovalsOptions as v, type SendUpdateToolResult as w, approveByHumanForAi as x, approveByHumanInputSchema as y, collectApprovalRequests as z };
338
+ export { normalizeRequestActionInputToolInput as $, type ApproveByHumanToolDurableOptions as A, type ReportStatusToolOutput as B, type CreateSendToHumanToolOptions as C, type RequestActionInputToolInput as D, type RequestActionInputToolOutput as E, type FormatToolApprovalTaskOptions as F, type ResolveToolApprovalsOptions as G, type HumanToolResult as H, type RobotRockToolApprovalConfig as I, type RobotRockToolApprovalDecision as J, type RunWithRobotRockApprovalsOptions as K, type SendUpdateToolResult as L, approveByHumanForAi as M, approveByHumanInputSchema as N, buildReportStatusToolDefinition as O, buildRequestActionInputToolDefinition as P, closeChatForAi as Q, type RobotRockAiWorkflowContext as R, type SendToHumanToolDefinition as S, type ToolApprovalRequestPart as T, collectApprovalRequests as U, createRobotRockAiTriggerContext as V, defaultRequestActionInputActionId as W, executeReportStatusTool as X, isReportStatusToolPart as Y, isRequestActionInputToolPart as Z, normalizeReportStatusToolInput as _, type ApproveByHumanToolOptions as a, normalizeRobotRockAiContext as a0, reportStatusPhaseSchema as a1, reportStatusToolInputSchema as a2, reportStatusToolOutputSchema as a3, requestActionInputToolInputSchema as a4, requestActionInputToolOutputSchema as a5, sendToHumanForAi as a6, sendToHumanToolInputSchema as a7, sendUpdateForAi as a8, sendUpdateToolInputSchema as a9, type ApproveByHumanToolDefinition as b, type CreateSendUpdateToolOptions as c, type SendUpdateToolDefinition as d, type RequestActionInputToolOptions as e, type RequestActionInputToolDefinition as f, type ReportStatusToolOptions as g, type ReportStatusToolDefinition as h, type CreateSendToHumanToolDurableOptions as i, type CreateSendUpdateToolDurableOptions as j, type RobotRockAiContext as k, type RobotRockAiMode as l, type RobotRockAiPollingContext as m, type RobotRockAiTriggerContext as n, applyRobotRockToolApprovalToTools as o, createRobotRockAiWorkflowContext as p, createRobotRockNeedsApproval as q, createRobotRockToolApproval as r, resolveToolApprovalsViaRobotRock as s, runWithRobotRockApprovals as t, type RobotRockToolCallInfo as u, APPROVE_BY_HUMAN_ACTIONS as v, REPORT_STATUS_TOOL_NAME as w, REQUEST_ACTION_INPUT_TOOL_NAME as x, type ReportStatusPhase as y, type ReportStatusToolInput as z };
@@ -1,10 +1,13 @@
1
1
  import * as _trigger_dev_sdk from '@trigger.dev/sdk';
2
- import { S as SendToHumanActionInput, a as SendToHumanInput } from '../client-D-XEBOWd.js';
3
- export { R as RobotRockHandlerWebhookPayload } from '../handler-webhook-BqEi6Bk-.js';
2
+ import { R as RobotRockPlatformOtelFields } from '../otel-platform-DzHyHkGk.js';
3
+ export { a as RobotRockHandlerWebhookPayload } from '../otel-platform-DzHyHkGk.js';
4
+ import { S as SendToHumanActionInput, a as SendToHumanInput } from '../client-CzVmjXpz.js';
4
5
  export { ApprovalResult, DiscriminatedApprovalResult, TaskContextInput, TaskResult } from '../schemas/index.js';
6
+ import '@opentelemetry/api';
7
+ import '@robotrock/core';
5
8
  import 'zod';
6
9
 
7
- type SendToHumanPayload<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = SendToHumanInput<A> & {
10
+ type SendToHumanPayload<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = SendToHumanInput<A> & RobotRockPlatformOtelFields & {
8
11
  /** Inbox app bucket. Overrides `ROBOTROCK_APP` when set. */
9
12
  app?: string;
10
13
  };
@@ -38,4 +41,4 @@ declare const approveByHumanTask: _trigger_dev_sdk.Task<"robotrock/approve-by-hu
38
41
  data: unknown;
39
42
  }>;
40
43
 
41
- export { type ApproveByHumanPayload, type SendToHumanPayload, approveByHumanTask, sendToHumanTask };
44
+ export { type ApproveByHumanPayload, RobotRockPlatformOtelFields, type SendToHumanPayload, approveByHumanTask, sendToHumanTask };