@noya-app/noya-multiplayer-react 0.1.50 → 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 +17 -0
- package/dist/index.bundle.js +28 -8
- package/dist/index.d.mts +23 -14
- package/dist/index.d.ts +23 -14
- package/dist/index.js +1953 -1911
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1771 -1732
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/NoyaStateContext.tsx +10 -9
- package/src/WebSocketConnection.ts +17 -39
- package/src/ai.ts +17 -0
- package/src/hooks.ts +2 -2
- package/src/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as _noya_app_state_manager from '@noya-app/state-manager';
|
|
2
|
-
import { ConnectedUsersManager, EphemeralUserDataManager, NoyaManager, StateManager, StateManagerOptions, MultiplayerStateManagerOptions, SyncAdapter, TSchema, Static, CreateParams, MultiplayerStateManager, ReconnectingWebSocketState, ClientToServerMessage, ServerToClientMessage, MultiplayerStateManagerError } from '@noya-app/state-manager';
|
|
2
|
+
import { AIToolDefinition, ConnectedUsersManager, EphemeralUserDataManager, NoyaManager, StateManager, StateManagerOptions, MultiplayerStateManagerOptions, SyncAdapter, TSchema, Static, CreateParams, MultiplayerStateManager, ReconnectingWebSocketState, ClientToServerMessage, ServerToClientMessage, MultiplayerStateManagerError } from '@noya-app/state-manager';
|
|
3
3
|
export * from '@noya-app/state-manager';
|
|
4
4
|
import React, { SetStateAction } from 'react';
|
|
5
5
|
import { GetAtPath, ObservableOptions, PathKey, Observable } from '@noya-app/observable';
|
|
6
6
|
import { MenuItem } from '@noya-app/noya-designsystem';
|
|
7
7
|
import { OutputTransform, Input } from '@noya-app/noya-schemas';
|
|
8
8
|
|
|
9
|
+
declare function useRegisterAITool(tool: AIToolDefinition): void;
|
|
10
|
+
declare function useCallableAITools(): _noya_app_state_manager.CallableAIToolsMap;
|
|
11
|
+
|
|
9
12
|
type Point = {
|
|
10
13
|
x: number;
|
|
11
14
|
y: number;
|
|
@@ -56,7 +59,7 @@ declare function useMultiplayerState<S, M extends object = object, E extends obj
|
|
|
56
59
|
assetManager: _noya_app_state_manager.AssetManager;
|
|
57
60
|
aiManager: _noya_app_state_manager.AIManager;
|
|
58
61
|
rpcManager: _noya_app_state_manager.RPCManager;
|
|
59
|
-
|
|
62
|
+
pipelineManager: _noya_app_state_manager.PipelineManager;
|
|
60
63
|
secretManager: _noya_app_state_manager.SecretManager;
|
|
61
64
|
menuItemsManager: _noya_app_state_manager.MenuManager<MenuT>;
|
|
62
65
|
createAsset: (options: _noya_app_state_manager.CreateAssetOptions | Uint8Array | File | Blob) => Promise<_noya_app_state_manager.Asset>;
|
|
@@ -117,11 +120,13 @@ interface NoyaStateProviderProps<S, M extends object, E extends object, MenuT ex
|
|
|
117
120
|
initialState?: S;
|
|
118
121
|
fallback?: React.ReactNode;
|
|
119
122
|
}
|
|
120
|
-
|
|
123
|
+
type AnyNoyaStateContextValue = {
|
|
121
124
|
noyaManager: NoyaManager<any, any, any, any>;
|
|
122
125
|
theme: AppTheme;
|
|
123
126
|
viewType: AppViewType;
|
|
124
127
|
};
|
|
128
|
+
declare const AnyNoyaStateContext: React.Context<AnyNoyaStateContextValue | undefined>;
|
|
129
|
+
declare function useAnyNoyaStateContext(): AnyNoyaStateContextValue;
|
|
125
130
|
declare function useAnyNoyaManager(): NoyaManager<any, any, any, any>;
|
|
126
131
|
declare function useColorScheme(): AppTheme;
|
|
127
132
|
declare function useViewType(): AppViewType;
|
|
@@ -137,16 +142,16 @@ declare function useSecretManager(): _noya_app_state_manager.SecretManager;
|
|
|
137
142
|
declare function useSecrets(): _noya_app_state_manager.Secret[];
|
|
138
143
|
declare function useSecret(name: string): _noya_app_state_manager.Secret | undefined;
|
|
139
144
|
declare function useInputs(): ({
|
|
140
|
-
|
|
145
|
+
id: string;
|
|
141
146
|
kind: "file";
|
|
147
|
+
required: boolean;
|
|
142
148
|
toolId: string | null;
|
|
143
|
-
id: string;
|
|
144
149
|
name: string;
|
|
145
150
|
description: string | null;
|
|
146
151
|
} | {
|
|
147
|
-
required: boolean;
|
|
148
|
-
kind: "data";
|
|
149
152
|
id: string;
|
|
153
|
+
kind: "data";
|
|
154
|
+
required: boolean;
|
|
150
155
|
name: string;
|
|
151
156
|
description: string | null;
|
|
152
157
|
schema: {
|
|
@@ -236,22 +241,28 @@ declare function useInputs(): ({
|
|
|
236
241
|
};
|
|
237
242
|
_kind: "Object";
|
|
238
243
|
} | null;
|
|
244
|
+
} | {
|
|
245
|
+
id: string;
|
|
246
|
+
kind: "secret";
|
|
247
|
+
required: boolean;
|
|
248
|
+
name: string;
|
|
249
|
+
description: string | null;
|
|
239
250
|
})[];
|
|
240
251
|
declare function useOutputTransforms(): ({
|
|
241
252
|
value: string;
|
|
242
|
-
kind: "script";
|
|
243
253
|
id: string;
|
|
254
|
+
kind: "script";
|
|
244
255
|
location: "state" | "url";
|
|
245
256
|
order: number;
|
|
246
257
|
} | {
|
|
247
258
|
value: string;
|
|
248
|
-
kind: "jsonPointer";
|
|
249
259
|
id: string;
|
|
260
|
+
kind: "jsonPointer";
|
|
250
261
|
order: number;
|
|
251
262
|
})[];
|
|
252
263
|
declare function useIOManager(): _noya_app_state_manager.IOManager;
|
|
253
264
|
declare function useIsInitialized(): boolean;
|
|
254
|
-
declare function
|
|
265
|
+
declare function usePipelineManager(): _noya_app_state_manager.PipelineManager;
|
|
255
266
|
declare const ConnectedUsersContext: React.Context<ConnectedUsersManager | undefined>;
|
|
256
267
|
declare function useConnectedUsersManager(): ConnectedUsersManager | undefined;
|
|
257
268
|
declare const AnyEphemeralUserDataManagerContext: React.Context<EphemeralUserDataManager<object> | undefined>;
|
|
@@ -327,9 +338,7 @@ declare class WebSocketConnection<State> {
|
|
|
327
338
|
private url;
|
|
328
339
|
private options;
|
|
329
340
|
private ws;
|
|
330
|
-
private
|
|
331
|
-
private pendingPingId?;
|
|
332
|
-
private intervalId?;
|
|
341
|
+
private closedForever;
|
|
333
342
|
constructor(url: URL, options?: ConnectionOptions<State>);
|
|
334
343
|
connect(): Promise<void>;
|
|
335
344
|
private handleOpen;
|
|
@@ -341,4 +350,4 @@ declare class WebSocketConnection<State> {
|
|
|
341
350
|
removeListener(listener: (state: ReconnectingWebSocketState) => void): void;
|
|
342
351
|
}
|
|
343
352
|
|
|
344
|
-
export { AnyEphemeralUserDataManagerContext, type AppData, type AppTheme, type AppViewType, ConnectedUsersContext, type ConnectionEvent, type ConnectionOptions, FallbackUntilInitialized, type GetAppDataOptions, type RenderUserPointer, type RenderUserPointerProps, StateInspector, type StateInspectorAnchor, type StateInspectorOptions, type UseMultiplayerStateOptions, type UseNoyaStateOptions, type UseNoyaStateResult, type UserPointerData, UserPointersOverlay, type UserPointersOverlayProps, WebSocketConnection, createDefaultAppData, createNoyaContext, enforceSchema, getAppData, parseAppDataParameter, useAIManager, useAnyEphemeralUserData, useAnyNoyaManager, useAnyNoyaStateContext, useAsset, useAssetManager, useAssets, useColorScheme, useConnectedUsersManager, useCurrentUserId, useIOManager, useInputs, useIsInitialized, useManagedHistory, useManagedState, useMultiplayerState, useNoyaState, useObservable, useOutputTransforms, useSecret, useSecretManager, useSecrets, useSyncStateManager, useViewType
|
|
353
|
+
export { AnyEphemeralUserDataManagerContext, AnyNoyaStateContext, type AnyNoyaStateContextValue, type AppData, type AppTheme, type AppViewType, ConnectedUsersContext, type ConnectionEvent, type ConnectionOptions, FallbackUntilInitialized, type GetAppDataOptions, type RenderUserPointer, type RenderUserPointerProps, StateInspector, type StateInspectorAnchor, type StateInspectorOptions, type UseMultiplayerStateOptions, type UseNoyaStateOptions, type UseNoyaStateResult, type UserPointerData, UserPointersOverlay, type UserPointersOverlayProps, WebSocketConnection, createDefaultAppData, createNoyaContext, enforceSchema, getAppData, parseAppDataParameter, useAIManager, useAnyEphemeralUserData, useAnyNoyaManager, useAnyNoyaStateContext, useAsset, useAssetManager, useAssets, useCallableAITools, useColorScheme, useConnectedUsersManager, useCurrentUserId, useIOManager, useInputs, useIsInitialized, useManagedHistory, useManagedState, useMultiplayerState, useNoyaState, useObservable, useOutputTransforms, usePipelineManager, useRegisterAITool, useSecret, useSecretManager, useSecrets, useSyncStateManager, useViewType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as _noya_app_state_manager from '@noya-app/state-manager';
|
|
2
|
-
import { ConnectedUsersManager, EphemeralUserDataManager, NoyaManager, StateManager, StateManagerOptions, MultiplayerStateManagerOptions, SyncAdapter, TSchema, Static, CreateParams, MultiplayerStateManager, ReconnectingWebSocketState, ClientToServerMessage, ServerToClientMessage, MultiplayerStateManagerError } from '@noya-app/state-manager';
|
|
2
|
+
import { AIToolDefinition, ConnectedUsersManager, EphemeralUserDataManager, NoyaManager, StateManager, StateManagerOptions, MultiplayerStateManagerOptions, SyncAdapter, TSchema, Static, CreateParams, MultiplayerStateManager, ReconnectingWebSocketState, ClientToServerMessage, ServerToClientMessage, MultiplayerStateManagerError } from '@noya-app/state-manager';
|
|
3
3
|
export * from '@noya-app/state-manager';
|
|
4
4
|
import React, { SetStateAction } from 'react';
|
|
5
5
|
import { GetAtPath, ObservableOptions, PathKey, Observable } from '@noya-app/observable';
|
|
6
6
|
import { MenuItem } from '@noya-app/noya-designsystem';
|
|
7
7
|
import { OutputTransform, Input } from '@noya-app/noya-schemas';
|
|
8
8
|
|
|
9
|
+
declare function useRegisterAITool(tool: AIToolDefinition): void;
|
|
10
|
+
declare function useCallableAITools(): _noya_app_state_manager.CallableAIToolsMap;
|
|
11
|
+
|
|
9
12
|
type Point = {
|
|
10
13
|
x: number;
|
|
11
14
|
y: number;
|
|
@@ -56,7 +59,7 @@ declare function useMultiplayerState<S, M extends object = object, E extends obj
|
|
|
56
59
|
assetManager: _noya_app_state_manager.AssetManager;
|
|
57
60
|
aiManager: _noya_app_state_manager.AIManager;
|
|
58
61
|
rpcManager: _noya_app_state_manager.RPCManager;
|
|
59
|
-
|
|
62
|
+
pipelineManager: _noya_app_state_manager.PipelineManager;
|
|
60
63
|
secretManager: _noya_app_state_manager.SecretManager;
|
|
61
64
|
menuItemsManager: _noya_app_state_manager.MenuManager<MenuT>;
|
|
62
65
|
createAsset: (options: _noya_app_state_manager.CreateAssetOptions | Uint8Array | File | Blob) => Promise<_noya_app_state_manager.Asset>;
|
|
@@ -117,11 +120,13 @@ interface NoyaStateProviderProps<S, M extends object, E extends object, MenuT ex
|
|
|
117
120
|
initialState?: S;
|
|
118
121
|
fallback?: React.ReactNode;
|
|
119
122
|
}
|
|
120
|
-
|
|
123
|
+
type AnyNoyaStateContextValue = {
|
|
121
124
|
noyaManager: NoyaManager<any, any, any, any>;
|
|
122
125
|
theme: AppTheme;
|
|
123
126
|
viewType: AppViewType;
|
|
124
127
|
};
|
|
128
|
+
declare const AnyNoyaStateContext: React.Context<AnyNoyaStateContextValue | undefined>;
|
|
129
|
+
declare function useAnyNoyaStateContext(): AnyNoyaStateContextValue;
|
|
125
130
|
declare function useAnyNoyaManager(): NoyaManager<any, any, any, any>;
|
|
126
131
|
declare function useColorScheme(): AppTheme;
|
|
127
132
|
declare function useViewType(): AppViewType;
|
|
@@ -137,16 +142,16 @@ declare function useSecretManager(): _noya_app_state_manager.SecretManager;
|
|
|
137
142
|
declare function useSecrets(): _noya_app_state_manager.Secret[];
|
|
138
143
|
declare function useSecret(name: string): _noya_app_state_manager.Secret | undefined;
|
|
139
144
|
declare function useInputs(): ({
|
|
140
|
-
|
|
145
|
+
id: string;
|
|
141
146
|
kind: "file";
|
|
147
|
+
required: boolean;
|
|
142
148
|
toolId: string | null;
|
|
143
|
-
id: string;
|
|
144
149
|
name: string;
|
|
145
150
|
description: string | null;
|
|
146
151
|
} | {
|
|
147
|
-
required: boolean;
|
|
148
|
-
kind: "data";
|
|
149
152
|
id: string;
|
|
153
|
+
kind: "data";
|
|
154
|
+
required: boolean;
|
|
150
155
|
name: string;
|
|
151
156
|
description: string | null;
|
|
152
157
|
schema: {
|
|
@@ -236,22 +241,28 @@ declare function useInputs(): ({
|
|
|
236
241
|
};
|
|
237
242
|
_kind: "Object";
|
|
238
243
|
} | null;
|
|
244
|
+
} | {
|
|
245
|
+
id: string;
|
|
246
|
+
kind: "secret";
|
|
247
|
+
required: boolean;
|
|
248
|
+
name: string;
|
|
249
|
+
description: string | null;
|
|
239
250
|
})[];
|
|
240
251
|
declare function useOutputTransforms(): ({
|
|
241
252
|
value: string;
|
|
242
|
-
kind: "script";
|
|
243
253
|
id: string;
|
|
254
|
+
kind: "script";
|
|
244
255
|
location: "state" | "url";
|
|
245
256
|
order: number;
|
|
246
257
|
} | {
|
|
247
258
|
value: string;
|
|
248
|
-
kind: "jsonPointer";
|
|
249
259
|
id: string;
|
|
260
|
+
kind: "jsonPointer";
|
|
250
261
|
order: number;
|
|
251
262
|
})[];
|
|
252
263
|
declare function useIOManager(): _noya_app_state_manager.IOManager;
|
|
253
264
|
declare function useIsInitialized(): boolean;
|
|
254
|
-
declare function
|
|
265
|
+
declare function usePipelineManager(): _noya_app_state_manager.PipelineManager;
|
|
255
266
|
declare const ConnectedUsersContext: React.Context<ConnectedUsersManager | undefined>;
|
|
256
267
|
declare function useConnectedUsersManager(): ConnectedUsersManager | undefined;
|
|
257
268
|
declare const AnyEphemeralUserDataManagerContext: React.Context<EphemeralUserDataManager<object> | undefined>;
|
|
@@ -327,9 +338,7 @@ declare class WebSocketConnection<State> {
|
|
|
327
338
|
private url;
|
|
328
339
|
private options;
|
|
329
340
|
private ws;
|
|
330
|
-
private
|
|
331
|
-
private pendingPingId?;
|
|
332
|
-
private intervalId?;
|
|
341
|
+
private closedForever;
|
|
333
342
|
constructor(url: URL, options?: ConnectionOptions<State>);
|
|
334
343
|
connect(): Promise<void>;
|
|
335
344
|
private handleOpen;
|
|
@@ -341,4 +350,4 @@ declare class WebSocketConnection<State> {
|
|
|
341
350
|
removeListener(listener: (state: ReconnectingWebSocketState) => void): void;
|
|
342
351
|
}
|
|
343
352
|
|
|
344
|
-
export { AnyEphemeralUserDataManagerContext, type AppData, type AppTheme, type AppViewType, ConnectedUsersContext, type ConnectionEvent, type ConnectionOptions, FallbackUntilInitialized, type GetAppDataOptions, type RenderUserPointer, type RenderUserPointerProps, StateInspector, type StateInspectorAnchor, type StateInspectorOptions, type UseMultiplayerStateOptions, type UseNoyaStateOptions, type UseNoyaStateResult, type UserPointerData, UserPointersOverlay, type UserPointersOverlayProps, WebSocketConnection, createDefaultAppData, createNoyaContext, enforceSchema, getAppData, parseAppDataParameter, useAIManager, useAnyEphemeralUserData, useAnyNoyaManager, useAnyNoyaStateContext, useAsset, useAssetManager, useAssets, useColorScheme, useConnectedUsersManager, useCurrentUserId, useIOManager, useInputs, useIsInitialized, useManagedHistory, useManagedState, useMultiplayerState, useNoyaState, useObservable, useOutputTransforms, useSecret, useSecretManager, useSecrets, useSyncStateManager, useViewType
|
|
353
|
+
export { AnyEphemeralUserDataManagerContext, AnyNoyaStateContext, type AnyNoyaStateContextValue, type AppData, type AppTheme, type AppViewType, ConnectedUsersContext, type ConnectionEvent, type ConnectionOptions, FallbackUntilInitialized, type GetAppDataOptions, type RenderUserPointer, type RenderUserPointerProps, StateInspector, type StateInspectorAnchor, type StateInspectorOptions, type UseMultiplayerStateOptions, type UseNoyaStateOptions, type UseNoyaStateResult, type UserPointerData, UserPointersOverlay, type UserPointersOverlayProps, WebSocketConnection, createDefaultAppData, createNoyaContext, enforceSchema, getAppData, parseAppDataParameter, useAIManager, useAnyEphemeralUserData, useAnyNoyaManager, useAnyNoyaStateContext, useAsset, useAssetManager, useAssets, useCallableAITools, useColorScheme, useConnectedUsersManager, useCurrentUserId, useIOManager, useInputs, useIsInitialized, useManagedHistory, useManagedState, useMultiplayerState, useNoyaState, useObservable, useOutputTransforms, usePipelineManager, useRegisterAITool, useSecret, useSecretManager, useSecrets, useSyncStateManager, useViewType };
|