@cadraos/sdk 0.1.5 → 0.1.7
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 +1069 -34
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +221 -7
- package/dist/chat/index.d.ts +221 -7
- package/dist/chat/index.js +1069 -37
- 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 +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -178,7 +178,11 @@ interface ExecuteInput {
|
|
|
178
178
|
context?: Record<string, unknown>;
|
|
179
179
|
/** Attachment UUIDs to include with the message (for images, documents, etc.) */
|
|
180
180
|
attachmentIds?: string[];
|
|
181
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Team UUID for team-based execution (routes to team's lead orchestrator).
|
|
183
|
+
* @deprecated Pass the team UUID directly as the agent/entity ID instead.
|
|
184
|
+
* The platform now auto-detects whether a UUID is an agent, team, or tool.
|
|
185
|
+
*/
|
|
182
186
|
teamUuid?: string;
|
|
183
187
|
/** Execution options */
|
|
184
188
|
options?: ExecuteOptions;
|
|
@@ -558,6 +562,34 @@ interface ToolConfigUpdateInput {
|
|
|
558
562
|
/** Enable/disable tool */
|
|
559
563
|
isEnabled?: boolean;
|
|
560
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Request to execute a tool directly, bypassing the agent runtime.
|
|
567
|
+
* The tool execution is enqueued for async processing via BullMQ.
|
|
568
|
+
*/
|
|
569
|
+
interface ExecuteToolDirectRequest {
|
|
570
|
+
/** Tool UUID */
|
|
571
|
+
toolUuid: string;
|
|
572
|
+
/** Which endpoint on the tool to call (defaults to first) */
|
|
573
|
+
endpointId?: string;
|
|
574
|
+
/** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
|
|
575
|
+
parameters: Record<string, unknown>;
|
|
576
|
+
/** Optional execution ID (auto-generated if not provided) */
|
|
577
|
+
executionId?: string;
|
|
578
|
+
/** Optional callback URL for completion notification */
|
|
579
|
+
callbackUrl?: string;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Response from a direct tool execution request.
|
|
583
|
+
* The tool is enqueued for async processing - use SSE or polling to get results.
|
|
584
|
+
*/
|
|
585
|
+
interface ExecuteToolDirectResponse {
|
|
586
|
+
/** Execution ID for tracking */
|
|
587
|
+
executionId: string;
|
|
588
|
+
/** BullMQ job ID */
|
|
589
|
+
jobId: string;
|
|
590
|
+
/** Execution status (always 'queued' on success) */
|
|
591
|
+
status: 'queued';
|
|
592
|
+
}
|
|
561
593
|
|
|
562
594
|
/**
|
|
563
595
|
* Artifact types
|
|
@@ -1487,6 +1519,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
1487
1519
|
* ```
|
|
1488
1520
|
*/
|
|
1489
1521
|
execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
|
|
1522
|
+
/**
|
|
1523
|
+
* Execute a tool directly, bypassing the agent runtime.
|
|
1524
|
+
*
|
|
1525
|
+
* Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
|
|
1526
|
+
* Use SSE or polling with the returned executionId to get the result.
|
|
1527
|
+
*
|
|
1528
|
+
* @param request - Direct execution request
|
|
1529
|
+
* @returns Queued execution response with executionId for tracking
|
|
1530
|
+
*
|
|
1531
|
+
* @example
|
|
1532
|
+
* ```typescript
|
|
1533
|
+
* const result = await client.tools.executeDirect({
|
|
1534
|
+
* toolUuid: 'tool-uuid',
|
|
1535
|
+
* parameters: { prompt: 'Generate an image of a sunset' },
|
|
1536
|
+
* });
|
|
1537
|
+
* console.log(result.executionId); // Use for polling/SSE
|
|
1538
|
+
* console.log(result.status); // 'queued'
|
|
1539
|
+
* ```
|
|
1540
|
+
*/
|
|
1541
|
+
executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
|
|
1490
1542
|
/**
|
|
1491
1543
|
* Validate input against tool schema
|
|
1492
1544
|
*
|
|
@@ -2093,4 +2145,4 @@ declare class NetworkError extends AISaaSError {
|
|
|
2093
2145
|
constructor(message?: string, details?: Record<string, unknown>);
|
|
2094
2146
|
}
|
|
2095
2147
|
|
|
2096
|
-
export { AISaaSClient, type AISaaSClientOptions, AISaaSError, type Agent, type AgentConfig, type AgentConfigUpdateInput, type AgentExecution, type AgentListOptions, type AgentStatus, type AgentType, type AgentUpdateInput, type Artifact, type ArtifactDownloadOptions, type ArtifactListOptions, type ArtifactType, type ArtifactUploadInput, AuthenticationError, AuthorizationError, type CompleteEvent, ConflictError, type ConnectionChangeEvent, type DelegationCompletedEvent, type DelegationStartedEvent, type ErrorEvent, type ExecuteInput, type ExecuteOptions, type ExecuteResponse, type ExecutionLog, type ExecutionStatus, type ExecutionStreamController, type ExecutionStreamControllerOptions, type JSONSchema, type ListOptions, NetworkError, NotFoundError, type PaginatedResponse, type PaginationInfo, type PausedEvent, type PlanEvent, type ProgressEvent, RateLimitError, type SendMessageInput, ServerError, type Session, type SessionArtifact, type SessionArtifactListOptions, type SessionArtifactType, type SessionArtifactVariantType, type SessionCreateInput, type SessionHistory, type SessionListOptions, type SessionMessage, type SignedUrlResponse, type Skill, type SkillDetails, type SkillExecuteInput, type SkillExecution, type SkillListOptions, type SkillTool, type SkillUpdateInput, type SkillVariable, type StartedEvent, type StreamController, type StreamEventMap, type TextDeltaEvent, TimeoutError, type TokenUsage, type Tool, type ToolCallEvent, type ToolConfigUpdateInput, type ToolExecution, type ToolListOptions, type ToolResultEvent, type ToolUpdateInput, type ToolValidationResult, ValidationError };
|
|
2148
|
+
export { AISaaSClient, type AISaaSClientOptions, AISaaSError, type Agent, type AgentConfig, type AgentConfigUpdateInput, type AgentExecution, type AgentListOptions, type AgentStatus, type AgentType, type AgentUpdateInput, type Artifact, type ArtifactDownloadOptions, type ArtifactListOptions, type ArtifactType, type ArtifactUploadInput, AuthenticationError, AuthorizationError, type CompleteEvent, ConflictError, type ConnectionChangeEvent, type DelegationCompletedEvent, type DelegationStartedEvent, type ErrorEvent, type ExecuteInput, type ExecuteOptions, type ExecuteResponse, type ExecuteToolDirectRequest, type ExecuteToolDirectResponse, type ExecutionLog, type ExecutionStatus, type ExecutionStreamController, type ExecutionStreamControllerOptions, type JSONSchema, type ListOptions, NetworkError, NotFoundError, type PaginatedResponse, type PaginationInfo, type PausedEvent, type PlanEvent, type ProgressEvent, RateLimitError, type SendMessageInput, ServerError, type Session, type SessionArtifact, type SessionArtifactListOptions, type SessionArtifactType, type SessionArtifactVariantType, type SessionCreateInput, type SessionHistory, type SessionListOptions, type SessionMessage, type SignedUrlResponse, type Skill, type SkillDetails, type SkillExecuteInput, type SkillExecution, type SkillListOptions, type SkillTool, type SkillUpdateInput, type SkillVariable, type StartedEvent, type StreamController, type StreamEventMap, type TextDeltaEvent, TimeoutError, type TokenUsage, type Tool, type ToolCallEvent, type ToolConfigUpdateInput, type ToolExecution, type ToolListOptions, type ToolResultEvent, type ToolUpdateInput, type ToolValidationResult, ValidationError };
|
package/dist/index.d.ts
CHANGED
|
@@ -178,7 +178,11 @@ interface ExecuteInput {
|
|
|
178
178
|
context?: Record<string, unknown>;
|
|
179
179
|
/** Attachment UUIDs to include with the message (for images, documents, etc.) */
|
|
180
180
|
attachmentIds?: string[];
|
|
181
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Team UUID for team-based execution (routes to team's lead orchestrator).
|
|
183
|
+
* @deprecated Pass the team UUID directly as the agent/entity ID instead.
|
|
184
|
+
* The platform now auto-detects whether a UUID is an agent, team, or tool.
|
|
185
|
+
*/
|
|
182
186
|
teamUuid?: string;
|
|
183
187
|
/** Execution options */
|
|
184
188
|
options?: ExecuteOptions;
|
|
@@ -558,6 +562,34 @@ interface ToolConfigUpdateInput {
|
|
|
558
562
|
/** Enable/disable tool */
|
|
559
563
|
isEnabled?: boolean;
|
|
560
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Request to execute a tool directly, bypassing the agent runtime.
|
|
567
|
+
* The tool execution is enqueued for async processing via BullMQ.
|
|
568
|
+
*/
|
|
569
|
+
interface ExecuteToolDirectRequest {
|
|
570
|
+
/** Tool UUID */
|
|
571
|
+
toolUuid: string;
|
|
572
|
+
/** Which endpoint on the tool to call (defaults to first) */
|
|
573
|
+
endpointId?: string;
|
|
574
|
+
/** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
|
|
575
|
+
parameters: Record<string, unknown>;
|
|
576
|
+
/** Optional execution ID (auto-generated if not provided) */
|
|
577
|
+
executionId?: string;
|
|
578
|
+
/** Optional callback URL for completion notification */
|
|
579
|
+
callbackUrl?: string;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Response from a direct tool execution request.
|
|
583
|
+
* The tool is enqueued for async processing - use SSE or polling to get results.
|
|
584
|
+
*/
|
|
585
|
+
interface ExecuteToolDirectResponse {
|
|
586
|
+
/** Execution ID for tracking */
|
|
587
|
+
executionId: string;
|
|
588
|
+
/** BullMQ job ID */
|
|
589
|
+
jobId: string;
|
|
590
|
+
/** Execution status (always 'queued' on success) */
|
|
591
|
+
status: 'queued';
|
|
592
|
+
}
|
|
561
593
|
|
|
562
594
|
/**
|
|
563
595
|
* Artifact types
|
|
@@ -1487,6 +1519,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
1487
1519
|
* ```
|
|
1488
1520
|
*/
|
|
1489
1521
|
execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
|
|
1522
|
+
/**
|
|
1523
|
+
* Execute a tool directly, bypassing the agent runtime.
|
|
1524
|
+
*
|
|
1525
|
+
* Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
|
|
1526
|
+
* Use SSE or polling with the returned executionId to get the result.
|
|
1527
|
+
*
|
|
1528
|
+
* @param request - Direct execution request
|
|
1529
|
+
* @returns Queued execution response with executionId for tracking
|
|
1530
|
+
*
|
|
1531
|
+
* @example
|
|
1532
|
+
* ```typescript
|
|
1533
|
+
* const result = await client.tools.executeDirect({
|
|
1534
|
+
* toolUuid: 'tool-uuid',
|
|
1535
|
+
* parameters: { prompt: 'Generate an image of a sunset' },
|
|
1536
|
+
* });
|
|
1537
|
+
* console.log(result.executionId); // Use for polling/SSE
|
|
1538
|
+
* console.log(result.status); // 'queued'
|
|
1539
|
+
* ```
|
|
1540
|
+
*/
|
|
1541
|
+
executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
|
|
1490
1542
|
/**
|
|
1491
1543
|
* Validate input against tool schema
|
|
1492
1544
|
*
|
|
@@ -2093,4 +2145,4 @@ declare class NetworkError extends AISaaSError {
|
|
|
2093
2145
|
constructor(message?: string, details?: Record<string, unknown>);
|
|
2094
2146
|
}
|
|
2095
2147
|
|
|
2096
|
-
export { AISaaSClient, type AISaaSClientOptions, AISaaSError, type Agent, type AgentConfig, type AgentConfigUpdateInput, type AgentExecution, type AgentListOptions, type AgentStatus, type AgentType, type AgentUpdateInput, type Artifact, type ArtifactDownloadOptions, type ArtifactListOptions, type ArtifactType, type ArtifactUploadInput, AuthenticationError, AuthorizationError, type CompleteEvent, ConflictError, type ConnectionChangeEvent, type DelegationCompletedEvent, type DelegationStartedEvent, type ErrorEvent, type ExecuteInput, type ExecuteOptions, type ExecuteResponse, type ExecutionLog, type ExecutionStatus, type ExecutionStreamController, type ExecutionStreamControllerOptions, type JSONSchema, type ListOptions, NetworkError, NotFoundError, type PaginatedResponse, type PaginationInfo, type PausedEvent, type PlanEvent, type ProgressEvent, RateLimitError, type SendMessageInput, ServerError, type Session, type SessionArtifact, type SessionArtifactListOptions, type SessionArtifactType, type SessionArtifactVariantType, type SessionCreateInput, type SessionHistory, type SessionListOptions, type SessionMessage, type SignedUrlResponse, type Skill, type SkillDetails, type SkillExecuteInput, type SkillExecution, type SkillListOptions, type SkillTool, type SkillUpdateInput, type SkillVariable, type StartedEvent, type StreamController, type StreamEventMap, type TextDeltaEvent, TimeoutError, type TokenUsage, type Tool, type ToolCallEvent, type ToolConfigUpdateInput, type ToolExecution, type ToolListOptions, type ToolResultEvent, type ToolUpdateInput, type ToolValidationResult, ValidationError };
|
|
2148
|
+
export { AISaaSClient, type AISaaSClientOptions, AISaaSError, type Agent, type AgentConfig, type AgentConfigUpdateInput, type AgentExecution, type AgentListOptions, type AgentStatus, type AgentType, type AgentUpdateInput, type Artifact, type ArtifactDownloadOptions, type ArtifactListOptions, type ArtifactType, type ArtifactUploadInput, AuthenticationError, AuthorizationError, type CompleteEvent, ConflictError, type ConnectionChangeEvent, type DelegationCompletedEvent, type DelegationStartedEvent, type ErrorEvent, type ExecuteInput, type ExecuteOptions, type ExecuteResponse, type ExecuteToolDirectRequest, type ExecuteToolDirectResponse, type ExecutionLog, type ExecutionStatus, type ExecutionStreamController, type ExecutionStreamControllerOptions, type JSONSchema, type ListOptions, NetworkError, NotFoundError, type PaginatedResponse, type PaginationInfo, type PausedEvent, type PlanEvent, type ProgressEvent, RateLimitError, type SendMessageInput, ServerError, type Session, type SessionArtifact, type SessionArtifactListOptions, type SessionArtifactType, type SessionArtifactVariantType, type SessionCreateInput, type SessionHistory, type SessionListOptions, type SessionMessage, type SignedUrlResponse, type Skill, type SkillDetails, type SkillExecuteInput, type SkillExecution, type SkillListOptions, type SkillTool, type SkillUpdateInput, type SkillVariable, type StartedEvent, type StreamController, type StreamEventMap, type TextDeltaEvent, TimeoutError, type TokenUsage, type Tool, type ToolCallEvent, type ToolConfigUpdateInput, type ToolExecution, type ToolListOptions, type ToolResultEvent, type ToolUpdateInput, type ToolValidationResult, ValidationError };
|
package/dist/index.js
CHANGED
|
@@ -1518,6 +1518,29 @@ var ToolsAPI = class extends BaseResourceAPI {
|
|
|
1518
1518
|
const idempotencyKey = generateIdempotencyKey();
|
|
1519
1519
|
return this.httpPost(`/${uuid}/execute`, { input }, { idempotencyKey });
|
|
1520
1520
|
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Execute a tool directly, bypassing the agent runtime.
|
|
1523
|
+
*
|
|
1524
|
+
* Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
|
|
1525
|
+
* Use SSE or polling with the returned executionId to get the result.
|
|
1526
|
+
*
|
|
1527
|
+
* @param request - Direct execution request
|
|
1528
|
+
* @returns Queued execution response with executionId for tracking
|
|
1529
|
+
*
|
|
1530
|
+
* @example
|
|
1531
|
+
* ```typescript
|
|
1532
|
+
* const result = await client.tools.executeDirect({
|
|
1533
|
+
* toolUuid: 'tool-uuid',
|
|
1534
|
+
* parameters: { prompt: 'Generate an image of a sunset' },
|
|
1535
|
+
* });
|
|
1536
|
+
* console.log(result.executionId); // Use for polling/SSE
|
|
1537
|
+
* console.log(result.status); // 'queued'
|
|
1538
|
+
* ```
|
|
1539
|
+
*/
|
|
1540
|
+
async executeDirect(request) {
|
|
1541
|
+
const idempotencyKey = generateIdempotencyKey();
|
|
1542
|
+
return this.httpPost("/execute-direct", request, { idempotencyKey });
|
|
1543
|
+
}
|
|
1521
1544
|
/**
|
|
1522
1545
|
* Validate input against tool schema
|
|
1523
1546
|
*
|