@objectstack/runtime 7.2.1 → 7.4.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/index.cjs +1169 -2155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -18
- package/dist/index.d.ts +112 -18
- package/dist/index.js +1135 -2121
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
package/dist/index.d.cts
CHANGED
|
@@ -7,6 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
import * as Contracts from '@objectstack/spec/contracts';
|
|
8
8
|
import { ISeedLoaderService, IDataEngine, IMetadataService } from '@objectstack/spec/contracts';
|
|
9
9
|
import { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph, Dataset, SeedLoaderConfigInput, ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
|
|
10
|
+
import { SchemaDiffEntry } from '@objectstack/spec/shared';
|
|
10
11
|
import { MetricsRegistry, ErrorReporter } from '@objectstack/observability';
|
|
11
12
|
export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsRegistry, MetricSample, MetricsRegistry, NoopErrorReporter, NoopMetricsRegistry, OBSERVABILITY_ERRORS_SERVICE, OBSERVABILITY_METRICS_SERVICE, RUNTIME_METRICS } from '@objectstack/observability';
|
|
12
13
|
import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
|
|
@@ -231,6 +232,30 @@ declare class AppPlugin implements Plugin {
|
|
|
231
232
|
init: (ctx: PluginContext) => Promise<void>;
|
|
232
233
|
start: (ctx: PluginContext) => Promise<void>;
|
|
233
234
|
stop: (ctx: PluginContext) => Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Resolve the identity bound to `os.user` / `os.org` for seed CEL values.
|
|
237
|
+
*
|
|
238
|
+
* On a fresh boot there are zero users until the first human sign-up
|
|
239
|
+
* (which the SeedLoader runs *before*), so identity-derived seeds like
|
|
240
|
+
* `owner_id: cel`os.user.id`` had nothing to resolve against and were
|
|
241
|
+
* dropped silently. To make seeds deterministic and self-sufficient we
|
|
242
|
+
* upsert a single non-loginable **system user** (`usr_system`) and bind
|
|
243
|
+
* it as `os.user`.
|
|
244
|
+
*
|
|
245
|
+
* Why a dedicated system user rather than the login admin:
|
|
246
|
+
* - `sys_user` is better-auth-managed and schema-locked (ADR-0010); the
|
|
247
|
+
* password lives in `sys_account`, so a *loginable* admin can only be
|
|
248
|
+
* minted through better-auth (the CLI does this via HTTP sign-up after
|
|
249
|
+
* boot). A raw insert here would bypass those invariants.
|
|
250
|
+
* - `usr_system` is an owner identity only (no credential row), analogous
|
|
251
|
+
* to Salesforce's "Automated Process" user. The human admin is created
|
|
252
|
+
* independently and need not be the seed owner.
|
|
253
|
+
*
|
|
254
|
+
* Idempotent: matches by the stable id, inserts once, reuses thereafter.
|
|
255
|
+
* Failures are non-fatal (logged) — records that actually need `os.user`
|
|
256
|
+
* then fail loudly in the loader with an actionable message.
|
|
257
|
+
*/
|
|
258
|
+
private ensureSeedIdentity;
|
|
234
259
|
/**
|
|
235
260
|
* Emit a kernel hook so the control-plane `AppCatalogService` can
|
|
236
261
|
* upsert / delete the corresponding `sys_app` row. Silently no-ops
|
|
@@ -329,6 +354,64 @@ declare class SeedLoaderService implements ISeedLoaderService {
|
|
|
329
354
|
private buildResult;
|
|
330
355
|
}
|
|
331
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Payload of the `external.schema.drift` event emitted on the kernel bus by the
|
|
359
|
+
* background drift checker (ADR-0015 §5.2). Consumed by `audit` / `notification`
|
|
360
|
+
* services. One event per drifted federated object.
|
|
361
|
+
*/
|
|
362
|
+
interface ExternalSchemaDriftEvent {
|
|
363
|
+
datasource: string;
|
|
364
|
+
object: string;
|
|
365
|
+
diffs: SchemaDiffEntry[];
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Boot-validation plugin — Gate 2 of ADR-0015 §5.2.
|
|
369
|
+
*
|
|
370
|
+
* On `kernel:ready`, validates every federated object against its remote table
|
|
371
|
+
* (via the `external-datasource` service) and applies the datasource's
|
|
372
|
+
* `external.validation.onMismatch` policy:
|
|
373
|
+
* - `fail` → throws `ExternalSchemaMismatchError` (aborts boot) — default,
|
|
374
|
+
* - `warn` → logs the diff and continues,
|
|
375
|
+
* - `ignore` → does nothing.
|
|
376
|
+
*
|
|
377
|
+
* No-op when the `external-datasource` service is not registered (federation
|
|
378
|
+
* unused).
|
|
379
|
+
*/
|
|
380
|
+
declare class ExternalValidationPlugin implements Plugin {
|
|
381
|
+
name: string;
|
|
382
|
+
type: string;
|
|
383
|
+
version: string;
|
|
384
|
+
/** Active background drift-check timers, keyed by datasource name. */
|
|
385
|
+
private driftTimers;
|
|
386
|
+
init: (_ctx: PluginContext) => void;
|
|
387
|
+
start: (ctx: PluginContext) => void;
|
|
388
|
+
/** Tear down background drift-check timers (idempotent). */
|
|
389
|
+
stop: () => void;
|
|
390
|
+
/** Exposed for testing; invoked from the kernel:ready handler. */
|
|
391
|
+
runValidation(ctx: PluginContext): Promise<void>;
|
|
392
|
+
/**
|
|
393
|
+
* Arm a background drift checker for every federated datasource that declares
|
|
394
|
+
* `external.validation.checkIntervalMs`. Each fires on its own interval and
|
|
395
|
+
* emits `external.schema.drift` events — it never throws or aborts the
|
|
396
|
+
* process, since drift past boot is observational, not fatal.
|
|
397
|
+
*
|
|
398
|
+
* No-op when metadata can't be enumerated or no datasource opts in. Re-arming
|
|
399
|
+
* (e.g. a second `kernel:ready`) first clears existing timers so intervals
|
|
400
|
+
* don't accumulate.
|
|
401
|
+
*/
|
|
402
|
+
scheduleDriftChecks(ctx: PluginContext): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Re-validate one datasource's federated objects and emit an
|
|
405
|
+
* `external.schema.drift` event per mismatch. Exposed for testing; invoked
|
|
406
|
+
* from the interval armed by {@link scheduleDriftChecks}. Never throws.
|
|
407
|
+
*
|
|
408
|
+
* @returns the number of drift events emitted.
|
|
409
|
+
*/
|
|
410
|
+
runDriftCheck(ctx: PluginContext, datasource: string): Promise<number>;
|
|
411
|
+
}
|
|
412
|
+
/** Convenience factory mirroring the createXxxPlugin convention. */
|
|
413
|
+
declare function createExternalValidationPlugin(): ExternalValidationPlugin;
|
|
414
|
+
|
|
332
415
|
/**
|
|
333
416
|
* Security response headers builder.
|
|
334
417
|
*
|
|
@@ -1368,6 +1451,26 @@ declare class HttpDispatcher {
|
|
|
1368
1451
|
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service).
|
|
1369
1452
|
*/
|
|
1370
1453
|
handlePackages(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Assemble a portable, offline-installable package manifest from the
|
|
1456
|
+
* `sys_metadata` overlay rows bound to `packageId`.
|
|
1457
|
+
*
|
|
1458
|
+
* The resulting shape mirrors what `marketplace-install-local` →
|
|
1459
|
+
* `manifestService.register()` → `engine.registerApp()` consumes:
|
|
1460
|
+
* `{ id, name, version, objects:[…], views:[…], flows:[…], … }`
|
|
1461
|
+
* where each category key is the PLURAL manifest name and its value is
|
|
1462
|
+
* an array of clean metadata bodies (provenance decorations stripped).
|
|
1463
|
+
*
|
|
1464
|
+
* Only the metadata categories that `registerApp` can actually consume
|
|
1465
|
+
* are exported. `datasources` and `emailTemplates` are intentionally
|
|
1466
|
+
* excluded (not registered by the import path). `tools` / `skills` ARE
|
|
1467
|
+
* round-tripped: they are registered by `registerApp` on import and
|
|
1468
|
+
* surfaced by `getMetaItems('tool' | 'skill')` on export.
|
|
1469
|
+
*
|
|
1470
|
+
* @returns the manifest object, or `null` if the package id is unknown
|
|
1471
|
+
* AND has no overlay-authored metadata.
|
|
1472
|
+
*/
|
|
1473
|
+
private assemblePackageManifest;
|
|
1371
1474
|
/**
|
|
1372
1475
|
* Cloud / Environment Control-Plane routes.
|
|
1373
1476
|
*
|
|
@@ -1411,19 +1514,6 @@ declare class HttpDispatcher {
|
|
|
1411
1514
|
* Returns `undefined` for anonymous calls or when auth is not wired up.
|
|
1412
1515
|
*/
|
|
1413
1516
|
private resolveActiveOrganizationId;
|
|
1414
|
-
private resolveCallerUserId;
|
|
1415
|
-
handleCloud(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
1416
|
-
/**
|
|
1417
|
-
* Cascade-delete a project: cred / member / package_installation rows,
|
|
1418
|
-
* then the physical database via the provisioning adapter, then the
|
|
1419
|
-
* `sys_environment` row itself. Used by both `DELETE /cloud/environments/:id`
|
|
1420
|
-
* and the org-cascade in `DELETE /cloud/organizations/:id`.
|
|
1421
|
-
*
|
|
1422
|
-
* Idempotent and best-effort: missing rows / unreachable adapters
|
|
1423
|
-
* become warnings rather than hard failures, so a half-provisioned
|
|
1424
|
-
* project can still be cleaned out.
|
|
1425
|
-
*/
|
|
1426
|
-
private deleteProjectCascade;
|
|
1427
1517
|
/**
|
|
1428
1518
|
* Handles Storage requests
|
|
1429
1519
|
* path: sub-path after /storage/
|
|
@@ -1440,6 +1530,8 @@ declare class HttpDispatcher {
|
|
|
1440
1530
|
*
|
|
1441
1531
|
* Routes:
|
|
1442
1532
|
* GET / → listFlows
|
|
1533
|
+
* GET /actions → getActionDescriptors (ADR-0018; ?paradigm/?source/?category filters)
|
|
1534
|
+
* GET /connectors → getConnectorDescriptors (ADR-0022; ?type filter)
|
|
1443
1535
|
* GET /:name → getFlow
|
|
1444
1536
|
* POST / → createFlow (registerFlow)
|
|
1445
1537
|
* PUT /:name → updateFlow
|
|
@@ -1448,6 +1540,8 @@ declare class HttpDispatcher {
|
|
|
1448
1540
|
* POST /:name/toggle → toggleFlow
|
|
1449
1541
|
* GET /:name/runs → listRuns
|
|
1450
1542
|
* GET /:name/runs/:runId → getRun
|
|
1543
|
+
* POST /:name/runs/:runId/resume → resume a paused run (screen input / ADR-0019)
|
|
1544
|
+
* GET /:name/runs/:runId/screen → the screen a paused run awaits
|
|
1451
1545
|
*/
|
|
1452
1546
|
handleAutomation(path: string, method: string, body: any, context: HttpProtocolContext, query?: any): Promise<HttpDispatcherResult>;
|
|
1453
1547
|
private getServicesMap;
|
|
@@ -1908,7 +2002,7 @@ declare function createObjectOSStack(config: ObjectOSStackConfig): Promise<Objec
|
|
|
1908
2002
|
* - The Console SPA stays on the tenant origin, so no CORS configuration
|
|
1909
2003
|
* is required on the cloud side.
|
|
1910
2004
|
* - Local-dev `os serve` works regardless of whether the developer's
|
|
1911
|
-
* browser has cookies for cloud.objectos.
|
|
2005
|
+
* browser has cookies for cloud.objectos.ai.
|
|
1912
2006
|
* - Adds a single, easily auditable network seam between tenant and
|
|
1913
2007
|
* control plane.
|
|
1914
2008
|
*
|
|
@@ -1922,7 +2016,7 @@ declare function createObjectOSStack(config: ObjectOSStackConfig): Promise<Objec
|
|
|
1922
2016
|
|
|
1923
2017
|
interface MarketplaceProxyPluginConfig {
|
|
1924
2018
|
/**
|
|
1925
|
-
* Control-plane base URL (e.g. https://cloud.objectos.
|
|
2019
|
+
* Control-plane base URL (e.g. https://cloud.objectos.ai). When the
|
|
1926
2020
|
* caller passes nothing AND the runtime has no OS_CLOUD_URL set, the
|
|
1927
2021
|
* plugin falls back to the public ObjectStack-operated cloud so that
|
|
1928
2022
|
* `objectstack dev` can browse the marketplace out of the box. Set
|
|
@@ -2144,7 +2238,7 @@ declare class RuntimeConfigPlugin implements Plugin {
|
|
|
2144
2238
|
* ObjectStack-operated control plane so a vanilla `objectstack dev` can
|
|
2145
2239
|
* browse the marketplace out of the box.
|
|
2146
2240
|
*/
|
|
2147
|
-
declare const DEFAULT_CLOUD_URL = "https://cloud.objectos.
|
|
2241
|
+
declare const DEFAULT_CLOUD_URL = "https://cloud.objectos.ai";
|
|
2148
2242
|
/**
|
|
2149
2243
|
* Resolve the effective control-plane URL from an explicit constructor
|
|
2150
2244
|
* value, the OS_CLOUD_URL env var, or the default. Returns an empty
|
|
@@ -2350,7 +2444,7 @@ interface SeedPlatformSsoClientOptions {
|
|
|
2350
2444
|
/** Project id (also used to derive client_id + client_secret). */
|
|
2351
2445
|
environmentId: string;
|
|
2352
2446
|
/**
|
|
2353
|
-
* Project hostname (e.g. `acme-crm.objectos.
|
|
2447
|
+
* Project hostname (e.g. `acme-crm.objectos.ai`). Optional — projects
|
|
2354
2448
|
* may be created before a hostname is assigned, in which case no
|
|
2355
2449
|
* redirect_uri is registered yet and the row is upserted with an
|
|
2356
2450
|
* empty `redirect_uris` array. Calling this function again once the
|
|
@@ -2636,4 +2730,4 @@ declare function actionBodyRunnerFactory(runner: ScriptRunner, opts: FactoryOpti
|
|
|
2636
2730
|
timeoutMs?: number;
|
|
2637
2731
|
}) => ((actionCtx: any) => Promise<unknown>) | undefined;
|
|
2638
2732
|
|
|
2639
|
-
export { AppPlugin, ArtifactApiClient, type ArtifactApiClientConfig, ArtifactEnvironmentRegistry, type ArtifactEnvironmentRegistryConfig, ArtifactKernelFactory, type ArtifactKernelFactoryConfig, AuthProxyPlugin, type BackfillPlatformSsoClientsOptions, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentArtifactResponse, type EnvironmentDriverRegistry, type EnvironmentKernelFactory, type EnvironmentRuntimeConfig, FileArtifactApiClient, type FileArtifactApiClientConfig, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, KernelManager, type KernelManagerConfig, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, type ObjectOSStackConfig, type ObjectOSStackResult, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, PLATFORM_SSO_PROVIDER_ID, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, type ResolvedHostname, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type SeedPlatformSsoClientOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, backfillPlatformSsoClients, buildPlatformSsoRedirectUri, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createObjectOSStack, createStandaloneStack, createSystemEnvironmentPlugin, derivePlatformSsoClientId, derivePlatformSsoClientSecret, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId, seedPlatformSsoClient };
|
|
2733
|
+
export { AppPlugin, ArtifactApiClient, type ArtifactApiClientConfig, ArtifactEnvironmentRegistry, type ArtifactEnvironmentRegistryConfig, ArtifactKernelFactory, type ArtifactKernelFactoryConfig, AuthProxyPlugin, type BackfillPlatformSsoClientsOptions, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentArtifactResponse, type EnvironmentDriverRegistry, type EnvironmentKernelFactory, type EnvironmentRuntimeConfig, type ExternalSchemaDriftEvent, ExternalValidationPlugin, FileArtifactApiClient, type FileArtifactApiClientConfig, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, KernelManager, type KernelManagerConfig, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, type ObjectOSStackConfig, type ObjectOSStackResult, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, PLATFORM_SSO_PROVIDER_ID, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, type ResolvedHostname, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type SeedPlatformSsoClientOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, backfillPlatformSsoClients, buildPlatformSsoRedirectUri, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createObjectOSStack, createStandaloneStack, createSystemEnvironmentPlugin, derivePlatformSsoClientId, derivePlatformSsoClientSecret, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId, seedPlatformSsoClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
import * as Contracts from '@objectstack/spec/contracts';
|
|
8
8
|
import { ISeedLoaderService, IDataEngine, IMetadataService } from '@objectstack/spec/contracts';
|
|
9
9
|
import { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph, Dataset, SeedLoaderConfigInput, ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
|
|
10
|
+
import { SchemaDiffEntry } from '@objectstack/spec/shared';
|
|
10
11
|
import { MetricsRegistry, ErrorReporter } from '@objectstack/observability';
|
|
11
12
|
export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsRegistry, MetricSample, MetricsRegistry, NoopErrorReporter, NoopMetricsRegistry, OBSERVABILITY_ERRORS_SERVICE, OBSERVABILITY_METRICS_SERVICE, RUNTIME_METRICS } from '@objectstack/observability';
|
|
12
13
|
import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
|
|
@@ -231,6 +232,30 @@ declare class AppPlugin implements Plugin {
|
|
|
231
232
|
init: (ctx: PluginContext) => Promise<void>;
|
|
232
233
|
start: (ctx: PluginContext) => Promise<void>;
|
|
233
234
|
stop: (ctx: PluginContext) => Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Resolve the identity bound to `os.user` / `os.org` for seed CEL values.
|
|
237
|
+
*
|
|
238
|
+
* On a fresh boot there are zero users until the first human sign-up
|
|
239
|
+
* (which the SeedLoader runs *before*), so identity-derived seeds like
|
|
240
|
+
* `owner_id: cel`os.user.id`` had nothing to resolve against and were
|
|
241
|
+
* dropped silently. To make seeds deterministic and self-sufficient we
|
|
242
|
+
* upsert a single non-loginable **system user** (`usr_system`) and bind
|
|
243
|
+
* it as `os.user`.
|
|
244
|
+
*
|
|
245
|
+
* Why a dedicated system user rather than the login admin:
|
|
246
|
+
* - `sys_user` is better-auth-managed and schema-locked (ADR-0010); the
|
|
247
|
+
* password lives in `sys_account`, so a *loginable* admin can only be
|
|
248
|
+
* minted through better-auth (the CLI does this via HTTP sign-up after
|
|
249
|
+
* boot). A raw insert here would bypass those invariants.
|
|
250
|
+
* - `usr_system` is an owner identity only (no credential row), analogous
|
|
251
|
+
* to Salesforce's "Automated Process" user. The human admin is created
|
|
252
|
+
* independently and need not be the seed owner.
|
|
253
|
+
*
|
|
254
|
+
* Idempotent: matches by the stable id, inserts once, reuses thereafter.
|
|
255
|
+
* Failures are non-fatal (logged) — records that actually need `os.user`
|
|
256
|
+
* then fail loudly in the loader with an actionable message.
|
|
257
|
+
*/
|
|
258
|
+
private ensureSeedIdentity;
|
|
234
259
|
/**
|
|
235
260
|
* Emit a kernel hook so the control-plane `AppCatalogService` can
|
|
236
261
|
* upsert / delete the corresponding `sys_app` row. Silently no-ops
|
|
@@ -329,6 +354,64 @@ declare class SeedLoaderService implements ISeedLoaderService {
|
|
|
329
354
|
private buildResult;
|
|
330
355
|
}
|
|
331
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Payload of the `external.schema.drift` event emitted on the kernel bus by the
|
|
359
|
+
* background drift checker (ADR-0015 §5.2). Consumed by `audit` / `notification`
|
|
360
|
+
* services. One event per drifted federated object.
|
|
361
|
+
*/
|
|
362
|
+
interface ExternalSchemaDriftEvent {
|
|
363
|
+
datasource: string;
|
|
364
|
+
object: string;
|
|
365
|
+
diffs: SchemaDiffEntry[];
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Boot-validation plugin — Gate 2 of ADR-0015 §5.2.
|
|
369
|
+
*
|
|
370
|
+
* On `kernel:ready`, validates every federated object against its remote table
|
|
371
|
+
* (via the `external-datasource` service) and applies the datasource's
|
|
372
|
+
* `external.validation.onMismatch` policy:
|
|
373
|
+
* - `fail` → throws `ExternalSchemaMismatchError` (aborts boot) — default,
|
|
374
|
+
* - `warn` → logs the diff and continues,
|
|
375
|
+
* - `ignore` → does nothing.
|
|
376
|
+
*
|
|
377
|
+
* No-op when the `external-datasource` service is not registered (federation
|
|
378
|
+
* unused).
|
|
379
|
+
*/
|
|
380
|
+
declare class ExternalValidationPlugin implements Plugin {
|
|
381
|
+
name: string;
|
|
382
|
+
type: string;
|
|
383
|
+
version: string;
|
|
384
|
+
/** Active background drift-check timers, keyed by datasource name. */
|
|
385
|
+
private driftTimers;
|
|
386
|
+
init: (_ctx: PluginContext) => void;
|
|
387
|
+
start: (ctx: PluginContext) => void;
|
|
388
|
+
/** Tear down background drift-check timers (idempotent). */
|
|
389
|
+
stop: () => void;
|
|
390
|
+
/** Exposed for testing; invoked from the kernel:ready handler. */
|
|
391
|
+
runValidation(ctx: PluginContext): Promise<void>;
|
|
392
|
+
/**
|
|
393
|
+
* Arm a background drift checker for every federated datasource that declares
|
|
394
|
+
* `external.validation.checkIntervalMs`. Each fires on its own interval and
|
|
395
|
+
* emits `external.schema.drift` events — it never throws or aborts the
|
|
396
|
+
* process, since drift past boot is observational, not fatal.
|
|
397
|
+
*
|
|
398
|
+
* No-op when metadata can't be enumerated or no datasource opts in. Re-arming
|
|
399
|
+
* (e.g. a second `kernel:ready`) first clears existing timers so intervals
|
|
400
|
+
* don't accumulate.
|
|
401
|
+
*/
|
|
402
|
+
scheduleDriftChecks(ctx: PluginContext): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Re-validate one datasource's federated objects and emit an
|
|
405
|
+
* `external.schema.drift` event per mismatch. Exposed for testing; invoked
|
|
406
|
+
* from the interval armed by {@link scheduleDriftChecks}. Never throws.
|
|
407
|
+
*
|
|
408
|
+
* @returns the number of drift events emitted.
|
|
409
|
+
*/
|
|
410
|
+
runDriftCheck(ctx: PluginContext, datasource: string): Promise<number>;
|
|
411
|
+
}
|
|
412
|
+
/** Convenience factory mirroring the createXxxPlugin convention. */
|
|
413
|
+
declare function createExternalValidationPlugin(): ExternalValidationPlugin;
|
|
414
|
+
|
|
332
415
|
/**
|
|
333
416
|
* Security response headers builder.
|
|
334
417
|
*
|
|
@@ -1368,6 +1451,26 @@ declare class HttpDispatcher {
|
|
|
1368
1451
|
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service).
|
|
1369
1452
|
*/
|
|
1370
1453
|
handlePackages(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Assemble a portable, offline-installable package manifest from the
|
|
1456
|
+
* `sys_metadata` overlay rows bound to `packageId`.
|
|
1457
|
+
*
|
|
1458
|
+
* The resulting shape mirrors what `marketplace-install-local` →
|
|
1459
|
+
* `manifestService.register()` → `engine.registerApp()` consumes:
|
|
1460
|
+
* `{ id, name, version, objects:[…], views:[…], flows:[…], … }`
|
|
1461
|
+
* where each category key is the PLURAL manifest name and its value is
|
|
1462
|
+
* an array of clean metadata bodies (provenance decorations stripped).
|
|
1463
|
+
*
|
|
1464
|
+
* Only the metadata categories that `registerApp` can actually consume
|
|
1465
|
+
* are exported. `datasources` and `emailTemplates` are intentionally
|
|
1466
|
+
* excluded (not registered by the import path). `tools` / `skills` ARE
|
|
1467
|
+
* round-tripped: they are registered by `registerApp` on import and
|
|
1468
|
+
* surfaced by `getMetaItems('tool' | 'skill')` on export.
|
|
1469
|
+
*
|
|
1470
|
+
* @returns the manifest object, or `null` if the package id is unknown
|
|
1471
|
+
* AND has no overlay-authored metadata.
|
|
1472
|
+
*/
|
|
1473
|
+
private assemblePackageManifest;
|
|
1371
1474
|
/**
|
|
1372
1475
|
* Cloud / Environment Control-Plane routes.
|
|
1373
1476
|
*
|
|
@@ -1411,19 +1514,6 @@ declare class HttpDispatcher {
|
|
|
1411
1514
|
* Returns `undefined` for anonymous calls or when auth is not wired up.
|
|
1412
1515
|
*/
|
|
1413
1516
|
private resolveActiveOrganizationId;
|
|
1414
|
-
private resolveCallerUserId;
|
|
1415
|
-
handleCloud(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
1416
|
-
/**
|
|
1417
|
-
* Cascade-delete a project: cred / member / package_installation rows,
|
|
1418
|
-
* then the physical database via the provisioning adapter, then the
|
|
1419
|
-
* `sys_environment` row itself. Used by both `DELETE /cloud/environments/:id`
|
|
1420
|
-
* and the org-cascade in `DELETE /cloud/organizations/:id`.
|
|
1421
|
-
*
|
|
1422
|
-
* Idempotent and best-effort: missing rows / unreachable adapters
|
|
1423
|
-
* become warnings rather than hard failures, so a half-provisioned
|
|
1424
|
-
* project can still be cleaned out.
|
|
1425
|
-
*/
|
|
1426
|
-
private deleteProjectCascade;
|
|
1427
1517
|
/**
|
|
1428
1518
|
* Handles Storage requests
|
|
1429
1519
|
* path: sub-path after /storage/
|
|
@@ -1440,6 +1530,8 @@ declare class HttpDispatcher {
|
|
|
1440
1530
|
*
|
|
1441
1531
|
* Routes:
|
|
1442
1532
|
* GET / → listFlows
|
|
1533
|
+
* GET /actions → getActionDescriptors (ADR-0018; ?paradigm/?source/?category filters)
|
|
1534
|
+
* GET /connectors → getConnectorDescriptors (ADR-0022; ?type filter)
|
|
1443
1535
|
* GET /:name → getFlow
|
|
1444
1536
|
* POST / → createFlow (registerFlow)
|
|
1445
1537
|
* PUT /:name → updateFlow
|
|
@@ -1448,6 +1540,8 @@ declare class HttpDispatcher {
|
|
|
1448
1540
|
* POST /:name/toggle → toggleFlow
|
|
1449
1541
|
* GET /:name/runs → listRuns
|
|
1450
1542
|
* GET /:name/runs/:runId → getRun
|
|
1543
|
+
* POST /:name/runs/:runId/resume → resume a paused run (screen input / ADR-0019)
|
|
1544
|
+
* GET /:name/runs/:runId/screen → the screen a paused run awaits
|
|
1451
1545
|
*/
|
|
1452
1546
|
handleAutomation(path: string, method: string, body: any, context: HttpProtocolContext, query?: any): Promise<HttpDispatcherResult>;
|
|
1453
1547
|
private getServicesMap;
|
|
@@ -1908,7 +2002,7 @@ declare function createObjectOSStack(config: ObjectOSStackConfig): Promise<Objec
|
|
|
1908
2002
|
* - The Console SPA stays on the tenant origin, so no CORS configuration
|
|
1909
2003
|
* is required on the cloud side.
|
|
1910
2004
|
* - Local-dev `os serve` works regardless of whether the developer's
|
|
1911
|
-
* browser has cookies for cloud.objectos.
|
|
2005
|
+
* browser has cookies for cloud.objectos.ai.
|
|
1912
2006
|
* - Adds a single, easily auditable network seam between tenant and
|
|
1913
2007
|
* control plane.
|
|
1914
2008
|
*
|
|
@@ -1922,7 +2016,7 @@ declare function createObjectOSStack(config: ObjectOSStackConfig): Promise<Objec
|
|
|
1922
2016
|
|
|
1923
2017
|
interface MarketplaceProxyPluginConfig {
|
|
1924
2018
|
/**
|
|
1925
|
-
* Control-plane base URL (e.g. https://cloud.objectos.
|
|
2019
|
+
* Control-plane base URL (e.g. https://cloud.objectos.ai). When the
|
|
1926
2020
|
* caller passes nothing AND the runtime has no OS_CLOUD_URL set, the
|
|
1927
2021
|
* plugin falls back to the public ObjectStack-operated cloud so that
|
|
1928
2022
|
* `objectstack dev` can browse the marketplace out of the box. Set
|
|
@@ -2144,7 +2238,7 @@ declare class RuntimeConfigPlugin implements Plugin {
|
|
|
2144
2238
|
* ObjectStack-operated control plane so a vanilla `objectstack dev` can
|
|
2145
2239
|
* browse the marketplace out of the box.
|
|
2146
2240
|
*/
|
|
2147
|
-
declare const DEFAULT_CLOUD_URL = "https://cloud.objectos.
|
|
2241
|
+
declare const DEFAULT_CLOUD_URL = "https://cloud.objectos.ai";
|
|
2148
2242
|
/**
|
|
2149
2243
|
* Resolve the effective control-plane URL from an explicit constructor
|
|
2150
2244
|
* value, the OS_CLOUD_URL env var, or the default. Returns an empty
|
|
@@ -2350,7 +2444,7 @@ interface SeedPlatformSsoClientOptions {
|
|
|
2350
2444
|
/** Project id (also used to derive client_id + client_secret). */
|
|
2351
2445
|
environmentId: string;
|
|
2352
2446
|
/**
|
|
2353
|
-
* Project hostname (e.g. `acme-crm.objectos.
|
|
2447
|
+
* Project hostname (e.g. `acme-crm.objectos.ai`). Optional — projects
|
|
2354
2448
|
* may be created before a hostname is assigned, in which case no
|
|
2355
2449
|
* redirect_uri is registered yet and the row is upserted with an
|
|
2356
2450
|
* empty `redirect_uris` array. Calling this function again once the
|
|
@@ -2636,4 +2730,4 @@ declare function actionBodyRunnerFactory(runner: ScriptRunner, opts: FactoryOpti
|
|
|
2636
2730
|
timeoutMs?: number;
|
|
2637
2731
|
}) => ((actionCtx: any) => Promise<unknown>) | undefined;
|
|
2638
2732
|
|
|
2639
|
-
export { AppPlugin, ArtifactApiClient, type ArtifactApiClientConfig, ArtifactEnvironmentRegistry, type ArtifactEnvironmentRegistryConfig, ArtifactKernelFactory, type ArtifactKernelFactoryConfig, AuthProxyPlugin, type BackfillPlatformSsoClientsOptions, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentArtifactResponse, type EnvironmentDriverRegistry, type EnvironmentKernelFactory, type EnvironmentRuntimeConfig, FileArtifactApiClient, type FileArtifactApiClientConfig, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, KernelManager, type KernelManagerConfig, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, type ObjectOSStackConfig, type ObjectOSStackResult, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, PLATFORM_SSO_PROVIDER_ID, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, type ResolvedHostname, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type SeedPlatformSsoClientOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, backfillPlatformSsoClients, buildPlatformSsoRedirectUri, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createObjectOSStack, createStandaloneStack, createSystemEnvironmentPlugin, derivePlatformSsoClientId, derivePlatformSsoClientSecret, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId, seedPlatformSsoClient };
|
|
2733
|
+
export { AppPlugin, ArtifactApiClient, type ArtifactApiClientConfig, ArtifactEnvironmentRegistry, type ArtifactEnvironmentRegistryConfig, ArtifactKernelFactory, type ArtifactKernelFactoryConfig, AuthProxyPlugin, type BackfillPlatformSsoClientsOptions, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentArtifactResponse, type EnvironmentDriverRegistry, type EnvironmentKernelFactory, type EnvironmentRuntimeConfig, type ExternalSchemaDriftEvent, ExternalValidationPlugin, FileArtifactApiClient, type FileArtifactApiClientConfig, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, KernelManager, type KernelManagerConfig, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, type ObjectOSStackConfig, type ObjectOSStackResult, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, PLATFORM_SSO_PROVIDER_ID, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, type ResolvedHostname, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type SeedPlatformSsoClientOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, backfillPlatformSsoClients, buildPlatformSsoRedirectUri, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createObjectOSStack, createStandaloneStack, createSystemEnvironmentPlugin, derivePlatformSsoClientId, derivePlatformSsoClientSecret, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId, seedPlatformSsoClient };
|