@cadraos/sdk 0.1.5 → 0.1.6

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.
@@ -1524,6 +1524,34 @@ interface ToolConfigUpdateInput {
1524
1524
  /** Enable/disable tool */
1525
1525
  isEnabled?: boolean;
1526
1526
  }
1527
+ /**
1528
+ * Request to execute a tool directly, bypassing the agent runtime.
1529
+ * The tool execution is enqueued for async processing via BullMQ.
1530
+ */
1531
+ interface ExecuteToolDirectRequest {
1532
+ /** Tool UUID */
1533
+ toolUuid: string;
1534
+ /** Which endpoint on the tool to call (defaults to first) */
1535
+ endpointId?: string;
1536
+ /** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
1537
+ parameters: Record<string, unknown>;
1538
+ /** Optional execution ID (auto-generated if not provided) */
1539
+ executionId?: string;
1540
+ /** Optional callback URL for completion notification */
1541
+ callbackUrl?: string;
1542
+ }
1543
+ /**
1544
+ * Response from a direct tool execution request.
1545
+ * The tool is enqueued for async processing - use SSE or polling to get results.
1546
+ */
1547
+ interface ExecuteToolDirectResponse {
1548
+ /** Execution ID for tracking */
1549
+ executionId: string;
1550
+ /** BullMQ job ID */
1551
+ jobId: string;
1552
+ /** Execution status (always 'queued' on success) */
1553
+ status: 'queued';
1554
+ }
1527
1555
 
1528
1556
  /**
1529
1557
  * Artifact types
@@ -2150,6 +2178,26 @@ declare class ToolsAPI extends BaseResourceAPI {
2150
2178
  * ```
2151
2179
  */
2152
2180
  execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
2181
+ /**
2182
+ * Execute a tool directly, bypassing the agent runtime.
2183
+ *
2184
+ * Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
2185
+ * Use SSE or polling with the returned executionId to get the result.
2186
+ *
2187
+ * @param request - Direct execution request
2188
+ * @returns Queued execution response with executionId for tracking
2189
+ *
2190
+ * @example
2191
+ * ```typescript
2192
+ * const result = await client.tools.executeDirect({
2193
+ * toolUuid: 'tool-uuid',
2194
+ * parameters: { prompt: 'Generate an image of a sunset' },
2195
+ * });
2196
+ * console.log(result.executionId); // Use for polling/SSE
2197
+ * console.log(result.status); // 'queued'
2198
+ * ```
2199
+ */
2200
+ executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
2153
2201
  /**
2154
2202
  * Validate input against tool schema
2155
2203
  *
@@ -1524,6 +1524,34 @@ interface ToolConfigUpdateInput {
1524
1524
  /** Enable/disable tool */
1525
1525
  isEnabled?: boolean;
1526
1526
  }
1527
+ /**
1528
+ * Request to execute a tool directly, bypassing the agent runtime.
1529
+ * The tool execution is enqueued for async processing via BullMQ.
1530
+ */
1531
+ interface ExecuteToolDirectRequest {
1532
+ /** Tool UUID */
1533
+ toolUuid: string;
1534
+ /** Which endpoint on the tool to call (defaults to first) */
1535
+ endpointId?: string;
1536
+ /** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
1537
+ parameters: Record<string, unknown>;
1538
+ /** Optional execution ID (auto-generated if not provided) */
1539
+ executionId?: string;
1540
+ /** Optional callback URL for completion notification */
1541
+ callbackUrl?: string;
1542
+ }
1543
+ /**
1544
+ * Response from a direct tool execution request.
1545
+ * The tool is enqueued for async processing - use SSE or polling to get results.
1546
+ */
1547
+ interface ExecuteToolDirectResponse {
1548
+ /** Execution ID for tracking */
1549
+ executionId: string;
1550
+ /** BullMQ job ID */
1551
+ jobId: string;
1552
+ /** Execution status (always 'queued' on success) */
1553
+ status: 'queued';
1554
+ }
1527
1555
 
1528
1556
  /**
1529
1557
  * Artifact types
@@ -2150,6 +2178,26 @@ declare class ToolsAPI extends BaseResourceAPI {
2150
2178
  * ```
2151
2179
  */
2152
2180
  execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
2181
+ /**
2182
+ * Execute a tool directly, bypassing the agent runtime.
2183
+ *
2184
+ * Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
2185
+ * Use SSE or polling with the returned executionId to get the result.
2186
+ *
2187
+ * @param request - Direct execution request
2188
+ * @returns Queued execution response with executionId for tracking
2189
+ *
2190
+ * @example
2191
+ * ```typescript
2192
+ * const result = await client.tools.executeDirect({
2193
+ * toolUuid: 'tool-uuid',
2194
+ * parameters: { prompt: 'Generate an image of a sunset' },
2195
+ * });
2196
+ * console.log(result.executionId); // Use for polling/SSE
2197
+ * console.log(result.status); // 'queued'
2198
+ * ```
2199
+ */
2200
+ executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
2153
2201
  /**
2154
2202
  * Validate input against tool schema
2155
2203
  *
@@ -1523,6 +1523,29 @@ var ToolsAPI = class extends BaseResourceAPI {
1523
1523
  const idempotencyKey = generateIdempotencyKey();
1524
1524
  return this.httpPost(`/${uuid}/execute`, { input }, { idempotencyKey });
1525
1525
  }
1526
+ /**
1527
+ * Execute a tool directly, bypassing the agent runtime.
1528
+ *
1529
+ * Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
1530
+ * Use SSE or polling with the returned executionId to get the result.
1531
+ *
1532
+ * @param request - Direct execution request
1533
+ * @returns Queued execution response with executionId for tracking
1534
+ *
1535
+ * @example
1536
+ * ```typescript
1537
+ * const result = await client.tools.executeDirect({
1538
+ * toolUuid: 'tool-uuid',
1539
+ * parameters: { prompt: 'Generate an image of a sunset' },
1540
+ * });
1541
+ * console.log(result.executionId); // Use for polling/SSE
1542
+ * console.log(result.status); // 'queued'
1543
+ * ```
1544
+ */
1545
+ async executeDirect(request) {
1546
+ const idempotencyKey = generateIdempotencyKey();
1547
+ return this.httpPost("/execute-direct", request, { idempotencyKey });
1548
+ }
1526
1549
  /**
1527
1550
  * Validate input against tool schema
1528
1551
  *