@cognipeer/agent-sdk 0.3.0 → 0.3.1

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/index.mjs CHANGED
@@ -1918,7 +1918,15 @@ function createGuardrail(options) {
1918
1918
  }
1919
1919
 
1920
1920
  // src/utils/stateSnapshot.ts
1921
- var DISALLOWED_CTX_KEYS = /* @__PURE__ */ new Set(["__onEvent", "__traceSession", "__paused"]);
1921
+ var DISALLOWED_CTX_KEYS = /* @__PURE__ */ new Set([
1922
+ "__onEvent",
1923
+ "__onProgress",
1924
+ "__onStream",
1925
+ "__traceSession",
1926
+ "__paused",
1927
+ "__cancellationToken",
1928
+ "__abortSignal"
1929
+ ]);
1922
1930
  var clone = (value) => {
1923
1931
  if (typeof globalThis.structuredClone === "function") {
1924
1932
  return globalThis.structuredClone(value);
@@ -2905,7 +2913,7 @@ function createContextTools(stateRef, opts) {
2905
2913
  schema: z.object({
2906
2914
  operation: z.enum(["write", "read"]),
2907
2915
  todoList: z.array(z.object({
2908
- id: z.number().int().positive().describe("Sequential id starting from 1"),
2916
+ id: z.number().int().min(1).describe("Sequential id starting from 1"),
2909
2917
  title: z.string().min(1),
2910
2918
  description: z.string().min(1),
2911
2919
  status: z.enum(["not-started", "in-progress", "completed"]),
@@ -3082,6 +3090,7 @@ function createSmartAgent(opts) {
3082
3090
  if (currentSummaries && currentSummaries.length > 0 && (!state.summaries || state.summaries.length === 0)) {
3083
3091
  state = { ...state, summaries: currentSummaries };
3084
3092
  }
3093
+ if (state.ctx?.__awaitingApproval || state.ctx?.__waitingForInput) break;
3085
3094
  if (state.ctx?.__needsSummarization && summarizer) {
3086
3095
  const ctx = { ...state.ctx || {} };
3087
3096
  delete ctx.__needsSummarization;