@cadenya/cadenya 0.40.0 → 0.42.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 (71) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/internal/utils/env.js +2 -2
  9. package/internal/utils/env.js.map +1 -1
  10. package/internal/utils/env.mjs +2 -2
  11. package/internal/utils/env.mjs.map +1 -1
  12. package/package.json +1 -1
  13. package/resources/agents/agents.d.mts +2 -2
  14. package/resources/agents/agents.d.mts.map +1 -1
  15. package/resources/agents/agents.d.ts +2 -2
  16. package/resources/agents/agents.d.ts.map +1 -1
  17. package/resources/agents/agents.js.map +1 -1
  18. package/resources/agents/agents.mjs.map +1 -1
  19. package/resources/agents/index.d.mts +1 -1
  20. package/resources/agents/index.d.mts.map +1 -1
  21. package/resources/agents/index.d.ts +1 -1
  22. package/resources/agents/index.d.ts.map +1 -1
  23. package/resources/agents/index.js.map +1 -1
  24. package/resources/agents/index.mjs.map +1 -1
  25. package/resources/agents/variations.d.mts +65 -18
  26. package/resources/agents/variations.d.mts.map +1 -1
  27. package/resources/agents/variations.d.ts +65 -18
  28. package/resources/agents/variations.d.ts.map +1 -1
  29. package/resources/agents/webhook-deliveries.d.mts +2 -2
  30. package/resources/agents/webhook-deliveries.d.mts.map +1 -1
  31. package/resources/agents/webhook-deliveries.d.ts +2 -2
  32. package/resources/agents/webhook-deliveries.d.ts.map +1 -1
  33. package/resources/index.d.mts +1 -1
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +1 -1
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/objectives/index.d.mts +1 -1
  40. package/resources/objectives/index.d.mts.map +1 -1
  41. package/resources/objectives/index.d.ts +1 -1
  42. package/resources/objectives/index.d.ts.map +1 -1
  43. package/resources/objectives/index.js.map +1 -1
  44. package/resources/objectives/index.mjs.map +1 -1
  45. package/resources/objectives/objectives.d.mts +41 -1
  46. package/resources/objectives/objectives.d.mts.map +1 -1
  47. package/resources/objectives/objectives.d.ts +41 -1
  48. package/resources/objectives/objectives.d.ts.map +1 -1
  49. package/resources/objectives/objectives.js +7 -0
  50. package/resources/objectives/objectives.js.map +1 -1
  51. package/resources/objectives/objectives.mjs +7 -0
  52. package/resources/objectives/objectives.mjs.map +1 -1
  53. package/resources/objectives/tool-calls.d.mts +1 -0
  54. package/resources/objectives/tool-calls.d.mts.map +1 -1
  55. package/resources/objectives/tool-calls.d.ts +1 -0
  56. package/resources/objectives/tool-calls.d.ts.map +1 -1
  57. package/src/client.ts +6 -0
  58. package/src/internal/utils/env.ts +2 -2
  59. package/src/resources/agents/agents.ts +6 -2
  60. package/src/resources/agents/index.ts +3 -1
  61. package/src/resources/agents/variations.ts +75 -22
  62. package/src/resources/agents/webhook-deliveries.ts +4 -2
  63. package/src/resources/index.ts +3 -0
  64. package/src/resources/objectives/index.ts +3 -0
  65. package/src/resources/objectives/objectives.ts +57 -0
  66. package/src/resources/objectives/tool-calls.ts +7 -0
  67. package/src/version.ts +1 -1
  68. package/version.d.mts +1 -1
  69. package/version.d.ts +1 -1
  70. package/version.js +1 -1
  71. package/version.mjs +1 -1
@@ -81,6 +81,18 @@ export class Objectives extends APIResource {
81
81
  return this._client.post(path`/v1/objectives/${objectiveID}/cancel`, { body, ...options });
82
82
  }
83
83
 
84
+ /**
85
+ * Triggers compaction on a running objective. Optionally override the variation's
86
+ * compaction config.
87
+ */
88
+ compact(
89
+ objectiveID: string,
90
+ body: ObjectiveCompactParams,
91
+ options?: RequestOptions,
92
+ ): APIPromise<ObjectiveCompactResponse> {
93
+ return this._client.post(path`/v1/objectives/${objectiveID}/compact`, { body, ...options });
94
+ }
95
+
84
96
  /**
85
97
  * Continues an objective that has completed
86
98
  */
@@ -173,6 +185,28 @@ export interface CallableTool {
173
185
  tool?: Shared.ResourceMetadata;
174
186
  }
175
187
 
188
+ export interface ContextWindowCompacted {
189
+ /**
190
+ * Number of messages that were compacted
191
+ */
192
+ messagesCompacted?: number;
193
+
194
+ /**
195
+ * The new context window created by this compaction
196
+ */
197
+ newContextWindow?: ObjectiveContextWindowData;
198
+
199
+ /**
200
+ * The strategies that were applied during this compaction
201
+ */
202
+ strategies?: Array<string>;
203
+
204
+ /**
205
+ * The summary generated by the summarization strategy, if used.
206
+ */
207
+ summary?: string;
208
+ }
209
+
176
210
  export interface Objective {
177
211
  data: ObjectiveData;
178
212
 
@@ -320,6 +354,8 @@ export interface ObjectiveError {
320
354
  export interface ObjectiveEventData {
321
355
  assistantMessage?: AssistantMessage;
322
356
 
357
+ contextWindowCompacted?: ContextWindowCompacted;
358
+
323
359
  error?: ObjectiveError;
324
360
 
325
361
  subObjectiveCreated?: SubObjectiveCreated;
@@ -541,6 +577,16 @@ export interface UserMessage {
541
577
  content?: string;
542
578
  }
543
579
 
580
+ /**
581
+ * Compact objective response
582
+ */
583
+ export interface ObjectiveCompactResponse {
584
+ /**
585
+ * The new context window created by the compaction
586
+ */
587
+ contextWindow?: ObjectiveContextWindowData;
588
+ }
589
+
544
590
  export interface ObjectiveContinueResponse {
545
591
  data: ObjectiveEventData;
546
592
 
@@ -630,6 +676,14 @@ export interface ObjectiveCancelParams {
630
676
  reason?: string;
631
677
  }
632
678
 
679
+ export interface ObjectiveCompactParams {
680
+ /**
681
+ * CompactionConfig defines how context window compaction behaves for objectives
682
+ * using this variation.
683
+ */
684
+ compactionConfig?: VariationsAPI.AgentVariationSpecCompactionConfig;
685
+ }
686
+
633
687
  export interface ObjectiveContinueParams {
634
688
  /**
635
689
  * When set to true, the message will be enqueued for when the agent loop is
@@ -691,6 +745,7 @@ export declare namespace Objectives {
691
745
  type AssistantMessage as AssistantMessage,
692
746
  type AssistantToolCall as AssistantToolCall,
693
747
  type CallableTool as CallableTool,
748
+ type ContextWindowCompacted as ContextWindowCompacted,
694
749
  type Objective as Objective,
695
750
  type ObjectiveContextWindow as ObjectiveContextWindow,
696
751
  type ObjectiveContextWindowData as ObjectiveContextWindowData,
@@ -710,6 +765,7 @@ export declare namespace Objectives {
710
765
  type ToolError as ToolError,
711
766
  type ToolResult as ToolResult,
712
767
  type UserMessage as UserMessage,
768
+ type ObjectiveCompactResponse as ObjectiveCompactResponse,
713
769
  type ObjectiveContinueResponse as ObjectiveContinueResponse,
714
770
  type ObjectiveListEventsResponse as ObjectiveListEventsResponse,
715
771
  type ObjectivesCursorPagination as ObjectivesCursorPagination,
@@ -718,6 +774,7 @@ export declare namespace Objectives {
718
774
  type ObjectiveCreateParams as ObjectiveCreateParams,
719
775
  type ObjectiveListParams as ObjectiveListParams,
720
776
  type ObjectiveCancelParams as ObjectiveCancelParams,
777
+ type ObjectiveCompactParams as ObjectiveCompactParams,
721
778
  type ObjectiveContinueParams as ObjectiveContinueParams,
722
779
  type ObjectiveListContextWindowsParams as ObjectiveListContextWindowsParams,
723
780
  type ObjectiveListEventsParams as ObjectiveListEventsParams,
@@ -85,6 +85,13 @@ export interface ObjectiveToolCall {
85
85
  | 'TOOL_CALL_STATUS_APPROVED'
86
86
  | 'TOOL_CALL_STATUS_DENIED';
87
87
 
88
+ executionStatus?:
89
+ | 'TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED'
90
+ | 'TOOL_CALL_EXECUTION_STATUS_PENDING'
91
+ | 'TOOL_CALL_EXECUTION_STATUS_RUNNING'
92
+ | 'TOOL_CALL_EXECUTION_STATUS_COMPLETED'
93
+ | 'TOOL_CALL_EXECUTION_STATUS_ERRORED';
94
+
88
95
  info?: ObjectiveToolCallInfo;
89
96
  }
90
97
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.40.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.40.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.40.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.40.0'; // x-release-please-version
4
+ exports.VERSION = '0.42.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.40.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map