@cadraos/sdk 0.1.4 → 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.
- package/dist/chat/index.cjs +23 -0
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +60 -6
- package/dist/chat/index.d.ts +60 -6
- package/dist/chat/index.js +23 -0
- package/dist/chat/index.js.map +1 -1
- package/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/chat/index.d.cts
CHANGED
|
@@ -807,8 +807,8 @@ interface ExecutionStreamController extends StreamController {
|
|
|
807
807
|
* Input for starting an agent execution
|
|
808
808
|
*/
|
|
809
809
|
interface StartExecutionInput {
|
|
810
|
-
/** UUID of the agent to execute */
|
|
811
|
-
agentId
|
|
810
|
+
/** UUID of the agent to execute. Optional when teamId is provided. */
|
|
811
|
+
agentId?: string;
|
|
812
812
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
813
813
|
teamId?: string;
|
|
814
814
|
/** Optional session ID for continuing a conversation */
|
|
@@ -1112,8 +1112,11 @@ interface ChatAdapter {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
|
|
1114
1114
|
interface AgentChatProps {
|
|
1115
|
-
/**
|
|
1116
|
-
|
|
1115
|
+
/**
|
|
1116
|
+
* The UUID of the agent to chat with.
|
|
1117
|
+
* Optional when teamId is provided (team execution routes to team's lead orchestrator).
|
|
1118
|
+
*/
|
|
1119
|
+
agentId?: string;
|
|
1117
1120
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
1118
1121
|
teamId?: string;
|
|
1119
1122
|
/**
|
|
@@ -1521,6 +1524,34 @@ interface ToolConfigUpdateInput {
|
|
|
1521
1524
|
/** Enable/disable tool */
|
|
1522
1525
|
isEnabled?: boolean;
|
|
1523
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
|
+
}
|
|
1524
1555
|
|
|
1525
1556
|
/**
|
|
1526
1557
|
* Artifact types
|
|
@@ -2147,6 +2178,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
2147
2178
|
* ```
|
|
2148
2179
|
*/
|
|
2149
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>;
|
|
2150
2201
|
/**
|
|
2151
2202
|
* Validate input against tool schema
|
|
2152
2203
|
*
|
|
@@ -2769,8 +2820,11 @@ declare function useChatConfig(): ChatConfigContextValue;
|
|
|
2769
2820
|
declare function useChatConfigOptional(): ChatConfigContextValue | null;
|
|
2770
2821
|
|
|
2771
2822
|
interface UseAgentChatOptions {
|
|
2772
|
-
/**
|
|
2773
|
-
|
|
2823
|
+
/**
|
|
2824
|
+
* UUID of the agent to chat with.
|
|
2825
|
+
* Optional when teamId is provided (team execution routes to team's lead orchestrator).
|
|
2826
|
+
*/
|
|
2827
|
+
agentId?: string;
|
|
2774
2828
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
2775
2829
|
teamId?: string;
|
|
2776
2830
|
/**
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -807,8 +807,8 @@ interface ExecutionStreamController extends StreamController {
|
|
|
807
807
|
* Input for starting an agent execution
|
|
808
808
|
*/
|
|
809
809
|
interface StartExecutionInput {
|
|
810
|
-
/** UUID of the agent to execute */
|
|
811
|
-
agentId
|
|
810
|
+
/** UUID of the agent to execute. Optional when teamId is provided. */
|
|
811
|
+
agentId?: string;
|
|
812
812
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
813
813
|
teamId?: string;
|
|
814
814
|
/** Optional session ID for continuing a conversation */
|
|
@@ -1112,8 +1112,11 @@ interface ChatAdapter {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
|
|
1114
1114
|
interface AgentChatProps {
|
|
1115
|
-
/**
|
|
1116
|
-
|
|
1115
|
+
/**
|
|
1116
|
+
* The UUID of the agent to chat with.
|
|
1117
|
+
* Optional when teamId is provided (team execution routes to team's lead orchestrator).
|
|
1118
|
+
*/
|
|
1119
|
+
agentId?: string;
|
|
1117
1120
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
1118
1121
|
teamId?: string;
|
|
1119
1122
|
/**
|
|
@@ -1521,6 +1524,34 @@ interface ToolConfigUpdateInput {
|
|
|
1521
1524
|
/** Enable/disable tool */
|
|
1522
1525
|
isEnabled?: boolean;
|
|
1523
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
|
+
}
|
|
1524
1555
|
|
|
1525
1556
|
/**
|
|
1526
1557
|
* Artifact types
|
|
@@ -2147,6 +2178,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
2147
2178
|
* ```
|
|
2148
2179
|
*/
|
|
2149
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>;
|
|
2150
2201
|
/**
|
|
2151
2202
|
* Validate input against tool schema
|
|
2152
2203
|
*
|
|
@@ -2769,8 +2820,11 @@ declare function useChatConfig(): ChatConfigContextValue;
|
|
|
2769
2820
|
declare function useChatConfigOptional(): ChatConfigContextValue | null;
|
|
2770
2821
|
|
|
2771
2822
|
interface UseAgentChatOptions {
|
|
2772
|
-
/**
|
|
2773
|
-
|
|
2823
|
+
/**
|
|
2824
|
+
* UUID of the agent to chat with.
|
|
2825
|
+
* Optional when teamId is provided (team execution routes to team's lead orchestrator).
|
|
2826
|
+
*/
|
|
2827
|
+
agentId?: string;
|
|
2774
2828
|
/** Optional team UUID for team-based execution (routes to team's lead orchestrator) */
|
|
2775
2829
|
teamId?: string;
|
|
2776
2830
|
/**
|
package/dist/chat/index.js
CHANGED
|
@@ -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
|
*
|