@almadar/shell-runtime 0.1.0 → 1.1.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/dist/chunk-2WCVOMZ2.js +112 -0
- package/dist/chunk-57SBCUSM.js +62 -0
- package/dist/{chunk-Q2H75UYT.js → chunk-A2JJT4GA.js} +1 -37
- package/dist/chunk-BAS26HBN.js +10 -0
- package/dist/{chunk-REPX5QPI.js → chunk-BOVU4TCQ.js} +11 -3
- package/dist/chunk-BY5G4225.js +6 -0
- package/dist/chunk-DFDNHVDW.js +284 -0
- package/dist/{chunk-NATGCIVM.js → chunk-JVSREWQO.js} +378 -130
- package/dist/{chunk-DYOJGLIX.js → chunk-LKWYCYX5.js} +2 -5
- package/dist/chunk-LYFIQPXX.js +1 -0
- package/dist/{chunk-ODJCZ27I.js → chunk-N7HYNKK6.js} +35 -2
- package/dist/{chunk-4J2QEIUV.js → chunk-NTFQ36UN.js} +4 -30
- package/dist/chunk-NU6LVKGS.js +15 -0
- package/dist/{chunk-VNMG7NKY.js → chunk-OQVSN7DP.js} +21 -26
- package/dist/chunk-P2N6K2IV.js +20 -0
- package/dist/{chunk-QQRDUMB2.js → chunk-QCJWPXLH.js} +11 -11
- package/dist/{chunk-QELZ6TEJ.js → chunk-UD2CXYSJ.js} +39 -3
- package/dist/{chunk-UJHOUZAL.js → chunk-V4EMDPCO.js} +2 -5
- package/dist/chunk-VKQA2DJX.js +409 -0
- package/dist/chunk-VNGXRYFF.js +9 -0
- package/dist/{chunk-HNOAZWFH.js → chunk-WGCWJOT2.js} +2 -0
- package/dist/chunk-XZGVOBY6.js +33 -0
- package/dist/chunk-ZUSM4VW4.js +197 -0
- package/dist/client/EventTransport.d.ts +23 -7
- package/dist/client/EventTransport.js +1 -2
- package/dist/client/awaiting.js +0 -1
- package/dist/client/channel-transport.d.ts +6 -6
- package/dist/client/channel-transport.js +0 -1
- package/dist/client/circuit-store.d.ts +16 -5
- package/dist/client/circuit-store.js +2 -3
- package/dist/client/client-kernel.d.ts +36 -15
- package/dist/client/declared-input-dispatch.d.ts +19 -2
- package/dist/client/declared-input-dispatch.js +1 -2
- package/dist/client/inbound-dispatch.d.ts +21 -2
- package/dist/client/inbound-dispatch.js +1 -2
- package/dist/client/local-fold.d.ts +15 -8
- package/dist/client/local-fold.js +1 -2
- package/dist/client/render-sigils.js +0 -1
- package/dist/client/state-book.d.ts +9 -16
- package/dist/client/state-book.js +1 -2
- package/dist/client/trait-mount-error.js +0 -1
- package/dist/credentials/env-vars.d.ts +5 -1
- package/dist/credentials/env-vars.js +1 -3
- package/dist/credentials/scope.d.ts +8 -7
- package/dist/credentials/scope.js +0 -1
- package/dist/credentials/vault.d.ts +142 -0
- package/dist/credentials/vault.js +1 -0
- package/dist/effects/in-flight-calls.js +0 -1
- package/dist/effects/on-device-model.js +0 -1
- package/dist/events/EventBus.d.ts +1 -4
- package/dist/events/EventBus.js +0 -1
- package/dist/events/emit-stamp.js +0 -1
- package/dist/index.d.ts +25 -42
- package/dist/index.js +27 -45
- package/dist/kernel/decode.d.ts +10 -10
- package/dist/kernel/decode.js +1 -2
- package/dist/kernel/engine.d.ts +133 -31
- package/dist/kernel/engine.js +7 -9
- package/dist/kernel/frame-applier.d.ts +8 -7
- package/dist/kernel/frame-applier.js +1 -2
- package/dist/kernel/host.d.ts +148 -16
- package/dist/kernel/host.js +4 -7
- package/dist/kernel/lane.d.ts +1 -22
- package/dist/kernel/lane.js +1 -2
- package/dist/kernel/os-fetch-port.d.ts +7 -0
- package/dist/kernel/os-fetch-port.js +3 -0
- package/dist/kernel/os-port.d.ts +30 -8
- package/dist/kernel/os-port.js +1 -2
- package/dist/kernel/program-effects.d.ts +11 -28
- package/dist/kernel/program-effects.js +1 -2
- package/dist/kernel/secret-ports.d.ts +139 -0
- package/dist/kernel/secret-ports.js +2 -0
- package/dist/kernel/wire.d.ts +113 -12
- package/dist/loader/fetch-loader.d.ts +26 -0
- package/dist/loader/fetch-loader.js +1 -0
- package/dist/loader/lazy-page.js +0 -1
- package/dist/loader/schema-loader.d.ts +1 -17
- package/dist/persistence/native-memory.js +0 -1
- package/dist/runtime/entities/declaredCollections.d.ts +6 -0
- package/dist/runtime/entities/declaredCollections.js +1 -0
- package/dist/runtime/evaluation/local-store-transport.d.ts +16 -23
- package/dist/runtime/evaluation/local-store-transport.js +9 -13
- package/dist/runtime/evaluation/residence-transport.d.ts +3 -3
- package/dist/runtime/evaluation/residence-transport.js +1 -2
- package/dist/runtime/evaluation/routed-persistence.js +0 -1
- package/dist/runtime/events/identity/routing.d.ts +2 -53
- package/dist/runtime/events/identity/routing.js +1 -2
- package/dist/runtime/types.d.ts +5 -205
- package/dist/runtime/types.js +1 -2
- package/dist/service/default-call-service.js +0 -1
- package/dist/service/service-provider.js +0 -1
- package/package.json +8 -5
- package/dist/chunk-2JU7Y4KU.js +0 -21
- package/dist/chunk-46RWK2B5.js +0 -28
- package/dist/chunk-4ZICQ5PM.js +0 -192
- package/dist/chunk-53IPZXDP.js +0 -76
- package/dist/chunk-5D63EMO5.js +0 -16
- package/dist/chunk-CPSQXEJ6.js +0 -55
- package/dist/chunk-CQP5XAX6.js +0 -173
- package/dist/chunk-CROS2GEX.js +0 -49
- package/dist/chunk-D4XJTBLB.js +0 -217
- package/dist/chunk-D5USD2EX.js +0 -232
- package/dist/chunk-EV56K4GB.js +0 -63
- package/dist/chunk-FQ6IZMIU.js +0 -10
- package/dist/chunk-HMK6YMQS.js +0 -135
- package/dist/chunk-IHQLE5M7.js +0 -62
- package/dist/chunk-JFWFDUTR.js +0 -35
- package/dist/chunk-MHYSHSRG.js +0 -54
- package/dist/chunk-MLKGABMK.js +0 -7
- package/dist/chunk-NAECVIAR.js +0 -322
- package/dist/chunk-Q7JK4KY7.js +0 -9
- package/dist/chunk-RBUMDYFS.js +0 -681
- package/dist/chunk-SAS5KKCR.js +0 -43
- package/dist/chunk-SWPDU752.js +0 -28
- package/dist/chunk-T775TUCD.js +0 -18
- package/dist/chunk-VMOBW7RK.js +0 -21
- package/dist/chunk-WNPNNYXY.js +0 -22
- package/dist/chunk-XB5GYODW.js +0 -28
- package/dist/chunk-YL2SO5TP.js +0 -334
- package/dist/chunk-YO4LWS3I.js +0 -606
- package/dist/chunk-ZAQSS47X.js +0 -157
- package/dist/chunk-ZCQUUJIF.js +0 -129
- package/dist/client/ServerBridge.d.ts +0 -126
- package/dist/client/ServerBridge.js +0 -3
- package/dist/credentials/seed.d.ts +0 -21
- package/dist/credentials/seed.js +0 -2
- package/dist/credentials/store.d.ts +0 -110
- package/dist/credentials/store.js +0 -2
- package/dist/index-hT1xCdTq.d.ts +0 -46
- package/dist/kernel/beacon.d.ts +0 -32
- package/dist/kernel/beacon.js +0 -2
- package/dist/kernel/http.d.ts +0 -302
- package/dist/kernel/http.js +0 -6
- package/dist/kernel/oauth-effects.d.ts +0 -25
- package/dist/kernel/oauth-effects.js +0 -7
- package/dist/kernel/oauth-port.d.ts +0 -31
- package/dist/kernel/oauth-port.js +0 -2
- package/dist/loader/http-loader.d.ts +0 -111
- package/dist/loader/http-loader.js +0 -2
- package/dist/runtime/effects/composition/compose-behaviors.d.ts +0 -58
- package/dist/runtime/effects/composition/compose-behaviors.js +0 -4
- package/dist/runtime/effects/composition/event-wiring.d.ts +0 -38
- package/dist/runtime/effects/composition/event-wiring.js +0 -2
- package/dist/runtime/effects/composition/index.d.ts +0 -5
- package/dist/runtime/effects/composition/index.js +0 -6
- package/dist/runtime/effects/composition/layout-strategy.d.ts +0 -35
- package/dist/runtime/effects/composition/layout-strategy.js +0 -2
- package/dist/runtime/effects/composition/pipe.d.ts +0 -25
- package/dist/runtime/effects/composition/pipe.js +0 -2
- package/dist/runtime/entities/mockStoreSeed.d.ts +0 -56
- package/dist/runtime/entities/mockStoreSeed.js +0 -3
- package/dist/runtime/entities/seedBrowserStore.d.ts +0 -28
- package/dist/runtime/entities/seedBrowserStore.js +0 -2
- package/dist/runtime/entities/std-mock-seed.d.ts +0 -87
- package/dist/runtime/entities/std-mock-seed.js +0 -2
- package/dist/runtime/time/TickScheduler.d.ts +0 -77
- package/dist/runtime/time/TickScheduler.js +0 -3
- package/dist/runtime/time/cron.d.ts +0 -25
- package/dist/runtime/time/cron.js +0 -2
- package/dist/runtime/time/duration.d.ts +0 -20
- package/dist/runtime/time/duration.js +0 -2
- package/dist/runtime/traits/OrbitalTraitParsing.d.ts +0 -34
- package/dist/runtime/traits/OrbitalTraitParsing.js +0 -2
- package/dist/runtime/traits/listen-targets.d.ts +0 -16
- package/dist/runtime/traits/listen-targets.js +0 -3
- package/dist/runtime/traits/trait-index.d.ts +0 -35
- package/dist/runtime/traits/trait-index.js +0 -3
package/dist/kernel/http.d.ts
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { HttpFailurePayload, JsonValue, HttpStreamEvent, RuntimeValue, CredentialPayload, HttpOAuthFailureCode, HttpOAuthFailureReason, HttpCall } from '@almadar/core';
|
|
2
|
-
export { HttpCall } from '@almadar/core';
|
|
3
|
-
import { BeaconDeliveryPorts } from './beacon.js';
|
|
4
|
-
import { CredentialStore } from '../credentials/store.js';
|
|
5
|
-
export { decodeOAuthAsk } from './decode.js';
|
|
6
|
-
import { IoRequestWire, OAuthAsk, OAuthReply, HttpResponseWire, HttpFailureWire, HttpRequestWire } from '@almadar/core/kernel-wire';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The one TypeScript half of the `http` effect: the host side that moves the bytes the Rust request builder
|
|
10
|
-
* (`@almadar/kernel`, wasm) produced. Both the kernel host (`host.ts`) and the interpreter (`EffectExecutor`)
|
|
11
|
-
* call it; nothing here builds a request, frames a stream or shapes a payload — the wasm exports do.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The pure half of `oauth-authorize` (`@almadar/kernel` `oauthAuthorizePlan` / `oauthAuthorizeBuild` / `oauthFailure`);
|
|
16
|
-
* a kernel build without them cannot run the effect.
|
|
17
|
-
*/
|
|
18
|
-
interface OAuthAuthorizeKernel {
|
|
19
|
-
/** Parses the client and options: `{ plan, clientId: { name, scope }, issuer, metadata }`; throws the effect's failure message. */
|
|
20
|
-
oauthAuthorizePlan(clientJson: string, optionsJson: string): string;
|
|
21
|
-
/** `{ ok: { authUrl, state, grant } }`, `{ failure: OAuthEffectFailurePayload }` or `{ refused: string }`. */
|
|
22
|
-
oauthAuthorizeBuild(planJson: string, clientId: string, metadataJson: string, stateBase64: string, verifierBase64: string): string;
|
|
23
|
-
/** The mock backend's `{ authUrl, state, grant }` from a plan and the drawn state bytes. */
|
|
24
|
-
oauthAuthorizeMockBuild(planJson: string, stateBase64: string): string;
|
|
25
|
-
/** The failure payload `{ error, code, reason }` of a closed reason. */
|
|
26
|
-
oauthFailure(reason: string): string;
|
|
27
|
-
}
|
|
28
|
-
/** The `@almadar/kernel` module-level exports the `http` effect uses; each takes and returns JSON text. */
|
|
29
|
-
interface HttpKernel extends Partial<OAuthAuthorizeKernel> {
|
|
30
|
-
httpDriverStart(callJson: string, egressJson: string): string;
|
|
31
|
-
httpDriverResume(driverJson: string, answerJson: string): string;
|
|
32
|
-
isPublicAddress(ip: string): boolean;
|
|
33
|
-
/** Frames a chunk of a stream (`{ events, carry }`); each event carries `key`. The call's driver is not needed. */
|
|
34
|
-
frameStream(framing: StreamFramingWire, key: string | null, chunk: string, carry: string): string;
|
|
35
|
-
/** The events the unterminated tail in `carry` makes at end of body. */
|
|
36
|
-
frameStreamFinish(framing: StreamFramingWire, key: string | null, carry: string): string;
|
|
37
|
-
/** Releases what the kernel holds for a call that ends before its final step (cancelled, aborted, thrown). */
|
|
38
|
-
httpDriverDrop(driverJson: string): void;
|
|
39
|
-
}
|
|
40
|
-
type StreamFramingWire = Extract<IoRequestWire, {
|
|
41
|
-
kind: 'httpStream';
|
|
42
|
-
}>['framing'];
|
|
43
|
-
/** How a stream's body is framed, and the key each framed event echoes. */
|
|
44
|
-
interface StreamFrame {
|
|
45
|
-
framing: StreamFramingWire;
|
|
46
|
-
key: string | null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The host's secret store: a credential NAME in, its value out; `set` keeps a minted value (an OAuth2 token) for `ttlMs`.
|
|
50
|
-
* `principal` is the signed-in user's id for a user-scoped credential (the kernel sets it from the dispatch's `@user`,
|
|
51
|
-
* never the program); absent, the credential is app-wide.
|
|
52
|
-
*/
|
|
53
|
-
interface HttpSecrets {
|
|
54
|
-
get(name: string, principal?: string): Promise<string | undefined>;
|
|
55
|
-
/** `ttlMs` of 0 forgets the value. */
|
|
56
|
-
set(name: string, value: string, ttlMs: number, principal?: string): Promise<void>;
|
|
57
|
-
/** Replace the stored credential with `value`, durably (a rotated refresh token). A host without one cannot rotate. */
|
|
58
|
-
rotate?(name: string, value: string, principal?: string): Promise<void>;
|
|
59
|
-
/** Drop the credential, the minted value and the stored one. */
|
|
60
|
-
forget(name: string, principal?: string): Promise<void>;
|
|
61
|
-
/** Keep `value` as the credential until it is forgotten, creating it when absent (an OAuth connection's tokens): unlike `rotate` it needs no existing entry. `label` is a non-secret account name stored beside it, never the value. */
|
|
62
|
-
persist?(name: string, value: string, principal?: string, label?: string): Promise<void>;
|
|
63
|
-
/** The non-secret account label stored beside the credential; absent when its row carries none. */
|
|
64
|
-
label?(name: string, principal?: string): Promise<string | undefined>;
|
|
65
|
-
/** Keep a one-use value (a pending OAuth grant) where every instance of the deployment can take it: the credential store's adapter when it shares one-use values, else the minted tier. */
|
|
66
|
-
hold?(name: string, value: string, ttlMs: number, principal?: string): Promise<void>;
|
|
67
|
-
/** Remove and return a held or minted value in one step, the single read of a one-use value. */
|
|
68
|
-
take?(name: string, principal?: string): Promise<string | undefined>;
|
|
69
|
-
/** Whether `persist` keeps a value on this host. */
|
|
70
|
-
durable?(): Promise<boolean>;
|
|
71
|
-
}
|
|
72
|
-
/** The credential-store key of one user's credential. */
|
|
73
|
-
declare function userCredentialKey(principal: string, name: string): string;
|
|
74
|
-
/** Where a host name points: its addresses, and whether the name already is one. */
|
|
75
|
-
interface ResolvedHost {
|
|
76
|
-
literal: boolean;
|
|
77
|
-
addresses: readonly string[];
|
|
78
|
-
}
|
|
79
|
-
interface PinnedInit {
|
|
80
|
-
method: string;
|
|
81
|
-
headers: Array<[string, string]>;
|
|
82
|
-
body?: Uint8Array<ArrayBuffer>;
|
|
83
|
-
redirect: 'manual';
|
|
84
|
-
signal?: AbortSignal;
|
|
85
|
-
}
|
|
86
|
-
/** The part of a fetch response the exchange reads. */
|
|
87
|
-
interface PinnedResponse {
|
|
88
|
-
status: number;
|
|
89
|
-
headers: {
|
|
90
|
-
entries(): IterableIterator<[string, string]>;
|
|
91
|
-
};
|
|
92
|
-
body: {
|
|
93
|
-
getReader(): {
|
|
94
|
-
read(): Promise<{
|
|
95
|
-
done: boolean;
|
|
96
|
-
value?: Uint8Array;
|
|
97
|
-
}>;
|
|
98
|
-
cancel?(): Promise<void>;
|
|
99
|
-
releaseLock?(): void;
|
|
100
|
-
};
|
|
101
|
-
} | null;
|
|
102
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
103
|
-
}
|
|
104
|
-
/** Fetch with the connection pinned to `address`, the one that was checked (no resolve-then-connect race). */
|
|
105
|
-
type PinnedFetch = (url: URL, init: PinnedInit, address: string) => Promise<PinnedResponse>;
|
|
106
|
-
/** CSPRNG output: `bytes` random bytes. */
|
|
107
|
-
type RandomSource = (bytes: number) => Uint8Array;
|
|
108
|
-
/**
|
|
109
|
-
* The host's raw credential store and mode flag, answered to the kernel's `credentialStore*` and `credentialMode*`
|
|
110
|
-
* asks. It decides nothing: the role gate, the declared-name check, the masking and the mode check are the kernel's.
|
|
111
|
-
*/
|
|
112
|
-
interface CredentialAdminPort {
|
|
113
|
-
/** Whether the store can encrypt and the service and name of every stored row; `null` when the host holds no store. */
|
|
114
|
-
list(): Promise<{
|
|
115
|
-
enabled: boolean;
|
|
116
|
-
entries: Array<{
|
|
117
|
-
service: string;
|
|
118
|
-
name: string;
|
|
119
|
-
}>;
|
|
120
|
-
} | null>;
|
|
121
|
-
/** The stored value of credential `name`, from the store only. */
|
|
122
|
-
read(name: string): Promise<string | null>;
|
|
123
|
-
write(service: string, name: string, value: string): Promise<void>;
|
|
124
|
-
/** Whether a stored row existed. */
|
|
125
|
-
remove(name: string): Promise<boolean>;
|
|
126
|
-
rotate(): Promise<{
|
|
127
|
-
rotated: number;
|
|
128
|
-
alreadyCurrent: number;
|
|
129
|
-
unreadable: number;
|
|
130
|
-
}>;
|
|
131
|
-
/** The mode flag; `null` when the host keeps none. */
|
|
132
|
-
mode(): Promise<string | null>;
|
|
133
|
-
/** Switch the flag; the host may refuse. The mode in force afterwards. */
|
|
134
|
-
setMode(mode: string): Promise<string>;
|
|
135
|
-
}
|
|
136
|
-
interface HttpPorts {
|
|
137
|
-
kernel: () => Promise<HttpKernel>;
|
|
138
|
-
/** The host CSPRNG `random-bytes` and the driver's `Random` ask draw from. */
|
|
139
|
-
random: RandomSource;
|
|
140
|
-
/** The program's declared `egress` origins. */
|
|
141
|
-
egress: readonly string[];
|
|
142
|
-
secrets: HttpSecrets;
|
|
143
|
-
/** The credential store and mode flag the credential administration effects ask; absent, those asks fail unavailable. */
|
|
144
|
-
credentials?: CredentialAdminPort;
|
|
145
|
-
fetch: PinnedFetch;
|
|
146
|
-
/** Looks a host up for the public-address check; `null` where the host cannot resolve a name (a browser). */
|
|
147
|
-
resolve: ((host: string) => Promise<ResolvedHost>) | null;
|
|
148
|
-
/** The host's beacon queue and keepalive fetch; absent, a `browser/beacon` call fails `unavailable`. */
|
|
149
|
-
beacon?: BeaconDeliveryPorts;
|
|
150
|
-
/** What an `oauth-client` call and the OAuth effects persist; absent, they fail `store-unavailable`. */
|
|
151
|
-
oauth?: OAuthPort;
|
|
152
|
-
}
|
|
153
|
-
interface HttpPortsOptions {
|
|
154
|
-
kernel: () => Promise<HttpKernel>;
|
|
155
|
-
random?: RandomSource;
|
|
156
|
-
egress: readonly string[];
|
|
157
|
-
secrets?: HttpSecrets;
|
|
158
|
-
/** Defaults to the installed credential store and mode flag. */
|
|
159
|
-
credentials?: CredentialAdminPort;
|
|
160
|
-
fetch?: PinnedFetch;
|
|
161
|
-
resolve?: (host: string) => Promise<ResolvedHost>;
|
|
162
|
-
/** What `oauth-client` calls and the OAuth effects persist; absent, they fail `store-unavailable`. */
|
|
163
|
-
oauth?: OAuthPort;
|
|
164
|
-
}
|
|
165
|
-
interface BrowserHttpPortsOptions {
|
|
166
|
-
kernel: () => Promise<HttpKernel>;
|
|
167
|
-
/** The program's declared `egress` origins. */
|
|
168
|
-
egress: readonly string[];
|
|
169
|
-
/** Defaults to the global `fetch`. */
|
|
170
|
-
fetch?: (url: string, init: RequestInit) => Promise<PinnedResponse & Response>;
|
|
171
|
-
/** Defaults to `navigator.sendBeacon` (text/plain Blob) when the page has one, and the global `fetch`. */
|
|
172
|
-
beacon?: BeaconDeliveryPorts;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* What an OAuth flow asks its host to keep (pending grants, connections, the subject index, discovered metadata,
|
|
176
|
-
* the clock). `principal` is the dispatch's signed-in user, set by the kernel and never by the program.
|
|
177
|
-
*/
|
|
178
|
-
interface OAuthPort {
|
|
179
|
-
answer(ask: OAuthAsk, principal: string | undefined): Promise<OAuthReply>;
|
|
180
|
-
}
|
|
181
|
-
/** The loud, coded error for a host that gave the `http` effect no ports. */
|
|
182
|
-
declare class HttpUnavailableError extends Error {
|
|
183
|
-
readonly code = "HTTP_KERNEL_UNAVAILABLE";
|
|
184
|
-
constructor(detail: string);
|
|
185
|
-
}
|
|
186
|
-
/** A failed `http` effect: its payload is what the `emit.failure` route carries. */
|
|
187
|
-
declare class HttpEffectFailure extends Error {
|
|
188
|
-
readonly payload: HttpFailurePayload;
|
|
189
|
-
constructor(payload: HttpFailurePayload);
|
|
190
|
-
}
|
|
191
|
-
/** Where the secrets' durable credentials live: the store a host installed, and how a name resolves through it. */
|
|
192
|
-
interface HttpSecretsHost {
|
|
193
|
-
store(): Promise<CredentialStore | null>;
|
|
194
|
-
resolve(name: string, principal: string | undefined): Promise<string | undefined>;
|
|
195
|
-
}
|
|
196
|
-
/** In-process secrets: minted values with an expiry, then the credential store the host holds (by default the one the host installed). */
|
|
197
|
-
declare function createHttpSecrets(now?: () => number, host?: HttpSecretsHost): HttpSecrets;
|
|
198
|
-
/** The credential store and mode flag the host installed, as the kernel's raw asks. */
|
|
199
|
-
declare function createCredentialAdminPort(): CredentialAdminPort;
|
|
200
|
-
/** Bytes from the platform CSPRNG. */
|
|
201
|
-
declare const systemRandom: RandomSource;
|
|
202
|
-
/** The most bytes one `random-bytes` may ask for (the kernel's `RANDOM_BYTES_MAX`). */
|
|
203
|
-
declare const RANDOM_BYTES_MAX = 1024;
|
|
204
|
-
/** Standard padded base64 (the wire form of a `Random` answer). */
|
|
205
|
-
declare function base64Standard(bytes: Uint8Array): string;
|
|
206
|
-
/** URL-safe base64 without padding (the `random-bytes` value; the kernel's `codec::base64url_encode`). */
|
|
207
|
-
declare function base64Url(bytes: Uint8Array): string;
|
|
208
|
-
/**
|
|
209
|
-
* `random-bytes`: the success payload for `bytes` drawn from the host CSPRNG; a bad count or key is the effect's
|
|
210
|
-
* failure. A keyed call echoes its `key` beside the `value`.
|
|
211
|
-
*/
|
|
212
|
-
declare function randomBytesPayload(ports: Pick<HttpPorts, 'random'>, bytes: RuntimeValue | undefined, key?: RuntimeValue): {
|
|
213
|
-
value: string;
|
|
214
|
-
key?: string;
|
|
215
|
-
};
|
|
216
|
-
/** `credential-status`: a bare name selects the viewer; an explicit slot selects its declared scope. */
|
|
217
|
-
declare function credentialStatusPayload(ports: Pick<HttpPorts, 'secrets'>, credential: RuntimeValue | undefined, principal: string | undefined): Promise<CredentialPayload>;
|
|
218
|
-
/** `credential-forget`: drops the signed-in viewer's credential; `{ connected: false }`. */
|
|
219
|
-
declare function credentialForgetPayload(ports: Pick<HttpPorts, 'secrets'>, credential: RuntimeValue | undefined, principal: string | undefined): Promise<{
|
|
220
|
-
connected: false;
|
|
221
|
-
label: string;
|
|
222
|
-
}>;
|
|
223
|
-
/** The Node half of the server `http` ports: name resolution and the address-pinned fetch (`@almadar/shell-node` installs it). */
|
|
224
|
-
interface NetPort {
|
|
225
|
-
resolve: (host: string) => Promise<ResolvedHost>;
|
|
226
|
-
fetch: PinnedFetch;
|
|
227
|
-
}
|
|
228
|
-
declare function installNetPort(port: NetPort): void;
|
|
229
|
-
declare function createHttpPorts(options: HttpPortsOptions): HttpPorts;
|
|
230
|
-
/**
|
|
231
|
-
* Ports for a client-site `http` (a call with no `auth`): the same kernel driver and exchange as the server,
|
|
232
|
-
* over the browser's `fetch`. A browser cannot resolve a name or pin a connection, so there is no
|
|
233
|
-
* public-address check; the program's `egress` (the driver refuses any other origin) and the browser's own
|
|
234
|
-
* CORS rules bound what the call reaches.
|
|
235
|
-
*/
|
|
236
|
-
declare function createBrowserHttpPorts(options: BrowserHttpPortsOptions): HttpPorts;
|
|
237
|
-
/** What one exchange came to; a cancelled exchange is the caller's abort signal, never an outcome. */
|
|
238
|
-
type Exchange = {
|
|
239
|
-
kind: 'reply';
|
|
240
|
-
response: HttpResponseWire;
|
|
241
|
-
} | {
|
|
242
|
-
kind: 'failure';
|
|
243
|
-
failure: HttpFailureWire;
|
|
244
|
-
};
|
|
245
|
-
/** Send one built request after its requested retry delay and read the whole reply. */
|
|
246
|
-
declare function sendHttp(ports: HttpPorts, request: HttpRequestWire, signal?: AbortSignal, delayMs?: number): Promise<Exchange>;
|
|
247
|
-
/**
|
|
248
|
-
* Send one built request and hand each framed event of the body to `onEvent` as it arrives; the reply that
|
|
249
|
-
* ends the exchange carries an empty body. Framing, and the `key` each event echoes, are the kernel's
|
|
250
|
-
* (`frameStream`, `frameStreamFinish`) over the ask's `framing` and `key`.
|
|
251
|
-
*/
|
|
252
|
-
declare function streamHttp(ports: HttpPorts, request: HttpRequestWire, stream: StreamFrame, onEvent: (event: HttpStreamEvent) => void, signal?: AbortSignal): Promise<Exchange>;
|
|
253
|
-
/** How a host took one beacon, as the driver's `beacon` answer carries it; a fetch that threw is a failure. */
|
|
254
|
-
type BeaconSettled = {
|
|
255
|
-
ok: {
|
|
256
|
-
via: 'queue';
|
|
257
|
-
} | {
|
|
258
|
-
via: 'fetch';
|
|
259
|
-
status: number;
|
|
260
|
-
} | {
|
|
261
|
-
via: 'unavailable';
|
|
262
|
-
message: string;
|
|
263
|
-
};
|
|
264
|
-
} | {
|
|
265
|
-
error: {
|
|
266
|
-
kind: 'failed';
|
|
267
|
-
message: string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
/**
|
|
271
|
-
* Hand one built beacon request to the host's beacon port. Cancelling stops the wait only: the queue and the
|
|
272
|
-
* fetch the browser already has are never aborted, and a late completion is dropped.
|
|
273
|
-
*/
|
|
274
|
-
declare function sendBeaconRequest(ports: HttpPorts, request: HttpRequestWire, signal?: AbortSignal): Promise<BeaconSettled>;
|
|
275
|
-
|
|
276
|
-
type HttpOutcome = {
|
|
277
|
-
ok: JsonValue;
|
|
278
|
-
} | {
|
|
279
|
-
error: HttpFailurePayload;
|
|
280
|
-
};
|
|
281
|
-
interface HttpRunOptions {
|
|
282
|
-
signal?: AbortSignal;
|
|
283
|
-
/** The dispatch's signed-in user id: whose credential a `scope: "user"` ask names (never set by the program). */
|
|
284
|
-
principal?: string | undefined;
|
|
285
|
-
/** Receives each framed event of a `stream` call. */
|
|
286
|
-
onMessage?: (event: HttpStreamEvent) => void;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
declare function isOAuthCode(value: JsonValue | undefined): value is HttpOAuthFailureCode;
|
|
290
|
-
declare function isOAuthReason(value: JsonValue | undefined): value is HttpOAuthFailureReason;
|
|
291
|
-
/** The failure of a call whose host has no port for what it needs. */
|
|
292
|
-
declare function unavailableFailure(error: string, key: string | null): HttpFailurePayload;
|
|
293
|
-
/** The reply the port answered, checked to be one of the closed reply variants. */
|
|
294
|
-
declare function checkOAuthReply(reply: OAuthReply): OAuthReply;
|
|
295
|
-
/**
|
|
296
|
-
* One `http` effect, driven by the kernel's step machine (`httpDriverStart`/`httpDriverResume`): every ask
|
|
297
|
-
* (credential, token store, request, stream) is answered here and nothing else is decided in TypeScript.
|
|
298
|
-
*/
|
|
299
|
-
declare function runHttpCall(ports: HttpPorts, call: HttpCall, options?: HttpRunOptions): Promise<HttpOutcome>;
|
|
300
|
-
|
|
301
|
-
export { HttpEffectFailure, HttpUnavailableError, RANDOM_BYTES_MAX, base64Standard, base64Url, checkOAuthReply, createBrowserHttpPorts, createCredentialAdminPort, createHttpPorts, createHttpSecrets, credentialForgetPayload, credentialStatusPayload, installNetPort, isOAuthCode, isOAuthReason, randomBytesPayload, runHttpCall, sendBeaconRequest, sendHttp, streamHttp, systemRandom, unavailableFailure, userCredentialKey };
|
|
302
|
-
export type { BeaconSettled, BrowserHttpPortsOptions, CredentialAdminPort, Exchange, HttpKernel, HttpOutcome, HttpPorts, HttpPortsOptions, HttpRunOptions, HttpSecrets, HttpSecretsHost, NetPort, OAuthAuthorizeKernel, OAuthPort, PinnedFetch, PinnedInit, PinnedResponse, RandomSource, ResolvedHost, StreamFrame, StreamFramingWire };
|
package/dist/kernel/http.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { HttpEffectFailure, HttpUnavailableError, RANDOM_BYTES_MAX, base64Standard, base64Url, checkOAuthReply, createBrowserHttpPorts, createCredentialAdminPort, createHttpPorts, createHttpSecrets, credentialForgetPayload, credentialStatusPayload, installNetPort, isOAuthCode, isOAuthReason, randomBytesPayload, runHttpCall, sendBeaconRequest, sendHttp, streamHttp, systemRandom, unavailableFailure, userCredentialKey } from '../chunk-YO4LWS3I.js';
|
|
2
|
-
import '../chunk-MZKIL5IN.js';
|
|
3
|
-
import '../chunk-VMOBW7RK.js';
|
|
4
|
-
export { decodeOAuthAsk } from '../chunk-RBUMDYFS.js';
|
|
5
|
-
import '../chunk-HLOUDLPI.js';
|
|
6
|
-
import '../chunk-MLKGABMK.js';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OAuthEffectFailurePayload, RuntimeValue, OAuthAuthorizePayload, OAuthConnectionPayload } from '@almadar/core';
|
|
2
|
-
import { HttpPorts } from './http.js';
|
|
3
|
-
import './beacon.js';
|
|
4
|
-
import '../credentials/store.js';
|
|
5
|
-
import './decode.js';
|
|
6
|
-
import '@almadar/core/kernel-wire';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The interpreter and kernel-host half of the OAuth effects (`oauth-authorize`, `oauth-connection-status`,
|
|
10
|
-
* `oauth-connection-forget`): the asks that orbital-core's `run_oauth_authorize` / `run_oauth_connection` make,
|
|
11
|
-
* in the same order, answered here. Every rule (client and option parsing, the authorization URL, the failure
|
|
12
|
-
* messages) is the kernel's, reached through `@almadar/kernel`; only the sequencing of host asks lives here.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** A failed OAuth effect: its payload is what the `emit.failure` route carries. */
|
|
16
|
-
declare class OAuthEffectFailure extends Error {
|
|
17
|
-
readonly payload: OAuthEffectFailurePayload;
|
|
18
|
-
constructor(payload: OAuthEffectFailurePayload);
|
|
19
|
-
}
|
|
20
|
-
/** `oauth-authorize`: the kernel's steps, in order — secret, metadata, two draws, pending grant. */
|
|
21
|
-
declare function oauthAuthorizePayload(ports: HttpPorts, client: RuntimeValue | undefined, options: RuntimeValue | undefined, principal: string | undefined, key?: RuntimeValue): Promise<OAuthAuthorizePayload>;
|
|
22
|
-
/** `oauth-connection-status` / `oauth-connection-forget`: store first, then caller (the legacy order). */
|
|
23
|
-
declare function oauthConnectionPayload(ports: HttpPorts, head: 'oauth-connection-status' | 'oauth-connection-forget', provider: RuntimeValue | undefined, principal: string | undefined): Promise<OAuthConnectionPayload>;
|
|
24
|
-
|
|
25
|
-
export { OAuthEffectFailure, oauthAuthorizePayload, oauthConnectionPayload };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { OAuthEffectFailure, oauthAuthorizePayload, oauthConnectionPayload } from '../chunk-ZAQSS47X.js';
|
|
2
|
-
import '../chunk-YO4LWS3I.js';
|
|
3
|
-
import '../chunk-MZKIL5IN.js';
|
|
4
|
-
import '../chunk-VMOBW7RK.js';
|
|
5
|
-
import '../chunk-RBUMDYFS.js';
|
|
6
|
-
import '../chunk-HLOUDLPI.js';
|
|
7
|
-
import '../chunk-MLKGABMK.js';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { HttpSecrets, OAuthPort } from './http.js';
|
|
2
|
-
import '@almadar/core';
|
|
3
|
-
import './beacon.js';
|
|
4
|
-
import '../credentials/store.js';
|
|
5
|
-
import './decode.js';
|
|
6
|
-
import '@almadar/core/kernel-wire';
|
|
7
|
-
|
|
8
|
-
/** What the person's consent page is opened with. */
|
|
9
|
-
interface OAuthConsentRequest {
|
|
10
|
-
authUrl: string;
|
|
11
|
-
state: string;
|
|
12
|
-
redirectUri: string;
|
|
13
|
-
}
|
|
14
|
-
interface OAuthPortOptions {
|
|
15
|
-
/** The host's credentials (read per ask when a function: a host installs them at boot). */
|
|
16
|
-
secrets: HttpSecrets | (() => HttpSecrets);
|
|
17
|
-
/** The host clock in epoch milliseconds. */
|
|
18
|
-
now?: () => number;
|
|
19
|
-
/** Opens the consent page for the person and answers the authorization code it returned, `null` when they declined; absent, the host asks no one. */
|
|
20
|
-
consent?: (request: OAuthConsentRequest) => Promise<string | null>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The port's clock decides expiry (`expiresAt >= now` is live, the inclusive boundary of the native store); the
|
|
24
|
-
* credential only garbage-collects, so it is given a grace beyond the TTL and an expired state answers `expired`,
|
|
25
|
-
* not `missing`.
|
|
26
|
-
*/
|
|
27
|
-
declare const PENDING_GRACE_MS: number;
|
|
28
|
-
declare function createOAuthPort(options: OAuthPortOptions): OAuthPort;
|
|
29
|
-
|
|
30
|
-
export { PENDING_GRACE_MS, createOAuthPort };
|
|
31
|
-
export type { OAuthConsentRequest, OAuthPortOptions };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ImportChainLike, SchemaLoader, HttpLoaderOptions, LoadResult, LoadedSchema, LoadedOrbital } from './schema-loader.js';
|
|
2
|
-
import '@almadar/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* HTTP Schema Loader
|
|
6
|
-
*
|
|
7
|
-
* Loads OrbitalSchema files via HTTP/fetch for browser environments.
|
|
8
|
-
* Also works in Node.js with the fetch API.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
declare class HttpImportChain implements ImportChainLike {
|
|
14
|
-
private chain;
|
|
15
|
-
/**
|
|
16
|
-
* Try to add a path to the chain.
|
|
17
|
-
* @returns Error message if circular, null if OK
|
|
18
|
-
*/
|
|
19
|
-
push(absolutePath: string): string | null;
|
|
20
|
-
/**
|
|
21
|
-
* Remove the last path from the chain.
|
|
22
|
-
*/
|
|
23
|
-
pop(): void;
|
|
24
|
-
/**
|
|
25
|
-
* Clone the chain for nested loading.
|
|
26
|
-
*/
|
|
27
|
-
clone(): HttpImportChain;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* HttpLoader - Loads OrbitalSchema files via HTTP/fetch.
|
|
31
|
-
*
|
|
32
|
-
* Designed for browser environments where file system access is not available.
|
|
33
|
-
* Uses the fetch API for loading schemas.
|
|
34
|
-
*
|
|
35
|
-
* Path Resolution:
|
|
36
|
-
* - Relative paths: `./health.orb` -> base URL + path
|
|
37
|
-
* - Standard library: `std/behaviors/game-core` -> std lib URL + path
|
|
38
|
-
* - Scoped packages: `@scope/pkg.orb` -> scoped URL + path
|
|
39
|
-
* - Absolute URLs: `https://...` -> used directly
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const loader = new HttpLoader({
|
|
44
|
-
* basePath: "/api/schemas",
|
|
45
|
-
* stdLibPath: "https://cdn.example.com/orbital-std",
|
|
46
|
-
* });
|
|
47
|
-
*
|
|
48
|
-
* // Load from relative path
|
|
49
|
-
* const result = await loader.load("./my-schema.orb");
|
|
50
|
-
*
|
|
51
|
-
* // Load from std library
|
|
52
|
-
* const stdResult = await loader.load("std/behaviors/game-core");
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare class HttpLoader implements SchemaLoader {
|
|
56
|
-
private options;
|
|
57
|
-
private cache;
|
|
58
|
-
constructor(options: HttpLoaderOptions);
|
|
59
|
-
/**
|
|
60
|
-
* Load a schema from an import path.
|
|
61
|
-
*/
|
|
62
|
-
load(importPath: string, fromPath?: string, chain?: ImportChainLike): Promise<LoadResult<LoadedSchema>>;
|
|
63
|
-
/**
|
|
64
|
-
* Load a specific orbital from a schema by name.
|
|
65
|
-
*/
|
|
66
|
-
loadOrbital(importPath: string, orbitalName?: string, fromPath?: string, chain?: ImportChainLike): Promise<LoadResult<LoadedOrbital>>;
|
|
67
|
-
/**
|
|
68
|
-
* Resolve an import path to an absolute URL.
|
|
69
|
-
*/
|
|
70
|
-
resolvePath(importPath: string, fromPath?: string): LoadResult<string>;
|
|
71
|
-
/**
|
|
72
|
-
* Resolve a standard library path.
|
|
73
|
-
*/
|
|
74
|
-
private resolveStdPath;
|
|
75
|
-
/**
|
|
76
|
-
* Resolve a scoped package path.
|
|
77
|
-
*/
|
|
78
|
-
private resolveScopedPath;
|
|
79
|
-
/**
|
|
80
|
-
* Resolve a relative path.
|
|
81
|
-
*/
|
|
82
|
-
private resolveRelativePath;
|
|
83
|
-
/**
|
|
84
|
-
* Fetch and parse an OrbitalSchema from a URL.
|
|
85
|
-
*/
|
|
86
|
-
private fetchSchema;
|
|
87
|
-
/**
|
|
88
|
-
* Join URL parts, handling relative paths and trailing slashes.
|
|
89
|
-
*/
|
|
90
|
-
private joinUrl;
|
|
91
|
-
/**
|
|
92
|
-
* Get parent URL (directory) from a URL.
|
|
93
|
-
*/
|
|
94
|
-
private getParentUrl;
|
|
95
|
-
/**
|
|
96
|
-
* Clear the cache.
|
|
97
|
-
*/
|
|
98
|
-
clearCache(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Get cache statistics.
|
|
101
|
-
*/
|
|
102
|
-
getCacheStats(): {
|
|
103
|
-
size: number;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Create an HTTP loader with sensible defaults.
|
|
108
|
-
*/
|
|
109
|
-
declare function createHttpLoader(basePath: string, options?: Partial<HttpLoaderOptions>): HttpLoader;
|
|
110
|
-
|
|
111
|
-
export { HttpImportChain, HttpLoader, createHttpLoader };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
2
|
-
import { EventWiringEntry } from './event-wiring.js';
|
|
3
|
-
import { LayoutStrategy } from './layout-strategy.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Compose Behaviors
|
|
7
|
-
*
|
|
8
|
-
* Main entry point for composing multiple orbital definitions into
|
|
9
|
-
* a single OrbitalSchema application. Handles event wiring, layout
|
|
10
|
-
* strategy detection, and page generation.
|
|
11
|
-
*
|
|
12
|
-
* @packageDocumentation
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Input for composing behaviors into an application.
|
|
17
|
-
*/
|
|
18
|
-
interface ComposeBehaviorsInput {
|
|
19
|
-
/** Application name */
|
|
20
|
-
appName: string;
|
|
21
|
-
/** Orbital definitions (or schemas) to compose */
|
|
22
|
-
orbitals: (OrbitalDefinition | OrbitalSchema)[];
|
|
23
|
-
/** Layout strategy override, or 'auto' to detect */
|
|
24
|
-
layoutStrategy?: LayoutStrategy | 'auto';
|
|
25
|
-
/** Cross-orbital event wiring */
|
|
26
|
-
eventWiring?: EventWiringEntry[];
|
|
27
|
-
/** Optional entity name mappings (original -> renamed) */
|
|
28
|
-
entityMappings?: Record<string, string>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Result of composing behaviors.
|
|
32
|
-
*/
|
|
33
|
-
interface ComposeBehaviorsResult {
|
|
34
|
-
/** The composed OrbitalSchema */
|
|
35
|
-
schema: OrbitalSchema;
|
|
36
|
-
/** Layout metadata */
|
|
37
|
-
layout: {
|
|
38
|
-
strategy: LayoutStrategy;
|
|
39
|
-
pageCount: number;
|
|
40
|
-
};
|
|
41
|
-
/** Wiring metadata */
|
|
42
|
-
wiring: {
|
|
43
|
-
connections: number;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Compose multiple orbital definitions into a single application schema.
|
|
48
|
-
*
|
|
49
|
-
* Steps:
|
|
50
|
-
* 1. Apply event wiring (adds emits/listens to traits)
|
|
51
|
-
* 2. Detect or use provided layout strategy
|
|
52
|
-
* 3. Generate pages based on the strategy
|
|
53
|
-
* 4. Build the final OrbitalSchema
|
|
54
|
-
*/
|
|
55
|
-
declare function composeBehaviors(input: ComposeBehaviorsInput): ComposeBehaviorsResult;
|
|
56
|
-
|
|
57
|
-
export { composeBehaviors };
|
|
58
|
-
export type { ComposeBehaviorsInput, ComposeBehaviorsResult };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { OrbitalDefinition } from '@almadar/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Event Wiring
|
|
5
|
-
*
|
|
6
|
-
* Applies cross-orbital event wiring to orbital definitions.
|
|
7
|
-
* Adds emits/listens declarations to traits so they can communicate
|
|
8
|
-
* across orbital boundaries.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A single event wiring entry connecting two traits across orbitals.
|
|
15
|
-
*/
|
|
16
|
-
interface EventWiringEntry {
|
|
17
|
-
/** Source trait name or orbital name */
|
|
18
|
-
from: string;
|
|
19
|
-
/** Event name (UPPER_SNAKE_CASE) */
|
|
20
|
-
event: string;
|
|
21
|
-
/** Target trait name or orbital name */
|
|
22
|
-
to: string;
|
|
23
|
-
/** Event to trigger on the listener side */
|
|
24
|
-
triggers: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Apply event wiring to orbital definitions.
|
|
28
|
-
*
|
|
29
|
-
* For each wiring entry:
|
|
30
|
-
* 1. Find the source trait and add an external emit (if not already present)
|
|
31
|
-
* 2. Find the target trait and add an external listen (if not already present)
|
|
32
|
-
*
|
|
33
|
-
* Returns a new array of orbitals with wiring applied (deep-cloned).
|
|
34
|
-
*/
|
|
35
|
-
declare function applyEventWiring(orbitals: OrbitalDefinition[], wiring: EventWiringEntry[]): OrbitalDefinition[];
|
|
36
|
-
|
|
37
|
-
export { applyEventWiring };
|
|
38
|
-
export type { EventWiringEntry };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { ComposeBehaviorsInput, ComposeBehaviorsResult, composeBehaviors } from './compose-behaviors.js';
|
|
2
|
-
export { EventWiringEntry, applyEventWiring } from './event-wiring.js';
|
|
3
|
-
export { LayoutStrategy, detectLayoutStrategy } from './layout-strategy.js';
|
|
4
|
-
export { PipeStep, pipeBehaviors } from './pipe.js';
|
|
5
|
-
import '@almadar/core';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import '../../../chunk-5D63EMO5.js';
|
|
2
|
-
export { pipeBehaviors } from '../../../chunk-FQ6IZMIU.js';
|
|
3
|
-
export { composeBehaviors } from '../../../chunk-ZCQUUJIF.js';
|
|
4
|
-
export { detectLayoutStrategy } from '../../../chunk-EV56K4GB.js';
|
|
5
|
-
export { applyEventWiring } from '../../../chunk-MHYSHSRG.js';
|
|
6
|
-
import '../../../chunk-MLKGABMK.js';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { OrbitalDefinition } from '@almadar/core';
|
|
2
|
-
import { EventWiringEntry } from './event-wiring.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Layout Strategy Detection
|
|
6
|
-
*
|
|
7
|
-
* Auto-detects the best layout strategy for a composed application
|
|
8
|
-
* based on the number of orbitals and their event wiring topology.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Layout strategy for the composed application.
|
|
15
|
-
*
|
|
16
|
-
* - 'single': One orbital, one page
|
|
17
|
-
* - 'tabs': 2-4 orbitals with no sequential chain
|
|
18
|
-
* - 'sidebar': 5+ orbitals (navigation-heavy)
|
|
19
|
-
* - 'dashboard': Single page with all orbitals visible
|
|
20
|
-
* - 'wizard-flow': Sequential event chain detected (A -> B -> C)
|
|
21
|
-
*/
|
|
22
|
-
type LayoutStrategy = 'sidebar' | 'tabs' | 'dashboard' | 'wizard-flow' | 'single';
|
|
23
|
-
/**
|
|
24
|
-
* Detect the best layout strategy based on orbital count and event wiring.
|
|
25
|
-
*
|
|
26
|
-
* Heuristic:
|
|
27
|
-
* 1. Sequential event chain detected -> 'wizard-flow'
|
|
28
|
-
* 2. 1 orbital -> 'single'
|
|
29
|
-
* 3. 2-4 orbitals -> 'tabs'
|
|
30
|
-
* 4. 5+ orbitals -> 'sidebar'
|
|
31
|
-
*/
|
|
32
|
-
declare function detectLayoutStrategy(orbitals: OrbitalDefinition[], eventWiring?: EventWiringEntry[]): LayoutStrategy;
|
|
33
|
-
|
|
34
|
-
export { detectLayoutStrategy };
|
|
35
|
-
export type { LayoutStrategy };
|