@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
|
@@ -13,8 +13,7 @@ import { getAgent } from '../api/agent';
|
|
|
13
13
|
import { useRuntimeContext } from '../contexts/Runtime';
|
|
14
14
|
import { createCachedStore } from '../utils/zustand';
|
|
15
15
|
export const createAgentState = ({ aid, working, agent }) => {
|
|
16
|
-
|
|
17
|
-
return createCachedStore(key, () => create()(immer((set) => ({
|
|
16
|
+
return createCachedStore(`agent-state-${aid}-${working}`, () => create()(immer((set) => ({
|
|
18
17
|
agent,
|
|
19
18
|
load: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
19
|
set((state) => {
|
|
@@ -48,7 +47,7 @@ export function useAgentState({ aid, working }) {
|
|
|
48
47
|
if (!state.agent) {
|
|
49
48
|
if (state.error)
|
|
50
49
|
throw state.error;
|
|
51
|
-
const key =
|
|
50
|
+
const key = `agent-loading-${aid}-${working}`;
|
|
52
51
|
(_a = LOADING_TASKS[key]) !== null && _a !== void 0 ? _a : (LOADING_TASKS[key] = state.load());
|
|
53
52
|
throw LOADING_TASKS[key];
|
|
54
53
|
}
|
|
@@ -36,7 +36,7 @@ import { createCachedStore } from '../utils/zustand';
|
|
|
36
36
|
const GET_MESSAGES_LIMIT = 100;
|
|
37
37
|
const GET_MESSAGES_ORDER_DIRECTION = 'desc';
|
|
38
38
|
export const createSessionState = ({ aid }) => {
|
|
39
|
-
return createCachedStore(aid
|
|
39
|
+
return createCachedStore(`session-state-${aid}`, () => create()(immer((set, get) => ({
|
|
40
40
|
reset: () => {
|
|
41
41
|
set((state) => {
|
|
42
42
|
state.loading = undefined;
|