@sixb/cli 0.0.1

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.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +275 -0
  3. package/dist/commands/access-token-utils.d.ts +9 -0
  4. package/dist/commands/access-token-utils.d.ts.map +1 -0
  5. package/dist/commands/api.d.ts +13 -0
  6. package/dist/commands/api.d.ts.map +1 -0
  7. package/dist/commands/app.d.ts +9 -0
  8. package/dist/commands/app.d.ts.map +1 -0
  9. package/dist/commands/atlas.d.ts +9 -0
  10. package/dist/commands/atlas.d.ts.map +1 -0
  11. package/dist/commands/auth.d.ts +8 -0
  12. package/dist/commands/auth.d.ts.map +1 -0
  13. package/dist/commands/build.d.ts +6 -0
  14. package/dist/commands/build.d.ts.map +1 -0
  15. package/dist/commands/check.d.ts +5 -0
  16. package/dist/commands/check.d.ts.map +1 -0
  17. package/dist/commands/db-migrate.d.ts +5 -0
  18. package/dist/commands/db-migrate.d.ts.map +1 -0
  19. package/dist/commands/dev.d.ts +12 -0
  20. package/dist/commands/dev.d.ts.map +1 -0
  21. package/dist/commands/init.d.ts +3 -0
  22. package/dist/commands/init.d.ts.map +1 -0
  23. package/dist/commands/lake-check.d.ts +5 -0
  24. package/dist/commands/lake-check.d.ts.map +1 -0
  25. package/dist/commands/lake-cleanup.d.ts +16 -0
  26. package/dist/commands/lake-cleanup.d.ts.map +1 -0
  27. package/dist/commands/orchestrator.d.ts +6 -0
  28. package/dist/commands/orchestrator.d.ts.map +1 -0
  29. package/dist/commands/rules.d.ts +6 -0
  30. package/dist/commands/rules.d.ts.map +1 -0
  31. package/dist/commands/scheduler.d.ts +6 -0
  32. package/dist/commands/scheduler.d.ts.map +1 -0
  33. package/dist/commands/service-account.d.ts +14 -0
  34. package/dist/commands/service-account.d.ts.map +1 -0
  35. package/dist/commands/token.d.ts +14 -0
  36. package/dist/commands/token.d.ts.map +1 -0
  37. package/dist/commands/typegen.d.ts +5 -0
  38. package/dist/commands/typegen.d.ts.map +1 -0
  39. package/dist/commands/worker-group.d.ts +8 -0
  40. package/dist/commands/worker-group.d.ts.map +1 -0
  41. package/dist/commands/worker.d.ts +8 -0
  42. package/dist/commands/worker.d.ts.map +1 -0
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/lib/api-client.d.ts +26 -0
  46. package/dist/lib/api-client.d.ts.map +1 -0
  47. package/dist/lib/browser-topology.d.ts +62 -0
  48. package/dist/lib/browser-topology.d.ts.map +1 -0
  49. package/dist/lib/errors.d.ts +19 -0
  50. package/dist/lib/errors.d.ts.map +1 -0
  51. package/dist/lib/health.d.ts +25 -0
  52. package/dist/lib/health.d.ts.map +1 -0
  53. package/dist/lib/loadSixb.d.ts +49 -0
  54. package/dist/lib/loadSixb.d.ts.map +1 -0
  55. package/dist/lib/production-roles.d.ts +65 -0
  56. package/dist/lib/production-roles.d.ts.map +1 -0
  57. package/dist/lib/production.d.ts +29 -0
  58. package/dist/lib/production.d.ts.map +1 -0
  59. package/dist/lib/public-origin.d.ts +17 -0
  60. package/dist/lib/public-origin.d.ts.map +1 -0
  61. package/dist/lib/runtime.d.ts +76 -0
  62. package/dist/lib/runtime.d.ts.map +1 -0
  63. package/dist/lib/shareable-providers.d.ts +20 -0
  64. package/dist/lib/shareable-providers.d.ts.map +1 -0
  65. package/dist/lib/storage-migration.d.ts +40 -0
  66. package/dist/lib/storage-migration.d.ts.map +1 -0
  67. package/dist/lib/typegen.d.ts +5 -0
  68. package/dist/lib/typegen.d.ts.map +1 -0
  69. package/dist/lib/worker-registry.d.ts +30 -0
  70. package/dist/lib/worker-registry.d.ts.map +1 -0
  71. package/dist/tsconfig.json +5 -0
  72. package/dist/ui/index.d.ts +164 -0
  73. package/dist/ui/index.d.ts.map +1 -0
  74. package/package.json +68 -0
  75. package/src/commands/access-token-utils.ts +63 -0
  76. package/src/commands/api.tsx +111 -0
  77. package/src/commands/app.tsx +91 -0
  78. package/src/commands/atlas.tsx +75 -0
  79. package/src/commands/auth.tsx +96 -0
  80. package/src/commands/build.tsx +90 -0
  81. package/src/commands/check.tsx +58 -0
  82. package/src/commands/db-migrate.tsx +27 -0
  83. package/src/commands/dev.tsx +141 -0
  84. package/src/commands/init.tsx +18 -0
  85. package/src/commands/lake-check.tsx +20 -0
  86. package/src/commands/lake-cleanup.tsx +63 -0
  87. package/src/commands/orchestrator.tsx +87 -0
  88. package/src/commands/rules.tsx +81 -0
  89. package/src/commands/scheduler.tsx +77 -0
  90. package/src/commands/service-account.tsx +304 -0
  91. package/src/commands/token.tsx +143 -0
  92. package/src/commands/typegen.tsx +18 -0
  93. package/src/commands/worker-group.tsx +120 -0
  94. package/src/commands/worker.tsx +96 -0
  95. package/src/index.tsx +390 -0
  96. package/src/lib/api-client.ts +132 -0
  97. package/src/lib/browser-topology.ts +292 -0
  98. package/src/lib/errors.ts +40 -0
  99. package/src/lib/health.ts +138 -0
  100. package/src/lib/loadSixb.ts +175 -0
  101. package/src/lib/production-roles.ts +48 -0
  102. package/src/lib/production.ts +104 -0
  103. package/src/lib/public-origin.ts +46 -0
  104. package/src/lib/runtime.ts +346 -0
  105. package/src/lib/shareable-providers.ts +67 -0
  106. package/src/lib/storage-migration.ts +120 -0
  107. package/src/lib/typegen.ts +12 -0
  108. package/src/lib/worker-registry.ts +191 -0
  109. package/src/ui/index.tsx +953 -0
@@ -0,0 +1,62 @@
1
+ import type { SixbBrowserOrigin } from "@sixb/server";
2
+ /**
3
+ * The process resolving the topology. One answer settles what used to be four options: whether
4
+ * local defaults apply, which browser surfaces the process has to account for, and which one it
5
+ * serves itself.
6
+ */
7
+ export type BrowserRole = "dev" | "api" | "atlas" | "app";
8
+ /** The two surfaces a browser loads, and the audience each maps to. */
9
+ export type BrowserSurface = "atlas" | "app";
10
+ interface BrowserBindOptions {
11
+ readonly host?: string;
12
+ /** `--port`: the port this role binds. See {@link resolveBrowserPorts}. */
13
+ readonly port?: string;
14
+ /** `--api-host` and `--api-port`, which only the two roles that bind the API accept. */
15
+ readonly apiHost?: string;
16
+ readonly apiPort?: string;
17
+ readonly apiPublicOrigin?: string;
18
+ readonly atlasPublicOrigin?: string;
19
+ readonly appPublicOrigin?: string;
20
+ }
21
+ export type BrowserTopologyOptions = BrowserBindOptions & ({
22
+ /**
23
+ * Hosts the API, so its allowlist has to name every surface the project actually
24
+ * serves — including the custom app, which exists only when the project has one.
25
+ */
26
+ readonly role: "dev" | "api";
27
+ readonly hasCustomApp: boolean;
28
+ } | {
29
+ readonly role: BrowserSurface;
30
+ });
31
+ export interface BrowserTopology {
32
+ readonly host: string;
33
+ readonly apiHost: string;
34
+ readonly atlasPort: number;
35
+ readonly appPort: number;
36
+ readonly apiPort: number;
37
+ readonly apiPublicOrigin: string;
38
+ readonly atlasPublicOrigin: string | null;
39
+ readonly appPublicOrigin: string | null;
40
+ readonly allowedBrowserOrigins: readonly SixbBrowserOrigin[];
41
+ /** The surface this process serves itself, or `null` when it serves none. */
42
+ readonly serves: BrowserSurface | null;
43
+ }
44
+ /** A topology resolved by a role that serves a surface, so {@link servedUrl} always has one. */
45
+ export interface ServingBrowserTopology extends BrowserTopology {
46
+ readonly serves: BrowserSurface;
47
+ }
48
+ export declare function resolveBrowserTopology(options: BrowserBindOptions & {
49
+ readonly role: BrowserSurface;
50
+ }): ServingBrowserTopology;
51
+ export declare function resolveBrowserTopology(options: BrowserTopologyOptions): BrowserTopology;
52
+ /**
53
+ * What a browser-serving role shows as its own address. The public origin when one is configured,
54
+ * and otherwise the address it actually bound — which is all the process knows, and better than a
55
+ * startup panel with no URL on it.
56
+ */
57
+ export declare function servedUrl(topology: ServingBrowserTopology): string;
58
+ export declare function apiUrl(topology: BrowserTopology): string;
59
+ export declare function apiDocsUrl(topology: BrowserTopology): string;
60
+ export declare function apiEventsUrl(topology: BrowserTopology): string;
61
+ export {};
62
+ //# sourceMappingURL=browser-topology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-topology.d.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E,MAAM,GAAG,IAAI,CAAA;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,QAAQ,CAAC,qBAAqB,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC5D,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAA;CACvC;AAED,gGAAgG;AAChG,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAChC;AA+BD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,kBAAkB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GAC9D,sBAAsB,CAAA;AACzB,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAAA;AA+IxF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAOlE;AAMD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAExD;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAE5D;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAI9D"}
@@ -0,0 +1,19 @@
1
+ export interface SixbCliErrorOptions extends ErrorOptions {
2
+ /**
3
+ * What the operator should do next, kept out of the message so the terminal can give the
4
+ * instruction its own place and a caller can log the diagnosis alone.
5
+ */
6
+ readonly remediation?: string;
7
+ }
8
+ /** A failure the CLI raised itself, as opposed to one it caught from the runtime. */
9
+ export declare class SixbCliError extends Error {
10
+ readonly remediation: string | undefined;
11
+ constructor(message: string, options?: SixbCliErrorOptions);
12
+ }
13
+ export declare function errorMessage(error: unknown): string;
14
+ /**
15
+ * Reads a remediation off an error, including through a wrapper's `cause` — wrapping is how the
16
+ * CLI adds context to a provider's failure.
17
+ */
18
+ export declare function errorRemediation(error: unknown): string | undefined;
19
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,qFAAqF;AACrF,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;gBAE5B,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;CAK/D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAYnE"}
@@ -0,0 +1,25 @@
1
+ import type { LoadedSixb } from "./loadSixb";
2
+ export interface ProviderCheck {
3
+ readonly ok: boolean;
4
+ /** What was found. Shown as-is, so it has to read as an answer on its own. */
5
+ readonly message: string;
6
+ }
7
+ export interface RuntimeCheckOptions {
8
+ /** Per-probe bound. Defaults to {@link PROBE_TIMEOUT_MS}. */
9
+ readonly timeoutMs?: number;
10
+ }
11
+ export interface RuntimeCheck {
12
+ readonly storage: ProviderCheck;
13
+ readonly timeseries: ProviderCheck;
14
+ readonly broker: ProviderCheck;
15
+ readonly queues: ProviderCheck;
16
+ readonly warnings: readonly string[];
17
+ }
18
+ /**
19
+ * Probes the configured providers with read-only round trips.
20
+ *
21
+ * There is no `events` row because there is no events provider: `EventsRuntime` is built over
22
+ * the broker, so probing both was one round trip reported twice.
23
+ */
24
+ export declare function checkRuntimeHealth(sixb: LoadedSixb, options?: RuntimeCheckOptions): Promise<RuntimeCheck>;
25
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/lib/health.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAM5C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,UAAU,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC,CAgBvB"}
@@ -0,0 +1,49 @@
1
+ import type { ActionDefinition, Broker, ConnectorAdapter, ConnectorClient, ConnectorDefinition, DatasetDefinition, LinkProjectionDefinition, ObjectProjectionDefinition, OntologyMaintenanceHandle, OntologyOperationalStatus, PipelineDefinition, ProjectionDefinition, RuleDefinition, ScheduleDefinition, SixbReadiness, SixbRuntimeContext, SyncDefinition, TelemetryProjectionDefinition } from "@sixb/core";
2
+ import type { AgentsRuntime } from "@sixb/core/internal/agents";
3
+ import type { AuthRuntime } from "@sixb/core/internal/auth";
4
+ import type { WorkflowsRuntime } from "@sixb/core/internal/workflows";
5
+ import type { ObjectRow } from "@sixb/core/storage";
6
+ export interface LoadedSixb extends SixbRuntimeContext {
7
+ readonly id: string;
8
+ readonly broker: Broker;
9
+ readonly auth: AuthRuntime;
10
+ listObjectTypes(): readonly unknown[];
11
+ listActions(): readonly ActionDefinition[];
12
+ getActionById(actionId: string): ActionDefinition | null;
13
+ listSyncs(): readonly SyncDefinition[];
14
+ listPipelines(): readonly PipelineDefinition[];
15
+ getPipelineById(pipelineId: string): PipelineDefinition | null;
16
+ listSchedules(): readonly ScheduleDefinition[];
17
+ readonly workflows: WorkflowsRuntime;
18
+ readonly agents: AgentsRuntime;
19
+ listObjectProjections(): readonly ObjectProjectionDefinition[];
20
+ listLinkProjections(): readonly LinkProjectionDefinition[];
21
+ listTelemetryProjections(): readonly TelemetryProjectionDefinition[];
22
+ listDatasets(): readonly DatasetDefinition[];
23
+ listRules(): readonly RuleDefinition[];
24
+ getDatasetById(datasetId: string): DatasetDefinition | null;
25
+ getProjectionById(projectionId: string): ProjectionDefinition | null;
26
+ getSyncById(syncId: string): SyncDefinition | null;
27
+ getRuleById(ruleId: string): RuleDefinition | null;
28
+ listSubTypes(objectTypeId: string): string[];
29
+ connector<TAdapter extends ConnectorAdapter>(definition: ConnectorDefinition<string, TAdapter>): Promise<ConnectorClient<TAdapter>>;
30
+ startScheduler(): Promise<void>;
31
+ stopScheduler(): Promise<void>;
32
+ startOntologyMaintenance(): Promise<OntologyMaintenanceHandle>;
33
+ getOntologyOperationalStatus(): OntologyOperationalStatus;
34
+ checkReadiness(): Promise<SixbReadiness>;
35
+ disconnectConnectors(): Promise<void>;
36
+ closeLogger(): Promise<void>;
37
+ closeBroker(): Promise<void>;
38
+ list(params: {
39
+ objectTypeIds?: readonly string[];
40
+ limit?: number;
41
+ offset?: number;
42
+ }): Promise<{
43
+ total: number;
44
+ hasMore: boolean;
45
+ objects: ObjectRow[];
46
+ }>;
47
+ }
48
+ export declare function loadSixbFromEntry(entry: string): Promise<LoadedSixb>;
49
+ //# sourceMappingURL=loadSixb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadSixb.d.ts","sourceRoot":"","sources":["../../src/lib/loadSixb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,MAAM,EACN,gB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E,CAAC,CAAA;CACvE;AAmFD,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA0B1E"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Every long-running production role, and what its startup has to know about itself.
3
+ *
4
+ * Total over the role union on purpose: a new role does not compile until it answers both
5
+ * questions here.
6
+ */
7
+ declare const PRODUCTION_ROLES: {
8
+ readonly api: {
9
+ readonly onEventPlane: true;
10
+ readonly usesStorageSchema: true;
11
+ };
12
+ readonly rules: {
13
+ readonly onEventPlane: true;
14
+ readonly usesStorageSchema: true;
15
+ };
16
+ readonly scheduler: {
17
+ readonly onEventPlane: true;
18
+ readonly usesStorageSchema: true;
19
+ };
20
+ readonly orchestrator: {
21
+ readonly onEventPlane: true;
22
+ readonly usesStorageSchema: true;
23
+ };
24
+ readonly worker: {
25
+ readonly onEventPlane: true;
26
+ readonly usesStorageSchema: true;
27
+ };
28
+ readonly "worker-group": {
29
+ readonly onEventPlane: true;
30
+ readonly usesStorageSchema: true;
31
+ };
32
+ readonly atlas: {
33
+ readonly onEventPlane: false;
34
+ readonly usesStorageSchema: false;
35
+ };
36
+ readonly app: {
37
+ readonly onEventPlane: false;
38
+ readonly usesStorageSchema: false;
39
+ };
40
+ };
41
+ interface ProductionRoleFacts {
42
+ /**
43
+ * Whether the role publishes to or claims from the event plane. `atlas` and `app` only serve
44
+ * a browser bundle, so refusing to boot them on a process-local provider would block a valid
45
+ * UI-only container.
46
+ */
47
+ readonly onEventPlane: boolean;
48
+ /**
49
+ * Whether the role should bring the storage schema up to date at startup. `atlas` and `app`
50
+ * are the tier facing the internet, and a container serving a bundle has no business holding
51
+ * a DDL grant.
52
+ */
53
+ readonly usesStorageSchema: boolean;
54
+ }
55
+ export type ProductionRole = keyof typeof PRODUCTION_ROLES;
56
+ /**
57
+ * The roles that migrate storage at startup, derived from the map rather than restated: a role
58
+ * declared `usesStorageSchema: false` cannot be passed to `migrateStorageForRole` at all.
59
+ */
60
+ export type StorageSchemaRole = {
61
+ [Role in ProductionRole]: (typeof PRODUCTION_ROLES)[Role]["usesStorageSchema"] extends true ? Role : never;
62
+ }[ProductionRole];
63
+ export declare function productionRoleFacts(role: ProductionRole): ProductionRoleFacts;
64
+ export {};
65
+ //# sourceMappingURL=production-roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production-roles.d.ts","sourceRoot":"","sources":["../../src/lib/production-roles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASkC,CAAA;AAExD,UAAU,mBAAmB;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;CACpC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,gBAAgB,CAAA;AAE1D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;KAC7B,IAAI,IAAI,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,SAAS,IAAI,GACvF,IAAI,GACJ,KAAK;CACV,CAAC,cAAc,CAAC,CAAA;AAEjB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,mBAAmB,CAE7E"}
@@ -0,0 +1,29 @@
1
+ import { type LoadedSixb } from "./loadSixb";
2
+ import type { ProductionRole } from "./production-roles";
3
+ export interface RuntimeEntryOptions {
4
+ readonly entry?: string;
5
+ }
6
+ export interface ProductionRuntimeOptions extends RuntimeEntryOptions {
7
+ /**
8
+ * The role being started. Required so the provider guard cannot be skipped by
9
+ * forgetting to call it: every production role goes through this loader, and the
10
+ * role union in `shareable-providers` decides whether the guard applies.
11
+ */
12
+ readonly role: ProductionRole;
13
+ }
14
+ export interface ProductionPaths {
15
+ readonly projectRoot: string;
16
+ readonly buildOutdir: string;
17
+ }
18
+ export declare function resolveRuntimeEntry(options?: RuntimeEntryOptions): Promise<string>;
19
+ export declare function loadProductionSixb(options: ProductionRuntimeOptions): Promise<{
20
+ entry: string;
21
+ sixb: LoadedSixb;
22
+ projectRoot: string;
23
+ buildOutdir: string;
24
+ }>;
25
+ export declare function resolveProductionPaths(entry: string): Promise<ProductionPaths>;
26
+ export declare function resolveProjectRoot(entry: string): string;
27
+ export declare function builtAppOutdir(buildOutdir: string): string;
28
+ export declare function builtAtlasOutdir(buildOutdir: string): string;
29
+ //# sourceMappingURL=production.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production.d.ts","sourceRoot":"","sources":["../../src/lib/production.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGxD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAU5F;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAYxF;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAepF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One definition of a public origin, for every role that reads one.
3
+ *
4
+ * `SIXB_API_PUBLIC_ORIGIN` used to mean something different depending on who read it: the browser
5
+ * roles parsed it and refused anything that was not a bare origin, while the agent worker took any
6
+ * non-blank string and discovered the problem at its first request instead. The same value could
7
+ * therefore stop `sixb api` at startup and start `sixb worker agent`, which is the failure mode
8
+ * worth removing — a bad origin should be refused once, by the first role that reads it.
9
+ */
10
+ /** An origin is scheme, host, and port, and nothing after them. */
11
+ export declare function normalizeOrigin(value: string, label: string): string;
12
+ /**
13
+ * The origin a flag or the environment set, normalized. `null` when neither did, and a thrown
14
+ * error when one of them set something that is not an origin.
15
+ */
16
+ export declare function configuredOrigin(value: string | undefined, envName: string, label: string): string | null;
17
+ //# sourceMappingURL=public-origin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-origin.d.ts","sourceRoot":"","sources":["../../src/lib/public-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAGf"}
@@ -0,0 +1,76 @@
1
+ import { ActionWorker } from "@sixb/action-worker";
2
+ import { AgentWorker } from "@sixb/agent-worker";
3
+ import type { Worker } from "@sixb/core/internal/workers";
4
+ import { OrchestratorWorker } from "@sixb/orchestrator";
5
+ import { PipelineWorker } from "@sixb/pipeline-worker";
6
+ import { ProjectionWorker } from "@sixb/projection-worker";
7
+ import { RulesWorker } from "@sixb/rules-worker";
8
+ import { SyncWorker } from "@sixb/sync-worker";
9
+ import { WorkflowWorker } from "@sixb/workflow-worker";
10
+ import type { LoadedSixb } from "./loadSixb";
11
+ export declare function waitForWorkerFailure(worker: Worker | null | undefined): Promise<never>;
12
+ export declare function stopQuietly(stopFn: (() => Promise<void>) | undefined | null): Promise<void>;
13
+ export interface RunningSixbRuntime {
14
+ readonly rulesWorker: RulesWorker | null;
15
+ readonly syncWorker: SyncWorker | null;
16
+ readonly actionWorker: ActionWorker | null;
17
+ readonly agentWorker: AgentWorker | null;
18
+ readonly projectionWorker: ProjectionWorker | null;
19
+ readonly pipelineWorker: PipelineWorker | null;
20
+ readonly workflowWorker: WorkflowWorker | null;
21
+ readonly orchestratorWorker: OrchestratorWorker | null;
22
+ readonly warnings: readonly string[];
23
+ waitForWorkerFailure(): Promise<never>;
24
+ stop(): Promise<void>;
25
+ }
26
+ export interface StartSixbRuntimeOptions {
27
+ readonly cohostWorkers?: boolean;
28
+ readonly agentApiBaseUrl?: string;
29
+ }
30
+ export interface RunningRulesRuntime {
31
+ readonly rulesWorker: RulesWorker | null;
32
+ stop(): Promise<void>;
33
+ }
34
+ export interface RunningSchedulerRuntime {
35
+ stop(): Promise<void>;
36
+ }
37
+ export interface RunningOrchestratorRuntime {
38
+ readonly orchestratorWorker: OrchestratorWorker | null;
39
+ readonly warnings: readonly string[];
40
+ stop(): Promise<void>;
41
+ }
42
+ export declare function migrateRuntimeStorage(sixb: LoadedSixb): Promise<void>;
43
+ export declare function checkRuntimeLakeDefinitions(sixb: LoadedSixb): Promise<void>;
44
+ export declare function stopSixbProviders(sixb: LoadedSixb): Promise<void>;
45
+ export declare function startRulesRuntime(sixb: LoadedSixb): Promise<RunningRulesRuntime>;
46
+ export declare function startSchedulerRuntime(sixb: LoadedSixb): Promise<RunningSchedulerRuntime>;
47
+ export declare function startOrchestratorRuntime(sixb: LoadedSixb): Promise<RunningOrchestratorRuntime>;
48
+ /**
49
+ * Starts the background runtimes owned by the CLI host.
50
+ *
51
+ * Startup order (consumers before producers):
52
+ * 1. RulesWorker (subscribes to ontology events)
53
+ * 2. ActionWorker (subscribes to events)
54
+ * 3. AgentWorker (claims from queues)
55
+ * 4. ProjectionWorker (claims from queues)
56
+ * 5. PipelineWorker (claims from queues)
57
+ * 6. WorkflowWorker (claims from queues)
58
+ * 7. SyncWorker (claims from queues)
59
+ * 8. Orchestrator (subscribes to events and enqueues jobs)
60
+ * 9. Scheduler (emits schedule.triggered)
61
+ *
62
+ * Shutdown order (producers before consumers):
63
+ * 1. Scheduler
64
+ * 2. Orchestrator (drains pending dispatches)
65
+ * 3. SyncWorker
66
+ * 4. WorkflowWorker
67
+ * 5. PipelineWorker
68
+ * 6. ProjectionWorker
69
+ * 7. AgentWorker
70
+ * 8. ActionWorker
71
+ * 9. RulesWorker (drains pending evaluations)
72
+ * 10. Runtime providers (connectors, broker)
73
+ */
74
+ export declare function startSixbRuntime(sixb: LoadedSixb, options?: StartSixbRuntimeOptions): Promise<RunningSixbRuntime>;
75
+ export declare function runUntilSignal(onShutdown: () => Promise<void>): Promise<void>;
76
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/lib/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAEzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,W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les";
3
+ export interface ProcessLocalProvider {
4
+ /** The config slot: `broker` or `queues`. */
5
+ readonly slot: string;
6
+ /** The configured class, so an operator can find it in `sixb.config.ts`. */
7
+ readonly configured: string;
8
+ readonly replacements: string;
9
+ }
10
+ /** The same detection as {@link assertShareableProviders}, without the refusal. */
11
+ export declare function findProcessLocalProviders(sixb: LoadedSixb): readonly ProcessLocalProvider[];
12
+ /**
13
+ * Refuses to start a production role whose broker or queues cannot cross a process boundary.
14
+ *
15
+ * Deployed unchanged, the scaffolded in-memory providers give each role a private set of lanes:
16
+ * the orchestrator enqueues, the worker polls an empty queue, and nothing reports a problem.
17
+ * Throws rather than warns, because an inert deployment is indistinguishable from an idle one.
18
+ */
19
+ export declare function assertShareableProviders(sixb: LoadedSixb, role: ProductionRole): void;
20
+ //# sourceMappingURL=shareable-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shareable-providers.d.ts","sourceRoot":"","sources":["../../src/lib/shareable-providers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,oBAAoB,CAAA;AA0B7E,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,mFAAmF;AACnF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,oBAAoB,EAAE,CAM3F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAarF"}
@@ -0,0 +1,40 @@
1
+ import type { LoadedSixb } from "./loadSixb";
2
+ import type { StorageSchemaRole } from "./production-roles";
3
+ export interface RoleStorageMigrationOptions {
4
+ readonly role: StorageSchemaRole;
5
+ /** `--no-migrate`. Combines with `SIXB_SKIP_MIGRATION=1`; either one opts out. */
6
+ readonly noMigrate?: boolean;
7
+ readonly env?: Record<string, string | undefined>;
8
+ /**
9
+ * Called once, only when a migration is about to run. A schema change can take minutes, and
10
+ * a process that looks stuck is a process an operator restarts.
11
+ */
12
+ readonly onStart?: () => void;
13
+ }
14
+ export type RoleStorageMigrationOutcome =
15
+ /** Steps were applied; `applied` names them. */
16
+ "migrated"
17
+ /** The schema was already at the latest version. */
18
+ | "current"
19
+ /** The configured storage exposes no migrators, so there is no schema to migrate. */
20
+ | "skipped"
21
+ /** The operator opted out with `--no-migrate` or `SIXB_SKIP_MIGRATION=1`. */
22
+ | "disabled";
23
+ export interface RoleStorageMigration {
24
+ readonly outcome: RoleStorageMigrationOutcome;
25
+ /** Migration step ids that this process applied, in order. */
26
+ readonly applied: readonly string[];
27
+ /** One line for the role's startup panel, naming what ran, or `null` when nothing did. */
28
+ readonly summary: string | null;
29
+ }
30
+ /**
31
+ * Brings the storage schema up to date before a production role starts serving, so a forgotten
32
+ * `sixb db migrate` cannot surface as a missing column on the first request.
33
+ *
34
+ * Concurrent replicas are handled below this call: Postgres serializes migrators on a session
35
+ * advisory lock, and every adapter refuses a history it does not recognize, so late replicas
36
+ * no-op instead of racing. SQLite is the exception, and its error is translated rather than
37
+ * passed through raw.
38
+ */
39
+ export declare function migrateStorageForRole(sixb: LoadedSixb, options: RoleStorageMigrationOptions): Promise<RoleStorageMigration>;
40
+ //# sourceMappingURL=storage-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-migration.d.ts","sourceRoot":"","sources":["../../src/lib/storage-migration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAK3D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IAChC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IACjD;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED,MAAM,MAAM,2BAA2B;AACrC,gDAAgD;AAC9C,UAAU;AACZ,oDAAoD;GAClD,SAAS;AACX,qFAAqF;GACnF,SAAS;AACX,6EAA6E;GAC3E,UAAU,CAAA;AAEd,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAA;IAC7C,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,oBAAoB,CAAC,CAkC/B"}
@@ -0,0 +1,5 @@
1
+ export interface GenerateProjectTypesOptions {
2
+ readonly entry?: string;
3
+ }
4
+ export declare function generateProjectTypes(options?: GenerateProjectTypesOptions): Promise<import("@sixb/core/internal/bootstrap").GenerateOntologyTypeManifestResult>;
5
+ //# sourceMappingURL=typegen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typegen.d.ts","sourceRoot":"","sources":["../../src/lib/typegen.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,2BAAgC,uFAInF"}
@@ -0,0 +1,30 @@
1
+ import type { Worker } from "@sixb/core/internal/workers";
2
+ import type { LoadedSixb } from "./loadSixb";
3
+ export interface WorkerCreationOptions {
4
+ readonly agentApiBaseUrl?: string;
5
+ }
6
+ export declare function createWorkerForType(sixb: LoadedSixb, workerType: string, options?: WorkerCreationOptions): Worker;
7
+ export declare function resolveWorkerTypeToStart(requestedWorker?: string): string;
8
+ /**
9
+ * Why this worker cannot be constructed with these options, or `null` when it can. Exported
10
+ * for `sixb worker`, which has to answer this before it migrates storage.
11
+ */
12
+ export declare function unmetWorkerRequirement(workerType: string, options: WorkerCreationOptions): string | null;
13
+ export interface WorkerGroupInputs {
14
+ readonly workerTypes: readonly string[];
15
+ readonly options: WorkerCreationOptions;
16
+ /**
17
+ * Whether the types were auto-selected rather than named on the command line. It changes the
18
+ * remedy only: an auto-selected type can also be dropped by naming the rest.
19
+ */
20
+ readonly autoSelected: boolean;
21
+ }
22
+ /**
23
+ * Refuses a worker group that cannot start whole, naming every reason at once.
24
+ *
25
+ * Five of six workers means jobs piling up in a queue nobody claims, which looks exactly like
26
+ * an idle system — so the refusal is right, and it has to say which workers it took down.
27
+ */
28
+ export declare function assertWorkerInputs(input: WorkerGroupInputs): void;
29
+ export declare function resolveRegisteredWorkerTypes(sixb: LoadedSixb): readonly string[];
30
+ //# sourceMappingURL=worker-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-registry.d.ts","sourceRoot":"","sources":["../../src/lib/worker-registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAMzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAClC;AA2CD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,qBAA0B,GAClC,MAAM,CAOR;AAED,wBAAgB,wBAAwB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAYzE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,qBAAqB,GAC7B,MAAM,GAAG,IAAI,CAEf;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;IACvC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CA6BjE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,CAiChF"}
@@ -0,0 +1,5 @@
1
+ // Written by scripts/build-package.ts, and published on purpose.
2
+ // Bun applies the nearest tsconfig paths map to every import it resolves, node_modules
3
+ // included. An empty map here keeps a consumer's aliases from sending a module in this
4
+ // directory back into a second copy of its own source.
5
+ { "compilerOptions": { "paths": {} } }