@blocklet/pages-kit 0.2.313 → 0.2.314
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/lib/cjs/builtin/async/ai-runtime/state/agent.js +2 -3
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/state/agent.js +2 -3
- package/lib/esm/builtin/async/ai-runtime/state/session.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -16,8 +16,7 @@ const agent_1 = require("../api/agent");
|
|
|
16
16
|
const Runtime_1 = require("../contexts/Runtime");
|
|
17
17
|
const zustand_2 = require("../utils/zustand");
|
|
18
18
|
const createAgentState = ({ aid, working, agent }) => {
|
|
19
|
-
|
|
20
|
-
return (0, zustand_2.createCachedStore)(key, () => (0, zustand_1.create)()((0, immer_1.immer)((set) => ({
|
|
19
|
+
return (0, zustand_2.createCachedStore)(`agent-state-${aid}-${working}`, () => (0, zustand_1.create)()((0, immer_1.immer)((set) => ({
|
|
21
20
|
agent,
|
|
22
21
|
load: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
22
|
set((state) => {
|
|
@@ -52,7 +51,7 @@ function useAgentState({ aid, working }) {
|
|
|
52
51
|
if (!state.agent) {
|
|
53
52
|
if (state.error)
|
|
54
53
|
throw state.error;
|
|
55
|
-
const key =
|
|
54
|
+
const key = `agent-loading-${aid}-${working}`;
|
|
56
55
|
(_a = LOADING_TASKS[key]) !== null && _a !== void 0 ? _a : (LOADING_TASKS[key] = state.load());
|
|
57
56
|
throw LOADING_TASKS[key];
|
|
58
57
|
}
|
|
@@ -39,7 +39,7 @@ const zustand_2 = require("../utils/zustand");
|
|
|
39
39
|
const GET_MESSAGES_LIMIT = 100;
|
|
40
40
|
const GET_MESSAGES_ORDER_DIRECTION = 'desc';
|
|
41
41
|
const createSessionState = ({ aid }) => {
|
|
42
|
-
return (0, zustand_2.createCachedStore)(aid
|
|
42
|
+
return (0, zustand_2.createCachedStore)(`session-state-${aid}`, () => (0, zustand_1.create)()((0, immer_1.immer)((set, get) => ({
|
|
43
43
|
reset: () => {
|
|
44
44
|
set((state) => {
|
|
45
45
|
state.loading = undefined;
|