@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.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1927,7 +1927,15 @@ function createGuardrail(options) {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
|
|
1929
1929
|
// src/utils/stateSnapshot.ts
|
|
1930
|
-
var DISALLOWED_CTX_KEYS = /* @__PURE__ */ new Set([
|
|
1930
|
+
var DISALLOWED_CTX_KEYS = /* @__PURE__ */ new Set([
|
|
1931
|
+
"__onEvent",
|
|
1932
|
+
"__onProgress",
|
|
1933
|
+
"__onStream",
|
|
1934
|
+
"__traceSession",
|
|
1935
|
+
"__paused",
|
|
1936
|
+
"__cancellationToken",
|
|
1937
|
+
"__abortSignal"
|
|
1938
|
+
]);
|
|
1931
1939
|
var clone = (value) => {
|
|
1932
1940
|
if (typeof globalThis.structuredClone === "function") {
|
|
1933
1941
|
return globalThis.structuredClone(value);
|
|
@@ -2914,7 +2922,7 @@ function createContextTools(stateRef, opts) {
|
|
|
2914
2922
|
schema: zod.z.object({
|
|
2915
2923
|
operation: zod.z.enum(["write", "read"]),
|
|
2916
2924
|
todoList: zod.z.array(zod.z.object({
|
|
2917
|
-
id: zod.z.number().int().
|
|
2925
|
+
id: zod.z.number().int().min(1).describe("Sequential id starting from 1"),
|
|
2918
2926
|
title: zod.z.string().min(1),
|
|
2919
2927
|
description: zod.z.string().min(1),
|
|
2920
2928
|
status: zod.z.enum(["not-started", "in-progress", "completed"]),
|
|
@@ -3091,6 +3099,7 @@ function createSmartAgent(opts) {
|
|
|
3091
3099
|
if (currentSummaries && currentSummaries.length > 0 && (!state.summaries || state.summaries.length === 0)) {
|
|
3092
3100
|
state = { ...state, summaries: currentSummaries };
|
|
3093
3101
|
}
|
|
3102
|
+
if (state.ctx?.__awaitingApproval || state.ctx?.__waitingForInput) break;
|
|
3094
3103
|
if (state.ctx?.__needsSummarization && summarizer) {
|
|
3095
3104
|
const ctx = { ...state.ctx || {} };
|
|
3096
3105
|
delete ctx.__needsSummarization;
|