@pritzlaff/nano-core 0.2.0 → 0.5.0

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/context.d.ts ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The context a pod's factory gets, and (with `callingOp`) each handler invocation gets: `one` and `all` read the deployment as it is
3
+ * now, over the call subscriptions from `self` in every runtime the pod is placed in, each a `Selection`.
4
+ *
5
+ * const kv = ctx.one(KeyValueStore) // NanoResult<Selection>: a Fail (not-found, not-unique) unless exactly one is wired
6
+ * if (kv.ok) await kv.value.call.put('k') // through that edge
7
+ * if (kv.ok) kv.value.on(KeyValueStore.ops.changed, ({ output }) => …) // hear that pod's event (typed by the op) while this build lives
8
+ * for await (const { input } of kv.value.on(KeyValueStore.ops.put)) … // the same, as an AsyncIterable; both connect (or throw) here
9
+ * await ctx.deps.store.put('k') // a declared role as a plain object: through ctx.one(role) at each call; a Fail throws
10
+ * if (ctx.all(KeyValueStore).length === 0) … // nothing wired: fall back
11
+ * await ctx.publish(Ticks.ops.tick, 1) // along every pipe from self with that source, and to `on` subscribers
12
+ * ctx.addOnCloseListener(() => clearInterval(timer)) // when this build is closed: restarted, removed, changed or closed
13
+ */
14
+ import type { Static, TSchema } from 'typebox';
15
+ import type { Client, Interface } from './iface.js';
16
+ import type { Op } from './op.js';
17
+ import type { NanoResult } from './result.js';
18
+ import type { Selector, SelectorData } from './selector.js';
19
+ /** An op's data (an event's, or an action's result). */
20
+ type DataOf<O> = O extends Op<any, infer S> ? S extends TSchema ? Static<S> : unknown : unknown;
21
+ type InOf<O> = O extends Op<infer S, any> ? S extends TSchema ? Static<S> : unknown : unknown;
22
+ /** What `on` gets: `{ input, output }` of an action's successful call, `{ output }` of an event. */
23
+ type Emission<O> = O extends {
24
+ kind: 'event';
25
+ } ? {
26
+ output: DataOf<O>;
27
+ } : {
28
+ input: InOf<O>;
29
+ output: DataOf<O>;
30
+ };
31
+ /**
32
+ * One call edge from the pod. `call` never throws: each call gives a `NanoResult`. `on` subscribes, and it behaves the
33
+ * same in both forms (and as the host's `subscribe` does):
34
+ * - it connects **at the call**: it hears every emission from that line on;
35
+ * - it **throws at the call** an `Error` carrying the `Fail` (`err.fail`) when it can't connect: `denied` (the runtime's
36
+ * policy refuses `'subscribe'`), `not-found` (the edge is gone, or this build is closed) or `unknown-op`;
37
+ * - subscribing and its end are messages on the runtime's stream (`sent` kind `subscribe` / `unsubscribe`).
38
+ */
39
+ export type Selection<I extends Interface> = {
40
+ readonly pod: string;
41
+ readonly runtime: string;
42
+ readonly call: Client<I>;
43
+ /** `fn` hears each emission until the returned unsubscribe is called, the build closes, `apply` removes the edge, or a
44
+ * later `apply`'s policy refuses it (seen on the stream as `unsubscribe` with `denied`). */
45
+ on<O extends I['ops'][keyof I['ops']]>(op: O, fn: (e: Emission<O>) => void | Promise<void>): () => void;
46
+ /** The same emissions as an AsyncIterable, iterated once. `break` unsubscribes; it is `done` when the build closes or
47
+ * the edge goes, and throws the `Fail` (after what it had received) when a later `apply`'s policy refuses it. */
48
+ on<O extends I['ops'][keyof I['ops']]>(op: O): AsyncIterable<Emission<O>>;
49
+ };
50
+ export type NanoContext<D extends Record<string, Selector> = Record<string, Selector>> = {
51
+ readonly self: string;
52
+ /** In a handler's context, the port it is handling (its calls and publishes continue that message's chain); absent in the factory's. */
53
+ readonly callingOp?: string;
54
+ readonly runtimes: readonly string[];
55
+ /** One plain object per declared dependency role, typed from its interface. */
56
+ readonly deps: {
57
+ readonly [K in keyof D]: D[K] extends Interface ? Interface.Type<D[K]> : Record<string, (input?: any) => Promise<any>>;
58
+ };
59
+ one<I extends Interface>(s: I | SelectorData): NanoResult<Selection<I>>;
60
+ all<I extends Interface>(s: I | SelectorData): Selection<I>[];
61
+ publish<O extends Op>(o: O, data: DataOf<O>): Promise<void>;
62
+ /** `fn` hears each other pod added to or removed from a runtime this pod is placed in, from now on, until this build closes. Needs the policy's `'lifecycle'`. */
63
+ addOnPodChangeListener(fn: (e: {
64
+ type: 'added' | 'removed';
65
+ runtime: string;
66
+ pod: string;
67
+ implementation: string;
68
+ }) => void | Promise<void>): void;
69
+ addOnCloseListener(fn: (e: {
70
+ reason: 'restarted' | 'removed' | 'changed' | 'closed';
71
+ }) => void | Promise<void>): void;
72
+ };
73
+ export {};
package/coord.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Coordinates: typed, layered names for what a contract or a provider defines, and for a running instance. Each is a
3
+ * frozen value whose `toString()` is the string form saved in deployments; `Coord.parse(kind, s)` reads one back.
4
+ *
5
+ * const kv = Coord.namespace('example.kv') // an author's namespace
6
+ * const store = kv.interfaceId('KeyValueStore') // example.kv.KeyValueStore
7
+ * const mem = kv.implementationId('memory') // example.kv/memory
8
+ * Coord.port(store, 'get') // example.kv.KeyValueStore/get
9
+ * const main = Coord.runtime('main') // main
10
+ * Coord.pod(mem, main, 'store') // example.kv/memory@main/store
11
+ */
12
+ export type Namespace = {
13
+ readonly kind: 'namespace';
14
+ readonly name: string;
15
+ interfaceId(name: string): InterfaceCoord;
16
+ implementationId(name: string): ImplCoord;
17
+ };
18
+ export type InterfaceCoord = {
19
+ readonly kind: 'interface';
20
+ readonly ns: Namespace;
21
+ readonly name: string;
22
+ };
23
+ export type ImplCoord = {
24
+ readonly kind: 'implementation';
25
+ readonly ns: Namespace;
26
+ readonly name: string;
27
+ };
28
+ export type PortCoord = {
29
+ readonly kind: 'port';
30
+ readonly interface: InterfaceCoord;
31
+ readonly op: string;
32
+ };
33
+ /** A runtime, by its id: the same id `runtimes` keys and events carry as a plain string. */
34
+ export type RuntimeCoord = {
35
+ readonly kind: 'runtime';
36
+ readonly id: string;
37
+ };
38
+ export type PodCoord = {
39
+ readonly kind: 'pod';
40
+ readonly implementation: ImplCoord;
41
+ readonly runtime: RuntimeCoord;
42
+ readonly pod: string;
43
+ };
44
+ type Kinds = {
45
+ namespace: Namespace;
46
+ interface: InterfaceCoord;
47
+ implementation: ImplCoord;
48
+ port: PortCoord;
49
+ runtime: RuntimeCoord;
50
+ pod: PodCoord;
51
+ };
52
+ declare function namespace(name: string): Namespace;
53
+ declare function port(i: InterfaceCoord, op: string): PortCoord;
54
+ declare function runtime(id: string): RuntimeCoord;
55
+ declare function pod(implementation: ImplCoord, runtime: RuntimeCoord, name: string): PodCoord;
56
+ declare function read<K extends keyof Kinds>(kind: K, s: string): Kinds[K];
57
+ /** Layer 1's coordinates (the package's `Coord` adds a namespace's building methods, in provider.ts): `Coord.namespace(ns)`, `Coord.port(interface, op)`, `Coord.runtime(id)`, `Coord.pod(implementation, runtime, pod)`, `Coord.parse(kind, s)`. */
58
+ export declare const Coord: {
59
+ namespace: typeof namespace;
60
+ port: typeof port;
61
+ runtime: typeof runtime;
62
+ pod: typeof pod;
63
+ parse: typeof read;
64
+ };
65
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Writing a deployment at the call site, as data. `AppDeployment.edit(base, registry)` copies `base`; nothing runs.
3
+ * The registry is read only to know what each pod's implementation provides.
4
+ *
5
+ * const d = AppDeployment.edit(app.deployment(), registry)
6
+ * d.place(kvMemory, { pod: 'store', in: 'backend' })
7
+ * const kvs = d.resolve('backend', KeyValueStoreDef.api) // { runtime, pod, implementation }; not-found / not-unique throw
8
+ * kvs.create(todosKv, { pod: 'todos', in: 'frontend' }) // pod; edge todos→store in backend; a rule letting it in
9
+ * await app.apply(d.deployment())
10
+ *
11
+ * `pipe(runtime, { from, source, to, target })` appends that pipe to the runtime (both pods placed there; an equal pipe
12
+ * is `invalid-input`); `unpipe(runtime, same)` removes it (`not-found` when there is none).
13
+ *
14
+ * `create` records a call edge in the resolved pod's runtime and, when that runtime's policy is `rules`, prepends
15
+ * `{ allow: ['call', 'subscribe'], from, outside, toInterface }` (the first match wins: the operator asked for this edge).
16
+ */
17
+ import type { AppDeployment } from './deployment.js';
18
+ import type { Interface } from './iface.js';
19
+ import type { Implementation } from './implementation.js';
20
+ import type { Registry } from './registry.js';
21
+ type Where = {
22
+ pod: string;
23
+ in: string;
24
+ eager?: boolean;
25
+ };
26
+ type PipeEnds = {
27
+ from: string;
28
+ source: string;
29
+ to: string;
30
+ target: string;
31
+ };
32
+ type Handle = {
33
+ readonly runtime: string;
34
+ readonly pod: string;
35
+ readonly implementation: string;
36
+ create(impl: Implementation, where: Where): Handle;
37
+ };
38
+ export declare function edit(base: AppDeployment, registry: Registry): {
39
+ place: (impl: Implementation, w: Where) => void;
40
+ resolve: (at: string, api: Interface) => Handle;
41
+ pipe: (at: string, p: PipeEnds) => undefined;
42
+ unpipe: (at: string, p: PipeEnds) => undefined;
43
+ deployment: () => AppDeployment;
44
+ };
45
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * DeploymentPolicy: the yes/no check the application makes before `apply` changes its deployment, like `Policy` for a message.
3
+ *
4
+ * const p = DeploymentPolicies.allowAll()
5
+ * await p.isAllowed({ caller: 'host', deployment }) // { approved: true }
6
+ */
7
+ import type { AppDeployment } from './deployment.js';
8
+ import type { Verdict } from './policy.js';
9
+ /** What it is asked: who applies (`'host'` or a pod name) and the deployment they want. */
10
+ export type DeploymentAsk = {
11
+ caller: string;
12
+ deployment: AppDeployment;
13
+ };
14
+ export type DeploymentPolicy = {
15
+ isAllowed(ask: DeploymentAsk): Verdict | Promise<Verdict>;
16
+ };
17
+ export declare const DeploymentPolicies: {
18
+ allowAll: () => DeploymentPolicy;
19
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * AppDeployment: the whole system as data — pods by name, runtimes by id, tags. `nano.json` is one, serialised.
3
+ * `assemble` checks it level by level: `Pods.create` of its pods, then `Runtime.create` of each runtime over its scope.
4
+ *
5
+ * const d = { pods: { db: Pod.lazy(kv) }, runtimes: { app: { pods: ['db'], subscriptions: [] } } }
6
+ * AppDeployment.assemble(d, registry) // success({ app: Runtime }), or the first failure naming the offender; never throws
7
+ */
8
+ import { Type } from 'typebox';
9
+ import { type PodDeployment } from './pods.js';
10
+ import type { Registry } from './registry.js';
11
+ import { type NanoResult } from './result.js';
12
+ import { Runtime, type RuntimeDeployment } from './runtime.js';
13
+ import { edit } from './deployment-edit.js';
14
+ export type AppDeployment = {
15
+ pods: PodDeployment;
16
+ runtimes: Record<string, RuntimeDeployment>;
17
+ tags?: Record<string, string[]>;
18
+ /** Host-owned: nano shape-checks these and otherwise ignores them. `frames`: each provider's own page, for its
19
+ * `home-origin` pods. */
20
+ modules?: Record<string, string>;
21
+ views?: Record<string, string>;
22
+ frames?: Record<string, string>;
23
+ /** The deployer's choice, a plain object: nano shape-checks it and otherwise ignores it; `deployment()` omits it. */
24
+ layout?: Record<string, unknown>;
25
+ };
26
+ /** A table by runtime id: ids follow the id rule, at most 50. */
27
+ export declare const RuntimeIds: Type.TRecord<"^.*$", Type.TUnknown>;
28
+ /** `d`'s runtimes, if every level of it checks out; the first failure otherwise. Pure; never throws. */
29
+ declare function assemble(d: unknown, registry: Registry): NanoResult<Record<string, Runtime>>;
30
+ /** A whole deployment checked level by level into its runtimes: `AppDeployment.assemble(d, registry)`; and written at
31
+ * the call site as data: `AppDeployment.edit(base, registry)` (deployment-edit.ts). */
32
+ export declare const AppDeployment: {
33
+ assemble: typeof assemble;
34
+ edit: typeof edit;
35
+ };
36
+ export {};
package/iface.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Interfaces: a coordinate plus a set of ops, each named by its key (its coordinate the hash of that name and its
3
+ * schemas), indexed by name and by op coord. A port is one op as offered by one interface, written readably.
4
+ *
5
+ * const db = Interface.define('acme.Db', { get: Op.action(Key, Value) })
6
+ * port(db, db.ops.get) // 'acme.Db/get'
7
+ *
8
+ * An implementation starts from the contract it provides: `api.impl(coord)` is a builder (`needs`, `config`, each
9
+ * optional, each typing the next step; `description(text)` too; `make` at every step; `create` all at once; `satisfies` for another interface
10
+ * from the same build), ending in `Implementation.define`.
11
+ *
12
+ * db.impl(acme.implementationId('mem')).needs({ log: Log }).make(({ deps }) => memDb(deps.log))
13
+ */
14
+ import type { Static, TSchema } from 'typebox';
15
+ import type { NanoContext } from './context.js';
16
+ import { type ImplCoord, type InterfaceCoord } from './coord.js';
17
+ import { Implementation } from './implementation.js';
18
+ import type { Op } from './op.js';
19
+ import type { NanoResult } from './result.js';
20
+ import type { Selector } from './selector.js';
21
+ export type Interface<Ops extends Record<string, Op> = Record<string, Op>> = {
22
+ readonly coord: string;
23
+ readonly ops: Ops;
24
+ readonly byCoord: ReadonlyMap<string, Op>;
25
+ /** A builder of an implementation providing this interface, at `coord` (in the provider's namespace). */
26
+ impl<Self extends Interface>(this: Self, coord: string | ImplCoord): Builder<Self, {}, undefined>;
27
+ };
28
+ type Deps = Record<string, Selector>;
29
+ /** What `make` gets: the pod's context, and its config. */
30
+ type Ctx<D extends Deps, C> = NanoContext<D> & {
31
+ readonly config: C;
32
+ };
33
+ type Lift<I extends Interface, D extends Deps, C> = (ctx: Ctx<D, C>) => Interface.Type<I> | Promise<Interface.Type<I>>;
34
+ type Built<D extends Deps, C> = Implementation & {
35
+ satisfies<J extends Interface>(j: J, make: Lift<J, D, C>): Built<D, C>;
36
+ };
37
+ type Cfg<S> = S extends TSchema ? Static<S> : undefined;
38
+ type Builder<I extends Interface, D extends Deps, C> = {
39
+ needs<E extends Deps>(deps: E): Builder<I, E, C>;
40
+ config<S extends TSchema>(schema: S): Builder<I, D, Static<S>>;
41
+ description(text: string): Builder<I, D, C>;
42
+ make(fn: Lift<I, D, C>): Built<D, C>;
43
+ create<E extends Deps = {}, S extends TSchema | undefined = undefined>(spec: {
44
+ needs?: E;
45
+ config?: S;
46
+ description?: string;
47
+ make: Lift<I, E, Cfg<S>>;
48
+ }): Built<E, Cfg<S>>;
49
+ };
50
+ export declare const COORD: RegExp;
51
+ /** A port: `<interface>/<op name>`. Handlers are keyed by it; op hashes only check that two ports fit. */
52
+ export declare const port: (i: Interface, o: Op) => string;
53
+ type Unnamed = Omit<Op, 'name' | 'coord'>;
54
+ type Named<U extends Record<string, Unnamed>> = {
55
+ [K in keyof U]: U[K] & {
56
+ readonly name: K & string;
57
+ readonly coord: string;
58
+ };
59
+ };
60
+ declare function define<U extends Record<string, Unnamed>>(at: string | InterfaceCoord, unnamed: U): Interface<Named<U>>;
61
+ type Data<D> = NonNullable<D> extends {
62
+ schema: infer S extends TSchema;
63
+ } ? Static<S> : never;
64
+ /** Typed caller for an interface: each action is an async function. Events have none: they are published. */
65
+ export type Client<I extends Interface> = {
66
+ [K in keyof I['ops'] as I['ops'][K]['kind'] extends 'event' ? never : K]: (input: Data<I['ops'][K]['input']>) => Promise<NanoResult<Data<I['ops'][K]['output']>>>;
67
+ };
68
+ type Ops<I extends Interface> = I['ops'];
69
+ type In<I extends Interface, K extends keyof Ops<I>> = Data<Ops<I>[K]['input']>;
70
+ type Out<I extends Interface, K extends keyof Ops<I>> = Data<Ops<I>[K]['output']>;
71
+ /** `Interface.define(coord, ops)`. */
72
+ export declare const Interface: {
73
+ define: typeof define;
74
+ };
75
+ export declare namespace Interface {
76
+ /** The plain object an interface describes: an input that is only `null` is no argument, an output that is only
77
+ * `null` is `void`. An event is a source: a method giving its data as an AsyncIterable. */
78
+ type Type<I extends Interface> = {
79
+ [K in keyof Ops<I>]: Ops<I>[K]['kind'] extends 'event' ? () => AsyncIterable<Out<I, K>> : (...args: [In<I, K>] extends [null] ? [] : [input: In<I, K>]) => Promise<[Out<I, K>] extends [null] ? void : Out<I, K>>;
80
+ };
81
+ }
82
+ export {};
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Implementations: code that provides whole interfaces. Its factory `make(ctx, config)` runs once per build and returns
3
+ * the handlers by port; state is whatever the factory closes over. A handler takes its input and the invocation's
4
+ * context (`ctx.callingOp`, `ctx.deps`): calls through it continue the invoking message's chain.
5
+ *
6
+ * const memDb = Implementation.define('acme/mem/db', {
7
+ * provides: [DB],
8
+ * make: (ctx, config) => { const m = new Map(); return [provide(DB, { get: async key => success(m.get(key)) })] },
9
+ * })
10
+ * Implementation.define('acme/mem/db', { provides: [DB], dependencies: { log: Log },
11
+ * make: ({ deps }) => ({ get: async key => { await deps.log.record(key); return null } }) }) // one interface: a plain object
12
+ */
13
+ import { type Client, type Interface } from './iface.js';
14
+ import type { NanoContext } from './context.js';
15
+ import type { ImplCoord } from './coord.js';
16
+ import type { Op } from './op.js';
17
+ import type { NanoResult } from './result.js';
18
+ import type { SchemaDef } from './schema.js';
19
+ import { type Selector, type SelectorData } from './selector.js';
20
+ /** A handler: its input, and the invocation's context (`callingOp`; its calls continue the invoking message's chain). */
21
+ export type Handler = (input: unknown, ctx: Omit<NanoContext, 'deps'>) => Promise<NanoResult<unknown>>;
22
+ /** One handler per action, typed as the Client's call, with the invocation's context. Events have none: they are published. */
23
+ export type Handlers<I extends Interface> = {
24
+ [K in keyof Client<I>]: (input: Parameters<Client<I>[K]>[0], ctx: NanoContext) => ReturnType<Client<I>[K]>;
25
+ };
26
+ /** A source: an event's method on a plain object, which the application runs once per build (`application/sources.ts`). */
27
+ export type Source = {
28
+ readonly op: Op;
29
+ run(): AsyncIterable<unknown>;
30
+ };
31
+ /** One interface's handlers and sources, keyed by port. Opaque: only `implementation` reads it. */
32
+ export type Provided = {
33
+ readonly iface: Interface;
34
+ readonly handlers: ReadonlyMap<string, Handler>;
35
+ readonly sources?: ReadonlyMap<string, Source>;
36
+ };
37
+ export declare function provide<I extends Interface>(i: I, handlers: Handlers<I>): Provided;
38
+ export type Implementation = {
39
+ readonly coord: string;
40
+ readonly provider: string;
41
+ readonly provides: readonly Interface[];
42
+ readonly dependencies: Readonly<Record<string, SelectorData>>;
43
+ readonly config?: SchemaDef;
44
+ readonly description?: string;
45
+ /** Declared calls: an op of a provided interface, by name, to the `'role.op'` dependency ops it may call. */
46
+ readonly calls: Readonly<Record<string, readonly string[]>>;
47
+ /** `ctx` without `deps`: they are made here from `dependencies`. It gives the build's handlers (by port) and its
48
+ * sources (by port), which the application starts, publishes, stops at close, and traces when they throw. */
49
+ make(ctx: Omit<NanoContext, 'deps'>, config: unknown): Promise<{
50
+ handlers: ReadonlyMap<string, Handler>;
51
+ sources: ReadonlyMap<string, Source>;
52
+ }>;
53
+ };
54
+ /** A plain object for `I`: its event (source) methods are optional, as an event may be published through `ctx`. */
55
+ type Plain<I extends Interface, D extends Record<string, Selector>, T = Interface.Type<I>> = {
56
+ [K in keyof T as I['ops'][K & string]['kind'] extends 'event' ? never : K]: T[K] extends (...a: infer A) => infer R ? (input: A extends [infer X] ? X : null, ctx: NanoContext<D>) => R : never;
57
+ } & {
58
+ [K in keyof T as I['ops'][K & string]['kind'] extends 'event' ? K : never]?: T[K];
59
+ };
60
+ /** `provide(...)` parts, or for a single interface its plain object (lifted by `handlers`; sources published). */
61
+ type Made<P, D extends Record<string, Selector>> = Provided[] | (P extends readonly [infer One extends Interface] ? Plain<One, D> : never);
62
+ type OpName<I> = I extends Interface ? keyof I['ops'] & string : never;
63
+ /** A role's ops: its interface's, or any `Op` when the role is selector data. */
64
+ type OpOf<S> = S extends Interface ? S['ops'][keyof S['ops']] : Op;
65
+ type Spec<P extends readonly Interface[], D extends Record<string, Selector>> = {
66
+ provides: [...P];
67
+ dependencies?: D;
68
+ config?: SchemaDef;
69
+ description?: string;
70
+ calls?: {
71
+ [K in OpName<P[number]>]?: {
72
+ [R in keyof D]?: OpOf<D[R]>[];
73
+ };
74
+ };
75
+ make(ctx: NanoContext<D>, config: any): Made<P, D> | Promise<Made<P, D>>;
76
+ };
77
+ declare function define<const P extends readonly Interface[], D extends Record<string, Selector> = {}>(at: string | ImplCoord, spec: Spec<P, D>): Implementation;
78
+ /** `Implementation.define(coord, spec)`. */
79
+ export declare const Implementation: {
80
+ define: typeof define;
81
+ };
82
+ export {};
package/index.d.ts CHANGED
@@ -1,5 +1,25 @@
1
- export * from './data.js';
2
- export * from './component.js';
3
- export * from './env.js';
1
+ /**
2
+ * The nano model, headless: schemas, ops, interfaces, results, implementations, providers, the registry, selectors,
3
+ * pods, runtimes and deployments (checked values), the context a pod's factory gets, and the one live `Application`.
4
+ *
5
+ * const Key = Schema.define(Type.String(), 'Key')
6
+ * const db = Interface.define('acme.Db', { get: Op.action(Key, Key) })
7
+ * AppDeployment.assemble({ pods: {}, runtimes: {} }, Registry.create()) // success({})
8
+ */
9
+ export type { Namespace, InterfaceCoord, ImplCoord, PortCoord, RuntimeCoord, PodCoord } from './coord.js';
10
+ export * from './schema.js';
11
+ export * from './op.js';
12
+ export * from './iface.js';
13
+ export * from './result.js';
14
+ export * from './context.js';
15
+ export * from './selector.js';
16
+ export * from './implementation.js';
17
+ export * from './provider.js';
4
18
  export * from './registry.js';
5
- export * from './runtime.js';
19
+ export * from './policy.js';
20
+ export * from './deployment-policy.js';
21
+ export * from './pod.js';
22
+ export { Pods, type PodDeployment } from './pods.js';
23
+ export { Runtime, type RuntimeDeployment, type Subscription } from './runtime.js';
24
+ export { AppDeployment } from './deployment.js';
25
+ export * from './application/index.js';