@objectstack/cloud-connection 9.3.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.
@@ -0,0 +1,1694 @@
1
+ import { Plugin as Plugin$1, PluginContext as PluginContext$1 } from '@objectstack/core';
2
+ import * as _objectstack_spec_data from '@objectstack/spec/data';
3
+ import { Page } from '@objectstack/spec/ui';
4
+
5
+ /**
6
+ * Shared marketplace / cloud control-plane defaults.
7
+ *
8
+ * Centralised so every plugin + the CLI auto-inject path agree on
9
+ * "what cloud URL do we mean when the user didn't set OS_CLOUD_URL?".
10
+ * Until we have a competing public hosted cloud, this points at the
11
+ * ObjectStack-operated control plane so a vanilla `objectstack dev` can
12
+ * browse the marketplace out of the box.
13
+ */
14
+ declare const DEFAULT_CLOUD_URL = "https://cloud.objectos.ai";
15
+ /**
16
+ * Resolve the effective control-plane URL from an explicit constructor
17
+ * value, the OS_CLOUD_URL env var, or the default. Returns an empty
18
+ * string when the caller explicitly disabled cloud with
19
+ * `OS_CLOUD_URL=off` / `local` — callers should treat that as
20
+ * "marketplace unavailable on this runtime".
21
+ */
22
+ declare function resolveCloudUrl(explicit?: string | null): string;
23
+
24
+ /**
25
+ * Marketplace public R2 base URL — when set, points at a Cloudflare R2
26
+ * bucket (custom domain or `pub-*.r2.dev`) that serves pre-rendered
27
+ * marketplace browse + install JSON snapshots. The snapshots are
28
+ * written by ObjectStack Cloud (`packages/service-cloud/src/marketplace-snapshot.ts`).
29
+ *
30
+ * Architecture: cloud writes, tenants read directly from R2 → CDN.
31
+ * Marketplace browse + install never touch the cloud control plane,
32
+ * so Cloud cold-start (~12s) is bypassed entirely and the read path
33
+ * scales to CF's edge capacity for free.
34
+ *
35
+ * Default: when OS_MARKETPLACE_PUBLIC_BASE_URL is unset we skip the
36
+ * public fast-path and fall back to the legacy cloud proxy. Once the
37
+ * R2 bucket public domain is wired up in operations, set
38
+ * `OS_MARKETPLACE_PUBLIC_BASE_URL=https://marketplace.objectos.ai`
39
+ * (or your own custom domain) to enable. Set to "off" / "none" to
40
+ * explicitly disable even if a default is configured.
41
+ *
42
+ * Path layout under the base URL (matches the snapshot writer):
43
+ * <base>/packages.json
44
+ * <base>/packages/{id}.json
45
+ * <base>/packages/{id}/versions/{versionId}/manifest.json
46
+ * <base>/packages/{id}/versions/latest/manifest.json
47
+ *
48
+ * Each JSON file is already in the same `{ success: true, data: ... }`
49
+ * shape as the corresponding cloud API endpoint, so callers can
50
+ * substitute one for the other transparently.
51
+ */
52
+ /**
53
+ * Resolve the effective public marketplace base URL. Returns an empty
54
+ * string when the public fast-path is disabled — callers should fall
55
+ * back to fetching via the cloud control plane.
56
+ */
57
+ declare function resolveMarketplacePublicBaseUrl(explicit?: string | null): string;
58
+ /**
59
+ * Map an incoming `/api/v1/marketplace/...` API path to a public R2
60
+ * object key (relative — caller prepends the base URL).
61
+ *
62
+ * Returns `null` when the path is not snapshot-backed. Today three
63
+ * paths are covered (list, detail, manifest); anything else (search
64
+ * with non-trivial filters, install actions, etc.) routes via cloud.
65
+ *
66
+ * Query strings are NOT included in the returned key — R2 is static.
67
+ * Callers that need filtering must fetch the full snapshot and filter
68
+ * client-side.
69
+ */
70
+ declare function publicMarketplaceKeyForApiPath(pathname: string): string | null;
71
+
72
+ /**
73
+ * MarketplaceProxyPlugin
74
+ *
75
+ * Forwards `GET /api/v1/marketplace/*` from a tenant ObjectOS runtime to
76
+ * the configured ObjectStack Cloud control-plane URL. The cloud endpoint
77
+ * is unauthenticated and only exposes packages whose owner has opted in
78
+ * to the public catalog (`sys_package.marketplace_listed = true`) — so the
79
+ * proxy passes through without any credentials.
80
+ *
81
+ * Why proxy instead of direct browser → cloud:
82
+ * - The Console SPA stays on the tenant origin, so no CORS configuration
83
+ * is required on the cloud side.
84
+ * - Local-dev `os serve` works regardless of whether the developer's
85
+ * browser has cookies for cloud.objectos.ai.
86
+ * - Adds a single, easily auditable network seam between tenant and
87
+ * control plane.
88
+ *
89
+ * Install is NOT proxied here. Installing a package mutates control-plane
90
+ * state and requires a cloud session + active organization context — the
91
+ * Console SPA performs install by opening the cloud's install dialog in a
92
+ * new tab so the user authenticates against cloud directly. A future
93
+ * iteration may introduce a delegated install token; until then, browse
94
+ * here and install on cloud.
95
+ */
96
+
97
+ interface MarketplaceProxyPluginConfig {
98
+ /**
99
+ * Control-plane base URL (e.g. https://cloud.objectos.ai). When the
100
+ * caller passes nothing AND the runtime has no OS_CLOUD_URL set, the
101
+ * plugin falls back to the public ObjectStack-operated cloud so that
102
+ * `objectstack dev` can browse the marketplace out of the box. Set
103
+ * OS_CLOUD_URL=off (or `local`) to opt out — the plugin then mounts
104
+ * a stub that responds 503 and the SPA renders an empty-state
105
+ * explaining marketplace is unavailable in this runtime.
106
+ */
107
+ controlPlaneUrl?: string;
108
+ /**
109
+ * Disable the in-memory response cache (testing / debugging).
110
+ * Defaults to the value of `OS_MARKETPLACE_CACHE` (anything in
111
+ * {"off","false","0","no"} disables).
112
+ */
113
+ cacheDisabled?: boolean;
114
+ /**
115
+ * Override the LRU upper bound. Defaults to 200 entries.
116
+ */
117
+ cacheMaxEntries?: number;
118
+ /**
119
+ * Public R2 base URL for marketplace snapshots. When set, GETs for
120
+ * snapshot-backed paths (`/packages`, `/packages/:id`,
121
+ * `/packages/:id/versions/:vid/manifest`) are fetched directly from
122
+ * R2 (CF edge) — bypassing the cloud control plane entirely.
123
+ * Defaults to the value of OS_MARKETPLACE_PUBLIC_BASE_URL. Empty
124
+ * string disables the public fast-path (legacy cloud-proxy only).
125
+ */
126
+ publicMarketplaceBaseUrl?: string;
127
+ }
128
+ declare class MarketplaceProxyPlugin implements Plugin$1 {
129
+ readonly name = "com.objectstack.runtime.marketplace-proxy";
130
+ readonly version = "1.1.0";
131
+ private readonly cloudUrl;
132
+ private readonly publicBaseUrl;
133
+ private readonly cache;
134
+ constructor(config?: MarketplaceProxyPluginConfig);
135
+ init: (_ctx: PluginContext$1) => Promise<void>;
136
+ start: (ctx: PluginContext$1) => Promise<void>;
137
+ }
138
+
139
+ /**
140
+ * MarketplaceInstallLocalPlugin
141
+ *
142
+ * Installs marketplace packages into THIS runtime's kernel as opposed to a
143
+ * remote cloud environment. Conceptually different from cloud install in
144
+ * three important ways:
145
+ *
146
+ * 1. Single target — the local kernel is the only install target; there
147
+ * is no `sys_environment` picker.
148
+ * 2. Manifests are cached on disk — once installed, the package is
149
+ * runnable offline. Cloud is only needed during the install action
150
+ * itself (to fetch the manifest snapshot).
151
+ * 3. Coexists with user-authored apps — the local runtime usually has
152
+ * its own `objectstack.config.ts` declared apps. Install refuses to
153
+ * overwrite a manifest_id that's already registered to avoid silently
154
+ * replacing user code.
155
+ *
156
+ * Endpoints (mounted by `start()` on the `kernel:ready` hook):
157
+ *
158
+ * POST /api/v1/marketplace/install-local
159
+ * body: { packageId: string, versionId?: string } (default: "latest")
160
+ * → fetches manifest from cloud, caches to disk, registers via
161
+ * the kernel's `manifest` service. Returns the installed entry.
162
+ *
163
+ * GET /api/v1/marketplace/install-local
164
+ * → lists currently installed marketplace packages
165
+ *
166
+ * DELETE /api/v1/marketplace/install-local/:manifestId
167
+ * → removes the cached manifest. Kernel must be restarted to fully
168
+ * unload — `engine.registerApp` is additive only. We document
169
+ * this in the response message.
170
+ *
171
+ * Persistence layout:
172
+ * <cwd>/.objectstack/installed-packages/<safe-manifest-id>.json
173
+ * Each file: { packageId, versionId, manifestId, version, manifest, installedAt, installedBy }
174
+ *
175
+ * On `kernel:ready`, the plugin scans the directory and re-registers each
176
+ * cached manifest so installs survive process restarts without further
177
+ * cloud round-trips.
178
+ */
179
+
180
+ interface MarketplaceInstallLocalPluginConfig {
181
+ /** Cloud control-plane base URL. When unset, falls back to OS_CLOUD_URL
182
+ * and then to the public ObjectStack cloud so a fresh `objectstack dev`
183
+ * can install from the marketplace without configuration. Set
184
+ * OS_CLOUD_URL=off to disable (the install endpoint then returns 503). */
185
+ controlPlaneUrl?: string;
186
+ /** Override the on-disk cache directory. Defaults to
187
+ * `<cwd>/.objectstack/installed-packages`. */
188
+ storageDir?: string;
189
+ }
190
+ declare class MarketplaceInstallLocalPlugin implements Plugin$1 {
191
+ readonly name = "com.objectstack.runtime.marketplace-install-local";
192
+ readonly version = "1.0.0";
193
+ private readonly cloudUrl;
194
+ private readonly ledger;
195
+ private readonly storageDir;
196
+ private readonly credentials;
197
+ constructor(config?: MarketplaceInstallLocalPluginConfig);
198
+ init: (_ctx: PluginContext$1) => Promise<void>;
199
+ start: (ctx: PluginContext$1) => Promise<void>;
200
+ /**
201
+ * Re-register every cached manifest with the kernel's manifest service.
202
+ * Safe to call on a kernel that already has the same manifest_id (the
203
+ * underlying ObjectQL registry overwrites by id, but we still warn so
204
+ * a developer can spot the dev-time clash between their config.ts and
205
+ * a marketplace package).
206
+ */
207
+ private rehydrate;
208
+ private handleInstall;
209
+ private handleList;
210
+ private handleUninstall;
211
+ /**
212
+ * Detect whether `manifestId` is already known to the kernel and classify
213
+ * the source so we can refuse vs upgrade gracefully.
214
+ *
215
+ * 'none' — fresh install
216
+ * 'marketplace' — previously installed by this plugin (allow upgrade)
217
+ * 'user-code' — defined by AppPlugin from objectstack.config.ts
218
+ * (refuse to avoid silently overwriting authored code)
219
+ */
220
+ private findConflict;
221
+ /**
222
+ * Pull a userId out of the request's better-auth session, if any.
223
+ * Returns null when there is no signed-in user. v1 does not check
224
+ * admin role — UI gating + the auth requirement is sufficient for
225
+ * dev / single-tenant runtimes. Stricter checks can be layered on
226
+ * via a middleware in cloud-hosted multi-tenant deployments.
227
+ */
228
+ /**
229
+ * POST /api/v1/marketplace/install-local/:manifestId/reseed-sample-data
230
+ *
231
+ * Re-runs SeedLoaderService against the cached manifest's `data` arrays.
232
+ * Idempotent (upsert by id). Useful when:
233
+ * • The user installed an app and skipped sample data
234
+ * • A purge was undone
235
+ * • The user wants a clean baseline back after editing demo rows
236
+ *
237
+ * Multi-tenant: requires an active organization on the session (same
238
+ * rule as install seed path).
239
+ */
240
+ private handleReseed;
241
+ /**
242
+ * POST /api/v1/marketplace/install-local/:manifestId/purge-sample-data
243
+ *
244
+ * Deletes every record whose id is declared in the cached manifest's
245
+ * seed datasets. Uses the `driver` service directly to bypass ACL /
246
+ * lifecycle hooks (same pattern as cloud purge). User-created records
247
+ * are never touched — only ids declared in the package's bundled
248
+ * datasets are removed. Already-deleted rows count as `skipped`.
249
+ */
250
+ private handlePurge;
251
+ /**
252
+ * Replicate the start-time side-effects that AppPlugin runs for
253
+ * statically-declared apps but the `manifest` service does NOT:
254
+ *
255
+ * 1. Load `manifest.translations` (array of `Record<locale, data>`)
256
+ * into the i18n service — auto-creating an in-memory fallback if
257
+ * none is registered, matching AppPlugin's behaviour.
258
+ *
259
+ * 2. Merge `manifest.data` (an array of seed datasets) into the
260
+ * kernel's `seed-datasets` service so SecurityPlugin's per-org
261
+ * replay middleware picks them up on every future
262
+ * sys_organization insert.
263
+ *
264
+ * 3. When `seedNow=true`, also run the seed immediately so the user
265
+ * sees demo data without having to create a new org:
266
+ * • single-tenant: run SeedLoaderService inline (mirrors
267
+ * AppPlugin single-tenant branch)
268
+ * • multi-tenant: invoke `seed-replayer` for the caller's
269
+ * active org (resolved from the request session)
270
+ *
271
+ * Errors are logged but never thrown — install succeeds even if
272
+ * post-register side-effects partially fail (the manifest itself is
273
+ * already registered + cached). Returns a small summary for the
274
+ * response envelope.
275
+ */
276
+ private applySideEffects;
277
+ /**
278
+ * Best-effort active-org resolution. Reads the better-auth session
279
+ * (same path as requireAuthenticatedUser) and returns
280
+ * `session.activeOrganizationId`, falling back to the user's first
281
+ * org membership.
282
+ */
283
+ private resolveActiveOrgId;
284
+ private requireAuthenticatedUser;
285
+ private readAll;
286
+ }
287
+
288
+ /** One installed-package entry — desired state + provenance. */
289
+ interface InstalledManifestEntry {
290
+ packageId: string;
291
+ versionId: string;
292
+ manifestId: string;
293
+ version: string;
294
+ manifest: any;
295
+ installedAt: string;
296
+ installedBy: string | null;
297
+ /** Whether the bundled seed datasets have been loaded into the kernel
298
+ * database. True after install (seedNow=true) or an explicit reseed;
299
+ * false after a purge. Persisted so the UI can show "Add" vs "Re-seed". */
300
+ withSampleData?: boolean;
301
+ }
302
+ /** Default ledger location, relative to the runtime's working directory. */
303
+ declare const DEFAULT_INSTALLED_PACKAGES_DIR = ".objectstack/installed-packages";
304
+ declare class LocalManifestSource {
305
+ /** Resolved ledger directory. */
306
+ readonly dir: string;
307
+ constructor(storageDir?: string);
308
+ /** Every valid entry in the ledger (corrupt files are skipped). */
309
+ list(): InstalledManifestEntry[];
310
+ /** Read one entry; null when absent or unreadable. */
311
+ read(manifestId: string): InstalledManifestEntry | null;
312
+ /** Whether the ledger holds an entry for this manifest id. */
313
+ has(manifestId: string): boolean;
314
+ /** Create or replace an entry (upsert by manifestId). */
315
+ write(entry: InstalledManifestEntry): void;
316
+ /** Remove an entry. Returns false when it was not present. */
317
+ remove(manifestId: string): boolean;
318
+ private fileFor;
319
+ }
320
+
321
+ /**
322
+ * CloudConnectionPlugin — the runtime-side client surface for a cloud
323
+ * control plane (ADR-0008 Phase 1).
324
+ *
325
+ * Mounts the same-origin `/api/v1/cloud-connection/*` routes the Console
326
+ * marketplace depends on:
327
+ *
328
+ * GET /api/v1/cloud-connection/status — is this env bound to a cloud account?
329
+ * POST /api/v1/cloud-connection/bind/start — begin an RFC 8628 device-code bind
330
+ * POST /api/v1/cloud-connection/bind/poll — poll device token + persist the binding
331
+ * POST /api/v1/cloud-connection/install — install a package via the control plane
332
+ * GET /api/v1/cloud-connection/installation — single-package installed-state probe
333
+ * GET /api/v1/cloud-connection/installed — env's full installed list (Installed view)
334
+ * GET /api/v1/cloud-connection/org-packages — owning org's own catalog ("Your organization")
335
+ *
336
+ * History: these routes started as app-level wiring in
337
+ * `apps/objectos/cloud-runtime-plugins.ts` (two ad-hoc plugins). ADR-0008
338
+ * Phase 1 consolidates them here as ONE plugin so both deployment shapes —
339
+ * `apps/objectos` (multi-tenant) and `apps/objectos-ee` (single-environment)
340
+ * — wire the same canonical implementation. ADR-0008 Phase 2 moves this
341
+ * surface into the open `@objectstack/cloud-connection` package; keep this
342
+ * file dependency-light (structural Plugin types, no @objectstack/core) so
343
+ * the move is mechanical.
344
+ *
345
+ * ## Environment & session resolution — two modes
346
+ *
347
+ * Multi-tenant (default): the request hostname is resolved to an environment
348
+ * via the host kernel's `env-registry` service, and the caller's session is
349
+ * validated against that environment's OWN per-env kernel (via
350
+ * `kernel-manager`) — auth is per-environment (ADR-0006).
351
+ *
352
+ * Single-environment (`singleEnvironment: true`, e.g. objectos-ee): there is
353
+ * no registry/manager; the environment id comes from config
354
+ * (`environmentId` / `OS_ENVIRONMENT_ID`, typically assigned when the
355
+ * runtime is bound to a control plane) and sessions are validated against
356
+ * the host kernel's own `auth` service. Routes degrade gracefully when the
357
+ * id is not (yet) configured: status reports `bound:false`; the others 404.
358
+ *
359
+ * ## Why a same-origin proxy at all
360
+ *
361
+ * The SPA cannot call the control plane from a tenant subdomain — that is a
362
+ * cross-origin, cross-site-cookie request the browser blocks. So the runtime
363
+ * answers on its own origin, authorizes against the environment's session,
364
+ * and talks to the control plane server-to-server (env→cloud service
365
+ * credential today; the device-code-bound `sys_cloud_connection` token for
366
+ * self-hosted runtimes).
367
+ */
368
+ interface PluginContext {
369
+ hook(event: string, handler: (...args: any[]) => any): void;
370
+ getService<T = any>(name: string): T;
371
+ logger?: {
372
+ info?: (msg: string) => void;
373
+ warn?: (msg: string) => void;
374
+ error?: (msg: string, err?: unknown) => void;
375
+ };
376
+ }
377
+ interface Plugin {
378
+ readonly name: string;
379
+ readonly version: string;
380
+ init(ctx: PluginContext): Promise<void>;
381
+ start(ctx: PluginContext): Promise<void>;
382
+ }
383
+ interface CloudConnectionPluginConfig {
384
+ /** Control-plane base URL. Default: `OS_CLOUD_URL` (read lazily at kernel:ready). */
385
+ controlPlaneUrl?: string;
386
+ /** env→cloud service credential. Default: `OS_CLOUD_API_KEY`. */
387
+ controlPlaneApiKey?: string;
388
+ /** OAuth device-flow client id. Default: `OS_CLI_CLIENT_ID` → `objectstack-cli`. */
389
+ deviceClientId?: string;
390
+ /**
391
+ * Fixed environment id (single-environment runtimes). Default:
392
+ * `OS_ENVIRONMENT_ID`. In multi-tenant mode leave unset — the id is
393
+ * resolved per-request from the hostname via `env-registry`.
394
+ */
395
+ environmentId?: string;
396
+ /**
397
+ * Single-environment mode (objectos-ee shipped shape): skip the
398
+ * env-registry/kernel-manager lookups and validate sessions against the
399
+ * host kernel's own `auth` service.
400
+ */
401
+ singleEnvironment?: boolean;
402
+ /**
403
+ * Override the on-disk credential store location. Defaults to
404
+ * `<cwd>/.objectstack/cloud-connection.json` — where the bind flow
405
+ * persists the `oscc_…` runtime bearer for self-hosted runtimes.
406
+ */
407
+ credentialPath?: string;
408
+ }
409
+ declare class CloudConnectionPlugin implements Plugin {
410
+ readonly name = "com.objectstack.cloud.connection";
411
+ readonly version = "0.3.0";
412
+ private readonly cfg;
413
+ private readonly store;
414
+ constructor(config?: CloudConnectionPluginConfig);
415
+ init: (_ctx: PluginContext) => Promise<void>;
416
+ start: (ctx: PluginContext) => Promise<void>;
417
+ }
418
+ /** Factory mirroring the package's other plugins' construction style. */
419
+ declare function createCloudConnectionPlugin(config?: CloudConnectionPluginConfig): CloudConnectionPlugin;
420
+
421
+ /**
422
+ * RuntimeConfigPlugin
423
+ *
424
+ * Serves `GET /api/v1/runtime/config` (and the legacy alias
425
+ * `GET /api/v1/studio/runtime-config`) so the Console / Studio SPA can learn
426
+ * the upstream cloud URL and capability flags **at boot time**, instead of
427
+ * sniffing `window.location.hostname` or reading Vite-time env vars.
428
+ *
429
+ * Response shape:
430
+ *
431
+ * {
432
+ * cloudUrl: string, // base URL of the upstream cloud ('' = same origin)
433
+ * singleEnvironment: boolean,
434
+ * defaultOrgId?, defaultEnvironmentId?, // multi-tenant, per-hostname
435
+ * features: { installLocal, marketplace, aiStudio, autoPublishAiBuilds },
436
+ * branding: { productName, productShortName }
437
+ * }
438
+ *
439
+ * ## Policy seam (ADR-0008 / open-mechanism-closed-intelligence)
440
+ *
441
+ * Which features a *plan* unlocks is distribution policy, not mechanism — it
442
+ * intentionally does NOT live in this open package. Hosts inject it via
443
+ * {@link RuntimeConfigPluginConfig.resolvePlanFeatures}: the cloud
444
+ * distribution passes its plan-entitlement rules there; a self-hosted or
445
+ * vanilla deployment omits it and gets static config-driven flags.
446
+ */
447
+
448
+ /** Capability flags a host's plan policy can derive per request. */
449
+ interface RuntimeConfigPlanFeatures {
450
+ /** Whether the SPA should surface AI-driven metadata authoring. */
451
+ aiStudio?: boolean;
452
+ /** Whether AI-built apps auto-publish in the author's own environment. */
453
+ autoPublishAiBuilds?: boolean;
454
+ }
455
+ interface RuntimeConfigPluginConfig {
456
+ /**
457
+ * Upstream cloud base URL. Falls back to `resolveCloudUrl()` (reads
458
+ * `OS_CLOUD_URL` / built-in default) when omitted. Pass an explicit
459
+ * empty string to declare "this runtime IS the cloud" (same-origin
460
+ * for marketplace + install).
461
+ */
462
+ controlPlaneUrl?: string;
463
+ /** Override the `features.installLocal` flag. Default: false. */
464
+ installLocal?: boolean;
465
+ /**
466
+ * Override the `features.aiStudio` flag — whether the SPA should surface
467
+ * AI-driven metadata authoring ("online development") affordances.
468
+ * Default: true (the actual authoring capability is still gated
469
+ * server-side; set false to force-hide the authoring UI).
470
+ */
471
+ aiStudio?: boolean;
472
+ /**
473
+ * Report this runtime as a single-environment deployment (CLI
474
+ * `objectstack dev` / `os serve`). Defaults to `false` for
475
+ * multi-tenant deployments.
476
+ */
477
+ singleEnvironment?: boolean;
478
+ /**
479
+ * Product name shown in browser title, splash screen, and other
480
+ * client chrome. Operators can override per-deployment (white-label,
481
+ * regional rebrands). Falls back to `OS_PRODUCT_NAME` env var, then
482
+ * to the default `'ObjectOS'`.
483
+ */
484
+ productName?: string;
485
+ /** Short product name (PWA shortName, compact spots). Defaults to productName. */
486
+ productShortName?: string;
487
+ /**
488
+ * Plan → feature policy hook. Called with `undefined` for the static
489
+ * default (no environment resolved / no plan known) and with the
490
+ * environment's plan string once hostname resolution provides one.
491
+ * Returned flags override the static config defaults; omitted keys keep
492
+ * them. When the hook itself is omitted, flags are purely config-driven.
493
+ */
494
+ resolvePlanFeatures?: (plan: string | undefined) => RuntimeConfigPlanFeatures;
495
+ }
496
+ declare class RuntimeConfigPlugin implements Plugin$1 {
497
+ readonly name = "com.objectstack.runtime.runtime-config";
498
+ readonly version = "1.0.0";
499
+ private readonly cloudUrl;
500
+ private readonly installLocal;
501
+ private readonly aiStudio;
502
+ private readonly singleEnvironment;
503
+ private readonly productName;
504
+ private readonly productShortName;
505
+ private readonly resolvePlanFeatures?;
506
+ constructor(config?: RuntimeConfigPluginConfig);
507
+ init: (_ctx: PluginContext$1) => Promise<void>;
508
+ start: (ctx: PluginContext$1) => Promise<void>;
509
+ destroy: () => Promise<void>;
510
+ }
511
+
512
+ /** Persisted binding credential + context. */
513
+ interface StoredConnectionCredential {
514
+ /** The `oscc_…` runtime bearer returned ONCE by the bind route. */
515
+ runtimeToken: string;
516
+ /**
517
+ * Cloud-minted durable runtime identity (ADR runtime-identity-binding).
518
+ * Presented as a claim on re-bind so the registration survives token
519
+ * rotation. Absent on stores written before v2.
520
+ */
521
+ runtimeId?: string;
522
+ /**
523
+ * Control-plane environment id — set only when the binding targeted a
524
+ * cloud-hosted environment. Self-hosted v2 registrations have none.
525
+ */
526
+ environmentId?: string;
527
+ /** Control-plane base URL the binding was made against. */
528
+ controlPlaneUrl?: string;
529
+ organizationId?: string;
530
+ accountEmail?: string;
531
+ boundAt?: string;
532
+ }
533
+ /** Default store location, relative to the runtime's working directory. */
534
+ declare const DEFAULT_CONNECTION_CREDENTIAL_PATH = ".objectstack/cloud-connection.json";
535
+ declare class ConnectionCredentialStore {
536
+ /** Resolved file path. */
537
+ readonly path: string;
538
+ constructor(path?: string);
539
+ /**
540
+ * Read the stored credential; null when absent or unreadable.
541
+ *
542
+ * An IDENTITY RESIDUAL — `runtimeToken: ''` with a `runtimeId` — is a
543
+ * valid record: unbind leaves one behind so a later re-bind to the same
544
+ * org claims the same registration (ADR runtime-identity-binding §2.1).
545
+ * Callers already treat the empty token as "no credential".
546
+ */
547
+ read(): StoredConnectionCredential | null;
548
+ /** Persist (replace) the credential. Written 0600 — it is a secret. */
549
+ write(credential: StoredConnectionCredential): void;
550
+ /** Remove the credential (unbind). Returns false when nothing was stored. */
551
+ clear(): boolean;
552
+ }
553
+
554
+ /** Setup page hosting the binding panel widget. */
555
+ declare const CloudConnectionSettingsPage: Page;
556
+ /** Manifest bundle the plugin registers so the page + nav reach the kernel. */
557
+ declare const CLOUD_CONNECTION_UI_BUNDLE: {
558
+ id: string;
559
+ namespace: string;
560
+ version: string;
561
+ type: string;
562
+ scope: string;
563
+ name: string;
564
+ description: string;
565
+ pages: {
566
+ name: string;
567
+ label: string;
568
+ type: "app" | "record" | "dashboard" | "grid" | "form" | "utility" | "kanban" | "gallery" | "calendar" | "timeline" | "list" | "home" | "record_detail" | "record_review" | "overview" | "blank";
569
+ template: string;
570
+ regions: {
571
+ name: string;
572
+ components: {
573
+ type: string;
574
+ properties: Record<string, unknown>;
575
+ id?: string | undefined;
576
+ label?: string | undefined;
577
+ events?: Record<string, string> | undefined;
578
+ style?: Record<string, string> | undefined;
579
+ className?: string | undefined;
580
+ visibility?: {
581
+ dialect: "cel" | "js" | "cron" | "template";
582
+ source?: string | undefined;
583
+ ast?: unknown;
584
+ meta?: {
585
+ rationale?: string | undefined;
586
+ generatedBy?: string | undefined;
587
+ } | undefined;
588
+ } | {
589
+ dialect: "template" | "cel" | "js" | "cron";
590
+ source?: string | undefined;
591
+ ast?: unknown;
592
+ meta?: {
593
+ rationale?: string | undefined;
594
+ generatedBy?: string | undefined;
595
+ } | undefined;
596
+ } | undefined;
597
+ dataSource?: {
598
+ object: string;
599
+ view?: string | undefined;
600
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
601
+ sort?: {
602
+ field: string;
603
+ order: "asc" | "desc";
604
+ }[] | undefined;
605
+ limit?: number | undefined;
606
+ } | undefined;
607
+ responsive?: {
608
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
609
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
610
+ columns?: {
611
+ xs?: number | undefined;
612
+ sm?: number | undefined;
613
+ md?: number | undefined;
614
+ lg?: number | undefined;
615
+ xl?: number | undefined;
616
+ '2xl'?: number | undefined;
617
+ } | undefined;
618
+ order?: {
619
+ xs?: number | undefined;
620
+ sm?: number | undefined;
621
+ md?: number | undefined;
622
+ lg?: number | undefined;
623
+ xl?: number | undefined;
624
+ '2xl'?: number | undefined;
625
+ } | undefined;
626
+ } | undefined;
627
+ aria?: {
628
+ ariaLabel?: string | undefined;
629
+ ariaDescribedBy?: string | undefined;
630
+ role?: string | undefined;
631
+ } | undefined;
632
+ }[];
633
+ width?: "full" | "large" | "small" | "medium" | undefined;
634
+ }[];
635
+ isDefault: boolean;
636
+ kind: "full" | "slotted";
637
+ description?: string | undefined;
638
+ icon?: string | undefined;
639
+ variables?: {
640
+ name: string;
641
+ type: "string" | "number" | "boolean" | "object" | "array" | "record_id";
642
+ defaultValue?: unknown;
643
+ source?: string | undefined;
644
+ }[] | undefined;
645
+ object?: string | undefined;
646
+ recordReview?: {
647
+ object: string;
648
+ actions: {
649
+ label: string;
650
+ type: "custom" | "approve" | "reject" | "skip";
651
+ nextRecord: boolean;
652
+ field?: string | undefined;
653
+ value?: string | number | boolean | undefined;
654
+ }[];
655
+ navigation: "sequential" | "random" | "filtered";
656
+ showProgress: boolean;
657
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
658
+ sort?: {
659
+ field: string;
660
+ order: "asc" | "desc";
661
+ }[] | undefined;
662
+ displayFields?: string[] | undefined;
663
+ } | undefined;
664
+ blankLayout?: {
665
+ columns: number;
666
+ rowHeight: number;
667
+ gap: number;
668
+ items: {
669
+ componentId: string;
670
+ x: number;
671
+ y: number;
672
+ width: number;
673
+ height: number;
674
+ }[];
675
+ } | undefined;
676
+ assignedProfiles?: string[] | undefined;
677
+ interfaceConfig?: {
678
+ source?: string | undefined;
679
+ sourceView?: string | undefined;
680
+ levels?: number | undefined;
681
+ filterBy?: {
682
+ field: string;
683
+ operator: string;
684
+ value?: string | number | boolean | (string | number)[] | null | undefined;
685
+ }[] | undefined;
686
+ appearance?: {
687
+ showDescription: boolean;
688
+ allowedVisualizations?: ("grid" | "kanban" | "gallery" | "calendar" | "timeline" | "map" | "gantt" | "chart")[] | undefined;
689
+ } | undefined;
690
+ userFilters?: {
691
+ element: "tabs" | "toggle" | "dropdown";
692
+ fields?: {
693
+ field: string;
694
+ label?: string | undefined;
695
+ type?: "boolean" | "text" | "select" | "multi-select" | "date-range" | undefined;
696
+ options?: {
697
+ value: string | number | boolean;
698
+ label: string;
699
+ color?: string | undefined;
700
+ }[] | undefined;
701
+ showCount?: boolean | undefined;
702
+ defaultValues?: (string | number | boolean)[] | undefined;
703
+ }[] | undefined;
704
+ tabs?: {
705
+ name: string;
706
+ pinned: boolean;
707
+ isDefault: boolean;
708
+ visible: boolean;
709
+ label?: string | undefined;
710
+ icon?: string | undefined;
711
+ view?: string | undefined;
712
+ filter?: {
713
+ field: string;
714
+ operator: string;
715
+ value?: string | number | boolean | (string | number)[] | null | undefined;
716
+ }[] | undefined;
717
+ order?: number | undefined;
718
+ }[] | undefined;
719
+ showAllRecords?: boolean | undefined;
720
+ } | undefined;
721
+ userActions?: {
722
+ sort: boolean;
723
+ search: boolean;
724
+ filter: boolean;
725
+ rowHeight: boolean;
726
+ addRecordForm: boolean;
727
+ buttons?: string[] | undefined;
728
+ } | undefined;
729
+ addRecord?: {
730
+ enabled: boolean;
731
+ position: "top" | "bottom" | "both";
732
+ mode: "inline" | "form" | "modal";
733
+ formView?: string | undefined;
734
+ } | undefined;
735
+ showRecordCount?: boolean | undefined;
736
+ allowPrinting?: boolean | undefined;
737
+ } | undefined;
738
+ aria?: {
739
+ ariaLabel?: string | undefined;
740
+ ariaDescribedBy?: string | undefined;
741
+ role?: string | undefined;
742
+ } | undefined;
743
+ slots?: {
744
+ header?: {
745
+ type: string;
746
+ properties: Record<string, unknown>;
747
+ id?: string | undefined;
748
+ label?: string | undefined;
749
+ events?: Record<string, string> | undefined;
750
+ style?: Record<string, string> | undefined;
751
+ className?: string | undefined;
752
+ visibility?: {
753
+ dialect: "cel" | "js" | "cron" | "template";
754
+ source?: string | undefined;
755
+ ast?: unknown;
756
+ meta?: {
757
+ rationale?: string | undefined;
758
+ generatedBy?: string | undefined;
759
+ } | undefined;
760
+ } | {
761
+ dialect: "template" | "cel" | "js" | "cron";
762
+ source?: string | undefined;
763
+ ast?: unknown;
764
+ meta?: {
765
+ rationale?: string | undefined;
766
+ generatedBy?: string | undefined;
767
+ } | undefined;
768
+ } | undefined;
769
+ dataSource?: {
770
+ object: string;
771
+ view?: string | undefined;
772
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
773
+ sort?: {
774
+ field: string;
775
+ order: "asc" | "desc";
776
+ }[] | undefined;
777
+ limit?: number | undefined;
778
+ } | undefined;
779
+ responsive?: {
780
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
781
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
782
+ columns?: {
783
+ xs?: number | undefined;
784
+ sm?: number | undefined;
785
+ md?: number | undefined;
786
+ lg?: number | undefined;
787
+ xl?: number | undefined;
788
+ '2xl'?: number | undefined;
789
+ } | undefined;
790
+ order?: {
791
+ xs?: number | undefined;
792
+ sm?: number | undefined;
793
+ md?: number | undefined;
794
+ lg?: number | undefined;
795
+ xl?: number | undefined;
796
+ '2xl'?: number | undefined;
797
+ } | undefined;
798
+ } | undefined;
799
+ aria?: {
800
+ ariaLabel?: string | undefined;
801
+ ariaDescribedBy?: string | undefined;
802
+ role?: string | undefined;
803
+ } | undefined;
804
+ } | {
805
+ type: string;
806
+ properties: Record<string, unknown>;
807
+ id?: string | undefined;
808
+ label?: string | undefined;
809
+ events?: Record<string, string> | undefined;
810
+ style?: Record<string, string> | undefined;
811
+ className?: string | undefined;
812
+ visibility?: {
813
+ dialect: "cel" | "js" | "cron" | "template";
814
+ source?: string | undefined;
815
+ ast?: unknown;
816
+ meta?: {
817
+ rationale?: string | undefined;
818
+ generatedBy?: string | undefined;
819
+ } | undefined;
820
+ } | {
821
+ dialect: "template" | "cel" | "js" | "cron";
822
+ source?: string | undefined;
823
+ ast?: unknown;
824
+ meta?: {
825
+ rationale?: string | undefined;
826
+ generatedBy?: string | undefined;
827
+ } | undefined;
828
+ } | undefined;
829
+ dataSource?: {
830
+ object: string;
831
+ view?: string | undefined;
832
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
833
+ sort?: {
834
+ field: string;
835
+ order: "asc" | "desc";
836
+ }[] | undefined;
837
+ limit?: number | undefined;
838
+ } | undefined;
839
+ responsive?: {
840
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
841
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
842
+ columns?: {
843
+ xs?: number | undefined;
844
+ sm?: number | undefined;
845
+ md?: number | undefined;
846
+ lg?: number | undefined;
847
+ xl?: number | undefined;
848
+ '2xl'?: number | undefined;
849
+ } | undefined;
850
+ order?: {
851
+ xs?: number | undefined;
852
+ sm?: number | undefined;
853
+ md?: number | undefined;
854
+ lg?: number | undefined;
855
+ xl?: number | undefined;
856
+ '2xl'?: number | undefined;
857
+ } | undefined;
858
+ } | undefined;
859
+ aria?: {
860
+ ariaLabel?: string | undefined;
861
+ ariaDescribedBy?: string | undefined;
862
+ role?: string | undefined;
863
+ } | undefined;
864
+ }[] | undefined;
865
+ actions?: {
866
+ type: string;
867
+ properties: Record<string, unknown>;
868
+ id?: string | undefined;
869
+ label?: string | undefined;
870
+ events?: Record<string, string> | undefined;
871
+ style?: Record<string, string> | undefined;
872
+ className?: string | undefined;
873
+ visibility?: {
874
+ dialect: "cel" | "js" | "cron" | "template";
875
+ source?: string | undefined;
876
+ ast?: unknown;
877
+ meta?: {
878
+ rationale?: string | undefined;
879
+ generatedBy?: string | undefined;
880
+ } | undefined;
881
+ } | {
882
+ dialect: "template" | "cel" | "js" | "cron";
883
+ source?: string | undefined;
884
+ ast?: unknown;
885
+ meta?: {
886
+ rationale?: string | undefined;
887
+ generatedBy?: string | undefined;
888
+ } | undefined;
889
+ } | undefined;
890
+ dataSource?: {
891
+ object: string;
892
+ view?: string | undefined;
893
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
894
+ sort?: {
895
+ field: string;
896
+ order: "asc" | "desc";
897
+ }[] | undefined;
898
+ limit?: number | undefined;
899
+ } | undefined;
900
+ responsive?: {
901
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
902
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
903
+ columns?: {
904
+ xs?: number | undefined;
905
+ sm?: number | undefined;
906
+ md?: number | undefined;
907
+ lg?: number | undefined;
908
+ xl?: number | undefined;
909
+ '2xl'?: number | undefined;
910
+ } | undefined;
911
+ order?: {
912
+ xs?: number | undefined;
913
+ sm?: number | undefined;
914
+ md?: number | undefined;
915
+ lg?: number | undefined;
916
+ xl?: number | undefined;
917
+ '2xl'?: number | undefined;
918
+ } | undefined;
919
+ } | undefined;
920
+ aria?: {
921
+ ariaLabel?: string | undefined;
922
+ ariaDescribedBy?: string | undefined;
923
+ role?: string | undefined;
924
+ } | undefined;
925
+ } | {
926
+ type: string;
927
+ properties: Record<string, unknown>;
928
+ id?: string | undefined;
929
+ label?: string | undefined;
930
+ events?: Record<string, string> | undefined;
931
+ style?: Record<string, string> | undefined;
932
+ className?: string | undefined;
933
+ visibility?: {
934
+ dialect: "cel" | "js" | "cron" | "template";
935
+ source?: string | undefined;
936
+ ast?: unknown;
937
+ meta?: {
938
+ rationale?: string | undefined;
939
+ generatedBy?: string | undefined;
940
+ } | undefined;
941
+ } | {
942
+ dialect: "template" | "cel" | "js" | "cron";
943
+ source?: string | undefined;
944
+ ast?: unknown;
945
+ meta?: {
946
+ rationale?: string | undefined;
947
+ generatedBy?: string | undefined;
948
+ } | undefined;
949
+ } | undefined;
950
+ dataSource?: {
951
+ object: string;
952
+ view?: string | undefined;
953
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
954
+ sort?: {
955
+ field: string;
956
+ order: "asc" | "desc";
957
+ }[] | undefined;
958
+ limit?: number | undefined;
959
+ } | undefined;
960
+ responsive?: {
961
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
962
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
963
+ columns?: {
964
+ xs?: number | undefined;
965
+ sm?: number | undefined;
966
+ md?: number | undefined;
967
+ lg?: number | undefined;
968
+ xl?: number | undefined;
969
+ '2xl'?: number | undefined;
970
+ } | undefined;
971
+ order?: {
972
+ xs?: number | undefined;
973
+ sm?: number | undefined;
974
+ md?: number | undefined;
975
+ lg?: number | undefined;
976
+ xl?: number | undefined;
977
+ '2xl'?: number | undefined;
978
+ } | undefined;
979
+ } | undefined;
980
+ aria?: {
981
+ ariaLabel?: string | undefined;
982
+ ariaDescribedBy?: string | undefined;
983
+ role?: string | undefined;
984
+ } | undefined;
985
+ }[] | undefined;
986
+ alerts?: {
987
+ type: string;
988
+ properties: Record<string, unknown>;
989
+ id?: string | undefined;
990
+ label?: string | undefined;
991
+ events?: Record<string, string> | undefined;
992
+ style?: Record<string, string> | undefined;
993
+ className?: string | undefined;
994
+ visibility?: {
995
+ dialect: "cel" | "js" | "cron" | "template";
996
+ source?: string | undefined;
997
+ ast?: unknown;
998
+ meta?: {
999
+ rationale?: string | undefined;
1000
+ generatedBy?: string | undefined;
1001
+ } | undefined;
1002
+ } | {
1003
+ dialect: "template" | "cel" | "js" | "cron";
1004
+ source?: string | undefined;
1005
+ ast?: unknown;
1006
+ meta?: {
1007
+ rationale?: string | undefined;
1008
+ generatedBy?: string | undefined;
1009
+ } | undefined;
1010
+ } | undefined;
1011
+ dataSource?: {
1012
+ object: string;
1013
+ view?: string | undefined;
1014
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1015
+ sort?: {
1016
+ field: string;
1017
+ order: "asc" | "desc";
1018
+ }[] | undefined;
1019
+ limit?: number | undefined;
1020
+ } | undefined;
1021
+ responsive?: {
1022
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1023
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1024
+ columns?: {
1025
+ xs?: number | undefined;
1026
+ sm?: number | undefined;
1027
+ md?: number | undefined;
1028
+ lg?: number | undefined;
1029
+ xl?: number | undefined;
1030
+ '2xl'?: number | undefined;
1031
+ } | undefined;
1032
+ order?: {
1033
+ xs?: number | undefined;
1034
+ sm?: number | undefined;
1035
+ md?: number | undefined;
1036
+ lg?: number | undefined;
1037
+ xl?: number | undefined;
1038
+ '2xl'?: number | undefined;
1039
+ } | undefined;
1040
+ } | undefined;
1041
+ aria?: {
1042
+ ariaLabel?: string | undefined;
1043
+ ariaDescribedBy?: string | undefined;
1044
+ role?: string | undefined;
1045
+ } | undefined;
1046
+ } | {
1047
+ type: string;
1048
+ properties: Record<string, unknown>;
1049
+ id?: string | undefined;
1050
+ label?: string | undefined;
1051
+ events?: Record<string, string> | undefined;
1052
+ style?: Record<string, string> | undefined;
1053
+ className?: string | undefined;
1054
+ visibility?: {
1055
+ dialect: "cel" | "js" | "cron" | "template";
1056
+ source?: string | undefined;
1057
+ ast?: unknown;
1058
+ meta?: {
1059
+ rationale?: string | undefined;
1060
+ generatedBy?: string | undefined;
1061
+ } | undefined;
1062
+ } | {
1063
+ dialect: "template" | "cel" | "js" | "cron";
1064
+ source?: string | undefined;
1065
+ ast?: unknown;
1066
+ meta?: {
1067
+ rationale?: string | undefined;
1068
+ generatedBy?: string | undefined;
1069
+ } | undefined;
1070
+ } | undefined;
1071
+ dataSource?: {
1072
+ object: string;
1073
+ view?: string | undefined;
1074
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1075
+ sort?: {
1076
+ field: string;
1077
+ order: "asc" | "desc";
1078
+ }[] | undefined;
1079
+ limit?: number | undefined;
1080
+ } | undefined;
1081
+ responsive?: {
1082
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1083
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1084
+ columns?: {
1085
+ xs?: number | undefined;
1086
+ sm?: number | undefined;
1087
+ md?: number | undefined;
1088
+ lg?: number | undefined;
1089
+ xl?: number | undefined;
1090
+ '2xl'?: number | undefined;
1091
+ } | undefined;
1092
+ order?: {
1093
+ xs?: number | undefined;
1094
+ sm?: number | undefined;
1095
+ md?: number | undefined;
1096
+ lg?: number | undefined;
1097
+ xl?: number | undefined;
1098
+ '2xl'?: number | undefined;
1099
+ } | undefined;
1100
+ } | undefined;
1101
+ aria?: {
1102
+ ariaLabel?: string | undefined;
1103
+ ariaDescribedBy?: string | undefined;
1104
+ role?: string | undefined;
1105
+ } | undefined;
1106
+ }[] | undefined;
1107
+ highlights?: {
1108
+ type: string;
1109
+ properties: Record<string, unknown>;
1110
+ id?: string | undefined;
1111
+ label?: string | undefined;
1112
+ events?: Record<string, string> | undefined;
1113
+ style?: Record<string, string> | undefined;
1114
+ className?: string | undefined;
1115
+ visibility?: {
1116
+ dialect: "cel" | "js" | "cron" | "template";
1117
+ source?: string | undefined;
1118
+ ast?: unknown;
1119
+ meta?: {
1120
+ rationale?: string | undefined;
1121
+ generatedBy?: string | undefined;
1122
+ } | undefined;
1123
+ } | {
1124
+ dialect: "template" | "cel" | "js" | "cron";
1125
+ source?: string | undefined;
1126
+ ast?: unknown;
1127
+ meta?: {
1128
+ rationale?: string | undefined;
1129
+ generatedBy?: string | undefined;
1130
+ } | undefined;
1131
+ } | undefined;
1132
+ dataSource?: {
1133
+ object: string;
1134
+ view?: string | undefined;
1135
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1136
+ sort?: {
1137
+ field: string;
1138
+ order: "asc" | "desc";
1139
+ }[] | undefined;
1140
+ limit?: number | undefined;
1141
+ } | undefined;
1142
+ responsive?: {
1143
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1144
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1145
+ columns?: {
1146
+ xs?: number | undefined;
1147
+ sm?: number | undefined;
1148
+ md?: number | undefined;
1149
+ lg?: number | undefined;
1150
+ xl?: number | undefined;
1151
+ '2xl'?: number | undefined;
1152
+ } | undefined;
1153
+ order?: {
1154
+ xs?: number | undefined;
1155
+ sm?: number | undefined;
1156
+ md?: number | undefined;
1157
+ lg?: number | undefined;
1158
+ xl?: number | undefined;
1159
+ '2xl'?: number | undefined;
1160
+ } | undefined;
1161
+ } | undefined;
1162
+ aria?: {
1163
+ ariaLabel?: string | undefined;
1164
+ ariaDescribedBy?: string | undefined;
1165
+ role?: string | undefined;
1166
+ } | undefined;
1167
+ } | {
1168
+ type: string;
1169
+ properties: Record<string, unknown>;
1170
+ id?: string | undefined;
1171
+ label?: string | undefined;
1172
+ events?: Record<string, string> | undefined;
1173
+ style?: Record<string, string> | undefined;
1174
+ className?: string | undefined;
1175
+ visibility?: {
1176
+ dialect: "cel" | "js" | "cron" | "template";
1177
+ source?: string | undefined;
1178
+ ast?: unknown;
1179
+ meta?: {
1180
+ rationale?: string | undefined;
1181
+ generatedBy?: string | undefined;
1182
+ } | undefined;
1183
+ } | {
1184
+ dialect: "template" | "cel" | "js" | "cron";
1185
+ source?: string | undefined;
1186
+ ast?: unknown;
1187
+ meta?: {
1188
+ rationale?: string | undefined;
1189
+ generatedBy?: string | undefined;
1190
+ } | undefined;
1191
+ } | undefined;
1192
+ dataSource?: {
1193
+ object: string;
1194
+ view?: string | undefined;
1195
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1196
+ sort?: {
1197
+ field: string;
1198
+ order: "asc" | "desc";
1199
+ }[] | undefined;
1200
+ limit?: number | undefined;
1201
+ } | undefined;
1202
+ responsive?: {
1203
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1204
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1205
+ columns?: {
1206
+ xs?: number | undefined;
1207
+ sm?: number | undefined;
1208
+ md?: number | undefined;
1209
+ lg?: number | undefined;
1210
+ xl?: number | undefined;
1211
+ '2xl'?: number | undefined;
1212
+ } | undefined;
1213
+ order?: {
1214
+ xs?: number | undefined;
1215
+ sm?: number | undefined;
1216
+ md?: number | undefined;
1217
+ lg?: number | undefined;
1218
+ xl?: number | undefined;
1219
+ '2xl'?: number | undefined;
1220
+ } | undefined;
1221
+ } | undefined;
1222
+ aria?: {
1223
+ ariaLabel?: string | undefined;
1224
+ ariaDescribedBy?: string | undefined;
1225
+ role?: string | undefined;
1226
+ } | undefined;
1227
+ }[] | undefined;
1228
+ details?: {
1229
+ type: string;
1230
+ properties: Record<string, unknown>;
1231
+ id?: string | undefined;
1232
+ label?: string | undefined;
1233
+ events?: Record<string, string> | undefined;
1234
+ style?: Record<string, string> | undefined;
1235
+ className?: string | undefined;
1236
+ visibility?: {
1237
+ dialect: "cel" | "js" | "cron" | "template";
1238
+ source?: string | undefined;
1239
+ ast?: unknown;
1240
+ meta?: {
1241
+ rationale?: string | undefined;
1242
+ generatedBy?: string | undefined;
1243
+ } | undefined;
1244
+ } | {
1245
+ dialect: "template" | "cel" | "js" | "cron";
1246
+ source?: string | undefined;
1247
+ ast?: unknown;
1248
+ meta?: {
1249
+ rationale?: string | undefined;
1250
+ generatedBy?: string | undefined;
1251
+ } | undefined;
1252
+ } | undefined;
1253
+ dataSource?: {
1254
+ object: string;
1255
+ view?: string | undefined;
1256
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1257
+ sort?: {
1258
+ field: string;
1259
+ order: "asc" | "desc";
1260
+ }[] | undefined;
1261
+ limit?: number | undefined;
1262
+ } | undefined;
1263
+ responsive?: {
1264
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1265
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1266
+ columns?: {
1267
+ xs?: number | undefined;
1268
+ sm?: number | undefined;
1269
+ md?: number | undefined;
1270
+ lg?: number | undefined;
1271
+ xl?: number | undefined;
1272
+ '2xl'?: number | undefined;
1273
+ } | undefined;
1274
+ order?: {
1275
+ xs?: number | undefined;
1276
+ sm?: number | undefined;
1277
+ md?: number | undefined;
1278
+ lg?: number | undefined;
1279
+ xl?: number | undefined;
1280
+ '2xl'?: number | undefined;
1281
+ } | undefined;
1282
+ } | undefined;
1283
+ aria?: {
1284
+ ariaLabel?: string | undefined;
1285
+ ariaDescribedBy?: string | undefined;
1286
+ role?: string | undefined;
1287
+ } | undefined;
1288
+ } | {
1289
+ type: string;
1290
+ properties: Record<string, unknown>;
1291
+ id?: string | undefined;
1292
+ label?: string | undefined;
1293
+ events?: Record<string, string> | undefined;
1294
+ style?: Record<string, string> | undefined;
1295
+ className?: string | undefined;
1296
+ visibility?: {
1297
+ dialect: "cel" | "js" | "cron" | "template";
1298
+ source?: string | undefined;
1299
+ ast?: unknown;
1300
+ meta?: {
1301
+ rationale?: string | undefined;
1302
+ generatedBy?: string | undefined;
1303
+ } | undefined;
1304
+ } | {
1305
+ dialect: "template" | "cel" | "js" | "cron";
1306
+ source?: string | undefined;
1307
+ ast?: unknown;
1308
+ meta?: {
1309
+ rationale?: string | undefined;
1310
+ generatedBy?: string | undefined;
1311
+ } | undefined;
1312
+ } | undefined;
1313
+ dataSource?: {
1314
+ object: string;
1315
+ view?: string | undefined;
1316
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1317
+ sort?: {
1318
+ field: string;
1319
+ order: "asc" | "desc";
1320
+ }[] | undefined;
1321
+ limit?: number | undefined;
1322
+ } | undefined;
1323
+ responsive?: {
1324
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1325
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1326
+ columns?: {
1327
+ xs?: number | undefined;
1328
+ sm?: number | undefined;
1329
+ md?: number | undefined;
1330
+ lg?: number | undefined;
1331
+ xl?: number | undefined;
1332
+ '2xl'?: number | undefined;
1333
+ } | undefined;
1334
+ order?: {
1335
+ xs?: number | undefined;
1336
+ sm?: number | undefined;
1337
+ md?: number | undefined;
1338
+ lg?: number | undefined;
1339
+ xl?: number | undefined;
1340
+ '2xl'?: number | undefined;
1341
+ } | undefined;
1342
+ } | undefined;
1343
+ aria?: {
1344
+ ariaLabel?: string | undefined;
1345
+ ariaDescribedBy?: string | undefined;
1346
+ role?: string | undefined;
1347
+ } | undefined;
1348
+ }[] | undefined;
1349
+ tabs?: {
1350
+ type: string;
1351
+ properties: Record<string, unknown>;
1352
+ id?: string | undefined;
1353
+ label?: string | undefined;
1354
+ events?: Record<string, string> | undefined;
1355
+ style?: Record<string, string> | undefined;
1356
+ className?: string | undefined;
1357
+ visibility?: {
1358
+ dialect: "cel" | "js" | "cron" | "template";
1359
+ source?: string | undefined;
1360
+ ast?: unknown;
1361
+ meta?: {
1362
+ rationale?: string | undefined;
1363
+ generatedBy?: string | undefined;
1364
+ } | undefined;
1365
+ } | {
1366
+ dialect: "template" | "cel" | "js" | "cron";
1367
+ source?: string | undefined;
1368
+ ast?: unknown;
1369
+ meta?: {
1370
+ rationale?: string | undefined;
1371
+ generatedBy?: string | undefined;
1372
+ } | undefined;
1373
+ } | undefined;
1374
+ dataSource?: {
1375
+ object: string;
1376
+ view?: string | undefined;
1377
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1378
+ sort?: {
1379
+ field: string;
1380
+ order: "asc" | "desc";
1381
+ }[] | undefined;
1382
+ limit?: number | undefined;
1383
+ } | undefined;
1384
+ responsive?: {
1385
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1386
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1387
+ columns?: {
1388
+ xs?: number | undefined;
1389
+ sm?: number | undefined;
1390
+ md?: number | undefined;
1391
+ lg?: number | undefined;
1392
+ xl?: number | undefined;
1393
+ '2xl'?: number | undefined;
1394
+ } | undefined;
1395
+ order?: {
1396
+ xs?: number | undefined;
1397
+ sm?: number | undefined;
1398
+ md?: number | undefined;
1399
+ lg?: number | undefined;
1400
+ xl?: number | undefined;
1401
+ '2xl'?: number | undefined;
1402
+ } | undefined;
1403
+ } | undefined;
1404
+ aria?: {
1405
+ ariaLabel?: string | undefined;
1406
+ ariaDescribedBy?: string | undefined;
1407
+ role?: string | undefined;
1408
+ } | undefined;
1409
+ } | {
1410
+ type: string;
1411
+ properties: Record<string, unknown>;
1412
+ id?: string | undefined;
1413
+ label?: string | undefined;
1414
+ events?: Record<string, string> | undefined;
1415
+ style?: Record<string, string> | undefined;
1416
+ className?: string | undefined;
1417
+ visibility?: {
1418
+ dialect: "cel" | "js" | "cron" | "template";
1419
+ source?: string | undefined;
1420
+ ast?: unknown;
1421
+ meta?: {
1422
+ rationale?: string | undefined;
1423
+ generatedBy?: string | undefined;
1424
+ } | undefined;
1425
+ } | {
1426
+ dialect: "template" | "cel" | "js" | "cron";
1427
+ source?: string | undefined;
1428
+ ast?: unknown;
1429
+ meta?: {
1430
+ rationale?: string | undefined;
1431
+ generatedBy?: string | undefined;
1432
+ } | undefined;
1433
+ } | undefined;
1434
+ dataSource?: {
1435
+ object: string;
1436
+ view?: string | undefined;
1437
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1438
+ sort?: {
1439
+ field: string;
1440
+ order: "asc" | "desc";
1441
+ }[] | undefined;
1442
+ limit?: number | undefined;
1443
+ } | undefined;
1444
+ responsive?: {
1445
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1446
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1447
+ columns?: {
1448
+ xs?: number | undefined;
1449
+ sm?: number | undefined;
1450
+ md?: number | undefined;
1451
+ lg?: number | undefined;
1452
+ xl?: number | undefined;
1453
+ '2xl'?: number | undefined;
1454
+ } | undefined;
1455
+ order?: {
1456
+ xs?: number | undefined;
1457
+ sm?: number | undefined;
1458
+ md?: number | undefined;
1459
+ lg?: number | undefined;
1460
+ xl?: number | undefined;
1461
+ '2xl'?: number | undefined;
1462
+ } | undefined;
1463
+ } | undefined;
1464
+ aria?: {
1465
+ ariaLabel?: string | undefined;
1466
+ ariaDescribedBy?: string | undefined;
1467
+ role?: string | undefined;
1468
+ } | undefined;
1469
+ }[] | undefined;
1470
+ discussion?: {
1471
+ type: string;
1472
+ properties: Record<string, unknown>;
1473
+ id?: string | undefined;
1474
+ label?: string | undefined;
1475
+ events?: Record<string, string> | undefined;
1476
+ style?: Record<string, string> | undefined;
1477
+ className?: string | undefined;
1478
+ visibility?: {
1479
+ dialect: "cel" | "js" | "cron" | "template";
1480
+ source?: string | undefined;
1481
+ ast?: unknown;
1482
+ meta?: {
1483
+ rationale?: string | undefined;
1484
+ generatedBy?: string | undefined;
1485
+ } | undefined;
1486
+ } | {
1487
+ dialect: "template" | "cel" | "js" | "cron";
1488
+ source?: string | undefined;
1489
+ ast?: unknown;
1490
+ meta?: {
1491
+ rationale?: string | undefined;
1492
+ generatedBy?: string | undefined;
1493
+ } | undefined;
1494
+ } | undefined;
1495
+ dataSource?: {
1496
+ object: string;
1497
+ view?: string | undefined;
1498
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1499
+ sort?: {
1500
+ field: string;
1501
+ order: "asc" | "desc";
1502
+ }[] | undefined;
1503
+ limit?: number | undefined;
1504
+ } | undefined;
1505
+ responsive?: {
1506
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1507
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1508
+ columns?: {
1509
+ xs?: number | undefined;
1510
+ sm?: number | undefined;
1511
+ md?: number | undefined;
1512
+ lg?: number | undefined;
1513
+ xl?: number | undefined;
1514
+ '2xl'?: number | undefined;
1515
+ } | undefined;
1516
+ order?: {
1517
+ xs?: number | undefined;
1518
+ sm?: number | undefined;
1519
+ md?: number | undefined;
1520
+ lg?: number | undefined;
1521
+ xl?: number | undefined;
1522
+ '2xl'?: number | undefined;
1523
+ } | undefined;
1524
+ } | undefined;
1525
+ aria?: {
1526
+ ariaLabel?: string | undefined;
1527
+ ariaDescribedBy?: string | undefined;
1528
+ role?: string | undefined;
1529
+ } | undefined;
1530
+ } | {
1531
+ type: string;
1532
+ properties: Record<string, unknown>;
1533
+ id?: string | undefined;
1534
+ label?: string | undefined;
1535
+ events?: Record<string, string> | undefined;
1536
+ style?: Record<string, string> | undefined;
1537
+ className?: string | undefined;
1538
+ visibility?: {
1539
+ dialect: "cel" | "js" | "cron" | "template";
1540
+ source?: string | undefined;
1541
+ ast?: unknown;
1542
+ meta?: {
1543
+ rationale?: string | undefined;
1544
+ generatedBy?: string | undefined;
1545
+ } | undefined;
1546
+ } | {
1547
+ dialect: "template" | "cel" | "js" | "cron";
1548
+ source?: string | undefined;
1549
+ ast?: unknown;
1550
+ meta?: {
1551
+ rationale?: string | undefined;
1552
+ generatedBy?: string | undefined;
1553
+ } | undefined;
1554
+ } | undefined;
1555
+ dataSource?: {
1556
+ object: string;
1557
+ view?: string | undefined;
1558
+ filter?: _objectstack_spec_data.FilterCondition | undefined;
1559
+ sort?: {
1560
+ field: string;
1561
+ order: "asc" | "desc";
1562
+ }[] | undefined;
1563
+ limit?: number | undefined;
1564
+ } | undefined;
1565
+ responsive?: {
1566
+ breakpoint?: "md" | "xs" | "sm" | "lg" | "xl" | "2xl" | undefined;
1567
+ hiddenOn?: ("md" | "xs" | "sm" | "lg" | "xl" | "2xl")[] | undefined;
1568
+ columns?: {
1569
+ xs?: number | undefined;
1570
+ sm?: number | undefined;
1571
+ md?: number | undefined;
1572
+ lg?: number | undefined;
1573
+ xl?: number | undefined;
1574
+ '2xl'?: number | undefined;
1575
+ } | undefined;
1576
+ order?: {
1577
+ xs?: number | undefined;
1578
+ sm?: number | undefined;
1579
+ md?: number | undefined;
1580
+ lg?: number | undefined;
1581
+ xl?: number | undefined;
1582
+ '2xl'?: number | undefined;
1583
+ } | undefined;
1584
+ } | undefined;
1585
+ aria?: {
1586
+ ariaLabel?: string | undefined;
1587
+ ariaDescribedBy?: string | undefined;
1588
+ role?: string | undefined;
1589
+ } | undefined;
1590
+ }[] | undefined;
1591
+ } | undefined;
1592
+ }[];
1593
+ navigationContributions: {
1594
+ app: string;
1595
+ group: string;
1596
+ priority: number;
1597
+ items: {
1598
+ id: string;
1599
+ type: string;
1600
+ pageName: string;
1601
+ label: string;
1602
+ icon: string;
1603
+ }[];
1604
+ }[];
1605
+ };
1606
+
1607
+ /**
1608
+ * Marketplace — plugin-owned Setup navigation (cloud ADR-0009: cloud
1609
+ * functionality ships as plugins carrying their FULL UI surface).
1610
+ *
1611
+ * Ownership moved here from `@objectstack/platform-objects`'
1612
+ * setup-nav.contributions.ts (ADR-0029 K2's standing direction): the nav
1613
+ * entry now lives and dies with the capability —
1614
+ *
1615
+ * - no MarketplaceProxyPlugin mounted (`OS_CLOUD_URL=off`) → no
1616
+ * "Browse Marketplace" entry → no dead page.
1617
+ * - no MarketplaceInstallLocalPlugin → no "Installed Apps" entry.
1618
+ *
1619
+ * The URLs still point at the console's existing marketplace routes; the
1620
+ * pages themselves migrate to plugin-carried metadata in later ADR-0009
1621
+ * stages (Installed Apps first).
1622
+ */
1623
+ /** "Browse Marketplace" — owned by the browse capability (the proxy). */
1624
+ declare const MARKETPLACE_BROWSE_UI_BUNDLE: {
1625
+ id: string;
1626
+ namespace: string;
1627
+ version: string;
1628
+ type: string;
1629
+ scope: string;
1630
+ name: string;
1631
+ description: string;
1632
+ navigationContributions: {
1633
+ app: string;
1634
+ group: string;
1635
+ priority: number;
1636
+ items: {
1637
+ id: string;
1638
+ type: string;
1639
+ label: string;
1640
+ url: string;
1641
+ icon: string;
1642
+ }[];
1643
+ }[];
1644
+ };
1645
+ declare const MARKETPLACE_INSTALLED_UI_BUNDLE: {
1646
+ id: string;
1647
+ namespace: string;
1648
+ version: string;
1649
+ type: string;
1650
+ scope: string;
1651
+ name: string;
1652
+ description: string;
1653
+ pages: {
1654
+ name: string;
1655
+ label: string;
1656
+ type: "app";
1657
+ template: string;
1658
+ kind: "full";
1659
+ isDefault: boolean;
1660
+ regions: ({
1661
+ name: string;
1662
+ width: "full";
1663
+ components: {
1664
+ type: string;
1665
+ properties: {
1666
+ title: string;
1667
+ subtitle: string;
1668
+ icon: string;
1669
+ };
1670
+ }[];
1671
+ } | {
1672
+ name: string;
1673
+ width: "large";
1674
+ components: {
1675
+ type: string;
1676
+ properties: {};
1677
+ }[];
1678
+ })[];
1679
+ }[];
1680
+ navigationContributions: {
1681
+ app: string;
1682
+ group: string;
1683
+ priority: number;
1684
+ items: {
1685
+ id: string;
1686
+ type: string;
1687
+ pageName: string;
1688
+ label: string;
1689
+ icon: string;
1690
+ }[];
1691
+ }[];
1692
+ };
1693
+
1694
+ export { CLOUD_CONNECTION_UI_BUNDLE, CloudConnectionPlugin, type CloudConnectionPluginConfig, CloudConnectionSettingsPage, ConnectionCredentialStore, DEFAULT_CLOUD_URL, DEFAULT_CONNECTION_CREDENTIAL_PATH, DEFAULT_INSTALLED_PACKAGES_DIR, type InstalledManifestEntry, LocalManifestSource, MARKETPLACE_BROWSE_UI_BUNDLE, MARKETPLACE_INSTALLED_UI_BUNDLE, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, type RuntimeConfigPlanFeatures, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, type StoredConnectionCredential, createCloudConnectionPlugin, publicMarketplaceKeyForApiPath, resolveCloudUrl, resolveMarketplacePublicBaseUrl };