@cadenya/cadenya 1.0.2 → 1.2.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.
- package/api.md +45 -45
- package/dist/client.d.ts +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/core/http.d.ts +6 -1
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +33 -6
- package/dist/core/http.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-variations.d.ts +42 -32
- package/dist/resources/agent-variations.d.ts.map +1 -1
- package/dist/resources/agent-variations.js +22 -20
- package/dist/resources/agent-variations.js.map +1 -1
- package/dist/resources/agents.d.ts +4 -2
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +1 -1
- package/dist/resources/agents.js.map +1 -1
- package/dist/resources/ai-provider-keys.d.ts +11 -1
- package/dist/resources/ai-provider-keys.d.ts.map +1 -1
- package/dist/resources/ai-provider-keys.js +2 -2
- package/dist/resources/ai-provider-keys.js.map +1 -1
- package/dist/resources/memory-layers.d.ts +1 -1
- package/dist/resources/memory-layers.js +1 -1
- package/dist/resources/memory-layers.js.map +1 -1
- package/dist/resources/models.d.ts +51 -1
- package/dist/resources/models.d.ts.map +1 -1
- package/dist/resources/models.js +32 -0
- package/dist/resources/models.js.map +1 -1
- package/dist/resources/objectives.d.ts +1 -46
- package/dist/resources/objectives.d.ts.map +1 -1
- package/dist/resources/objectives.js +0 -35
- package/dist/resources/objectives.js.map +1 -1
- package/dist/resources/tool-search.d.ts +1 -1
- package/dist/resources/tool-search.js +1 -1
- package/dist/resources/tool-search.js.map +1 -1
- package/dist/resources/tools.d.ts +1 -1
- package/dist/resources/tools.js +1 -1
- package/dist/resources/tools.js.map +1 -1
- package/dist/types.d.ts +449 -100
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +40 -0
- package/dist/types.js.map +1 -1
- package/dist/webhooks.d.ts +7 -1
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +4 -4
- package/src/core/http.ts +45 -6
- package/src/index.ts +1 -1
- package/src/resources/agent-variations.ts +59 -47
- package/src/resources/agents.ts +4 -2
- package/src/resources/ai-provider-keys.ts +13 -3
- package/src/resources/memory-layers.ts +1 -1
- package/src/resources/models.ts +67 -1
- package/src/resources/objectives.ts +1 -62
- package/src/resources/tool-search.ts +1 -1
- package/src/resources/tools.ts +1 -1
- package/src/types.ts +517 -103
- package/src/webhooks.ts +7 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { HttpClient, RequestOptions, RequestSpec, APIPromise, pathSegment, snapshotParams } from '../core/http.js';
|
|
4
4
|
import { Page } from '../core/pagination.js';
|
|
5
5
|
import { Stream } from '../core/sse.js';
|
|
6
|
-
import type { AgentVariationSpec_CompactionConfig, CompactObjectiveResponse, CreateObjectiveRequest_Secret, CreateOperationMetadata, GetObjectiveDiagnosticsResponse, ListObjectiveContextWindowsResponse, ListObjectiveEventsResponse, ListObjectiveFeedbackResponse,
|
|
6
|
+
import type { AgentVariationSpec_CompactionConfig, CompactObjectiveResponse, CreateObjectiveRequest_Secret, CreateOperationMetadata, GetObjectiveDiagnosticsResponse, ListObjectiveContextWindowsResponse, ListObjectiveEventsResponse, ListObjectiveFeedbackResponse, ListObjectiveToolCallsResponse, ListObjectiveToolsResponse, ListObjectivesResponse, MemoryReference, Objective, ObjectiveContextWindow, ObjectiveEpisodicConfigParam, ObjectiveEvent, ObjectiveFeedback, ObjectiveFeedbackData, ObjectiveServiceListObjectiveToolCallsExecutionStatus, ObjectiveServiceListObjectiveToolCallsStatus, ObjectiveServiceListObjectivesState, ObjectiveTool, ObjectiveToolCall, ObjectiveToolCallWithResult, SetToolCallContentRequest_ContentBlock, SubjectAssertion, TenantAssertion } from '../types.js';
|
|
7
7
|
import { wireObjectiveEpisodicConfig } from '../types.js';
|
|
8
8
|
|
|
9
9
|
export interface ObjectiveListParams {
|
|
@@ -267,32 +267,6 @@ export interface ObjectiveCreateFeedbackParams {
|
|
|
267
267
|
workspaceId?: string;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
export interface ObjectiveListTasksParams {
|
|
271
|
-
/**
|
|
272
|
-
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
273
|
-
*/
|
|
274
|
-
workspaceId?: string;
|
|
275
|
-
/**
|
|
276
|
-
* Maximum number of results to return
|
|
277
|
-
*/
|
|
278
|
-
limit?: number;
|
|
279
|
-
/**
|
|
280
|
-
* Pagination cursor from previous response
|
|
281
|
-
*/
|
|
282
|
-
cursor?: string;
|
|
283
|
-
/**
|
|
284
|
-
* Sort order for results
|
|
285
|
-
*/
|
|
286
|
-
sortOrder?: string;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export interface ObjectiveRetrieveTaskParams {
|
|
290
|
-
/**
|
|
291
|
-
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
292
|
-
*/
|
|
293
|
-
workspaceId?: string;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
270
|
export interface ObjectiveListToolCallsParams {
|
|
297
271
|
/**
|
|
298
272
|
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
@@ -580,41 +554,6 @@ export class Objectives {
|
|
|
580
554
|
}, options);
|
|
581
555
|
}
|
|
582
556
|
|
|
583
|
-
/**
|
|
584
|
-
* List objective tasks
|
|
585
|
-
*
|
|
586
|
-
* @example
|
|
587
|
-
* ```ts
|
|
588
|
-
* const page = await client.objectives.listTasks('objective_123');
|
|
589
|
-
* for await (const item of page) {
|
|
590
|
-
* // auto-fetches every page
|
|
591
|
-
* }
|
|
592
|
-
* ```
|
|
593
|
-
*/
|
|
594
|
-
async listTasks(objectiveId: string, params?: ObjectiveListTasksParams, options?: RequestOptions): Promise<Page<ObjectiveTask>> {
|
|
595
|
-
const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
596
|
-
if (workspaceId === undefined) throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
597
|
-
const _base = snapshotParams(params);
|
|
598
|
-
const response = await this._client.request<ListObjectiveTasksResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}/tasks`, query: { limit: params?.limit, cursor: params?.cursor, sortOrder: params?.sortOrder } }, options);
|
|
599
|
-
return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.listTasks(objectiveId, { ..._base, cursor: cursor }, options));
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Get an objective task by ID
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```ts
|
|
607
|
-
* const objectiveTask = await client.objectives.retrieveTask('objective_123', '_123');
|
|
608
|
-
* ```
|
|
609
|
-
*/
|
|
610
|
-
retrieveTask(objectiveId: string, id: string, params?: ObjectiveRetrieveTaskParams, options?: RequestOptions): APIPromise<ObjectiveTask> {
|
|
611
|
-
return this._client.requestAPI<ObjectiveTask>(() => {
|
|
612
|
-
const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
613
|
-
if (workspaceId === undefined) throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
614
|
-
return { method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}/tasks/${pathSegment('id', id)}` };
|
|
615
|
-
}, options);
|
|
616
|
-
}
|
|
617
|
-
|
|
618
557
|
/**
|
|
619
558
|
* List objective tool calls
|
|
620
559
|
*
|
|
@@ -21,7 +21,7 @@ export class ToolSearch {
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
24
|
-
* const searchToolsOrToolSetsResponse = await client.toolSearch.searchOrSets({ query: '
|
|
24
|
+
* const searchToolsOrToolSetsResponse = await client.toolSearch.searchOrSets({ query: 'sample' });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
searchOrSets(params: ToolSearchSearchOrSetsParams, options?: RequestOptions): APIPromise<SearchToolsOrToolSetsResponse> {
|
package/src/resources/tools.ts
CHANGED
|
@@ -150,7 +150,7 @@ export class Tools {
|
|
|
150
150
|
*
|
|
151
151
|
* @example
|
|
152
152
|
* ```ts
|
|
153
|
-
* const tool = await client.toolSets.tools.create('tool_set_123', { metadata: { name: 'sample' }, spec: { config: { http: { requestMethod: '
|
|
153
|
+
* const tool = await client.toolSets.tools.create('tool_set_123', { metadata: { name: 'sample' }, spec: { config: { http: { requestMethod: 'GET' }, type: 'http' }, description: 'sample', parameters: { }, requiresApproval: true } });
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
156
|
create(toolSetId: string, params: ToolCreateParams, options?: RequestOptions): APIPromise<Tool> {
|