@anuma/sdk 6.27.6 → 6.27.8
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/expo/index.cjs +7 -3
- package/dist/expo/index.mjs +7 -3
- package/dist/react/index.cjs +5 -3
- package/dist/react/index.mjs +5 -3
- package/dist/tools/index.cjs +3 -1
- package/dist/tools/index.mjs +3 -1
- package/dist/tools/selection/index.cjs +1 -1
- package/dist/tools/selection/index.d.mts +3 -3
- package/dist/tools/selection/index.d.ts +3 -3
- package/dist/tools/selection/index.mjs +1 -1
- package/package.json +1 -1
package/dist/expo/index.cjs
CHANGED
|
@@ -9449,6 +9449,7 @@ function useChat(options) {
|
|
|
9449
9449
|
const abortControllerRef = (0, import_react3.useRef)(null);
|
|
9450
9450
|
const detachControllerRef = (0, import_react3.useRef)(null);
|
|
9451
9451
|
const pendingResumeRef = (0, import_react3.useRef)(null);
|
|
9452
|
+
const requestIdRef = (0, import_react3.useRef)(0);
|
|
9452
9453
|
const fireCancel = (0, import_react3.useCallback)(
|
|
9453
9454
|
(handle) => {
|
|
9454
9455
|
const { inferenceId } = handle;
|
|
@@ -9577,6 +9578,8 @@ function useChat(options) {
|
|
|
9577
9578
|
abortControllerRef.current = abortController;
|
|
9578
9579
|
const detachController = new AbortController();
|
|
9579
9580
|
detachControllerRef.current = detachController;
|
|
9581
|
+
const requestId = ++requestIdRef.current;
|
|
9582
|
+
const superseded = () => requestIdRef.current !== requestId;
|
|
9580
9583
|
pendingResumeRef.current = null;
|
|
9581
9584
|
setIsLoading(true);
|
|
9582
9585
|
try {
|
|
@@ -9696,7 +9699,8 @@ function useChat(options) {
|
|
|
9696
9699
|
piiRedaction: requestPiiRedaction ?? resolvedPiiRedaction,
|
|
9697
9700
|
onPiiRedacted
|
|
9698
9701
|
});
|
|
9699
|
-
if (
|
|
9702
|
+
if (superseded()) {
|
|
9703
|
+
} else if ("detached" in result && result.detached && result.resume) {
|
|
9700
9704
|
pendingResumeRef.current = result.resume;
|
|
9701
9705
|
} else {
|
|
9702
9706
|
pendingResumeRef.current = null;
|
|
@@ -9708,7 +9712,7 @@ function useChat(options) {
|
|
|
9708
9712
|
onError
|
|
9709
9713
|
);
|
|
9710
9714
|
} finally {
|
|
9711
|
-
setIsLoading(false);
|
|
9715
|
+
if (!superseded()) setIsLoading(false);
|
|
9712
9716
|
if (abortControllerRef.current === abortController) {
|
|
9713
9717
|
abortControllerRef.current = null;
|
|
9714
9718
|
}
|
|
@@ -20292,7 +20296,7 @@ function createMemoryVaultTool(vaultCtx, options, embeddingOptions, cache) {
|
|
|
20292
20296
|
// src/expo/useChatStorage.ts
|
|
20293
20297
|
init_redactor();
|
|
20294
20298
|
|
|
20295
|
-
// src/tools/
|
|
20299
|
+
// src/tools/confirmConstants.ts
|
|
20296
20300
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
20297
20301
|
|
|
20298
20302
|
// src/tools/appBuilderPrompt.ts
|
package/dist/expo/index.mjs
CHANGED
|
@@ -7841,6 +7841,7 @@ function useChat(options) {
|
|
|
7841
7841
|
const abortControllerRef = useRef3(null);
|
|
7842
7842
|
const detachControllerRef = useRef3(null);
|
|
7843
7843
|
const pendingResumeRef = useRef3(null);
|
|
7844
|
+
const requestIdRef = useRef3(0);
|
|
7844
7845
|
const fireCancel = useCallback3(
|
|
7845
7846
|
(handle) => {
|
|
7846
7847
|
const { inferenceId } = handle;
|
|
@@ -7969,6 +7970,8 @@ function useChat(options) {
|
|
|
7969
7970
|
abortControllerRef.current = abortController;
|
|
7970
7971
|
const detachController = new AbortController();
|
|
7971
7972
|
detachControllerRef.current = detachController;
|
|
7973
|
+
const requestId = ++requestIdRef.current;
|
|
7974
|
+
const superseded = () => requestIdRef.current !== requestId;
|
|
7972
7975
|
pendingResumeRef.current = null;
|
|
7973
7976
|
setIsLoading(true);
|
|
7974
7977
|
try {
|
|
@@ -8088,7 +8091,8 @@ function useChat(options) {
|
|
|
8088
8091
|
piiRedaction: requestPiiRedaction ?? resolvedPiiRedaction,
|
|
8089
8092
|
onPiiRedacted
|
|
8090
8093
|
});
|
|
8091
|
-
if (
|
|
8094
|
+
if (superseded()) {
|
|
8095
|
+
} else if ("detached" in result && result.detached && result.resume) {
|
|
8092
8096
|
pendingResumeRef.current = result.resume;
|
|
8093
8097
|
} else {
|
|
8094
8098
|
pendingResumeRef.current = null;
|
|
@@ -8100,7 +8104,7 @@ function useChat(options) {
|
|
|
8100
8104
|
onError
|
|
8101
8105
|
);
|
|
8102
8106
|
} finally {
|
|
8103
|
-
setIsLoading(false);
|
|
8107
|
+
if (!superseded()) setIsLoading(false);
|
|
8104
8108
|
if (abortControllerRef.current === abortController) {
|
|
8105
8109
|
abortControllerRef.current = null;
|
|
8106
8110
|
}
|
|
@@ -18622,7 +18626,7 @@ function createMemoryVaultTool(vaultCtx, options, embeddingOptions, cache) {
|
|
|
18622
18626
|
};
|
|
18623
18627
|
}
|
|
18624
18628
|
|
|
18625
|
-
// src/tools/
|
|
18629
|
+
// src/tools/confirmConstants.ts
|
|
18626
18630
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
18627
18631
|
|
|
18628
18632
|
// src/tools/appBuilderPrompt.ts
|
package/dist/react/index.cjs
CHANGED
|
@@ -9406,6 +9406,7 @@ function useChat(options) {
|
|
|
9406
9406
|
} = options || {};
|
|
9407
9407
|
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
9408
9408
|
const abortControllerRef = (0, import_react.useRef)(null);
|
|
9409
|
+
const requestIdRef = (0, import_react.useRef)(0);
|
|
9409
9410
|
const piiRedactorRef = (0, import_react.useRef)(null);
|
|
9410
9411
|
if (piiRedaction === true && !piiRedactorRef.current) {
|
|
9411
9412
|
piiRedactorRef.current = new PiiRedactor();
|
|
@@ -9455,6 +9456,7 @@ function useChat(options) {
|
|
|
9455
9456
|
}
|
|
9456
9457
|
const abortController = new AbortController();
|
|
9457
9458
|
abortControllerRef.current = abortController;
|
|
9459
|
+
const requestId = ++requestIdRef.current;
|
|
9458
9460
|
setIsLoading(true);
|
|
9459
9461
|
try {
|
|
9460
9462
|
const tokenGetterValidation = validateTokenGetter(getToken);
|
|
@@ -9554,8 +9556,8 @@ function useChat(options) {
|
|
|
9554
9556
|
onError
|
|
9555
9557
|
);
|
|
9556
9558
|
} finally {
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
+
if (requestIdRef.current === requestId) {
|
|
9560
|
+
setIsLoading(false);
|
|
9559
9561
|
abortControllerRef.current = null;
|
|
9560
9562
|
}
|
|
9561
9563
|
}
|
|
@@ -22637,7 +22639,7 @@ async function preprocessFiles(files, options = {}) {
|
|
|
22637
22639
|
};
|
|
22638
22640
|
}
|
|
22639
22641
|
|
|
22640
|
-
// src/tools/
|
|
22642
|
+
// src/tools/confirmConstants.ts
|
|
22641
22643
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
22642
22644
|
|
|
22643
22645
|
// src/tools/appBuilderPrompt.ts
|
package/dist/react/index.mjs
CHANGED
|
@@ -7540,6 +7540,7 @@ function useChat(options) {
|
|
|
7540
7540
|
} = options || {};
|
|
7541
7541
|
const [isLoading, setIsLoading] = useState(false);
|
|
7542
7542
|
const abortControllerRef = useRef(null);
|
|
7543
|
+
const requestIdRef = useRef(0);
|
|
7543
7544
|
const piiRedactorRef = useRef(null);
|
|
7544
7545
|
if (piiRedaction === true && !piiRedactorRef.current) {
|
|
7545
7546
|
piiRedactorRef.current = new PiiRedactor();
|
|
@@ -7589,6 +7590,7 @@ function useChat(options) {
|
|
|
7589
7590
|
}
|
|
7590
7591
|
const abortController = new AbortController();
|
|
7591
7592
|
abortControllerRef.current = abortController;
|
|
7593
|
+
const requestId = ++requestIdRef.current;
|
|
7592
7594
|
setIsLoading(true);
|
|
7593
7595
|
try {
|
|
7594
7596
|
const tokenGetterValidation = validateTokenGetter(getToken);
|
|
@@ -7688,8 +7690,8 @@ function useChat(options) {
|
|
|
7688
7690
|
onError
|
|
7689
7691
|
);
|
|
7690
7692
|
} finally {
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
+
if (requestIdRef.current === requestId) {
|
|
7694
|
+
setIsLoading(false);
|
|
7693
7695
|
abortControllerRef.current = null;
|
|
7694
7696
|
}
|
|
7695
7697
|
}
|
|
@@ -20713,7 +20715,7 @@ async function preprocessFiles(files, options = {}) {
|
|
|
20713
20715
|
};
|
|
20714
20716
|
}
|
|
20715
20717
|
|
|
20716
|
-
// src/tools/
|
|
20718
|
+
// src/tools/confirmConstants.ts
|
|
20717
20719
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
20718
20720
|
|
|
20719
20721
|
// src/tools/appBuilderPrompt.ts
|
package/dist/tools/index.cjs
CHANGED
|
@@ -836,8 +836,10 @@ function createChoiceTool(options) {
|
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
|
|
839
|
-
// src/tools/
|
|
839
|
+
// src/tools/confirmConstants.ts
|
|
840
840
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
841
|
+
|
|
842
|
+
// src/tools/confirm.ts
|
|
841
843
|
function createConfirmTool(options) {
|
|
842
844
|
return createInteractiveTool(options, {
|
|
843
845
|
name: CONFIRM_TOOL_NAME,
|
package/dist/tools/index.mjs
CHANGED
|
@@ -680,8 +680,10 @@ function createChoiceTool(options) {
|
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
// src/tools/
|
|
683
|
+
// src/tools/confirmConstants.ts
|
|
684
684
|
var CONFIRM_TOOL_NAME = "prompt_user_confirm";
|
|
685
|
+
|
|
686
|
+
// src/tools/confirm.ts
|
|
685
687
|
function createConfirmTool(options) {
|
|
686
688
|
return createInteractiveTool(options, {
|
|
687
689
|
name: CONFIRM_TOOL_NAME,
|
|
@@ -772,9 +772,9 @@ declare function selectServerSideTools(options: SelectServerSideToolsOptions): P
|
|
|
772
772
|
*
|
|
773
773
|
* Dependency-safe by construction: `generateEmbeddings` comes from the db-free
|
|
774
774
|
* `../memoryEngine/generate` core, `RECALL_TOOL_NAME` from the
|
|
775
|
-
* dependency-free `../memory/recallConstants`, and `CONFIRM_TOOL_NAME` from
|
|
776
|
-
* `../../tools/
|
|
777
|
-
*
|
|
775
|
+
* dependency-free `../memory/recallConstants`, and `CONFIRM_TOOL_NAME` from the
|
|
776
|
+
* dependency-free `../../tools/confirmConstants`, so nothing here drags in the
|
|
777
|
+
* WatermelonDB data layer.
|
|
778
778
|
*/
|
|
779
779
|
|
|
780
780
|
/** Typed accessor for client tool name (handles function-call style and flat). */
|
|
@@ -772,9 +772,9 @@ declare function selectServerSideTools(options: SelectServerSideToolsOptions): P
|
|
|
772
772
|
*
|
|
773
773
|
* Dependency-safe by construction: `generateEmbeddings` comes from the db-free
|
|
774
774
|
* `../memoryEngine/generate` core, `RECALL_TOOL_NAME` from the
|
|
775
|
-
* dependency-free `../memory/recallConstants`, and `CONFIRM_TOOL_NAME` from
|
|
776
|
-
* `../../tools/
|
|
777
|
-
*
|
|
775
|
+
* dependency-free `../memory/recallConstants`, and `CONFIRM_TOOL_NAME` from the
|
|
776
|
+
* dependency-free `../../tools/confirmConstants`, so nothing here drags in the
|
|
777
|
+
* WatermelonDB data layer.
|
|
778
778
|
*/
|
|
779
779
|
|
|
780
780
|
/** Typed accessor for client tool name (handles function-call style and flat). */
|