@noya-app/noya-multiplayer-react 0.1.51 → 0.1.52
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/.turbo/turbo-build.log +22 -11
- package/CHANGELOG.md +8 -0
- package/dist/index.bundle.js +28 -8
- package/dist/index.d.mts +20 -9
- package/dist/index.d.ts +20 -9
- package/dist/index.js +1940 -1880
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1755 -1698
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/NoyaStateContext.tsx +8 -7
- package/src/ai.ts +17 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noya-app/noya-multiplayer-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dev": "npm run build -- --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@noya-app/state-manager": "0.1.
|
|
15
|
+
"@noya-app/state-manager": "0.1.41",
|
|
16
16
|
"@noya-app/emitter": "0.1.0",
|
|
17
17
|
"@noya-app/observable": "0.1.5",
|
|
18
18
|
"@noya-app/task-runner": "0.1.5",
|
package/src/NoyaStateContext.tsx
CHANGED
|
@@ -46,13 +46,14 @@ interface NoyaStateProviderProps<
|
|
|
46
46
|
fallback?: React.ReactNode;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
export type AnyNoyaStateContextValue = {
|
|
50
|
+
noyaManager: NoyaManager<any, any, any, any>;
|
|
51
|
+
theme: AppTheme;
|
|
52
|
+
viewType: AppViewType;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const AnyNoyaStateContext = createContext<
|
|
56
|
+
AnyNoyaStateContextValue | undefined
|
|
56
57
|
>(undefined);
|
|
57
58
|
|
|
58
59
|
export function useAnyNoyaStateContext() {
|
package/src/ai.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AIToolDefinition } from "@noya-app/state-manager";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useAIManager } from "./NoyaStateContext";
|
|
4
|
+
import { useObservable } from "./useObservable";
|
|
5
|
+
|
|
6
|
+
export function useRegisterAITool(tool: AIToolDefinition) {
|
|
7
|
+
const aiManager = useAIManager();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
return aiManager.registerTool(tool);
|
|
11
|
+
}, [aiManager, tool]);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useCallableAITools() {
|
|
15
|
+
const aiManager = useAIManager();
|
|
16
|
+
return useObservable(aiManager.callableTools$);
|
|
17
|
+
}
|