@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.
Files changed (63) hide show
  1. package/api.md +45 -45
  2. package/dist/client.d.ts +2 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +4 -4
  5. package/dist/client.js.map +1 -1
  6. package/dist/core/http.d.ts +6 -1
  7. package/dist/core/http.d.ts.map +1 -1
  8. package/dist/core/http.js +33 -6
  9. package/dist/core/http.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/resources/agent-variations.d.ts +42 -32
  15. package/dist/resources/agent-variations.d.ts.map +1 -1
  16. package/dist/resources/agent-variations.js +22 -20
  17. package/dist/resources/agent-variations.js.map +1 -1
  18. package/dist/resources/agents.d.ts +4 -2
  19. package/dist/resources/agents.d.ts.map +1 -1
  20. package/dist/resources/agents.js +1 -1
  21. package/dist/resources/agents.js.map +1 -1
  22. package/dist/resources/ai-provider-keys.d.ts +11 -1
  23. package/dist/resources/ai-provider-keys.d.ts.map +1 -1
  24. package/dist/resources/ai-provider-keys.js +2 -2
  25. package/dist/resources/ai-provider-keys.js.map +1 -1
  26. package/dist/resources/memory-layers.d.ts +1 -1
  27. package/dist/resources/memory-layers.js +1 -1
  28. package/dist/resources/memory-layers.js.map +1 -1
  29. package/dist/resources/models.d.ts +51 -1
  30. package/dist/resources/models.d.ts.map +1 -1
  31. package/dist/resources/models.js +32 -0
  32. package/dist/resources/models.js.map +1 -1
  33. package/dist/resources/objectives.d.ts +1 -46
  34. package/dist/resources/objectives.d.ts.map +1 -1
  35. package/dist/resources/objectives.js +0 -35
  36. package/dist/resources/objectives.js.map +1 -1
  37. package/dist/resources/tool-search.d.ts +1 -1
  38. package/dist/resources/tool-search.js +1 -1
  39. package/dist/resources/tool-search.js.map +1 -1
  40. package/dist/resources/tools.d.ts +1 -1
  41. package/dist/resources/tools.js +1 -1
  42. package/dist/resources/tools.js.map +1 -1
  43. package/dist/types.d.ts +449 -100
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/types.js +40 -0
  46. package/dist/types.js.map +1 -1
  47. package/dist/webhooks.d.ts +7 -1
  48. package/dist/webhooks.d.ts.map +1 -1
  49. package/dist/webhooks.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/client.ts +4 -4
  52. package/src/core/http.ts +45 -6
  53. package/src/index.ts +1 -1
  54. package/src/resources/agent-variations.ts +59 -47
  55. package/src/resources/agents.ts +4 -2
  56. package/src/resources/ai-provider-keys.ts +13 -3
  57. package/src/resources/memory-layers.ts +1 -1
  58. package/src/resources/models.ts +67 -1
  59. package/src/resources/objectives.ts +1 -62
  60. package/src/resources/tool-search.ts +1 -1
  61. package/src/resources/tools.ts +1 -1
  62. package/src/types.ts +517 -103
  63. 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, ListObjectiveTasksResponse, ListObjectiveToolCallsResponse, ListObjectiveToolsResponse, ListObjectivesResponse, MemoryReference, Objective, ObjectiveContextWindow, ObjectiveEpisodicConfigParam, ObjectiveEvent, ObjectiveFeedback, ObjectiveFeedbackData, ObjectiveServiceListObjectiveToolCallsExecutionStatus, ObjectiveServiceListObjectiveToolCallsStatus, ObjectiveServiceListObjectivesState, ObjectiveTask, ObjectiveTool, ObjectiveToolCall, ObjectiveToolCallWithResult, SetToolCallContentRequest_ContentBlock, SubjectAssertion, TenantAssertion } from '../types.js';
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: 'query_123' });
24
+ * const searchToolsOrToolSetsResponse = await client.toolSearch.searchOrSets({ query: 'sample' });
25
25
  * ```
26
26
  */
27
27
  searchOrSets(params: ToolSearchSearchOrSetsParams, options?: RequestOptions): APIPromise<SearchToolsOrToolSetsResponse> {
@@ -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: 'HTTP_METHOD_UNSPECIFIED' }, type: 'http' }, description: 'sample', parameters: { }, requiresApproval: true } });
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> {