@astrale-os/shell-react 0.4.0-beta.10 → 0.4.0-beta.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0-beta.11](https://github.com/astrale-os/shell/compare/shell-react-v0.4.0-beta.10...shell-react-v0.4.0-beta.11) (2026-09-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **react:** allow id-only action receivers ([#167](https://github.com/astrale-os/shell/issues/167)) ([7f75975](https://github.com/astrale-os/shell/commit/7f759753864033e9593bb70080fa8b8c5a5157c0))
9
+
3
10
  ## [0.4.0-beta.10](https://github.com/astrale-os/shell/compare/shell-react-v0.4.0-beta.9...shell-react-v0.4.0-beta.10) (2026-09-01)
4
11
 
5
12
 
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export type { ActAsProps, PolicyObject } from './auth/index.js';
6
6
  export { ClientError, NodeUnavailableError, ProtocolError, ResponseError, StaleRouteError, TransportError, isClientError, isNodeUnavailableError, useCall, useGraphStore, useQuery, useStream, } from './graph/index.js';
7
7
  export type { CallOptions, GraphResource, GraphResourceState, GraphStore, QueryResourceOptions, StreamHandle, StreamOptions, } from './graph/index.js';
8
8
  export { DomainProvider, RelationUnavailableError, queryRefresh, useAction, useDomain, useDomains, useDynamicDomain, useDynamicObject, useKernel, useMutation, useObject, useRelation, } from './schema/index.js';
9
- export type { ActionOptions, ActionRefresh, DomainProviderProps, DomainAction, MutationOptions, QueryRefresh, RelationOptions, RelationResource, RelationUnavailable, RichReadOptions, } from './schema/index.js';
9
+ export type { ActionReceiver, ActionOptions, ActionRefresh, DomainProviderProps, DomainAction, MutationOptions, QueryRefresh, RelationOptions, RelationResource, RelationUnavailable, RichReadOptions, } from './schema/index.js';
10
10
  export { Link, NavigationScope, NavScope, NodeLink, pathParam, ViewLink, defineNavigation, enumParam, location, memoryAdapter, urlAdapter, useAncestors, useLocation, useNavigate, useNavigation, useNavScope, } from './navigation/index.js';
11
11
  export type { LinkProps, LocationDefinition, MissingPolicy, NavAdapter, NavLocation, NavScopeHandle, NavScopeProps, NavSnapshot, NavTarget, NavigationDefinition, NavigationParam, NavigationParams, NavigationRoutes, NavigationTarget, NodeLinkProps, Navigate, SerializedLocation, ViewLinkProps, } from './navigation/index.js';
12
12
  export { SelectionScope, useSelection } from './selection/index.js';
@@ -1,13 +1,16 @@
1
- import type { BoundNodeFor } from '@astrale-os/sdk/client';
2
1
  import type { SessionRequestOptions } from '@astrale-os/sdk/client/session';
2
+ import type { NodeId } from '@astrale-os/sdk/graph/node';
3
3
  import type { QueryAST, QueryDefinition } from '@astrale-os/sdk/query';
4
4
  import type { Domain } from '@astrale-os/sdk/schema';
5
- import type { CallableInputOf, CallableResultOf, MethodOwnerKeyOf, MethodInheritance, ResolvedFunction, ResolvedMethod } from '@astrale-os/sdk/schema';
5
+ import type { CallableInputOf, CallableResultOf, MethodInheritance, ResolvedFunction, ResolvedMethod } from '@astrale-os/sdk/schema';
6
6
  type ExecutableInheritance = Exclude<MethodInheritance, 'abstract'>;
7
7
  type InstanceMethod = ResolvedMethod<unknown, unknown, false, ExecutableInheritance>;
8
8
  type StaticMethod = ResolvedMethod<unknown, unknown, true, ExecutableInheritance>;
9
9
  type Callable = ResolvedFunction | InstanceMethod | StaticMethod;
10
- type MethodReceiver<C extends InstanceMethod> = BoundNodeFor<MethodOwnerKeyOf<C>>;
10
+ /** Stable identity of an instance Method receiver; the Kernel resolves and authorizes its Class. */
11
+ export interface ActionReceiver {
12
+ readonly id: NodeId;
13
+ }
11
14
  declare const QUERY_REFRESH: unique symbol;
12
15
  export interface QueryRefresh {
13
16
  readonly id: string;
@@ -27,7 +30,7 @@ export interface ActionOptions extends SessionRequestOptions {
27
30
  readonly refresh?: ActionRefresh;
28
31
  readonly onError?: (error: unknown) => void;
29
32
  }
30
- type ActionArgs<C extends Callable> = C extends InstanceMethod ? [receiver: MethodReceiver<C>, input: CallableInputOf<C>] : [input: CallableInputOf<C>];
33
+ type ActionArgs<C extends Callable> = C extends InstanceMethod ? [receiver: ActionReceiver, input: CallableInputOf<C>] : [input: CallableInputOf<C>];
31
34
  export interface DomainAction<Args extends unknown[], Result> {
32
35
  run(...args: Args): Promise<Result>;
33
36
  readonly pending: boolean;
@@ -3,6 +3,7 @@ export { useDomain, useDomains, useDynamicDomain } from './domain.hook.js';
3
3
  export { DomainProvider } from './domain.context.js';
4
4
  export type { DomainProviderProps } from './domain.context.js';
5
5
  export { queryRefresh, useAction } from './action.hook.js';
6
+ export type { ActionReceiver } from './action.hook.js';
6
7
  export type { ActionOptions, ActionRefresh, DomainAction, QueryRefresh } from './action.hook.js';
7
8
  export { useMutation } from './mutation.hook.js';
8
9
  export type { MutationOptions } from './mutation.hook.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/shell-react",
3
- "version": "0.4.0-beta.10",
3
+ "version": "0.4.0-beta.11",
4
4
  "description": "Astrale shell-react — the React face of the shell (provider, hooks, view components)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "zod": "4.4.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@astrale-os/sdk": "0.5.0-beta.99",
34
+ "@astrale-os/sdk": "0.5.0-beta.101",
35
35
  "@testing-library/dom": "^10.4.0",
36
36
  "@testing-library/react": "^16.3.0",
37
37
  "@types/node": "^26.2.0",
@@ -46,7 +46,7 @@
46
46
  "vitest": "4.1.10"
47
47
  },
48
48
  "peerDependencies": {
49
- "@astrale-os/sdk": ">=0.5.0-beta.99 <1.0.0",
49
+ "@astrale-os/sdk": ">=0.5.0-beta.101 <1.0.0",
50
50
  "react": ">=18",
51
51
  "react-dom": ">=18"
52
52
  },
package/src/index.ts CHANGED
@@ -53,6 +53,7 @@ export {
53
53
  useRelation,
54
54
  } from './schema/index.js'
55
55
  export type {
56
+ ActionReceiver,
56
57
  ActionOptions,
57
58
  ActionRefresh,
58
59
  DomainProviderProps,
@@ -1,4 +1,3 @@
1
- import type { BoundNodeFor } from '@astrale-os/sdk/client'
2
1
  import type { SessionRequestOptions } from '@astrale-os/sdk/client/session'
3
2
  import type { NodeId } from '@astrale-os/sdk/graph/node'
4
3
  import type { QueryAST, QueryDefinition } from '@astrale-os/sdk/query'
@@ -6,7 +5,6 @@ import type { Domain } from '@astrale-os/sdk/schema'
6
5
  import type {
7
6
  CallableInputOf,
8
7
  CallableResultOf,
9
- MethodOwnerKeyOf,
10
8
  MethodInheritance,
11
9
  ResolvedFunction,
12
10
  ResolvedMethod,
@@ -28,8 +26,11 @@ type ExecutableInheritance = Exclude<MethodInheritance, 'abstract'>
28
26
  type InstanceMethod = ResolvedMethod<unknown, unknown, false, ExecutableInheritance>
29
27
  type StaticMethod = ResolvedMethod<unknown, unknown, true, ExecutableInheritance>
30
28
  type Callable = ResolvedFunction | InstanceMethod | StaticMethod
31
- type Receiver = { readonly id: NodeId }
32
- type MethodReceiver<C extends InstanceMethod> = BoundNodeFor<MethodOwnerKeyOf<C>>
29
+
30
+ /** Stable identity of an instance Method receiver; the Kernel resolves and authorizes its Class. */
31
+ export interface ActionReceiver {
32
+ readonly id: NodeId
33
+ }
33
34
 
34
35
  const QUERY_REFRESH = Symbol('shell-react.query-refresh')
35
36
 
@@ -76,7 +77,7 @@ export interface ActionOptions extends SessionRequestOptions {
76
77
  }
77
78
 
78
79
  type ActionArgs<C extends Callable> = C extends InstanceMethod
79
- ? [receiver: MethodReceiver<C>, input: CallableInputOf<C>]
80
+ ? [receiver: ActionReceiver, input: CallableInputOf<C>]
80
81
  : [input: CallableInputOf<C>]
81
82
 
82
83
  export interface DomainAction<Args extends unknown[], Result> {
@@ -110,7 +111,10 @@ export function useAction<C extends Callable>(
110
111
  try {
111
112
  const result = isInstanceMethod(current)
112
113
  ? await kernel.session.invoke(
113
- reference(bindingRef.current.domain, current)(receiverPath(args[0] as Receiver)),
114
+ reference(
115
+ bindingRef.current.domain,
116
+ current,
117
+ )(receiverPath(args[0] as ActionReceiver)),
114
118
  args[1] as never,
115
119
  request,
116
120
  )
@@ -161,7 +165,7 @@ function isInstanceMethod(callable: Callable): callable is InstanceMethod {
161
165
  return 'owner' in callable && callable.static === false
162
166
  }
163
167
 
164
- function receiverPath(receiver: Receiver): Path {
168
+ function receiverPath(receiver: ActionReceiver): Path {
165
169
  return Path.id(receiver.id)
166
170
  }
167
171
 
@@ -3,6 +3,7 @@ export { useDomain, useDomains, useDynamicDomain } from './domain.hook.js'
3
3
  export { DomainProvider } from './domain.context.js'
4
4
  export type { DomainProviderProps } from './domain.context.js'
5
5
  export { queryRefresh, useAction } from './action.hook.js'
6
+ export type { ActionReceiver } from './action.hook.js'
6
7
  export type { ActionOptions, ActionRefresh, DomainAction, QueryRefresh } from './action.hook.js'
7
8
  export { useMutation } from './mutation.hook.js'
8
9
  export type { MutationOptions } from './mutation.hook.js'