@astrale-os/sdk 0.5.0-beta.120 → 0.5.0-beta.121
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 +7 -0
- package/dist/application/mutation/authoring/builder.js +2 -2
- package/dist/application/mutation/authoring/endpoint.d.ts +3 -3
- package/dist/application/mutation/index.d.ts +1 -0
- package/dist/platform/graph/alias.d.ts +12 -0
- package/dist/platform/graph/alias.js +13 -0
- package/dist/platform/graph/document/index.d.ts +2 -1
- package/dist/platform/graph/document/index.js +2 -1
- package/dist/platform/graph/index.d.ts +2 -1
- package/dist/platform/graph/index.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0-beta.121](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.120...sdk-v0.5.0-beta.121) (2026-09-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **graph:** expose local aliases for SDK authoring ([#443](https://github.com/astrale-os/sdk/issues/443)) ([16dffa3](https://github.com/astrale-os/sdk/commit/16dffa3b904899f9aba53aac22676b53ffbbdae3))
|
|
9
|
+
|
|
3
10
|
## [0.5.0-beta.120](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.119...sdk-v0.5.0-beta.120) (2026-09-07)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
2
1
|
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { LocalAlias } from '../../../platform/graph/alias.js';
|
|
3
3
|
import { endpoint, existingEndpoint } from './endpoint.js';
|
|
4
4
|
import { precondition } from './precondition.js';
|
|
5
5
|
import { conditions, delta, properties } from './properties.js';
|
|
@@ -33,7 +33,7 @@ export function richMutationBuilder(core) {
|
|
|
33
33
|
expect: expectation,
|
|
34
34
|
createNode(input) {
|
|
35
35
|
const created = core.createNode({
|
|
36
|
-
as:
|
|
36
|
+
as: LocalAlias(input.as),
|
|
37
37
|
class: classKey(input.class),
|
|
38
38
|
...(input.props === undefined ? {} : { props: properties(input.class, input.props) }),
|
|
39
39
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
2
1
|
import type { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
3
2
|
import type { NodeTarget } from '@astrale-os/kernel-core/path';
|
|
4
3
|
import type { ResolvedClass } from '@astrale-os/kernel-dsl/v1';
|
|
4
|
+
import type { LocalAlias } from '../../../platform/graph/alias.js';
|
|
5
5
|
export interface CreatedNode<Class extends ResolvedClass<'node'> = ResolvedClass<'node'>> {
|
|
6
|
-
readonly created:
|
|
6
|
+
readonly created: LocalAlias;
|
|
7
7
|
readonly class: Class;
|
|
8
8
|
}
|
|
9
9
|
export type ExistingEndpoint = NodeTarget | Readonly<{
|
|
@@ -11,6 +11,6 @@ export type ExistingEndpoint = NodeTarget | Readonly<{
|
|
|
11
11
|
}>;
|
|
12
12
|
export type MutationEndpoint = ExistingEndpoint | CreatedNode;
|
|
13
13
|
export declare function endpoint(input: MutationEndpoint): NodeTarget | {
|
|
14
|
-
readonly created:
|
|
14
|
+
readonly created: LocalAlias;
|
|
15
15
|
};
|
|
16
16
|
export declare function existingEndpoint(input: ExistingEndpoint): NodeTarget;
|
|
@@ -5,3 +5,4 @@ export type { Mutation, MutationDefinition, MutationInputOf, MutationOutputOf }
|
|
|
5
5
|
export type { CreatedNode, EdgeSelector, ExistingEndpoint, MutationEndpoint, QueryPrecondition, RichMutationBuilder, RichPropertyConditions, RichPropertyDelta, RichPropertyInput, RichPropertyName, } from './authoring/index.js';
|
|
6
6
|
/** Canonical low-level Mutation documents remain available as the explicit escape hatch. */
|
|
7
7
|
export * from '@astrale-os/kernel-core/graph/mutate';
|
|
8
|
+
export type { LocalAlias, LocalBinding } from '../../platform/graph/alias.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type LocalBinding as CanonicalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
2
|
+
/** A name scoped to one graph or mutation, distinct from a persistent Node identity. */
|
|
3
|
+
export type LocalAlias = CanonicalBinding;
|
|
4
|
+
/** Admit a local name using the canonical Kernel grammar. */
|
|
5
|
+
export declare function LocalAlias(input: string): LocalAlias;
|
|
6
|
+
export declare const isLocalAlias: (input: unknown) => input is LocalAlias;
|
|
7
|
+
/** @deprecated Use LocalAlias. */
|
|
8
|
+
export type LocalBinding = LocalAlias;
|
|
9
|
+
/** @deprecated Use LocalAlias. */
|
|
10
|
+
export declare const LocalBinding: typeof LocalAlias;
|
|
11
|
+
/** @deprecated Use isLocalAlias. */
|
|
12
|
+
export declare const isLocalBinding: (input: unknown) => input is LocalAlias;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isLocalBinding as isCanonicalBinding, } from '@astrale-os/kernel-core/graph/graph';
|
|
2
|
+
/** Admit a local name using the canonical Kernel grammar. */
|
|
3
|
+
export function LocalAlias(input) {
|
|
4
|
+
if (!isLocalAlias(input)) {
|
|
5
|
+
throw new TypeError(`Invalid local alias ${JSON.stringify(input)}.`);
|
|
6
|
+
}
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
export const isLocalAlias = isCanonicalBinding;
|
|
10
|
+
/** @deprecated Use LocalAlias. */
|
|
11
|
+
export const LocalBinding = LocalAlias;
|
|
12
|
+
/** @deprecated Use isLocalAlias. */
|
|
13
|
+
export const isLocalBinding = isLocalAlias;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Curated aggregate over canonical graph values. */
|
|
2
|
-
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError,
|
|
2
|
+
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError, } from '@astrale-os/kernel-core/graph/graph';
|
|
3
|
+
export { LocalAlias, isLocalAlias, LocalBinding, isLocalBinding } from './alias.js';
|
|
3
4
|
export type { AnonymousNodeSpec, GraphDataJson, GraphSpecEdge, GraphSpecEndpoint, GraphSpecJson, GraphSpecNode, } from '@astrale-os/kernel-core/graph/graph';
|
|
4
5
|
export * from './edge/index.js';
|
|
5
6
|
export * from './node/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Curated aggregate over canonical graph values. */
|
|
2
|
-
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError,
|
|
2
|
+
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError, } from '@astrale-os/kernel-core/graph/graph';
|
|
3
|
+
export { LocalAlias, isLocalAlias, LocalBinding, isLocalBinding } from './alias.js';
|
|
3
4
|
export * from './edge/index.js';
|
|
4
5
|
export * from './node/index.js';
|
|
5
6
|
export * from './path/index.js';
|