@astrale-os/sdk 0.5.0-beta.124 → 0.5.0-beta.125

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0-beta.125](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.124...sdk-v0.5.0-beta.125) (2026-09-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **runtime:** emit inferred recipe tuples without repeating schemas ([#451](https://github.com/astrale-os/sdk/issues/451)) ([e4e6fbc](https://github.com/astrale-os/sdk/commit/e4e6fbc72a9b5a80a876be9c9a9ba89a1f4d3ffd))
9
+ * **runtime:** retain mixed recipe collection contracts ([#453](https://github.com/astrale-os/sdk/issues/453)) ([e7d18d0](https://github.com/astrale-os/sdk/commit/e7d18d0b669df90001d417c76c33f578b92b5039))
10
+ * **schema:** retain inferred dependency graphs without repeated expansion ([#455](https://github.com/astrale-os/sdk/issues/455)) ([5c02a00](https://github.com/astrale-os/sdk/commit/5c02a00ffca51f9d5c3bfa6301fabd657c0cd65c))
11
+
3
12
  ## [0.5.0-beta.124](https://github.com/astrale-os/sdk/compare/sdk-v0.5.0-beta.123...sdk-v0.5.0-beta.124) (2026-09-07)
4
13
 
5
14
 
@@ -3,3 +3,4 @@ export type { RuntimeInput } from './define.js';
3
3
  export type { RuntimeInitialization, RuntimeInitializationContext, RuntimeInitializer, } from './initialize.js';
4
4
  export type { RuntimeIntegrations } from './integrations.js';
5
5
  export type { Runtime } from './runtime.js';
6
+ export type { AuthoredRuntime } from './declarations.js';
@@ -0,0 +1,43 @@
1
+ import type { schema } from '../../platform/schema/index.js';
2
+ import type { ActionAddress, ActionDefinition } from '../action/index.js';
3
+ import type { DeclaredErrors } from '../error/index.js';
4
+ import type { Integrations } from '../integration/index.js';
5
+ import type { WorkflowAddress, WorkflowDefinition } from '../workflow/index.js';
6
+ import type { RuntimeInitialization, RuntimeInitializer } from './initialize.js';
7
+ import type { RuntimeIntegrations } from './integrations.js';
8
+ import type { Runtime } from './runtime.js';
9
+ /** Retain each recipe's exact contract without repeating the owning Schema in every tuple slot. */
10
+ type RuntimeFunctionSignature<Recipe> = Recipe extends ActionDefinition<infer Schema, infer Address, infer Definitions, infer Errors> ? readonly [
11
+ 'action',
12
+ Address,
13
+ Definitions,
14
+ Errors,
15
+ {
16
+ [Key in keyof Recipe as Exclude<Key, keyof ActionDefinition<Schema, Address, Definitions, Errors>>]: Recipe[Key];
17
+ }
18
+ ] : Recipe extends WorkflowDefinition<infer Schema, infer Address, infer Definitions, infer Errors> ? readonly [
19
+ 'workflow',
20
+ Address,
21
+ Definitions,
22
+ Errors,
23
+ {
24
+ [Key in keyof Recipe as Exclude<Key, keyof WorkflowDefinition<Schema, Address, Definitions, Errors>>]: Recipe[Key];
25
+ }
26
+ ] : never;
27
+ export type RuntimeFunctionSignatures<Functions extends readonly unknown[]> = {
28
+ [Index in keyof Functions]: RuntimeFunctionSignature<Functions[Index]>;
29
+ };
30
+ type RuntimeFunction<Schema extends schema.DomainSchema, Signature> = Signature extends readonly [
31
+ infer Kind,
32
+ infer Address,
33
+ infer Definitions extends Integrations,
34
+ infer Errors extends DeclaredErrors,
35
+ infer Extra
36
+ ] ? Kind extends 'action' ? ActionDefinition<Schema, Extract<Address, ActionAddress<Schema>>, Definitions, Errors> & Extra : WorkflowDefinition<Schema, Extract<Address, WorkflowAddress<Schema>>, Definitions, Errors> & Extra : never;
37
+ type RuntimeFunctions<Schema extends schema.DomainSchema, Signatures extends readonly unknown[]> = {
38
+ [Index in keyof Signatures]: RuntimeFunction<Schema, Signatures[Index]>;
39
+ };
40
+ /** A portable inferred Runtime keeps its Schema once while retaining the exact recipe tuple. */
41
+ export interface AuthoredRuntime<Schema extends schema.DomainSchema, Integrations extends RuntimeIntegrations, Initialize extends RuntimeInitializer<never, RuntimeInitialization, Schema>, Signatures extends readonly unknown[]> extends Runtime<Schema, Integrations, Initialize, RuntimeFunctions<Schema, Signatures>> {
42
+ }
43
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import type { schema } from '../../platform/schema/index.js';
2
2
  import type { ActionDefinition } from '../action/index.js';
3
3
  import type { Providers } from '../integration/index.js';
4
4
  import type { WorkflowDefinition } from '../workflow/index.js';
5
+ import type { AuthoredRuntime, RuntimeFunctionSignatures } from './declarations.js';
5
6
  import type { RuntimeInitialization, RuntimeInitializer } from './initialize.js';
6
7
  import type { RuntimeIntegrations } from './integrations.js';
7
8
  import type { Runtime } from './runtime.js';
@@ -22,6 +23,6 @@ export interface RuntimeInput<Integrations extends RuntimeIntegrations, Initiali
22
23
  readonly functions: Functions;
23
24
  }
24
25
  /** Define one inert Runtime declaration; realization requires an exact loaded DSL Domain. */
25
- export declare function defineRuntime<Schema extends schema.DomainSchema>(): <const Integrations extends RuntimeIntegrations, Initialize extends AnyRuntimeInitializer<Schema>, const Functions extends readonly unknown[]>(input: RuntimeInput<Integrations, Initialize, Functions> & AdmitsRecipeSchema<Schema, Functions> & AdmitsIntegrations<Integrations, Functions> & AdmitsProviders<Integrations, Initialize>) => Runtime<Schema, Integrations, Initialize, Functions>;
26
+ export declare function defineRuntime<Schema extends schema.DomainSchema>(): <const Integrations extends RuntimeIntegrations, Initialize extends AnyRuntimeInitializer<Schema>, const Functions extends readonly unknown[]>(input: RuntimeInput<Integrations, Initialize, Functions> & AdmitsRecipeSchema<Schema, Functions> & AdmitsIntegrations<Integrations, Functions> & AdmitsProviders<Integrations, Initialize>) => AuthoredRuntime<Schema, Integrations, Initialize, RuntimeFunctionSignatures<Functions>>;
26
27
  export declare function isRuntime(input: unknown): input is Runtime;
27
28
  export {};
@@ -1,5 +1,7 @@
1
1
  import { KernelSchema as CoreKernelSchema } from '@astrale-os/kernel-core/schema';
2
2
  export * from '@astrale-os/kernel-dsl/v1';
3
+ export { defineSchema } from './schema-authoring.js';
4
+ export type { AuthoredSchema, AuthoredDomain } from './schema-authoring.js';
3
5
  export { stateProperty } from './state-property.js';
4
6
  export type { StateProperty } from './state-property.js';
5
7
  export { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
@@ -2,6 +2,7 @@ import { KernelSchema as CoreKernelSchema } from '@astrale-os/kernel-core/schema
2
2
  /** Canonical Schema authoring, compilation, loading, and resolved Domain surface. */
3
3
  import { schema as language } from '@astrale-os/kernel-dsl/v1';
4
4
  export * from '@astrale-os/kernel-dsl/v1';
5
+ export { defineSchema } from './schema-authoring.js';
5
6
  export { stateProperty } from './state-property.js';
6
7
  export { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
7
8
  export { defineClass, nodeClass } from './class-authoring.js';
@@ -0,0 +1,48 @@
1
+ import type { DefinedSchema, ResolvedDomainOfInput } from '@astrale-os/kernel-dsl/v1/builder';
2
+ import type { DomainSchema } from '@astrale-os/kernel-dsl/v1/schema';
3
+ import { defineSchema as kernelDefineSchema } from '@astrale-os/kernel-dsl/v1';
4
+ type DomainSchemaInput = Parameters<typeof kernelDefineSchema>[1];
5
+ declare const authoredGraph: unique symbol;
6
+ /** Opaque legacy Schemas retain their witness; SDK Schemas retain authored input and edges. */
7
+ type Entry = readonly [origin: string, schema: DomainSchema] | readonly [
8
+ origin: string,
9
+ input: DomainSchemaInput,
10
+ dependencies: Readonly<Record<string, string>>
11
+ ];
12
+ type Dependencies<Input> = 'dependencies' extends keyof Input ? NonNullable<Input['dependencies']> : {};
13
+ type GraphOf<Schema> = typeof authoredGraph extends keyof Schema ? Schema[typeof authoredGraph] extends infer Graph ? Graph extends Entry ? Graph : never : never : Schema extends DomainSchema<infer Origin> ? readonly [Origin, Schema] : never;
14
+ type GraphOfInput<Origin extends string, Input extends DomainSchemaInput> = readonly [
15
+ Origin,
16
+ {
17
+ readonly [Key in keyof Input as Exclude<Key, 'dependencies'>]: Input[Key];
18
+ },
19
+ {
20
+ readonly [Alias in keyof Dependencies<Input>]: Dependencies<Input>[Alias] extends DomainSchema<infer DependencyOrigin> ? DependencyOrigin : never;
21
+ }
22
+ ] | {
23
+ [Alias in keyof Dependencies<Input>]: GraphOf<Dependencies<Input>[Alias]>;
24
+ }[keyof Dependencies<Input>];
25
+ type LastEntry<Graph> = (Graph extends unknown ? (entry: () => Graph) => void : never) extends (entry: infer Intersection) => void ? Intersection extends () => infer Last ? Last : never : never;
26
+ type WithoutEquivalent<Graph, Selected> = Graph extends Selected ? Selected extends Graph ? never : Graph : Graph;
27
+ type UniqueEntries<Graph, Selected = LastEntry<Graph>> = [Graph] extends [never] ? never : Selected | UniqueEntries<WithoutEquivalent<Graph, Selected>>;
28
+ type InputOf<Origin extends string, Graph extends Entry> = Extract<Graph, readonly [Origin, DomainSchemaInput, Readonly<Record<string, string>>]> extends readonly [
29
+ string,
30
+ infer Input extends DomainSchemaInput,
31
+ infer Dependencies extends Readonly<Record<string, string>>
32
+ ] ? Input & {
33
+ readonly dependencies: {
34
+ readonly [Alias in keyof Dependencies]: SchemaOf<Dependencies[Alias], Graph>;
35
+ };
36
+ } : never;
37
+ type SchemaOf<Origin extends string, Graph extends Entry> = Extract<Graph, readonly [Origin, DomainSchema]> extends infer Legacy ? [Legacy] extends [never] ? AuthoredSchema<Origin, Graph> : Legacy extends readonly [string, infer Schema extends DomainSchema] ? Schema : never : never;
38
+ /** Resolve a dependency graph without expanding a shared Schema at each dependency edge. */
39
+ export interface AuthoredDomain<Origin extends string, Graph extends Entry> extends ResolvedDomainOfInput<Origin, InputOf<Origin, Graph>> {
40
+ }
41
+ /** A Schema retains each transitive author's input once, with dependency edges represented by origin. */
42
+ export interface AuthoredSchema<Origin extends string, Graph extends Entry> extends DefinedSchema<Origin, AuthoredDomain<Origin, Graph>> {
43
+ readonly [authoredGraph]?: Graph;
44
+ }
45
+ type DefineSchema = <const Origin extends string, const Input extends DomainSchemaInput>(origin: Origin, input: Input) => string extends Origin | Extract<Dependencies<Input>[keyof Dependencies<Input>], DomainSchema>['origin'] ? DefinedSchema<Origin, ResolvedDomainOfInput<Origin, Input>> : AuthoredSchema<Origin, Extract<UniqueEntries<GraphOfInput<Origin, Input>>, Entry>>;
46
+ /** The canonical implementation with a portable, automatically inferred declaration. */
47
+ export declare const defineSchema: DefineSchema;
48
+ export {};
@@ -0,0 +1,3 @@
1
+ import { defineSchema as kernelDefineSchema } from '@astrale-os/kernel-dsl/v1';
2
+ /** The canonical implementation with a portable, automatically inferred declaration. */
3
+ export const defineSchema = kernelDefineSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/sdk",
3
- "version": "0.5.0-beta.124",
3
+ "version": "0.5.0-beta.125",
4
4
  "description": "Schema-first SDK for defining, composing, and deploying Astrale domains",
5
5
  "keywords": [
6
6
  "astrale",