@glubean/engine 0.7.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/engine.d.ts +46 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +1391 -0
- package/dist/engine.js.map +1 -0
- package/dist/http-trace.d.ts +38 -0
- package/dist/http-trace.d.ts.map +1 -0
- package/dist/http-trace.js +128 -0
- package/dist/http-trace.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/node-host.d.ts +14 -0
- package/dist/node-host.d.ts.map +1 -0
- package/dist/node-host.js +29 -0
- package/dist/node-host.js.map +1 -0
- package/dist/types.d.ts +378 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @glubean/engine (Stage 1 spike) — environment-agnostic run-loop core.
|
|
3
|
+
*
|
|
4
|
+
* Lives in packages/engine during the isolation gate; both hosts reference it:
|
|
5
|
+
* @glubean/runner (NodeHost) and lite's BrowserHost. Hosts implement the ports
|
|
6
|
+
* and drive RunnerCore; the run-loop semantics live here, written once.
|
|
7
|
+
*
|
|
8
|
+
* HTTP architecture (Decision B, codex-reviewed): run REAL ky in BOTH hosts. The
|
|
9
|
+
* host seam is the web-standard `fetch`; the engine builds a per-run ky instance
|
|
10
|
+
* with the injected fetch + scope-bound trace hooks and exposes it as
|
|
11
|
+
* `scope.runtime.http`. ky (extend/hooks/retry/timeout/configure().http) is then
|
|
12
|
+
* shared, written once — no hand-rolled HttpFacade.
|
|
13
|
+
*
|
|
14
|
+
* Stage 1 goal (headline go/no-go): prove per-run isolation is delegated entirely
|
|
15
|
+
* to the injected Carrier port via an explicit ExecutionScope, with NO module-
|
|
16
|
+
* global coupling. Narrow run-loop only (simple / linear steps); branch / poll /
|
|
17
|
+
* retry / timeout / workflow are Stage 2.
|
|
18
|
+
*/
|
|
19
|
+
import type { KyInstance, Options } from "ky";
|
|
20
|
+
import type { InternalRuntime, RuntimeCarrier } from "@glubean/sdk/internal";
|
|
21
|
+
import type { GlubeanAction, GlubeanEvent, HttpSchemaOptions, MetricOptions, PollUntilOptions, SchemaIssue, SchemaLike, Trace, ValidateOptions } from "@glubean/sdk";
|
|
22
|
+
/** ky request options plus Glubean's retained public `prefixUrl` (the engine maps
|
|
23
|
+
* it to ky 2's `prefix` at the boundary) and the `schema` option for automatic
|
|
24
|
+
* request/response validation (node parity: harness KyOptionsWithSchema). */
|
|
25
|
+
export type GlubeanHttpOptions = Options & {
|
|
26
|
+
prefixUrl?: string;
|
|
27
|
+
schema?: HttpSchemaOptions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The http client both hosts expose as `ctx.http` / `runtime.http`: a ky instance
|
|
31
|
+
* whose call / method / `.extend()` options also accept the public `prefixUrl`
|
|
32
|
+
* (codex P2-3 — typing it as raw KyInstance would reject `extend({ prefixUrl })`
|
|
33
|
+
* at compile time even though the runtime proxy maps it).
|
|
34
|
+
*/
|
|
35
|
+
type KyResponsePromise = ReturnType<KyInstance["get"]>;
|
|
36
|
+
export interface GlubeanHttp {
|
|
37
|
+
(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
38
|
+
get(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
39
|
+
post(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
40
|
+
put(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
41
|
+
patch(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
42
|
+
delete(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
43
|
+
head(url: string | URL | Request, options?: GlubeanHttpOptions): KyResponsePromise;
|
|
44
|
+
extend(options: GlubeanHttpOptions | ((parentOptions: Options) => GlubeanHttpOptions)): GlubeanHttp;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Host port: the only HTTP egress, as the web-standard `fetch`. node = node fetch
|
|
48
|
+
* (undici) / browser = a fetch wrapping the CORS-bypass extension or direct fetch.
|
|
49
|
+
* The browser wrapper MUST honor the real fetch contract (Request/URL + init,
|
|
50
|
+
* AbortSignal, clone-before-read) — see fetch-conformance tests. (codex P1-3)
|
|
51
|
+
*/
|
|
52
|
+
export type FetchImpl = (input: Request | string | URL, init?: RequestInit) => Promise<Response>;
|
|
53
|
+
/** Host port: vars are available everywhere; secrets are node-only (never browser). */
|
|
54
|
+
export interface EnvProvider {
|
|
55
|
+
vars(): Record<string, string>;
|
|
56
|
+
secrets(): Record<string, string>;
|
|
57
|
+
/** Optional RAW vars snapshot for ctx.vars.all() (node parity: {...rawVars}). The
|
|
58
|
+
* `vars()` accessor a host returns may be a fallback Proxy (.env→process.env) whose
|
|
59
|
+
* spread would resolve empty values to the fallback / drop them; varsAll() returns
|
|
60
|
+
* the un-proxied map so all() matches legacy exactly. Falls back to spreading vars()
|
|
61
|
+
* when absent (codex Phase-8 P2). */
|
|
62
|
+
varsAll?(): Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
export type ExecutionEvent = {
|
|
65
|
+
type: "start";
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
tags: string[];
|
|
69
|
+
retryCount?: number;
|
|
70
|
+
} | {
|
|
71
|
+
type: "assertion";
|
|
72
|
+
id: string;
|
|
73
|
+
passed: boolean;
|
|
74
|
+
message?: string;
|
|
75
|
+
actual?: unknown;
|
|
76
|
+
expected?: unknown;
|
|
77
|
+
stepIndex?: number;
|
|
78
|
+
} | {
|
|
79
|
+
type: "trace";
|
|
80
|
+
id: string;
|
|
81
|
+
data: Trace;
|
|
82
|
+
stepIndex?: number;
|
|
83
|
+
} | {
|
|
84
|
+
type: "log";
|
|
85
|
+
id: string;
|
|
86
|
+
message: string;
|
|
87
|
+
data?: unknown;
|
|
88
|
+
stepIndex?: number;
|
|
89
|
+
} | {
|
|
90
|
+
type: "warning";
|
|
91
|
+
id: string;
|
|
92
|
+
condition: boolean;
|
|
93
|
+
message: string;
|
|
94
|
+
stepIndex?: number;
|
|
95
|
+
} | {
|
|
96
|
+
type: "schema_validation";
|
|
97
|
+
id: string;
|
|
98
|
+
label: string;
|
|
99
|
+
success: boolean;
|
|
100
|
+
severity: "error" | "warn" | "fatal";
|
|
101
|
+
issues?: SchemaIssue[];
|
|
102
|
+
stepIndex?: number;
|
|
103
|
+
} | {
|
|
104
|
+
type: "metric";
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
value: number;
|
|
108
|
+
unit?: string;
|
|
109
|
+
tags?: Record<string, string>;
|
|
110
|
+
stepIndex?: number;
|
|
111
|
+
} | {
|
|
112
|
+
type: "action";
|
|
113
|
+
id: string;
|
|
114
|
+
data: GlubeanAction;
|
|
115
|
+
stepIndex?: number;
|
|
116
|
+
} | {
|
|
117
|
+
type: "event";
|
|
118
|
+
id: string;
|
|
119
|
+
data: GlubeanEvent;
|
|
120
|
+
stepIndex?: number;
|
|
121
|
+
} | {
|
|
122
|
+
type: "step_start";
|
|
123
|
+
id: string;
|
|
124
|
+
index: number;
|
|
125
|
+
name: string;
|
|
126
|
+
total: number;
|
|
127
|
+
} | {
|
|
128
|
+
type: "step_end";
|
|
129
|
+
id: string;
|
|
130
|
+
index: number;
|
|
131
|
+
name: string;
|
|
132
|
+
status: "passed" | "failed" | "skipped";
|
|
133
|
+
durationMs: number;
|
|
134
|
+
assertions: number;
|
|
135
|
+
failedAssertions: number;
|
|
136
|
+
attempts?: number;
|
|
137
|
+
retriesUsed?: number;
|
|
138
|
+
error?: string;
|
|
139
|
+
returnState?: unknown;
|
|
140
|
+
} | {
|
|
141
|
+
type: "branch";
|
|
142
|
+
id: string;
|
|
143
|
+
index: number;
|
|
144
|
+
name: string;
|
|
145
|
+
takenIndex: number | "default";
|
|
146
|
+
takenValue?: string | number | boolean | null;
|
|
147
|
+
message?: string;
|
|
148
|
+
total: number;
|
|
149
|
+
error?: string;
|
|
150
|
+
} | {
|
|
151
|
+
type: "poll";
|
|
152
|
+
id: string;
|
|
153
|
+
index: number;
|
|
154
|
+
name: string;
|
|
155
|
+
attempts: number;
|
|
156
|
+
elapsedMs: number;
|
|
157
|
+
satisfied: boolean;
|
|
158
|
+
exhausted: boolean;
|
|
159
|
+
error?: string;
|
|
160
|
+
} | {
|
|
161
|
+
type: "timeout_update";
|
|
162
|
+
id: string;
|
|
163
|
+
timeout: number;
|
|
164
|
+
} | {
|
|
165
|
+
type: "session_set";
|
|
166
|
+
id: string;
|
|
167
|
+
key: string;
|
|
168
|
+
value: unknown;
|
|
169
|
+
} | {
|
|
170
|
+
type: "status";
|
|
171
|
+
id: string;
|
|
172
|
+
status: "ok" | "error" | "skipped";
|
|
173
|
+
error?: string;
|
|
174
|
+
};
|
|
175
|
+
/** Host port: where execution events go. node = stdout stream / browser = collector. */
|
|
176
|
+
export interface EventSink {
|
|
177
|
+
emit(e: ExecutionEvent): void;
|
|
178
|
+
}
|
|
179
|
+
/** Host port: clock / timers. Stage 1 uses now() only (trace timing). */
|
|
180
|
+
export interface Scheduler {
|
|
181
|
+
now(): number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Host ports wired in Stage 1. `carrier` is the SDK RuntimeCarrier the engine
|
|
185
|
+
* installs so getRuntime() consumers (configure() / session / configured-http)
|
|
186
|
+
* resolve to the active scope's runtime. node provides an ALS carrier (true
|
|
187
|
+
* cross-await isolation); browser provides its own (single-flight today,
|
|
188
|
+
* AsyncContext-style propagation later — an open decision, not this gate).
|
|
189
|
+
*/
|
|
190
|
+
export interface RunnerServices {
|
|
191
|
+
fetch: FetchImpl;
|
|
192
|
+
env: EnvProvider;
|
|
193
|
+
events: EventSink;
|
|
194
|
+
scheduler: Scheduler;
|
|
195
|
+
carrier: RuntimeCarrier;
|
|
196
|
+
/** HTTP trace policy (host-injected from ExecutorOptions, all default OFF): full
|
|
197
|
+
* request/response capture, response-body schema inference, and aggressive array
|
|
198
|
+
* truncation. Node parity: harness emitFullTrace / inferSchema / truncateArrays. */
|
|
199
|
+
http?: {
|
|
200
|
+
emitFullTrace?: boolean;
|
|
201
|
+
inferSchema?: boolean;
|
|
202
|
+
truncateArrays?: boolean;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export interface ModuleLoader {
|
|
206
|
+
provide(source: string): Promise<Record<string, unknown>>;
|
|
207
|
+
}
|
|
208
|
+
export interface DataProvider {
|
|
209
|
+
read(name: string): Promise<string>;
|
|
210
|
+
}
|
|
211
|
+
export interface FeaturePolicy {
|
|
212
|
+
supports(feature: string): boolean;
|
|
213
|
+
}
|
|
214
|
+
/** Per-run runtime input (vars/secrets/session) layered over the host EnvProvider. */
|
|
215
|
+
export interface ScopeInput {
|
|
216
|
+
vars?: Record<string, string>;
|
|
217
|
+
secrets?: Record<string, string>;
|
|
218
|
+
session?: Record<string, unknown>;
|
|
219
|
+
/** Test-level retry attempt (the host re-runs a failed test); surfaced on
|
|
220
|
+
* ctx.retryCount + the start event, like the node harness. 0/undefined = first run. */
|
|
221
|
+
retryCount?: number;
|
|
222
|
+
}
|
|
223
|
+
export interface TestResult {
|
|
224
|
+
id: string;
|
|
225
|
+
name: string;
|
|
226
|
+
/** The engine's verdict: "error" if it threw OR a soft assertion failed. */
|
|
227
|
+
status: "ok" | "error" | "skipped";
|
|
228
|
+
/** True only if user code threw (vs a soft assertion failure). Lets a host
|
|
229
|
+
* distinguish "completed but failed an assertion" from "threw" when deciding
|
|
230
|
+
* status/exit semantics (the runner re-raises a throw; a soft fail completed). */
|
|
231
|
+
threw?: boolean;
|
|
232
|
+
/** True if a STEP failed (assertion or throw) in a steps run. Node parity: a
|
|
233
|
+
* steps test with any failed step is reported as a failure ("One or more steps
|
|
234
|
+
* failed"), unlike a simple test's soft assertion failure which "completes". */
|
|
235
|
+
stepsFailed?: boolean;
|
|
236
|
+
/** The message a host should throw for `stepsFailed` — usually "One or more steps
|
|
237
|
+
* failed", or a branch-decision-specific message when a branch decision failed. */
|
|
238
|
+
stepsFailMessage?: string;
|
|
239
|
+
/** When `status === "skipped"` because user code called ctx.skip(reason?): the
|
|
240
|
+
* reason. A host re-raises its own SkipError(reason) so the dispatcher emits the
|
|
241
|
+
* same skipped status (with `reason`) as the legacy path (plan 0005 / codex). */
|
|
242
|
+
skipReason?: string;
|
|
243
|
+
error?: string;
|
|
244
|
+
/** The original throw's stack (only when `threw`), so a host can re-raise with
|
|
245
|
+
* the user's stack instead of a host-rooted one (diagnostics parity). */
|
|
246
|
+
errorStack?: string;
|
|
247
|
+
/** The original throw's error name (e.g. "TypeError", ky's "TimeoutError"), so a
|
|
248
|
+
* host can re-raise with it and keep failure classification (diagnostics parity). */
|
|
249
|
+
errorName?: string;
|
|
250
|
+
assertions: {
|
|
251
|
+
total: number;
|
|
252
|
+
passed: number;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export type TestFn = (ctx: EngineContext, state?: unknown) => unknown | Promise<unknown>;
|
|
256
|
+
export interface StepDef {
|
|
257
|
+
meta: {
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
fn: TestFn;
|
|
261
|
+
}
|
|
262
|
+
export interface TestDef {
|
|
263
|
+
meta: {
|
|
264
|
+
id: string;
|
|
265
|
+
name?: string;
|
|
266
|
+
tags?: string[];
|
|
267
|
+
skip?: boolean;
|
|
268
|
+
only?: boolean;
|
|
269
|
+
};
|
|
270
|
+
type: "simple" | "steps";
|
|
271
|
+
fn?: TestFn;
|
|
272
|
+
setup?: TestFn;
|
|
273
|
+
steps?: StepDef[];
|
|
274
|
+
teardown?: TestFn;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* The narrow ctx surface Stage 1 exercises — scope-bound, never module globals.
|
|
278
|
+
* Structurally a subset of the SDK TestContext (http/expect/assert/warn/vars/
|
|
279
|
+
* secrets/session/log), enough to run real simple / builder / each tests. The
|
|
280
|
+
* Stage-2 surface (validate/skip/fail/setTimeout/metric/attach) is not here yet.
|
|
281
|
+
*/
|
|
282
|
+
export interface EngineContext {
|
|
283
|
+
/** ky instance for this run (the same shared ky both hosts use), accepting the
|
|
284
|
+
* public `prefixUrl` option. */
|
|
285
|
+
http: GlubeanHttp;
|
|
286
|
+
expect(actual: unknown): unknown;
|
|
287
|
+
assert(condition: unknown, message?: string, details?: unknown): void;
|
|
288
|
+
warn(condition: unknown, message?: string): void;
|
|
289
|
+
vars: {
|
|
290
|
+
get(k: string): string | undefined;
|
|
291
|
+
require(k: string, validate?: (value: string) => boolean | string | void | null): string;
|
|
292
|
+
/** A copy of all vars for diagnostics/logging (node parity: harness ctx.vars.all). */
|
|
293
|
+
all(): Record<string, string>;
|
|
294
|
+
};
|
|
295
|
+
secrets: {
|
|
296
|
+
get(k: string): string | undefined;
|
|
297
|
+
require(k: string, validate?: (value: string) => boolean | string | void | null): string;
|
|
298
|
+
};
|
|
299
|
+
session: {
|
|
300
|
+
get(k: string): unknown;
|
|
301
|
+
require(k: string): unknown;
|
|
302
|
+
set(k: string, v: unknown): void;
|
|
303
|
+
entries(): Record<string, unknown>;
|
|
304
|
+
};
|
|
305
|
+
log(message: string, data?: unknown): void;
|
|
306
|
+
/** Validate `data` against a SchemaLike (zod or any safeParse/parse object); emits
|
|
307
|
+
* a schema_validation event and routes a failure by severity (error→failed
|
|
308
|
+
* assertion, warn→warning, fatal→failed assertion + abort). Returns the parsed
|
|
309
|
+
* value on success, else undefined (node parity: harness ctx.validate). */
|
|
310
|
+
validate<T>(data: unknown, schema: SchemaLike<T>, label?: string, options?: ValidateOptions): T | undefined;
|
|
311
|
+
/** Report a numeric metric (node parity: harness ctx.metric). */
|
|
312
|
+
metric(name: string, value: number, options?: MetricOptions): void;
|
|
313
|
+
/** Record a typed interaction (node parity: harness ctx.action). */
|
|
314
|
+
action(a: GlubeanAction): void;
|
|
315
|
+
/** Emit a protocol trace (node parity: harness ctx.trace) — emits a trace event
|
|
316
|
+
* AND a derived `action` ({protocol}:request). The HTTP auto-trace routes through
|
|
317
|
+
* this too. */
|
|
318
|
+
trace(request: Trace): void;
|
|
319
|
+
/** Emit a generic structured event (node parity: harness ctx.event — the workflow
|
|
320
|
+
* first-class unwrap stays node-legacy; the engine always emits generic). */
|
|
321
|
+
event(ev: GlubeanEvent): void;
|
|
322
|
+
/** Set a custom test timeout (ms) — emits a timeout_update control event the parent
|
|
323
|
+
* uses to re-arm its deadline (node parity: harness ctx.setTimeout). */
|
|
324
|
+
setTimeout(ms: number): void;
|
|
325
|
+
/** Poll `fn` until it returns truthy or `timeoutMs` elapses; on timeout call
|
|
326
|
+
* `onTimeout` (silent) or throw (node parity: harness ctx.pollUntil). */
|
|
327
|
+
pollUntil(options: PollUntilOptions, fn: () => Promise<boolean | unknown>): Promise<void>;
|
|
328
|
+
/** Skip the current test with an optional reason (node parity: throws a SkipError
|
|
329
|
+
* the run-loop turns into a `skipped` verdict; a step/branch-predicate skip skips
|
|
330
|
+
* the whole test unless a failure was already recorded). */
|
|
331
|
+
skip(reason?: string): never;
|
|
332
|
+
/** Immediately fail + abort: emit a failed assertion (counted even if caught) then
|
|
333
|
+
* throw, so a steps/branch leg records the failure (node parity: harness ctx.fail). */
|
|
334
|
+
fail(message: string): never;
|
|
335
|
+
/** Test-level retry attempt for this run (0 on the first run). */
|
|
336
|
+
retryCount: number;
|
|
337
|
+
/** Process memory snapshot (node parity: harness ctx.getMemoryUsage → process
|
|
338
|
+
* .memoryUsage()); null where unavailable (browser) — browser-safe via globalThis. */
|
|
339
|
+
getMemoryUsage(): {
|
|
340
|
+
heapUsed: number;
|
|
341
|
+
heapTotal: number;
|
|
342
|
+
external: number;
|
|
343
|
+
rss: number;
|
|
344
|
+
} | null;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Per-run state. THE headline invariant: every piece of per-run state lives here
|
|
348
|
+
* (or in scope.runtime), never in a module-level variable. Two concurrent runs
|
|
349
|
+
* hold two scopes; isolation is whatever the injected Carrier provides.
|
|
350
|
+
*/
|
|
351
|
+
export interface ExecutionScope {
|
|
352
|
+
runtime: InternalRuntime;
|
|
353
|
+
testMeta: {
|
|
354
|
+
id: string;
|
|
355
|
+
tags: string[];
|
|
356
|
+
};
|
|
357
|
+
stepIndex: number;
|
|
358
|
+
/** 0-based index of the step currently running (null outside a step) — events
|
|
359
|
+
* emitted during a step carry it as `stepIndex`, like the node harness. */
|
|
360
|
+
currentStepIndex: number | null;
|
|
361
|
+
retryCount: number;
|
|
362
|
+
assertions: {
|
|
363
|
+
total: number;
|
|
364
|
+
passed: number;
|
|
365
|
+
};
|
|
366
|
+
http: GlubeanHttp;
|
|
367
|
+
session: Record<string, unknown>;
|
|
368
|
+
/** Raw merged vars snapshot for ctx.vars.all() — host raw vars + per-run input.vars,
|
|
369
|
+
* WITHOUT the fallback-proxy resolution (node parity: {...rawVars}; codex Phase-8 P2). */
|
|
370
|
+
varsAll: Record<string, string>;
|
|
371
|
+
/** The run's ctx, back-filled once makeCtx runs. The scope-bound ky hooks (built
|
|
372
|
+
* in createScope, BEFORE makeCtx) read it lazily at request time so the HTTP
|
|
373
|
+
* auto-trace can route through ctx.trace / ctx.metric (→ derived action,
|
|
374
|
+
* http_duration_ms) + the schema hooks through ctx.assert / ctx.warn. */
|
|
375
|
+
ctxRef?: EngineContext;
|
|
376
|
+
}
|
|
377
|
+
export {};
|
|
378
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA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,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACjG;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB;gFAC4E;IAC5E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;+FAC2F;IAC3F,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;8EAG0E;IAC1E,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@glubean/engine",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"description": "Environment-agnostic run-loop core shared by the Node runner and the browser host.",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"ky": "^2.0.2",
|
|
24
|
+
"@glubean/sdk": "0.7.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"esbuild": "^0.25.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/glubean/glubean.git",
|
|
33
|
+
"directory": "packages/engine"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.build.json",
|
|
37
|
+
"pretest": "node -e \"const fs=require('fs'),p=require('path');const bad=fs.readdirSync('src',{recursive:true}).filter(f=>(/\\.(js|d\\.ts)$/.test(f)&&!f.endsWith('.mjs'))).map(f=>p.join('src',f));if(bad.length){console.error('ERROR: Stale build artifacts in src/ — delete them:',bad);process.exit(1)}\"",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"smoke": "pnpm --filter @glubean/sdk --filter @glubean/engine build && node browser-smoke/build-smoke.mjs",
|
|
40
|
+
"smoke:serve": "pnpm --filter @glubean/sdk --filter @glubean/engine build && node browser-smoke/serve-smoke.mjs"
|
|
41
|
+
}
|
|
42
|
+
}
|