@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.
- package/dist/chat/index.cjs +23 -0
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +48 -0
- package/dist/chat/index.d.ts +48 -0
- 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/index.d.cts
CHANGED
|
@@ -558,6 +558,34 @@ interface ToolConfigUpdateInput {
|
|
|
558
558
|
/** Enable/disable tool */
|
|
559
559
|
isEnabled?: boolean;
|
|
560
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Request to execute a tool directly, bypassing the agent runtime.
|
|
563
|
+
* The tool execution is enqueued for async processing via BullMQ.
|
|
564
|
+
*/
|
|
565
|
+
interface ExecuteToolDirectRequest {
|
|
566
|
+
/** Tool UUID */
|
|
567
|
+
toolUuid: string;
|
|
568
|
+
/** Which endpoint on the tool to call (defaults to first) */
|
|
569
|
+
endpointId?: string;
|
|
570
|
+
/** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
|
|
571
|
+
parameters: Record<string, unknown>;
|
|
572
|
+
/** Optional execution ID (auto-generated if not provided) */
|
|
573
|
+
executionId?: string;
|
|
574
|
+
/** Optional callback URL for completion notification */
|
|
575
|
+
callbackUrl?: string;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Response from a direct tool execution request.
|
|
579
|
+
* The tool is enqueued for async processing - use SSE or polling to get results.
|
|
580
|
+
*/
|
|
581
|
+
interface ExecuteToolDirectResponse {
|
|
582
|
+
/** Execution ID for tracking */
|
|
583
|
+
executionId: string;
|
|
584
|
+
/** BullMQ job ID */
|
|
585
|
+
jobId: string;
|
|
586
|
+
/** Execution status (always 'queued' on success) */
|
|
587
|
+
status: 'queued';
|
|
588
|
+
}
|
|
561
589
|
|
|
562
590
|
/**
|
|
563
591
|
* Artifact types
|
|
@@ -1487,6 +1515,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
1487
1515
|
* ```
|
|
1488
1516
|
*/
|
|
1489
1517
|
execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Execute a tool directly, bypassing the agent runtime.
|
|
1520
|
+
*
|
|
1521
|
+
* Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
|
|
1522
|
+
* Use SSE or polling with the returned executionId to get the result.
|
|
1523
|
+
*
|
|
1524
|
+
* @param request - Direct execution request
|
|
1525
|
+
* @returns Queued execution response with executionId for tracking
|
|
1526
|
+
*
|
|
1527
|
+
* @example
|
|
1528
|
+
* ```typescript
|
|
1529
|
+
* const result = await client.tools.executeDirect({
|
|
1530
|
+
* toolUuid: 'tool-uuid',
|
|
1531
|
+
* parameters: { prompt: 'Generate an image of a sunset' },
|
|
1532
|
+
* });
|
|
1533
|
+
* console.log(result.executionId); // Use for polling/SSE
|
|
1534
|
+
* console.log(result.status); // 'queued'
|
|
1535
|
+
* ```
|
|
1536
|
+
*/
|
|
1537
|
+
executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
|
|
1490
1538
|
/**
|
|
1491
1539
|
* Validate input against tool schema
|
|
1492
1540
|
*
|
|
@@ -2093,4 +2141,4 @@ declare class NetworkError extends AISaaSError {
|
|
|
2093
2141
|
constructor(message?: string, details?: Record<string, unknown>);
|
|
2094
2142
|
}
|
|
2095
2143
|
|
|
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 };
|
|
2144
|
+
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
|
@@ -558,6 +558,34 @@ interface ToolConfigUpdateInput {
|
|
|
558
558
|
/** Enable/disable tool */
|
|
559
559
|
isEnabled?: boolean;
|
|
560
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Request to execute a tool directly, bypassing the agent runtime.
|
|
563
|
+
* The tool execution is enqueued for async processing via BullMQ.
|
|
564
|
+
*/
|
|
565
|
+
interface ExecuteToolDirectRequest {
|
|
566
|
+
/** Tool UUID */
|
|
567
|
+
toolUuid: string;
|
|
568
|
+
/** Which endpoint on the tool to call (defaults to first) */
|
|
569
|
+
endpointId?: string;
|
|
570
|
+
/** Tool parameters (prompt, referenceImageArtifactUuid, aspectRatio, etc.) */
|
|
571
|
+
parameters: Record<string, unknown>;
|
|
572
|
+
/** Optional execution ID (auto-generated if not provided) */
|
|
573
|
+
executionId?: string;
|
|
574
|
+
/** Optional callback URL for completion notification */
|
|
575
|
+
callbackUrl?: string;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Response from a direct tool execution request.
|
|
579
|
+
* The tool is enqueued for async processing - use SSE or polling to get results.
|
|
580
|
+
*/
|
|
581
|
+
interface ExecuteToolDirectResponse {
|
|
582
|
+
/** Execution ID for tracking */
|
|
583
|
+
executionId: string;
|
|
584
|
+
/** BullMQ job ID */
|
|
585
|
+
jobId: string;
|
|
586
|
+
/** Execution status (always 'queued' on success) */
|
|
587
|
+
status: 'queued';
|
|
588
|
+
}
|
|
561
589
|
|
|
562
590
|
/**
|
|
563
591
|
* Artifact types
|
|
@@ -1487,6 +1515,26 @@ declare class ToolsAPI extends BaseResourceAPI {
|
|
|
1487
1515
|
* ```
|
|
1488
1516
|
*/
|
|
1489
1517
|
execute(uuid: string, input: Record<string, unknown>): Promise<ToolExecution>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Execute a tool directly, bypassing the agent runtime.
|
|
1520
|
+
*
|
|
1521
|
+
* Enqueues the tool for async processing via BullMQ (no LLM, no ReAct loop).
|
|
1522
|
+
* Use SSE or polling with the returned executionId to get the result.
|
|
1523
|
+
*
|
|
1524
|
+
* @param request - Direct execution request
|
|
1525
|
+
* @returns Queued execution response with executionId for tracking
|
|
1526
|
+
*
|
|
1527
|
+
* @example
|
|
1528
|
+
* ```typescript
|
|
1529
|
+
* const result = await client.tools.executeDirect({
|
|
1530
|
+
* toolUuid: 'tool-uuid',
|
|
1531
|
+
* parameters: { prompt: 'Generate an image of a sunset' },
|
|
1532
|
+
* });
|
|
1533
|
+
* console.log(result.executionId); // Use for polling/SSE
|
|
1534
|
+
* console.log(result.status); // 'queued'
|
|
1535
|
+
* ```
|
|
1536
|
+
*/
|
|
1537
|
+
executeDirect(request: ExecuteToolDirectRequest): Promise<ExecuteToolDirectResponse>;
|
|
1490
1538
|
/**
|
|
1491
1539
|
* Validate input against tool schema
|
|
1492
1540
|
*
|
|
@@ -2093,4 +2141,4 @@ declare class NetworkError extends AISaaSError {
|
|
|
2093
2141
|
constructor(message?: string, details?: Record<string, unknown>);
|
|
2094
2142
|
}
|
|
2095
2143
|
|
|
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 };
|
|
2144
|
+
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
|
*
|