robotrock 0.8.5 → 0.9.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,4 +1,4 @@
1
- import { TaskContextInput, AssignToInput, TaskPriority, ThreadUpdateStatus, AgentTelemetryInput, TaskResponse, DiscriminatedApprovalResult, Task, ThreadUpdate } from './schemas/index.js';
1
+ import { TaskContextFormatVersion, TaskContextInput, AssignToInput, TaskPriority, ThreadUpdateStatus, TaskResponse, DiscriminatedApprovalResult, Task, ThreadUpdate } from './schemas/index.js';
2
2
 
3
3
  type RobotRockWebhookConfig = {
4
4
  url: string;
@@ -14,6 +14,11 @@ interface RobotRockPollingOptions {
14
14
  */
15
15
  timeoutMs?: number;
16
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
+ };
17
22
  type RobotRockClientBaseConfig = {
18
23
  /** Optional override for API key. Falls back to ROBOTROCK_API_KEY. */
19
24
  apiKey?: string;
@@ -28,10 +33,12 @@ type RobotRockClientBaseConfig = {
28
33
  */
29
34
  app?: string;
30
35
  /**
31
- * Task context format version sent on every `sendToHuman` request.
32
- * @default 2
36
+ * Agent release version (semver, git SHA, deploy tag).
37
+ * Defaults to `AGENT_VERSION` or `ROBOTROCK_AGENT_VERSION` from env when omitted.
33
38
  */
34
- version?: 2;
39
+ version?: string;
40
+ /** Advanced settings (context wire format, etc.). */
41
+ advanced?: RobotRockAdvancedConfig;
35
42
  };
36
43
  /** Client config with a webhook (mutually exclusive with `polling`). */
37
44
  type RobotRockWebhookClientConfig = RobotRockClientBaseConfig & {
@@ -46,7 +53,7 @@ type RobotRockPollingClientConfig = RobotRockClientBaseConfig & {
46
53
  type RobotRockConfig = RobotRockWebhookClientConfig | RobotRockPollingClientConfig;
47
54
  type SendToHumanActionInput = Omit<TaskContextInput["actions"][number], "handlers">;
48
55
  type SendToHumanValidUntil = Date | string;
49
- type SendToHumanInput<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = Omit<TaskContextInput, "app" | "actions" | "version" | "validUntil"> & {
56
+ type SendToHumanInput<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = Omit<TaskContextInput, "app" | "actions" | "contextVersion" | "version" | "validUntil"> & {
50
57
  actions: A;
51
58
  /** Task deadline; serialized to an ISO 8601 string on the wire. */
52
59
  validUntil?: SendToHumanValidUntil;
@@ -75,10 +82,10 @@ type SendToHumanInput<A extends readonly SendToHumanActionInput[] = readonly Sen
75
82
  status?: ThreadUpdateStatus;
76
83
  };
77
84
  /**
78
- * Agent telemetry (version, cost, tool calls) not shown in inbox UI.
85
+ * Agent release version override. When omitted, uses the client `version`.
79
86
  * Used for statistics and feedback analysis.
80
87
  */
81
- agent?: AgentTelemetryInput;
88
+ version?: string;
82
89
  };
83
90
  type SendToHumanWithAppInput<A extends readonly SendToHumanActionInput[] = readonly SendToHumanActionInput[]> = (SendToHumanInput<A> | Readonly<SendToHumanInput<A>>) & {
84
91
  /** Inbox app bucket. Overrides the client `app` when set. */
@@ -111,7 +118,8 @@ declare class RobotRock {
111
118
  private readonly apiKey;
112
119
  private readonly baseUrl;
113
120
  private readonly app?;
114
- private readonly version;
121
+ private readonly agentVersion?;
122
+ private readonly contextVersion;
115
123
  private readonly webhook?;
116
124
  private readonly polling;
117
125
  constructor(config: RobotRockConfig);
@@ -134,4 +142,4 @@ declare class RobotRock {
134
142
  declare function createClient(config: RobotRockConfig): RobotRock;
135
143
  declare function attachWebhookToActions(actions: readonly SendToHumanActionInput[], webhook: RobotRockWebhookConfig): TaskContextInput["actions"];
136
144
 
137
- export { RobotRock as R, type SendToHumanActionInput as S, type SendToHumanInput as a, type RobotRockConfig as b, RobotRockError as c, type RobotRockPollingClientConfig as d, type RobotRockPollingOptions as e, type RobotRockWebhookClientConfig as f, type RobotRockWebhookConfig as g, type SendToHumanResult as h, type SendToHumanValidUntil as i, type SendUpdateInput as j, attachWebhookToActions as k, createClient as l };
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 };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { R as RobotRock, b as RobotRockConfig } from './client-D-XEBOWd.js';
2
- export { c as RobotRockError, d as RobotRockPollingClientConfig, e as RobotRockPollingOptions, f as RobotRockWebhookClientConfig, g as RobotRockWebhookConfig, S as SendToHumanActionInput, a as SendToHumanInput, h as SendToHumanResult, i as SendToHumanValidUntil, j as SendUpdateInput, k as attachWebhookToActions, l as createClient } from './client-D-XEBOWd.js';
1
+ import { R as RobotRock, b as RobotRockConfig } from './client-Cy7YLxms.js';
2
+ export { c as RobotRockAdvancedConfig, d as RobotRockError, e as RobotRockPollingClientConfig, f as RobotRockPollingOptions, g as RobotRockWebhookClientConfig, h as RobotRockWebhookConfig, S as SendToHumanActionInput, a as SendToHumanInput, i as SendToHumanResult, j as SendToHumanValidUntil, k as SendUpdateInput, l as attachWebhookToActions, m as createClient } from './client-Cy7YLxms.js';
3
3
  import { Task, DiscriminatedApprovalResult } from './schemas/index.js';
4
- export { AGENT_OTEL_SPANS_MAX, AgentCost, AgentCostTokens, AgentOtel, AgentOtelSpanStatus, AgentOtelSpanSummary, AgentTelemetry, AgentTelemetryInput, AgentToolCalls, ApprovalResult, AssignToInput, CreateTaskBody, CreateTaskBodyInput, DEFAULT_TASK_PRIORITY, DEFAULT_THREAD_UPDATE_STATUS, Handler, InferActionData, LOWEST_TASK_PRIORITY, TASK_PRIORITY_RANK, TaskAction, TaskContext, TaskContextInput, TaskPriority, TaskResponse, TaskResult, TaskStatus, ThreadUpdate, ThreadUpdateBody, ThreadUpdateBodyInput, ThreadUpdateInput, ThreadUpdateResponse, ThreadUpdateSource, ThreadUpdateStatus, TriggerHandler, TupleElementIndices, WebhookHandler, agentCostSchema, agentCostTokensSchema, agentOtelSchema, agentOtelSpanStatusSchema, agentOtelSpanSummarySchema, agentTelemetrySchema, agentToolCallsSchema, assignToSchema, createTaskBodySchema, taskContextSchema, taskPriorities, taskPrioritySchema, threadUpdateBodySchema, threadUpdateInputSchema, threadUpdateStatusSchema, threadUpdateStatuses } from './schemas/index.js';
4
+ export { AgentTelemetry, AgentTelemetryInput, ApprovalResult, AssignToInput, CreateTaskBody, CreateTaskBodyInput, DEFAULT_TASK_PRIORITY, DEFAULT_THREAD_UPDATE_STATUS, Handler, InferActionData, LOWEST_TASK_PRIORITY, TASK_CONTEXT_FORMAT_VERSION, TASK_PRIORITY_RANK, TaskAction, TaskContext, TaskContextFormatVersion, TaskContextInput, TaskPriority, TaskResponse, TaskResult, TaskStatus, ThreadUpdate, ThreadUpdateBody, ThreadUpdateBodyInput, ThreadUpdateInput, ThreadUpdateResponse, ThreadUpdateSource, ThreadUpdateStatus, TriggerHandler, TupleElementIndices, WebhookHandler, agentTelemetrySchema, assignToSchema, createTaskBodySchema, taskContextSchema, taskPriorities, taskPrioritySchema, threadUpdateBodySchema, threadUpdateInputSchema, threadUpdateStatusSchema, threadUpdateStatuses } from './schemas/index.js';
5
5
  import { z } from 'zod';
6
- export { R as RobotRockHandlerWebhookPayload } from './handler-webhook-BqEi6Bk-.js';
7
- export { AgentTelemetryFromOtelOptions, OtelSpanLike, OtelSpanSummaryInput, agentTelemetryFromOtel, toolCallsFromOtelSpans } from './otel/index.js';
6
+ export { E as EndRobotRockHumanWaitSpanOptions, b as RobotRockCreatedTask, c as RobotRockHandledOtelInput, a as RobotRockHandlerWebhookPayload, d as RobotRockHumanWaitOtelSession, e as RobotRockOtelHandle, f as RobotRockOtelRecordOptions, R as RobotRockPlatformOtelFields, g as beginRobotRockHumanWaitOtel, h as captureRobotRockOtelHandle, i as endRobotRockHumanWaitSpan, j as finishRobotRockHumanWaitOtel, r as recordRobotRockHandledToOtel, s as shouldRecordRobotRockOtel, k as startRobotRockHumanWaitSpan, l as stripPlatformOtelFields, t as toRobotRockHandledOtelInput } from './otel-platform-DzHyHkGk.js';
7
+ import '@opentelemetry/api';
8
8
 
9
9
  /**
10
10
  * Read RobotRock client config from environment variables.
@@ -98,7 +98,7 @@ declare function assertNotPlatformRejectRequest(actionId: string, data?: unknown
98
98
  */
99
99
  declare function shouldStopAgentForHandledAction(actionId: string | undefined): boolean;
100
100
 
101
- declare const robotRockWebhookPayloadSchema: z.ZodObject<{
101
+ declare const robotRockWebhookPayloadBodySchema: z.ZodObject<{
102
102
  taskId: z.ZodString;
103
103
  action: z.ZodObject<{
104
104
  id: z.ZodString;
@@ -108,15 +108,16 @@ declare const robotRockWebhookPayloadSchema: z.ZodObject<{
108
108
  handledBy: z.ZodOptional<z.ZodString>;
109
109
  handledAt: z.ZodString;
110
110
  handlerType: z.ZodString;
111
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
112
111
  }, z.core.$strip>;
112
+ type RobotRockWebhookPayload = z.infer<typeof robotRockWebhookPayloadBodySchema> & {
113
+ headers: Record<string, string>;
114
+ };
113
115
  type RobotRockWebhookErrorCode = "MISSING_WEBHOOK_SECRET" | "MISSING_SIGNATURE" | "INVALID_SIGNATURE" | "INVALID_JSON" | "INVALID_PAYLOAD";
114
116
  declare class RobotRockWebhookError extends Error {
115
117
  readonly code: RobotRockWebhookErrorCode;
116
118
  readonly details?: unknown | undefined;
117
119
  constructor(message: string, code: RobotRockWebhookErrorCode, details?: unknown | undefined);
118
120
  }
119
- type RobotRockWebhookPayload = z.infer<typeof robotRockWebhookPayloadSchema>;
120
121
  interface VerifyRobotRockWebhookOptions {
121
122
  /**
122
123
  * Override shared secret (defaults to ROBOTROCK_WEBHOOK_SECRET).