@astrale-os/shell-react 0.2.10-beta.3 → 0.3.1
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/application/apps/app-host.d.ts +5 -5
- package/dist/application/apps/app-host.d.ts.map +1 -1
- package/dist/application/apps/app-host.js +18 -39
- package/dist/application/apps/apps.hook.d.ts +4 -11
- package/dist/application/apps/apps.hook.d.ts.map +1 -1
- package/dist/application/apps/apps.hook.js +9 -49
- package/dist/application/apps/open-app.hook.d.ts +4 -7
- package/dist/application/apps/open-app.hook.d.ts.map +1 -1
- package/dist/application/apps/open-app.hook.js +2 -2
- package/dist/application/index.d.ts +1 -3
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +1 -2
- package/dist/application/spaces/space.hook.d.ts.map +1 -1
- package/dist/application/spaces/space.hook.js +4 -1
- package/dist/auth/act-as.context.d.ts +1 -1
- package/dist/auth/act-as.context.d.ts.map +1 -1
- package/dist/auth/auth.hook.d.ts +1 -1
- package/dist/auth/auth.hook.d.ts.map +1 -1
- package/dist/auth/can.hook.d.ts +2 -2
- package/dist/auth/can.hook.d.ts.map +1 -1
- package/dist/auth/self.hook.d.ts +1 -1
- package/dist/auth/self.hook.d.ts.map +1 -1
- package/dist/components/can.d.ts +2 -2
- package/dist/components/can.d.ts.map +1 -1
- package/dist/graph/call/call.hook.d.ts +2 -2
- package/dist/graph/call/call.hook.d.ts.map +1 -1
- package/dist/graph/call/stream.hook.d.ts +2 -2
- package/dist/graph/call/stream.hook.d.ts.map +1 -1
- package/dist/graph/graph.context.d.ts +1 -1
- package/dist/graph/graph.context.d.ts.map +1 -1
- package/dist/graph/guards.error.d.ts +4 -4
- package/dist/graph/guards.error.d.ts.map +1 -1
- package/dist/graph/guards.error.js +4 -4
- package/dist/graph/query-definition.hook.d.ts +1 -2
- package/dist/graph/query-definition.hook.d.ts.map +1 -1
- package/dist/graph/query-definition.hook.js +4 -10
- package/dist/graph/resource.d.ts +1 -1
- package/dist/graph/resource.d.ts.map +1 -1
- package/dist/graph/store.d.ts +2 -2
- package/dist/graph/store.d.ts.map +1 -1
- package/dist/graph/store.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
- package/dist/navigation/adapters/url.adapter.js +2 -5
- package/dist/navigation/codec.d.ts.map +1 -1
- package/dist/navigation/codec.js +1 -7
- package/dist/navigation/link.js +1 -1
- package/dist/navigation/scope.context.d.ts +1 -1
- package/dist/navigation/scope.context.d.ts.map +1 -1
- package/dist/navigation/scope.context.js +3 -6
- package/dist/navigation/snapshot.d.ts +1 -1
- package/dist/navigation/snapshot.d.ts.map +1 -1
- package/dist/navigation/snapshot.js +2 -8
- package/dist/navigation/view-key.d.ts +3 -0
- package/dist/navigation/view-key.d.ts.map +1 -0
- package/dist/navigation/view-key.js +8 -0
- package/dist/schema/action.hook.d.ts +11 -7
- package/dist/schema/action.hook.d.ts.map +1 -1
- package/dist/schema/action.hook.js +11 -6
- package/dist/schema/domain.hook.js +12 -13
- package/dist/schema/kernel.hook.d.ts +1 -1
- package/dist/schema/kernel.hook.d.ts.map +1 -1
- package/dist/schema/kernel.hook.js +1 -1
- package/dist/schema/mutation.hook.d.ts +2 -2
- package/dist/schema/mutation.hook.d.ts.map +1 -1
- package/dist/schema/mutation.hook.js +6 -5
- package/dist/schema/object.hook.d.ts +3 -6
- package/dist/schema/object.hook.d.ts.map +1 -1
- package/dist/schema/object.hook.js +4 -5
- package/dist/schema/relation.hook.d.ts +29 -19
- package/dist/schema/relation.hook.d.ts.map +1 -1
- package/dist/schema/relation.hook.js +45 -63
- package/dist/selection/live.d.ts.map +1 -1
- package/dist/selection/live.js +1 -2
- package/dist/session/session.context.d.ts +3 -4
- package/dist/session/session.context.d.ts.map +1 -1
- package/package.json +4 -14
- package/src/application/apps/app-host.tsx +22 -52
- package/src/application/apps/apps.hook.ts +14 -64
- package/src/application/apps/open-app.hook.ts +5 -10
- package/src/application/index.ts +2 -12
- package/src/application/spaces/space.hook.ts +6 -1
- package/src/auth/act-as.context.tsx +1 -1
- package/src/auth/auth.hook.ts +1 -1
- package/src/auth/can.hook.ts +3 -3
- package/src/auth/self.hook.ts +1 -1
- package/src/components/can.tsx +2 -2
- package/src/graph/call/call.hook.ts +2 -2
- package/src/graph/call/stream.hook.ts +2 -2
- package/src/graph/graph.context.ts +1 -1
- package/src/graph/guards.error.ts +4 -4
- package/src/graph/query-definition.hook.ts +13 -23
- package/src/graph/resource.ts +1 -1
- package/src/graph/store.ts +3 -3
- package/src/index.ts +3 -7
- package/src/navigation/adapters/url.adapter.ts +3 -4
- package/src/navigation/codec.ts +1 -7
- package/src/navigation/link.tsx +1 -1
- package/src/navigation/scope.context.tsx +5 -6
- package/src/navigation/snapshot.ts +4 -9
- package/src/navigation/view-key.ts +11 -0
- package/src/schema/action.hook.ts +45 -28
- package/src/schema/domain.hook.ts +9 -10
- package/src/schema/kernel.hook.ts +1 -1
- package/src/schema/mutation.hook.ts +13 -9
- package/src/schema/object.hook.ts +10 -18
- package/src/schema/relation.hook.ts +127 -145
- package/src/selection/live.ts +1 -2
- package/src/session/session.context.ts +3 -4
- package/dist/application/apps/domains.hook.d.ts +0 -7
- package/dist/application/apps/domains.hook.d.ts.map +0 -1
- package/dist/application/apps/domains.hook.js +0 -18
- package/src/application/apps/domains.hook.ts +0 -37
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Key } from '@astrale-os/sdk/schema';
|
|
2
|
+
import type { App, HostCapabilities, ResolvedView } from '@astrale-os/shell';
|
|
2
3
|
import type { CSSProperties, ReactNode } from 'react';
|
|
3
4
|
import type { SandboxPolicy, ViewHostHandle } from '../../window/host.js';
|
|
4
5
|
import type { WindowState } from '../../window/lifecycle/states.js';
|
|
5
|
-
/** The states `AppHost`'s fallback answers — the frame's, plus the two OS phases. */
|
|
6
6
|
export type AppHostFallbackState = WindowState | {
|
|
7
7
|
readonly phase: 'opening';
|
|
8
8
|
} | {
|
|
9
9
|
readonly phase: 'no-view';
|
|
10
10
|
};
|
|
11
11
|
export interface AppHostProps {
|
|
12
|
-
app:
|
|
13
|
-
/** Override the entry View
|
|
12
|
+
app: App | Key.Origin;
|
|
13
|
+
/** Override the installed Domain entry View. */
|
|
14
14
|
view?: ResolvedView;
|
|
15
15
|
capabilities?: HostCapabilities;
|
|
16
16
|
sandbox?: SandboxPolicy;
|
|
17
17
|
fallback?: (state: AppHostFallbackState) => ReactNode;
|
|
18
|
-
onSession?: (session: AppSession) => void;
|
|
19
18
|
className?: string;
|
|
20
19
|
style?: CSSProperties;
|
|
21
20
|
}
|
|
21
|
+
/** Resolve and mount an installed Domain through the ordinary Shell View lifecycle. */
|
|
22
22
|
export declare const AppHost: import("react").ForwardRefExoticComponent<AppHostProps & import("react").RefAttributes<ViewHostHandle>>;
|
|
23
23
|
//# sourceMappingURL=app-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-host.d.ts","sourceRoot":"","sources":["../../../src/application/apps/app-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"app-host.d.ts","sourceRoot":"","sources":["../../../src/application/apps/app-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAKnE,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAA;AAEjC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACrB,gDAAgD;IAChD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED,uFAAuF;AACvF,eAAO,MAAM,OAAO,yGAoDnB,CAAA"}
|
|
@@ -1,60 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* AppHost (API §12.2) = useOpenApp + ViewHost. Opens the app's `AppSession`,
|
|
4
|
-
* mounts its entry view with the session credential, and DISPOSES the session
|
|
5
|
-
* with the window (unmount, or an app change). `opening` renders while the
|
|
6
|
-
* session opens; `no-view` when the app pins no entrypoint; every mounted-frame
|
|
7
|
-
* phase is the window module's `WindowState`.
|
|
8
|
-
*/
|
|
9
2
|
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
10
3
|
import { ViewHost } from '../../window/host.js';
|
|
11
|
-
import { toRef } from './apps.hook.js';
|
|
12
4
|
import { useOpenApp } from './open-app.hook.js';
|
|
5
|
+
/** Resolve and mount an installed Domain through the ordinary Shell View lifecycle. */
|
|
13
6
|
export const AppHost = forwardRef(function AppHost(props, ref) {
|
|
14
7
|
const open = useOpenApp();
|
|
15
|
-
const [
|
|
8
|
+
const [opened, setOpened] = useState(undefined);
|
|
16
9
|
const [error, setError] = useState(undefined);
|
|
17
|
-
const
|
|
10
|
+
const origin = typeof props.app === 'string' ? props.app : props.app.origin;
|
|
18
11
|
const openRef = useRef(open);
|
|
19
12
|
openRef.current = open;
|
|
20
|
-
const appRef = useRef(props.app);
|
|
21
|
-
appRef.current = props.app;
|
|
22
|
-
const onSessionRef = useRef(props.onSession);
|
|
23
|
-
onSessionRef.current = props.onSession;
|
|
24
|
-
// Open (re)opens the session per app; the cleanup disposes it — so the session
|
|
25
|
-
// is torn down with the window (unmount) and swapped on an app change.
|
|
26
13
|
useEffect(() => {
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
setSession(null);
|
|
14
|
+
let active = true;
|
|
15
|
+
setOpened(undefined);
|
|
30
16
|
setError(undefined);
|
|
31
|
-
void openRef.current(
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
setSession(s);
|
|
38
|
-
onSessionRef.current?.(s);
|
|
39
|
-
}, (e) => {
|
|
40
|
-
if (!cancelled)
|
|
41
|
-
setError(e);
|
|
17
|
+
void openRef.current(origin).then((view) => {
|
|
18
|
+
if (active)
|
|
19
|
+
setOpened(view);
|
|
20
|
+
}, (cause) => {
|
|
21
|
+
if (active)
|
|
22
|
+
setError(cause);
|
|
42
23
|
});
|
|
43
24
|
return () => {
|
|
44
|
-
|
|
45
|
-
opened?.dispose();
|
|
25
|
+
active = false;
|
|
46
26
|
};
|
|
47
|
-
|
|
48
|
-
}, [appKey]);
|
|
27
|
+
}, [origin]);
|
|
49
28
|
const { fallback, className, style } = props;
|
|
50
29
|
const box = (children) => (_jsx("div", { className: className, style: style, children: children }));
|
|
51
|
-
// A session-open failure has no window yet — `windowId` is honestly absent (§10).
|
|
52
30
|
if (error !== undefined)
|
|
53
31
|
return box(fallback?.({ phase: 'crashed', error }) ?? null);
|
|
54
|
-
if (
|
|
32
|
+
if (opened === undefined && props.view === undefined) {
|
|
55
33
|
return box(fallback?.({ phase: 'opening' }) ?? null);
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
}
|
|
35
|
+
const view = props.view ?? opened;
|
|
36
|
+
if (view === null || view === undefined)
|
|
58
37
|
return box(fallback?.({ phase: 'no-view' }) ?? null);
|
|
59
|
-
return (_jsx(ViewHost, { ref: ref, view: view,
|
|
38
|
+
return (_jsx(ViewHost, { ref: ref, view: view, capabilities: props.capabilities, sandbox: props.sandbox, fallback: fallback ? (state) => fallback(state) : undefined, className: className, style: style }));
|
|
60
39
|
});
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { App } from '@astrale-os/shell';
|
|
2
2
|
import type { ReadState } from '../../graph/memory/read/envelope.js';
|
|
3
3
|
export interface AppsResult extends ReadState {
|
|
4
|
-
readonly apps: readonly
|
|
4
|
+
readonly apps: readonly App[];
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare function toRef(x: NodeTarget | {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
}): NodeTarget;
|
|
11
|
-
/** Stable dependency identity for one Shell node target. */
|
|
12
|
-
export declare function targetKey(x: NodeTarget | {
|
|
13
|
-
readonly id: string;
|
|
14
|
-
}): string;
|
|
6
|
+
/** Read the installed Domain applications available to the current Shell session. */
|
|
7
|
+
export declare function useApps(): AppsResult;
|
|
15
8
|
//# sourceMappingURL=apps.hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/apps.hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apps.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/apps.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAI5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAQpE,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAA;CAC9B;AAED,qFAAqF;AACrF,wBAAgB,OAAO,IAAI,UAAU,CAoBpC"}
|
|
@@ -1,59 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* useApps(space?) (API §12.2) — the apps installed in a space (`installed_in`
|
|
4
|
-
* in-edges). No arg targets the CURRENT space (shared store, so a switch anywhere
|
|
5
|
-
* swaps the dock) and is IDLE while none is selected (§1.3); an explicit `null`
|
|
6
|
-
* stays idle; OS plane unavailable → fully idle. Also `toRef`, the app/space
|
|
7
|
-
* subject normalizer the apps hooks share.
|
|
8
|
-
*/
|
|
9
|
-
import { useCallback, useEffect, useMemo, useSyncExternalStore } from 'react';
|
|
1
|
+
import { useMemo } from 'react';
|
|
10
2
|
import { useAsyncResource } from '../../graph/async.js';
|
|
11
3
|
import { useShell } from '../../session/shell.hook.js';
|
|
12
|
-
import { currentSpaceStore } from '../spaces/current-space.store.js';
|
|
13
4
|
import { isOsPlaneAvailable } from '../user/user.store.js';
|
|
14
5
|
const NO_APPS = [];
|
|
15
|
-
|
|
16
|
-
export function useApps(
|
|
6
|
+
/** Read the installed Domain applications available to the current Shell session. */
|
|
7
|
+
export function useApps() {
|
|
17
8
|
const shell = useShell();
|
|
18
9
|
const available = isOsPlaneAvailable(shell);
|
|
19
|
-
|
|
20
|
-
// window swaps the dock here (§12.2). An explicit `null` stays idle; an explicit
|
|
21
|
-
// space bypasses the store entirely (no needless currentSpace fetch). OS plane
|
|
22
|
-
// unavailable (§12.2) → fully idle.
|
|
23
|
-
const useCurrent = space === undefined;
|
|
24
|
-
const store = currentSpaceStore(shell);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (useCurrent && available)
|
|
27
|
-
store.ensure();
|
|
28
|
-
}, [store, useCurrent, available]);
|
|
29
|
-
const subscribe = useCallback((cb) => (useCurrent && available ? store.subscribe(cb) : () => { }), [store, useCurrent, available]);
|
|
30
|
-
const getSnapshot = useCallback(() => (useCurrent && available ? store.getSnapshot() : IDLE_CURRENT), [store, useCurrent, available]);
|
|
31
|
-
const currentSnap = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
32
|
-
const effective = useCurrent ? currentSnap.space : (space ?? null);
|
|
33
|
-
const effRef = effective === null ? null : toRef(effective);
|
|
34
|
-
const appsRes = useAsyncResource(!available || effRef === null ? null : () => shell.apps.in(effRef), NO_APPS, [shell, effRef, available]);
|
|
10
|
+
const result = useAsyncResource(available ? () => shell.apps.list() : null, NO_APPS, [shell, available]);
|
|
35
11
|
return useMemo(() => ({
|
|
36
|
-
apps:
|
|
37
|
-
pending:
|
|
38
|
-
error:
|
|
12
|
+
apps: result.data,
|
|
13
|
+
pending: result.pending,
|
|
14
|
+
error: result.error,
|
|
39
15
|
live: false,
|
|
40
16
|
seq: 0,
|
|
41
|
-
refetch:
|
|
42
|
-
}), [
|
|
43
|
-
}
|
|
44
|
-
/** A bound-node-ish subject carries a graph id. */
|
|
45
|
-
function hasId(x) {
|
|
46
|
-
return typeof x === 'object' && x !== null && 'id' in x;
|
|
47
|
-
}
|
|
48
|
-
/** An `@id` ref for a bound node, else the normalized ref of a raw subject. */
|
|
49
|
-
export function toRef(x) {
|
|
50
|
-
return hasId(x) ? x.id : x;
|
|
51
|
-
}
|
|
52
|
-
/** Stable dependency identity for one Shell node target. */
|
|
53
|
-
export function targetKey(x) {
|
|
54
|
-
if (hasId(x))
|
|
55
|
-
return `id:${x.id}`;
|
|
56
|
-
if (typeof x === 'string')
|
|
57
|
-
return `text:${x}`;
|
|
58
|
-
return `path:${Path.from(x).raw}`;
|
|
17
|
+
refetch: result.refetch,
|
|
18
|
+
}), [result.data, result.pending, result.error, result.refetch]);
|
|
59
19
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* app-open protocol lives in the shell package). Resolves to the session; disposal
|
|
4
|
-
* is the caller's (AppHost disposes it with the window).
|
|
5
|
-
*/
|
|
6
|
-
import type { ApplicationNode, AppSession, NodeTarget } from '@astrale-os/shell';
|
|
1
|
+
import type { Key } from '@astrale-os/sdk/schema';
|
|
2
|
+
import type { App, ResolvedView } from '@astrale-os/shell';
|
|
7
3
|
import type { Action } from '../../graph/action.js';
|
|
8
|
-
|
|
4
|
+
/** Resolve one installed Domain's ordinary entry View. */
|
|
5
|
+
export declare function useOpenApp(): Action<[App | Key.Origin], ResolvedView | null>;
|
|
9
6
|
//# sourceMappingURL=open-app.hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-app.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/open-app.hook.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"open-app.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/open-app.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAInD,0DAA0D;AAC1D,wBAAgB,UAAU,IAAI,MAAM,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC,CAG5E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAction } from '../../graph/action.js';
|
|
2
2
|
import { useShell } from '../../session/shell.hook.js';
|
|
3
|
-
|
|
3
|
+
/** Resolve one installed Domain's ordinary entry View. */
|
|
4
4
|
export function useOpenApp() {
|
|
5
5
|
const shell = useShell();
|
|
6
|
-
return useAction((app) => shell.apps.open(
|
|
6
|
+
return useAction((app) => shell.apps.open(app));
|
|
7
7
|
}
|
|
@@ -7,12 +7,10 @@ export { useSpace } from './spaces/space.hook.js';
|
|
|
7
7
|
export type { SpaceResult } from './spaces/space.hook.js';
|
|
8
8
|
export { useApps } from './apps/apps.hook.js';
|
|
9
9
|
export type { AppsResult } from './apps/apps.hook.js';
|
|
10
|
-
export { useInstalledDomains } from './apps/domains.hook.js';
|
|
11
|
-
export type { DomainsResult } from './apps/domains.hook.js';
|
|
12
10
|
export { useOpenApp } from './apps/open-app.hook.js';
|
|
13
11
|
export { AppHost } from './apps/app-host.js';
|
|
14
12
|
export type { AppHostFallbackState, AppHostProps } from './apps/app-host.js';
|
|
15
13
|
export { AppLogo } from './apps/app-logo.js';
|
|
16
14
|
export type { AppLogoProps } from './apps/app-logo.js';
|
|
17
|
-
export type {
|
|
15
|
+
export type { App, NodeTarget, ResolvedView, SpaceNode, UserNode } from '@astrale-os/shell';
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// application — API §12.2. The OS-plane hooks over the shell package's
|
|
2
2
|
// `shell.user/spaces/apps` namespaces + the window module: useUser, useSpaces,
|
|
3
|
-
// useCurrentSpace, useSpace, useApps,
|
|
3
|
+
// useCurrentSpace, useSpace, useApps, useOpenApp,
|
|
4
4
|
// AppHost, AppLogo.
|
|
5
5
|
export { useUser } from './user/user.hook.js';
|
|
6
6
|
export { useSpaces } from './spaces/spaces.hook.js';
|
|
7
7
|
export { useCurrentSpace } from './spaces/current-space.hook.js';
|
|
8
8
|
export { useSpace } from './spaces/space.hook.js';
|
|
9
9
|
export { useApps } from './apps/apps.hook.js';
|
|
10
|
-
export { useInstalledDomains } from './apps/domains.hook.js';
|
|
11
10
|
export { useOpenApp } from './apps/open-app.hook.js';
|
|
12
11
|
export { AppHost } from './apps/app-host.js';
|
|
13
12
|
export { AppLogo } from './apps/app-logo.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/space.hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/space.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAA;AAS9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAOjE,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE5C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAqBxE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
1
2
|
/**
|
|
2
3
|
* useSpace(ref) (API §12.2) — a single space by ref; `null`/`undefined` (or an
|
|
3
4
|
* unavailable OS plane) is idle (§1.3). One-shot today (§12 flag).
|
|
@@ -6,7 +7,6 @@ import { useMemo } from 'react';
|
|
|
6
7
|
import { useAsyncResource } from '../../graph/async.js';
|
|
7
8
|
import { isIdleInput } from '../../graph/memory/read/idle.js';
|
|
8
9
|
import { useShell } from '../../session/shell.hook.js';
|
|
9
|
-
import { targetKey } from '../apps/apps.hook.js';
|
|
10
10
|
import { isOsPlaneAvailable } from '../user/user.store.js';
|
|
11
11
|
export function useSpace(ref) {
|
|
12
12
|
const shell = useShell();
|
|
@@ -23,3 +23,6 @@ export function useSpace(ref) {
|
|
|
23
23
|
refetch: res.refetch,
|
|
24
24
|
}), [idle, res]);
|
|
25
25
|
}
|
|
26
|
+
function targetKey(input) {
|
|
27
|
+
return typeof input === 'string' ? `text:${input}` : `path:${Path.from(input).raw}`;
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"act-as.context.d.ts","sourceRoot":"","sources":["../../src/auth/act-as.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"act-as.context.d.ts","sourceRoot":"","sources":["../../src/auth/act-as.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMpD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAA;AAChC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAA;AAEtC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CACxB;AAED,eAAO,MAAM,eAAe,iDAA8C,CAAA;AAG1E,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CA8BrF"}
|
package/dist/auth/auth.hook.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthApi } from '@astrale-os/
|
|
1
|
+
import type { AuthApi } from '@astrale-os/sdk/auth';
|
|
2
2
|
/** The exact Client Auth capability for the effective subtree principal. */
|
|
3
3
|
export declare function useAuth(): AuthApi;
|
|
4
4
|
//# sourceMappingURL=auth.hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.hook.d.ts","sourceRoot":"","sources":["../../src/auth/auth.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.hook.d.ts","sourceRoot":"","sources":["../../src/auth/auth.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAInD,4EAA4E;AAC5E,wBAAgB,OAAO,IAAI,OAAO,CAEjC"}
|
package/dist/auth/can.hook.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { PathLike } from '@astrale-os/sdk/graph/path';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PolicyRef } from '@astrale-os/sdk/schema';
|
|
4
4
|
export type PolicyObject = NodeId | {
|
|
5
5
|
readonly id: NodeId;
|
|
6
6
|
};
|
|
@@ -8,5 +8,5 @@ export type PolicyObject = NodeId | {
|
|
|
8
8
|
* Evaluate one declared Kernel policy for one exact graph object. This is a UI affordance; the
|
|
9
9
|
* invoked callable remains the authorization enforcement point.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useCan(policy: PathLike |
|
|
11
|
+
export declare function useCan(policy: PathLike | PolicyRef | null | undefined, object: PolicyObject | null | undefined): boolean | undefined;
|
|
12
12
|
//# sourceMappingURL=can.hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"can.hook.d.ts","sourceRoot":"","sources":["../../src/auth/can.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"can.hook.d.ts","sourceRoot":"","sources":["../../src/auth/can.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAOvD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,EAC/C,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACtC,OAAO,GAAG,SAAS,CA2BrB"}
|
package/dist/auth/self.hook.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self.hook.d.ts","sourceRoot":"","sources":["../../src/auth/self.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"self.hook.d.ts","sourceRoot":"","sources":["../../src/auth/self.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAIpD,wBAAgB,OAAO,IAAI,QAAQ,CAElC"}
|
package/dist/components/can.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PathLike } from '@astrale-os/sdk/graph/path';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PolicyRef } from '@astrale-os/sdk/schema';
|
|
3
3
|
import type { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import type { PolicyObject } from '../auth/can.hook.js';
|
|
5
5
|
export declare function Can(props: {
|
|
6
|
-
readonly policy: PathLike |
|
|
6
|
+
readonly policy: PathLike | PolicyRef;
|
|
7
7
|
readonly object: PolicyObject;
|
|
8
8
|
readonly children: ReactNode;
|
|
9
9
|
readonly fallback?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"can.d.ts","sourceRoot":"","sources":["../../src/components/can.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"can.d.ts","sourceRoot":"","sources":["../../src/components/can.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAIvD,wBAAgB,GAAG,CAAC,KAAK,EAAE;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAC9B,GAAG,YAAY,CAEf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Call } from '@astrale-os/
|
|
2
|
-
import type { SessionRequestOptions } from '@astrale-os/
|
|
1
|
+
import type { Call } from '@astrale-os/sdk/client';
|
|
2
|
+
import type { SessionRequestOptions } from '@astrale-os/sdk/client/session';
|
|
3
3
|
import type { Value } from '@astrale-os/sdk/value';
|
|
4
4
|
import type { Action } from '../action.js';
|
|
5
5
|
export interface CallOptions extends SessionRequestOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.hook.d.ts","sourceRoot":"","sources":["../../../src/graph/call/call.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"call.hook.d.ts","sourceRoot":"","sources":["../../../src/graph/call/call.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAK1C,MAAM,WAAW,WAAY,SAAQ,qBAAqB;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAC5C;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA;AAG9B,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;AACzF,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,EACzC,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,EACrC,OAAO,CAAC,EAAE,WAAW,GACpB,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Call } from '@astrale-os/
|
|
2
|
-
import type { SessionRequestOptions } from '@astrale-os/
|
|
1
|
+
import type { Call } from '@astrale-os/sdk/client';
|
|
2
|
+
import type { SessionRequestOptions } from '@astrale-os/sdk/client/session';
|
|
3
3
|
import type { Value } from '@astrale-os/sdk/value';
|
|
4
4
|
import type { KernelClient } from '@astrale-os/shell';
|
|
5
5
|
export type KernelStream = Awaited<ReturnType<KernelClient['stream']>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.hook.d.ts","sourceRoot":"","sources":["../../../src/graph/call/stream.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stream.hook.d.ts","sourceRoot":"","sources":["../../../src/graph/call/stream.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAMrD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AACtE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA;AAC9B,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;AAE3E,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,UAAU,CAAE,SAAQ,qBAAqB;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;CACtC;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,CAAC,GAAG,UAAU;IAC3E,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,MAAM,IAAI,IAAI,CAAA;CACf;AAmCD,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,EAChD,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,EAC5B,OAAO,CAAC,EAAE,aAAa,GACtB,YAAY,CAAC,CAAC,EAAE,UAAU,CAAC,CA4D7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphStore } from '@astrale-os/
|
|
1
|
+
import type { GraphStore } from '@astrale-os/sdk/client/store';
|
|
2
2
|
/** Optional exact Client GraphStore supplied by an injected Shell adapter. */
|
|
3
3
|
export declare const GraphContext: import("react").Context<GraphStore | null>;
|
|
4
4
|
export type { GraphStore };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.context.d.ts","sourceRoot":"","sources":["../../src/graph/graph.context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"graph.context.d.ts","sourceRoot":"","sources":["../../src/graph/graph.context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAI9D,8EAA8E;AAC9E,eAAO,MAAM,YAAY,4CAAyC,CAAA;AAGlE,YAAY,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ClientError, ProtocolError, ResponseError, StaleRouteError, TransportError, } from '@astrale-os/
|
|
2
|
-
export { NodeUnavailableError } from '@astrale-os/
|
|
1
|
+
export { ClientError, ProtocolError, ResponseError, StaleRouteError, TransportError, } from '@astrale-os/sdk/client';
|
|
2
|
+
export { NodeUnavailableError } from '@astrale-os/sdk/client';
|
|
3
3
|
export { UnsupportedFeatureError } from './memory/read/envelope.js';
|
|
4
|
-
import { ClientError } from '@astrale-os/
|
|
5
|
-
import { NodeUnavailableError } from '@astrale-os/
|
|
4
|
+
import { ClientError } from '@astrale-os/sdk/client';
|
|
5
|
+
import { NodeUnavailableError } from '@astrale-os/sdk/client';
|
|
6
6
|
export declare function isClientError(error: unknown): error is ClientError;
|
|
7
7
|
export declare function isNodeUnavailableError(error: unknown): error is NodeUnavailableError;
|
|
8
8
|
//# sourceMappingURL=guards.error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.error.d.ts","sourceRoot":"","sources":["../../src/graph/guards.error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,
|
|
1
|
+
{"version":3,"file":"guards.error.d.ts","sourceRoot":"","sources":["../../src/graph/guards.error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ClientError, ProtocolError, ResponseError, StaleRouteError, TransportError, } from '@astrale-os/
|
|
2
|
-
export { NodeUnavailableError } from '@astrale-os/
|
|
1
|
+
export { ClientError, ProtocolError, ResponseError, StaleRouteError, TransportError, } from '@astrale-os/sdk/client';
|
|
2
|
+
export { NodeUnavailableError } from '@astrale-os/sdk/client';
|
|
3
3
|
export { UnsupportedFeatureError } from './memory/read/envelope.js';
|
|
4
|
-
import { ClientError } from '@astrale-os/
|
|
5
|
-
import { NodeUnavailableError } from '@astrale-os/
|
|
4
|
+
import { ClientError } from '@astrale-os/sdk/client';
|
|
5
|
+
import { NodeUnavailableError } from '@astrale-os/sdk/client';
|
|
6
6
|
export function isClientError(error) {
|
|
7
7
|
return error instanceof ClientError;
|
|
8
8
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { QueryDefinition } from '@astrale-os/sdk/query';
|
|
2
|
-
import type { QueryAST } from '@astrale-os/sdk/query';
|
|
3
2
|
import type { GraphResource } from './resource.js';
|
|
4
3
|
export interface QueryResourceOptions {
|
|
5
4
|
readonly keepPrevious?: boolean;
|
|
@@ -7,5 +6,5 @@ export interface QueryResourceOptions {
|
|
|
7
6
|
readonly refreshWhen?: 'always' | 'visible';
|
|
8
7
|
}
|
|
9
8
|
/** Execute one named SDK Query definition exclusively through the current GraphStore. */
|
|
10
|
-
export declare function useQuery<Input, Output
|
|
9
|
+
export declare function useQuery<Input, Output>(definition: QueryDefinition<Input, Output> | null, input: Input, options?: QueryResourceOptions): GraphResource<Output>;
|
|
11
10
|
//# sourceMappingURL=query-definition.hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-definition.hook.d.ts","sourceRoot":"","sources":["../../src/graph/query-definition.hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query-definition.hook.d.ts","sourceRoot":"","sources":["../../src/graph/query-definition.hook.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAKtE,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAA;AAKtE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC5C;AAqID,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EACpC,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,EACjD,KAAK,EAAE,KAAK,EACZ,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAAC,MAAM,CAAC,CAwDvB"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { executeQuery } from '@astrale-os/sdk/query';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
3
|
-
import { useDynamicDomain } from '../schema/domain.hook.js';
|
|
4
3
|
import { retainRefreshScheduler } from './resource.js';
|
|
5
4
|
import { useGraphStore } from './store.js';
|
|
6
5
|
class DefinitionObserver {
|
|
7
6
|
store;
|
|
8
|
-
binding;
|
|
9
7
|
definition;
|
|
10
8
|
input;
|
|
11
9
|
listeners = new Set();
|
|
@@ -16,9 +14,8 @@ class DefinitionObserver {
|
|
|
16
14
|
pending = null;
|
|
17
15
|
started = false;
|
|
18
16
|
rerunQueued = false;
|
|
19
|
-
constructor(store,
|
|
17
|
+
constructor(store, definition, input) {
|
|
20
18
|
this.store = store;
|
|
21
|
-
this.binding = binding;
|
|
22
19
|
this.definition = definition;
|
|
23
20
|
this.input = input;
|
|
24
21
|
}
|
|
@@ -53,9 +50,7 @@ class DefinitionObserver {
|
|
|
53
50
|
touched.push(Object.freeze({ ast, options }));
|
|
54
51
|
return this.store.read(ast, { ...options, freshness });
|
|
55
52
|
};
|
|
56
|
-
const
|
|
57
|
-
const query = bindQueries(execute, { bind });
|
|
58
|
-
const running = query(this.definition, this.input)
|
|
53
|
+
const running = executeQuery({ query: execute }, this.definition, this.input)
|
|
59
54
|
.then((data) => {
|
|
60
55
|
if (!this.started || generation !== this.generation)
|
|
61
56
|
return;
|
|
@@ -119,9 +114,8 @@ class DefinitionObserver {
|
|
|
119
114
|
/** Execute one named SDK Query definition exclusively through the current GraphStore. */
|
|
120
115
|
export function useQuery(definition, input, options = {}) {
|
|
121
116
|
const store = useGraphStore();
|
|
122
|
-
const binding = useDynamicDomain();
|
|
123
117
|
const inputIdentity = stableIdentity(input);
|
|
124
|
-
const observer = useMemo(() => (definition === null ? null : new DefinitionObserver(store,
|
|
118
|
+
const observer = useMemo(() => (definition === null ? null : new DefinitionObserver(store, definition, input)), [store, definition, inputIdentity]);
|
|
125
119
|
const idle = useMemo(() => Object.freeze({ state: 'idle' }), []);
|
|
126
120
|
const subscribe = useCallback((listener) => observer?.subscribe(listener) ?? (() => { }), [observer]);
|
|
127
121
|
const snapshot = useCallback(() => observer?.getSnapshot() ?? idle, [observer, idle]);
|
package/dist/graph/resource.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphStore, StoreQueryResponse } from '@astrale-os/
|
|
1
|
+
import type { GraphStore, StoreQueryResponse } from '@astrale-os/sdk/client/store';
|
|
2
2
|
import type { QueryAST } from '@astrale-os/sdk/query';
|
|
3
3
|
export type GraphResourceState = 'idle' | 'loading' | 'ready' | 'stale' | 'refreshing' | 'optimistic' | 'failed';
|
|
4
4
|
export interface GraphResource<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/graph/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/graph/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAiB,MAAM,8BAA8B,CAAA;AACjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAMrD,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,QAAQ,CAAA;AAEZ,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;IAClC,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAA;IACnE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;QACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;QACzB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;KACtB,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAA;IACrD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC5C;AAsID,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,QAAQ,EAAE,MAAM,EAC7D,KAAK,EAAE,KAAK,GAAG,IAAI,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,MAAM,EACxD,OAAO,GAAE,oBAAoB,CAAC,MAAM,CAAM,GACzC,aAAa,CAAC,MAAM,CAAC,CA2EvB;AAoCD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,GAAG,SAAS,GACzB,MAAM,IAAI,CAkCZ"}
|
package/dist/graph/store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GraphApi } from '@astrale-os/
|
|
2
|
-
import type { GraphStore as GraphStoreValue } from '@astrale-os/
|
|
1
|
+
import type { GraphApi } from '@astrale-os/sdk/client';
|
|
2
|
+
import type { GraphStore as GraphStoreValue } from '@astrale-os/sdk/client/store';
|
|
3
3
|
import type { Shell } from '@astrale-os/shell';
|
|
4
4
|
interface StoreEntry {
|
|
5
5
|
readonly shell: Shell;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/graph/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/graph/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACjF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAO9C,UAAU,UAAU;IAClB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB;AAID,4FAA4F;AAC5F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED,KAAK,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAE3E,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,KAAK,EACZ,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GACnC,OAAO,CAAC,eAAe,CAAC,CAc1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,GAAG,UAAU,CAwBzE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,IAAI,CAezD;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,IAAI,eAAe,CAI/C"}
|
package/dist/graph/store.js
CHANGED