-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
141 lines (125 loc) · 6.31 KB
/
Copy pathindex.ts
File metadata and controls
141 lines (125 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
// Export Kernels
export { ObjectKernel } from '@objectstack/core';
// Export Runtime
export { Runtime } from './runtime.js';
export type { RuntimeConfig } from './runtime.js';
// Export Standalone Stack
export { createStandaloneStack, resolveObjectStackHome } from './standalone-stack.js';
export type { StandaloneStackConfig, StandaloneStackResult } from './standalone-stack.js';
// Export Default Host (artifact-first, no objectstack.config.ts required)
export { createDefaultHostConfig, resolveDefaultArtifactPath } from './default-host.js';
export type { DefaultHostConfigOptions, DefaultHostConfigResult } from './default-host.js';
// Export Plugins
export { DriverPlugin } from './driver-plugin.js';
export { AppPlugin, collectBundleHooks, collectBundleFunctions, collectBundleActions } from './app-plugin.js';
export { SeedLoaderService } from './seed-loader.js';
// Boot-summary seed outcome accumulator (#3415/#3430) — the single writer
// contract shared by AppPlugin and the marketplace rehydrate/heal path.
export { recordSeedOutcome } from './seed-summary.js';
export type { SeedSourceOutcome } from './seed-summary.js';
// Multi-tenant seed-replay registry (#3453) — the register-once-then-mutate
// contract shared by AppPlugin and the marketplace install path so a new org
// replays the UNION of every seed source, not just the first one.
export { mergeSeedDatasets, readSeedDatasets, registerSeedReplayerOnce } from './seed-datasets.js';
// External Datasource Federation — boot-validation gate (ADR-0015, Gate 2)
export { ExternalValidationPlugin, createExternalValidationPlugin } from './external-validation-plugin.js';
export type { ExternalSchemaDriftEvent } from './external-validation-plugin.js';
// NOTE: the runtime-UI datasource lifecycle host glue (ADR-0015 Addendum —
// default driver factory + secret binder) was extracted into the private
// `@objectstack/datasource-admin` package and no longer ships here.
export { createDispatcherPlugin } from './dispatcher-plugin.js';
export type { DispatcherPluginConfig } from './dispatcher-plugin.js';
export { createSystemEnvironmentPlugin, SYSTEM_ENVIRONMENT_ID } from './system-environment-plugin.js';
export type { SystemEnvironmentPluginConfig } from './system-environment-plugin.js';
// Export HTTP Server Components
export { HttpServer } from './http-server.js';
export { HttpDispatcher } from './http-dispatcher.js';
export type { HttpProtocolContext, HttpDispatcherResult } from './http-dispatcher.js';
// ADR-0006 generic kernel-resolution seam (retained framework contract; the
// multi-tenant implementation lives in cloud `@objectstack/objectos-runtime`).
export type { KernelResolver } from './http-dispatcher.js';
export { MiddlewareManager } from './middleware.js';
// ── Security primitives ───────────────────────────────────────────────
// Adapter-agnostic helpers for response hardening (CSP/HSTS/XCTO/…)
// and per-IP token-bucket rate limiting. The dispatcher plugin wires
// security headers automatically; rate limiting is exposed as a
// primitive so adapters can mount it at the appropriate layer (see
// `docs/guide/hardening.md`).
export {
buildSecurityHeaders,
type SecurityHeadersOptions,
RateLimiter,
DEFAULT_RATE_LIMITS,
type RateLimitBucketConfig,
type RateLimitDecision,
type RateLimitDefaults,
type RateLimitStore,
} from './security/index.js';
// ── Observability primitives ──────────────────────────────────────────
// Request-id propagation (X-Request-Id + W3C traceparent), pluggable
// MetricsRegistry, and pluggable ErrorReporter. The dispatcher plugin
// wraps every route with instrumentation when these are configured;
// see `docs/guide/observability.md`.
export {
extractRequestId,
generateRequestId,
resolveRequestId,
parseTraceparent,
formatTraceparent,
type TraceContext,
NoopMetricsRegistry,
InMemoryMetricsRegistry,
RUNTIME_METRICS,
type MetricsRegistry,
type MetricSample,
NoopErrorReporter,
InMemoryErrorReporter,
type ErrorReporter,
type CapturedError,
ObservabilityServicePlugin,
OBSERVABILITY_METRICS_SERVICE,
OBSERVABILITY_ERRORS_SERVICE,
resolveMetrics,
resolveErrorReporter,
type ObservabilityServicePluginOptions,
} from './observability/index.js';
// Export Artifact Loader
export { loadArtifactBundle, mergeRuntimeModule, isHttpUrl, readArtifactSource } from './load-artifact-bundle.js';
export type { LoadArtifactBundleOptions } from './load-artifact-bundle.js';
// ── ObjectOS Cloud Runtime (artifact-fetching shared multi-tenant host) ───────
// Multi-tenant / cloud-operations code is NOT part of the framework
// (ADR-0006). The MULTI-TENANT runtime — createObjectOSStack, the kernel
// manager, environment registries, artifact fetching, the auth proxy,
// per-environment kernel construction, platform SSO, marketplace
// browse/install, the runtime-config endpoint — lives in the cloud
// distribution (`@objectstack/objectos-runtime`). Phase 4 removed the
// framework's duplicate cloud plugins (= cloud ADR-0007 ⑤); Phase 5
// converged the dispatcher's environment resolution + kernel routing into
// the single generic `KernelResolver` seam (exported above with
// HttpDispatcher) — the only multi-tenant contract the framework retains.
// Export Sandbox (script body runner) — engine choice is quickjs-emscripten.
// See packages/runtime/src/sandbox/script-runner.ts for the decision rationale.
export { UnimplementedScriptRunner, QuickJSScriptRunner, SandboxError, hookBodyRunnerFactory, actionBodyRunnerFactory } from './sandbox/index.js';
export type {
ScriptRunner,
ScriptContext,
ScriptOrigin,
ScriptResult,
ScriptRunOptions,
QuickJSScriptRunnerOptions,
} from './sandbox/index.js';
// Re-export from @objectstack/rest
export {
RestServer,
RouteManager,
RouteGroupBuilder,
createRestApiPlugin,
} from '@objectstack/rest';
export type {
RouteEntry,
RestApiPluginConfig,
} from '@objectstack/rest';
// Export Types
export * from '@objectstack/core';
export { readEnvWithDeprecation, _resetEnvDeprecationWarnings } from '@objectstack/types';