@loxtep/sdk 0.12.0 → 0.13.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cli/commands/delivery-cmd.d.ts +1 -0
  3. package/dist/cli/commands/delivery-cmd.d.ts.map +1 -1
  4. package/dist/cli/commands/delivery-cmd.js +60 -44
  5. package/dist/cli/commands/delivery-cmd.js.map +1 -1
  6. package/dist/cli/commands/ingest-cmd.d.ts +1 -0
  7. package/dist/cli/commands/ingest-cmd.d.ts.map +1 -1
  8. package/dist/cli/commands/ingest-cmd.js +37 -24
  9. package/dist/cli/commands/ingest-cmd.js.map +1 -1
  10. package/dist/cli/commands/transform-cmd.d.ts +1 -0
  11. package/dist/cli/commands/transform-cmd.d.ts.map +1 -1
  12. package/dist/cli/commands/transform-cmd.js +36 -23
  13. package/dist/cli/commands/transform-cmd.js.map +1 -1
  14. package/dist/cli/help.d.ts.map +1 -1
  15. package/dist/cli/help.js +5 -3
  16. package/dist/cli/help.js.map +1 -1
  17. package/dist/cli/index.d.ts.map +1 -1
  18. package/dist/cli/index.js +565 -522
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/client/data-products.d.ts +10 -8
  21. package/dist/client/data-products.d.ts.map +1 -1
  22. package/dist/client/data-products.js +142 -93
  23. package/dist/client/data-products.js.map +1 -1
  24. package/dist/client/flow-types.d.ts +16 -6
  25. package/dist/client/flow-types.d.ts.map +1 -1
  26. package/dist/client/flow-types.js +6 -1
  27. package/dist/client/flow-types.js.map +1 -1
  28. package/dist/client/index.d.ts +89 -88
  29. package/dist/client/index.d.ts.map +1 -1
  30. package/dist/client/index.js +13 -12
  31. package/dist/client/index.js.map +1 -1
  32. package/dist/client/queues.d.ts +5 -3
  33. package/dist/client/queues.d.ts.map +1 -1
  34. package/dist/client/queues.js +26 -21
  35. package/dist/client/queues.js.map +1 -1
  36. package/dist/client/workflows.d.ts +7 -7
  37. package/dist/client/workflows.d.ts.map +1 -1
  38. package/dist/client/workflows.js +71 -63
  39. package/dist/client/workflows.js.map +1 -1
  40. package/dist/lib/sdk-ingest-bundle.d.ts +5 -1
  41. package/dist/lib/sdk-ingest-bundle.d.ts.map +1 -1
  42. package/dist/lib/sdk-ingest-bundle.js +38 -29
  43. package/dist/lib/sdk-ingest-bundle.js.map +1 -1
  44. package/dist/rstreams/event-bridge.d.ts +4 -4
  45. package/dist/rstreams/event-bridge.d.ts.map +1 -1
  46. package/dist/rstreams/event-bridge.js +23 -16
  47. package/dist/rstreams/event-bridge.js.map +1 -1
  48. package/docs/event-writer-transport-modes.md +47 -0
  49. package/docs/sdk-first-ingest.md +14 -12
  50. package/package.json +1 -1
  51. package/schemas/entity-json-schemas/SCHEMA_SYNC.md +1 -1
  52. package/schemas/entity-json-schemas/SOURCE.json +5 -4
  53. package/schemas/entity-json-schemas/connection.json +35 -0
  54. package/schemas/entity-json-schemas/data-product.json +16 -0
  55. package/schemas/entity-json-schemas/grant.json +146 -0
  56. package/schemas/entity-json-schemas/transformation.json +19 -0
package/dist/cli/index.js CHANGED
@@ -7,55 +7,55 @@
7
7
  * Usage: loxtep <command> [options]
8
8
  * Help is grouped by customer-facing command areas — see ./help.ts
9
9
  */
10
- import { runLogin } from './commands/login.js';
11
- import { runLogout } from './commands/logout.js';
12
- import { runWhoami } from './commands/whoami.js';
13
- import { runAttach } from './commands/attach-cmd.js';
14
- import { runConfigList, runConfigPaths, runConfigSet, runConfigExportFromDataProduct, runConfigExportFromConnector, } from './commands/config-cmd.js';
15
- import { runInitCommand } from './commands/init-cmd.js';
16
- import { runStart } from './commands/start-cmd.js';
17
- import { runSetup } from './commands/setup-cmd.js';
18
- import { runBusLogin } from './commands/bus-cmd.js';
19
- import { createCliClient, requireCliClient } from './create-cli-client.js';
20
- import { runDataProductsList, runDataProductsGet, runDataProductsQuery, runDataProductsTables, runDataProductsCreate, runDataProductsReadiness, runDataProductsPromote, } from './commands/data-products-cmd.js';
21
- import { runDataPlaneIceberg, runDataPlaneExport, runPrimaryEntity, runDefineGlossary, runDataContractsUpdate, runQualityRules, } from './commands/data-plane-cmd.js';
22
- import { runMetricsRateLimits, runMetricsLog } from './commands/metrics-cmd.js';
23
- import { runQueueInfo, runQueueCheckpoint } from './commands/queue-cmd.js';
24
- import { runWorkflowsList, runWorkflowsGet, runWorkflowsCreate, runWorkflowsDeploy, runWorkflowsPreviewQueryTrigger, runWorkflowsRunQueryTrigger, } from './commands/workflows-cmd.js';
25
- import { runBundleSave } from './commands/bundle-cmd.js';
26
- import { runIngestCreate } from './commands/ingest-cmd.js';
27
- import { runTransformCreate } from './commands/transform-cmd.js';
28
- import { runDeliveryCreate } from './commands/delivery-cmd.js';
29
- import { runPush } from './commands/push-cmd.js';
30
- import { runLint } from './commands/lint-cmd.js';
31
- import { runConnectorsList, runConnectorsTest, runConnectorsCaptureSamples, runConnectorsListEntities, } from './commands/connectors-cmd.js';
32
- import { runObserveStatus } from './commands/observe-cmd.js';
33
- import { runTriggersList, runTriggersGet, runTriggersCreate, runTriggersTest, runTriggersResetBackfill, } from './commands/triggers-cmd.js';
34
- import { runDomainsList, runDomainsGet } from './commands/domains-cmd.js';
35
- import { runStandardsList, runStandardsGet } from './commands/standards-cmd.js';
36
- import { runDataContractsList, runDataContractsGet, runDataContractsCreate } from './commands/data-contracts-cmd.js';
37
- import { runGenerate } from './commands/generate-cmd.js';
38
- import { runTest } from './commands/test-cmd.js';
39
- import { runDeploy } from './commands/deploy-cmd.js';
40
- import { runImprovementsListCommand, runImprovementsApplyCommand, runImprovementsRejectCommand, } from './commands/improvements-cmd.js';
41
- import { runApprovalsListCommand, runApprovalsApproveCommand, runApprovalsRejectCommand, parseApprovalsListNumericFlags, } from './commands/approvals-cmd.js';
42
- import { runCdlcTransitionCommand, runCdlcReviewQueueCommand, } from './commands/cdlc-cmd.js';
43
- import { runCandidatesListCommand, runCandidatesActCommand, } from './commands/candidates-cmd.js';
44
- import { runPacksListCommand, runPacksActivateCommand, runPacksStatusCommand, } from './commands/packs-cmd.js';
45
- import { PROPOSALS_USAGE, runProposalsListCommand, runProposalsAcceptCommand, runProposalsRejectCommand, runProposalsInferDefinitionsCommand, } from './commands/proposals-cmd.js';
46
- import { DEFINE_USAGE, runDefineStatusCommand, runDefineEvidenceCommand, runDefineListCommand, runDefineGetCommand, runDefineSubmitShapeCommand, runDefineSubmitSemanticCommand, runDefineApproveCommand, runDefineApplyCommand, runDefineWithdrawCommand, runDefineSkillCommand, runDefineStartProcedureCommand, runDefineBatchCommand, } from './commands/define-cmd.js';
47
- import { runDeploymentsListCommand, runDeploymentsGetCommand, } from './commands/deployments-cmd.js';
48
- import { runActivityListCommand } from './commands/activity-cmd.js';
49
- import { runInstancesList, runInstancesGet, runInstancesStreamConfig, runInstancesCreate, runInstancesUpdate, runInstancesRedeployRuntimes, runInstancesDeploymentUrls, runInstancesRegistration, runInstancesRegister, parseCreateInstanceArgs, parseUpdateInstanceArgs, } from './commands/instances-cmd.js';
50
- import { runBotsList, runBotsGet, runBotsRegister, runBotsUpdate, runBotsDeregister, runBotsReconcile, } from './commands/bots-cmd.js';
51
- import { runProjectsList, runProjectsGet, runProjectsLink, runProjectsChanges, runProjectsClone, runProjectsGithubPullCmd, runProjectsGithubPushCmd, } from './commands/projects-cmd.js';
52
- import { runStatus } from './commands/status-cmd.js';
53
- import { runOntologyLinkClassCommand } from './commands/ontology-cmd.js';
54
- import { printCliHelp } from './help.js';
55
- import { printCliVersion } from './version.js';
56
- import { startUpdateCheck } from './update-notifier.js';
57
- import { LoxtepError } from '../errors/base.js';
58
- import { AuthenticationError, AuthorizationError } from '../errors/auth.js';
10
+ import { runLogin } from "./commands/login.js";
11
+ import { runLogout } from "./commands/logout.js";
12
+ import { runWhoami } from "./commands/whoami.js";
13
+ import { runAttach } from "./commands/attach-cmd.js";
14
+ import { runConfigList, runConfigPaths, runConfigSet, runConfigExportFromDataProduct, runConfigExportFromConnector, } from "./commands/config-cmd.js";
15
+ import { runInitCommand } from "./commands/init-cmd.js";
16
+ import { runStart } from "./commands/start-cmd.js";
17
+ import { runSetup } from "./commands/setup-cmd.js";
18
+ import { runBusLogin } from "./commands/bus-cmd.js";
19
+ import { createCliClient, requireCliClient } from "./create-cli-client.js";
20
+ import { runDataProductsList, runDataProductsGet, runDataProductsQuery, runDataProductsTables, runDataProductsCreate, runDataProductsReadiness, runDataProductsPromote, } from "./commands/data-products-cmd.js";
21
+ import { runDataPlaneIceberg, runDataPlaneExport, runPrimaryEntity, runDefineGlossary, runDataContractsUpdate, runQualityRules, } from "./commands/data-plane-cmd.js";
22
+ import { runMetricsRateLimits, runMetricsLog } from "./commands/metrics-cmd.js";
23
+ import { runQueueInfo, runQueueCheckpoint } from "./commands/queue-cmd.js";
24
+ import { runWorkflowsList, runWorkflowsGet, runWorkflowsCreate, runWorkflowsDeploy, runWorkflowsPreviewQueryTrigger, runWorkflowsRunQueryTrigger, } from "./commands/workflows-cmd.js";
25
+ import { runBundleSave } from "./commands/bundle-cmd.js";
26
+ import { runIngestCreate } from "./commands/ingest-cmd.js";
27
+ import { runTransformCreate } from "./commands/transform-cmd.js";
28
+ import { runDeliveryCreate } from "./commands/delivery-cmd.js";
29
+ import { runPush } from "./commands/push-cmd.js";
30
+ import { runLint } from "./commands/lint-cmd.js";
31
+ import { runConnectorsList, runConnectorsTest, runConnectorsCaptureSamples, runConnectorsListEntities, } from "./commands/connectors-cmd.js";
32
+ import { runObserveStatus } from "./commands/observe-cmd.js";
33
+ import { runTriggersList, runTriggersGet, runTriggersCreate, runTriggersTest, runTriggersResetBackfill, } from "./commands/triggers-cmd.js";
34
+ import { runDomainsList, runDomainsGet } from "./commands/domains-cmd.js";
35
+ import { runStandardsList, runStandardsGet } from "./commands/standards-cmd.js";
36
+ import { runDataContractsList, runDataContractsGet, runDataContractsCreate, } from "./commands/data-contracts-cmd.js";
37
+ import { runGenerate } from "./commands/generate-cmd.js";
38
+ import { runTest } from "./commands/test-cmd.js";
39
+ import { runDeploy } from "./commands/deploy-cmd.js";
40
+ import { runImprovementsListCommand, runImprovementsApplyCommand, runImprovementsRejectCommand, } from "./commands/improvements-cmd.js";
41
+ import { runApprovalsListCommand, runApprovalsApproveCommand, runApprovalsRejectCommand, parseApprovalsListNumericFlags, } from "./commands/approvals-cmd.js";
42
+ import { runCdlcTransitionCommand, runCdlcReviewQueueCommand, } from "./commands/cdlc-cmd.js";
43
+ import { runCandidatesListCommand, runCandidatesActCommand, } from "./commands/candidates-cmd.js";
44
+ import { runPacksListCommand, runPacksActivateCommand, runPacksStatusCommand, } from "./commands/packs-cmd.js";
45
+ import { PROPOSALS_USAGE, runProposalsListCommand, runProposalsAcceptCommand, runProposalsRejectCommand, runProposalsInferDefinitionsCommand, } from "./commands/proposals-cmd.js";
46
+ import { DEFINE_USAGE, runDefineStatusCommand, runDefineEvidenceCommand, runDefineListCommand, runDefineGetCommand, runDefineSubmitShapeCommand, runDefineSubmitSemanticCommand, runDefineApproveCommand, runDefineApplyCommand, runDefineWithdrawCommand, runDefineSkillCommand, runDefineStartProcedureCommand, runDefineBatchCommand, } from "./commands/define-cmd.js";
47
+ import { runDeploymentsListCommand, runDeploymentsGetCommand, } from "./commands/deployments-cmd.js";
48
+ import { runActivityListCommand } from "./commands/activity-cmd.js";
49
+ import { runInstancesList, runInstancesGet, runInstancesStreamConfig, runInstancesCreate, runInstancesUpdate, runInstancesRedeployRuntimes, runInstancesDeploymentUrls, runInstancesRegistration, runInstancesRegister, parseCreateInstanceArgs, parseUpdateInstanceArgs, } from "./commands/instances-cmd.js";
50
+ import { runBotsList, runBotsGet, runBotsRegister, runBotsUpdate, runBotsDeregister, runBotsReconcile, } from "./commands/bots-cmd.js";
51
+ import { runProjectsList, runProjectsGet, runProjectsLink, runProjectsChanges, runProjectsClone, runProjectsGithubPullCmd, runProjectsGithubPushCmd, } from "./commands/projects-cmd.js";
52
+ import { runStatus } from "./commands/status-cmd.js";
53
+ import { runOntologyLinkClassCommand } from "./commands/ontology-cmd.js";
54
+ import { printCliHelp } from "./help.js";
55
+ import { printCliVersion } from "./version.js";
56
+ import { startUpdateCheck } from "./update-notifier.js";
57
+ import { LoxtepError } from "../errors/base.js";
58
+ import { AuthenticationError, AuthorizationError } from "../errors/auth.js";
59
59
  function printHelp() {
60
60
  printCliHelp();
61
61
  }
@@ -77,7 +77,7 @@ function formatCliError(err) {
77
77
  * Does not read `process.argv` so callers can inject argv.
78
78
  */
79
79
  export async function runCli(argv) {
80
- if (argv.includes('--help') || argv.includes('-h')) {
80
+ if (argv.includes("--help") || argv.includes("-h")) {
81
81
  printHelp();
82
82
  return;
83
83
  }
@@ -94,11 +94,11 @@ export async function runCli(argv) {
94
94
  // finally block entirely, which used to silently swallow the notice for any pre-auth command.
95
95
  const updateCheck = startUpdateCheck();
96
96
  try {
97
- if (!command || command === '--help' || command === '-h') {
97
+ if (!command || command === "--help" || command === "-h") {
98
98
  printHelp();
99
99
  return;
100
100
  }
101
- if (command === '--version' || command === '-V' || command === 'version') {
101
+ if (command === "--version" || command === "-V" || command === "version") {
102
102
  printCliVersion();
103
103
  return;
104
104
  }
@@ -109,31 +109,40 @@ export async function runCli(argv) {
109
109
  }
110
110
  async function runCommand() {
111
111
  switch (command) {
112
- case 'start': {
113
- if (args.includes('--help') || args.includes('-h')) {
114
- console.log('Usage: loxtep start [--client claude|codex|opencode|cursor] [--no-launch]\nInstall the client integration and launch your agent. Requires Node 22.20+.');
112
+ case "start": {
113
+ if (args.includes("--help") || args.includes("-h")) {
114
+ console.log("Usage: loxtep start [--client claude|codex|opencode|cursor] [--no-launch]\nInstall the client integration and launch your agent. Requires Node 22.20+.");
115
115
  break;
116
116
  }
117
117
  for (let i = 1; i < args.length; i++) {
118
- if (args[i] === '--no-launch')
118
+ if (args[i] === "--no-launch")
119
119
  continue;
120
- if (args[i] === '--client' && args[i + 1] && !args[i + 1].startsWith('-')) {
120
+ if (args[i] === "--client" &&
121
+ args[i + 1] &&
122
+ !args[i + 1].startsWith("-")) {
121
123
  i++;
122
124
  continue;
123
125
  }
124
126
  throw new Error(`Unknown or incomplete start option: ${args[i]}. See loxtep start --help.`);
125
127
  }
126
- runStart({ client: getArg('--client'), noLaunch: args.includes('--no-launch') });
128
+ runStart({
129
+ client: getArg("--client"),
130
+ noLaunch: args.includes("--no-launch"),
131
+ });
127
132
  break;
128
133
  }
129
- case 'login': {
130
- const emailIdx = args.indexOf('--email');
131
- const passwordIdx = args.indexOf('--password');
132
- const mfaIdx = args.indexOf('--mfa-code');
133
- const orgIdx = args.indexOf('--organization-id');
134
- const scope = args.includes('--global') ? 'global' : args.includes('--local') ? 'local' : undefined;
134
+ case "login": {
135
+ const emailIdx = args.indexOf("--email");
136
+ const passwordIdx = args.indexOf("--password");
137
+ const mfaIdx = args.indexOf("--mfa-code");
138
+ const orgIdx = args.indexOf("--organization-id");
139
+ const scope = args.includes("--global")
140
+ ? "global"
141
+ : args.includes("--local")
142
+ ? "local"
143
+ : undefined;
135
144
  await runLogin({
136
- console: args.includes('--console'),
145
+ console: args.includes("--console"),
137
146
  email: emailIdx >= 0 ? args[emailIdx + 1] : undefined,
138
147
  password: passwordIdx >= 0 ? args[passwordIdx + 1] : undefined,
139
148
  mfa_code: mfaIdx >= 0 ? args[mfaIdx + 1] : undefined,
@@ -142,24 +151,28 @@ export async function runCli(argv) {
142
151
  });
143
152
  break;
144
153
  }
145
- case 'logout': {
146
- const scope = args.includes('--global') ? 'global' : args.includes('--local') ? 'local' : undefined;
154
+ case "logout": {
155
+ const scope = args.includes("--global")
156
+ ? "global"
157
+ : args.includes("--local")
158
+ ? "local"
159
+ : undefined;
147
160
  await runLogout({ scope });
148
161
  break;
149
162
  }
150
- case 'whoami':
151
- await runWhoami({ debug: args.includes('--debug') });
163
+ case "whoami":
164
+ await runWhoami({ debug: args.includes("--debug") });
152
165
  break;
153
- case 'init': {
154
- const templateIdx = args.indexOf('--template');
166
+ case "init": {
167
+ const templateIdx = args.indexOf("--template");
155
168
  const templateSlug = templateIdx >= 0 ? args[templateIdx + 1] : undefined;
156
- const createRepoIdx = args.indexOf('--create-repo');
157
- const createRepo = createRepoIdx >= 0 ? (args[createRepoIdx + 1] || true) : undefined;
158
- const fromRepoIdx = args.indexOf('--from-repo');
169
+ const createRepoIdx = args.indexOf("--create-repo");
170
+ const createRepo = createRepoIdx >= 0 ? args[createRepoIdx + 1] || true : undefined;
171
+ const fromRepoIdx = args.indexOf("--from-repo");
159
172
  const fromRepo = fromRepoIdx >= 0 ? args[fromRepoIdx + 1] : undefined;
160
- const nameIdx = args.indexOf('--name');
173
+ const nameIdx = args.indexOf("--name");
161
174
  const name = nameIdx >= 0 ? args[nameIdx + 1] : undefined;
162
- const projectIdIdx = args.indexOf('--project-id');
175
+ const projectIdIdx = args.indexOf("--project-id");
163
176
  const projectId = projectIdIdx >= 0 ? args[projectIdIdx + 1] : undefined;
164
177
  // Attempt to get an authenticated client (don't fail if not logged in)
165
178
  const clientResult = await createCliClient().catch(() => null);
@@ -181,138 +194,142 @@ export async function runCli(argv) {
181
194
  process.exitCode = result.exitCode;
182
195
  break;
183
196
  }
184
- case 'generate':
197
+ case "generate":
185
198
  await runGenerate();
186
199
  break;
187
- case 'setup':
200
+ case "setup":
188
201
  await runSetup();
189
202
  break;
190
- case 'test':
203
+ case "test":
191
204
  await runTest();
192
205
  break;
193
- case 'deploy': {
194
- const dryRun = args.includes('--dry-run');
206
+ case "deploy": {
207
+ const dryRun = args.includes("--dry-run");
195
208
  await runDeploy({ dry_run: dryRun });
196
209
  break;
197
210
  }
198
- case 'lint': {
211
+ case "lint": {
199
212
  await runLint({
200
- workflow_id: getArg('--workflow'),
213
+ workflow_id: getArg("--workflow"),
201
214
  });
202
215
  break;
203
216
  }
204
- case 'attach': {
217
+ case "attach": {
205
218
  const authResult = await requireCliClient();
206
219
  const attachResult = await runAttach(authResult.client, {
207
- instanceId: getArg('--instance'),
220
+ instanceId: getArg("--instance"),
208
221
  });
209
222
  if (attachResult.stdout.length > 0) {
210
- attachResult.stdout.forEach(line => console.log(line));
223
+ attachResult.stdout.forEach((line) => console.log(line));
211
224
  }
212
225
  if (attachResult.stderr.length > 0) {
213
- attachResult.stderr.forEach(line => console.error(line));
226
+ attachResult.stderr.forEach((line) => console.error(line));
214
227
  }
215
228
  if (attachResult.exitCode !== 0) {
216
229
  process.exitCode = attachResult.exitCode;
217
230
  }
218
231
  break;
219
232
  }
220
- case 'link': {
233
+ case "link": {
221
234
  // Alias for projects link — cloud project ↔ directory bind.
222
235
  const linkRef = args[1];
223
- if (!linkRef || linkRef.startsWith('--')) {
224
- console.error('Usage: loxtep link <project_id|name> [--path <dir>]');
236
+ if (!linkRef || linkRef.startsWith("--")) {
237
+ console.error("Usage: loxtep link <project_id|name> [--path <dir>]");
225
238
  process.exitCode = 1;
226
239
  break;
227
240
  }
228
241
  await runProjectsLink(linkRef, {
229
- path: getArg('--path'),
230
- debug: args.includes('--debug'),
242
+ path: getArg("--path"),
243
+ debug: args.includes("--debug"),
231
244
  });
232
245
  break;
233
246
  }
234
- case 'projects':
235
- if (sub === 'list') {
247
+ case "projects":
248
+ if (sub === "list") {
236
249
  await runProjectsList({
237
- debug: args.includes('--debug'),
238
- source: getArg('--source'),
250
+ debug: args.includes("--debug"),
251
+ source: getArg("--source"),
239
252
  });
240
253
  }
241
- else if (sub === 'get' && args[2]) {
242
- await runProjectsGet(args[2], { debug: args.includes('--debug') });
254
+ else if (sub === "get" && args[2]) {
255
+ await runProjectsGet(args[2], { debug: args.includes("--debug") });
243
256
  }
244
- else if (sub === 'link' && args[2] && !args[2].startsWith('--')) {
257
+ else if (sub === "link" && args[2] && !args[2].startsWith("--")) {
245
258
  await runProjectsLink(args[2], {
246
- path: getArg('--path'),
247
- debug: args.includes('--debug'),
259
+ path: getArg("--path"),
260
+ debug: args.includes("--debug"),
248
261
  });
249
262
  }
250
- else if (sub === 'changes') {
263
+ else if (sub === "changes") {
251
264
  await runProjectsChanges({
252
- debug: args.includes('--debug'),
253
- json: args.includes('--json'),
265
+ debug: args.includes("--debug"),
266
+ json: args.includes("--json"),
254
267
  });
255
268
  }
256
- else if (sub === 'clone' && args[2] && !args[2].startsWith('--')) {
257
- const cloneDir = args[3] && !args[3].startsWith('--') ? args[3] : undefined;
269
+ else if (sub === "clone" && args[2] && !args[2].startsWith("--")) {
270
+ const cloneDir = args[3] && !args[3].startsWith("--") ? args[3] : undefined;
258
271
  await runProjectsClone(args[2], cloneDir, {
259
- debug: args.includes('--debug'),
272
+ debug: args.includes("--debug"),
260
273
  });
261
274
  }
262
- else if (sub === 'pull') {
275
+ else if (sub === "pull") {
263
276
  await runProjectsGithubPullCmd({
264
- debug: args.includes('--debug'),
265
- projectId: getArg('--project-id'),
266
- commitSha: getArg('--commit-sha'),
277
+ debug: args.includes("--debug"),
278
+ projectId: getArg("--project-id"),
279
+ commitSha: getArg("--commit-sha"),
267
280
  });
268
281
  }
269
- else if (sub === 'push') {
282
+ else if (sub === "push") {
270
283
  await runProjectsGithubPushCmd({
271
- debug: args.includes('--debug'),
272
- projectId: getArg('--project-id'),
273
- commitMessage: getArg('--message') ?? getArg('--commit-message'),
274
- branch: getArg('--branch'),
284
+ debug: args.includes("--debug"),
285
+ projectId: getArg("--project-id"),
286
+ commitMessage: getArg("--message") ?? getArg("--commit-message"),
287
+ branch: getArg("--branch"),
275
288
  });
276
289
  }
277
290
  else {
278
- console.error('Usage: loxtep projects list [--source local|remote|all] | projects get <id> | projects link <id|name> [--path <dir>] | projects changes [--json] | projects clone <id|name> [dir] | projects pull | projects push');
291
+ console.error("Usage: loxtep projects list [--source local|remote|all] | projects get <id> | projects link <id|name> [--path <dir>] | projects changes [--json] | projects clone <id|name> [dir] | projects pull | projects push");
279
292
  process.exitCode = 1;
280
293
  }
281
294
  break;
282
- case 'status': {
295
+ case "status": {
283
296
  // Cwd-first project workspace status — not `observe status` (bots/queues).
284
297
  await runStatus({
285
- json: args.includes('--json'),
286
- unpublished: args.includes('--unpublished'),
298
+ json: args.includes("--json"),
299
+ unpublished: args.includes("--unpublished"),
287
300
  });
288
301
  break;
289
302
  }
290
- case 'bus':
291
- if (sub === 'login') {
303
+ case "bus":
304
+ if (sub === "login") {
292
305
  await runBusLogin();
293
306
  }
294
307
  else {
295
- console.error('Usage: loxtep bus login');
308
+ console.error("Usage: loxtep bus login");
296
309
  process.exitCode = 1;
297
310
  }
298
311
  break;
299
- case 'config':
300
- if (sub === 'list') {
312
+ case "config":
313
+ if (sub === "list") {
301
314
  await runConfigList();
302
315
  }
303
- else if (sub === 'paths') {
316
+ else if (sub === "paths") {
304
317
  await runConfigPaths();
305
318
  }
306
- else if (sub === 'set' && args[2] != null) {
307
- await runConfigSet(args[2], args[3] ?? '');
319
+ else if (sub === "set" && args[2] != null) {
320
+ await runConfigSet(args[2], args[3] ?? "");
308
321
  }
309
- else if (sub === 'export') {
310
- const fromDpIdx = args.indexOf('--from-data-product');
322
+ else if (sub === "export") {
323
+ const fromDpIdx = args.indexOf("--from-data-product");
311
324
  const dpId = fromDpIdx >= 0 ? args[fromDpIdx + 1] : undefined;
312
- const fromConnIdx = args.indexOf('--from-connector');
325
+ const fromConnIdx = args.indexOf("--from-connector");
313
326
  const connId = fromConnIdx >= 0 ? args[fromConnIdx + 1] : undefined;
314
- const fmtArg = getArg('--format');
315
- const format = fmtArg === 'json' ? 'json' : fmtArg === 'env' ? 'env' : 'sh';
327
+ const fmtArg = getArg("--format");
328
+ const format = fmtArg === "json"
329
+ ? "json"
330
+ : fmtArg === "env"
331
+ ? "env"
332
+ : "sh";
316
333
  if (connId) {
317
334
  await runConfigExportFromConnector(connId, { format });
318
335
  }
@@ -320,47 +337,47 @@ export async function runCli(argv) {
320
337
  await runConfigExportFromDataProduct(dpId, { format });
321
338
  }
322
339
  else {
323
- console.error('Usage: loxtep config export --from-connector <id> [--format sh|json|env]\n loxtep config export --from-data-product <id> [--format sh|json|env]');
340
+ console.error("Usage: loxtep config export --from-connector <id> [--format sh|json|env]\n loxtep config export --from-data-product <id> [--format sh|json|env]");
324
341
  process.exitCode = 1;
325
342
  }
326
343
  }
327
344
  else {
328
- console.error('Usage: loxtep config list | loxtep config paths | loxtep config set <key> <value> | loxtep config export --from-connector <id> | loxtep config export --from-data-product <id>');
345
+ console.error("Usage: loxtep config list | loxtep config paths | loxtep config set <key> <value> | loxtep config export --from-connector <id> | loxtep config export --from-data-product <id>");
329
346
  process.exitCode = 1;
330
347
  }
331
348
  break;
332
- case 'data-products':
333
- if (sub === 'list') {
334
- await runDataProductsList({ debug: args.includes('--debug') });
349
+ case "data-products":
350
+ if (sub === "list") {
351
+ await runDataProductsList({ debug: args.includes("--debug") });
335
352
  }
336
- else if (sub === 'get' && args[2]) {
353
+ else if (sub === "get" && args[2]) {
337
354
  await runDataProductsGet(args[2]);
338
355
  }
339
- else if (sub === 'query' && args[2]) {
340
- const fileIdx = args.indexOf('--file');
356
+ else if (sub === "query" && args[2]) {
357
+ const fileIdx = args.indexOf("--file");
341
358
  const sql = fileIdx >= 0
342
359
  ? undefined
343
360
  : args
344
361
  .slice(3)
345
- .join(' ')
346
- .replace(/^["']|["']$/g, '');
362
+ .join(" ")
363
+ .replace(/^["']|["']$/g, "");
347
364
  if (fileIdx >= 0) {
348
- const fs = await import('fs/promises');
365
+ const fs = await import("fs/promises");
349
366
  const path = args[fileIdx + 1];
350
367
  if (!path) {
351
- console.error('Usage: loxtep data-products query <id> --file <path>');
368
+ console.error("Usage: loxtep data-products query <id> --file <path>");
352
369
  process.exitCode = 1;
353
370
  }
354
371
  else {
355
- const sqlFromFile = (await fs.readFile(path, 'utf-8')).trim();
372
+ const sqlFromFile = (await fs.readFile(path, "utf-8")).trim();
356
373
  await runDataProductsQuery(args[2], sqlFromFile, {
357
- receipt: args.includes('--receipt') || args.includes('--json'),
374
+ receipt: args.includes("--receipt") || args.includes("--json"),
358
375
  });
359
376
  }
360
377
  }
361
378
  else if (sql) {
362
379
  await runDataProductsQuery(args[2], sql, {
363
- receipt: args.includes('--receipt') || args.includes('--json'),
380
+ receipt: args.includes("--receipt") || args.includes("--json"),
364
381
  });
365
382
  }
366
383
  else {
@@ -368,59 +385,67 @@ export async function runCli(argv) {
368
385
  process.exitCode = 1;
369
386
  }
370
387
  }
371
- else if (sub === 'tables' && args[2]) {
388
+ else if (sub === "tables" && args[2]) {
372
389
  await runDataProductsTables(args[2]);
373
390
  }
374
- else if (sub === 'create') {
375
- const name = getArg('--name');
376
- const domainId = getArg('--domain-id');
377
- const kind = getArg('--kind');
378
- const description = getArg('--description');
379
- if (!name || !domainId || !kind || !['source', 'consumer'].includes(kind)) {
380
- console.error('Usage: loxtep data-products create --name <name> --domain-id <uuid> --kind <source|consumer> [--description <text>]');
391
+ else if (sub === "create") {
392
+ const name = getArg("--name");
393
+ const domainId = getArg("--domain-id");
394
+ const kind = getArg("--kind");
395
+ const description = getArg("--description");
396
+ if (!name ||
397
+ !domainId ||
398
+ !kind ||
399
+ !["source", "consumer"].includes(kind)) {
400
+ console.error("Usage: loxtep data-products create --name <name> --domain-id <uuid> --kind <source|consumer> [--description <text>]");
381
401
  process.exitCode = 1;
382
402
  }
383
403
  else {
384
- await runDataProductsCreate({ name, domain_id: domainId, kind, description });
404
+ await runDataProductsCreate({
405
+ name,
406
+ domain_id: domainId,
407
+ kind,
408
+ description,
409
+ });
385
410
  }
386
411
  }
387
- else if (sub === 'readiness' && args[2]) {
412
+ else if (sub === "readiness" && args[2]) {
388
413
  await runDataProductsReadiness(args[2]);
389
414
  }
390
- else if (sub === 'promote' && args[2]) {
391
- const target = getArg('--target');
392
- if (!target || !['silver', 'gold'].includes(target)) {
393
- console.error('Usage: loxtep data-products promote <id> --target <silver|gold>');
415
+ else if (sub === "promote" && args[2]) {
416
+ const target = getArg("--target");
417
+ if (!target || !["silver", "gold"].includes(target)) {
418
+ console.error("Usage: loxtep data-products promote <id> --target <silver|gold>");
394
419
  process.exitCode = 1;
395
420
  }
396
421
  else {
397
422
  await runDataProductsPromote(args[2], target);
398
423
  }
399
424
  }
400
- else if (sub === 'iceberg') {
425
+ else if (sub === "iceberg") {
401
426
  await runDataPlaneIceberg(args.slice(2));
402
427
  }
403
- else if (sub === 'export' && args[2]) {
428
+ else if (sub === "export" && args[2]) {
404
429
  await runDataPlaneExport(args.slice(2));
405
430
  }
406
- else if (sub === 'primary-entity' && args[2]) {
407
- await runPrimaryEntity(args[2], { json: args.includes('--json') });
431
+ else if (sub === "primary-entity" && args[2]) {
432
+ await runPrimaryEntity(args[2], { json: args.includes("--json") });
408
433
  }
409
434
  else {
410
435
  console.error('Usage: loxtep data-products list | get <id> | create --name ... --domain-id ... | query <id> "SQL" [--receipt] | tables <id> | iceberg ... | export <id> --start <eid> | primary-entity <id>');
411
436
  process.exitCode = 1;
412
437
  }
413
438
  break;
414
- case 'metrics':
415
- if (sub === 'rate-limits') {
439
+ case "metrics":
440
+ if (sub === "rate-limits") {
416
441
  await runMetricsRateLimits();
417
442
  }
418
- else if (sub === 'log') {
419
- const id = getArg('--id');
420
- const valueStr = getArg('--value');
443
+ else if (sub === "log") {
444
+ const id = getArg("--id");
445
+ const valueStr = getArg("--value");
421
446
  const value = valueStr != null ? Number(valueStr) : NaN;
422
447
  if (!id || Number.isNaN(value)) {
423
- console.error('Usage: loxtep metrics log --id <id> --value <number> [--tags k=v,...]');
448
+ console.error("Usage: loxtep metrics log --id <id> --value <number> [--tags k=v,...]");
424
449
  process.exitCode = 1;
425
450
  }
426
451
  else {
@@ -428,57 +453,62 @@ export async function runCli(argv) {
428
453
  }
429
454
  }
430
455
  else {
431
- console.error('Usage: loxtep metrics rate-limits | loxtep metrics log --id <id> --value <n>');
456
+ console.error("Usage: loxtep metrics rate-limits | loxtep metrics log --id <id> --value <n>");
432
457
  process.exitCode = 1;
433
458
  }
434
459
  break;
435
- case 'queue':
436
- if (sub === 'info') {
437
- const queueIdx = args.indexOf('--queue');
460
+ case "queue":
461
+ if (sub === "info") {
462
+ const queueIdx = args.indexOf("--queue");
438
463
  const idOrName = queueIdx >= 0 ? args[queueIdx + 1] : args[2];
439
464
  if (!idOrName) {
440
- console.error('Usage: loxtep queue info <data-product-id> | loxtep queue info --queue <queue-name>');
465
+ console.error("Usage: loxtep queue info <data-product-id> | loxtep queue info --queue <queue-name>");
441
466
  process.exitCode = 1;
442
467
  }
443
468
  else {
444
- await runQueueInfo(idOrName, { queueName: queueIdx >= 0, instanceId: getArg('--instance') });
469
+ await runQueueInfo(idOrName, {
470
+ queueName: queueIdx >= 0,
471
+ instanceId: getArg("--instance"),
472
+ });
445
473
  }
446
474
  }
447
- else if (sub === 'checkpoint' && args[2]) {
448
- const botIdx = args.indexOf('--bot');
475
+ else if (sub === "checkpoint" && args[2]) {
476
+ const botIdx = args.indexOf("--bot");
449
477
  const botId = botIdx >= 0 ? args[botIdx + 1] : undefined;
450
478
  if (!botId) {
451
- console.error('Usage: loxtep queue checkpoint <data-product-id> --bot <bot-id>');
479
+ console.error("Usage: loxtep queue checkpoint <data-product-id> --bot <bot-id>");
452
480
  process.exitCode = 1;
453
481
  }
454
482
  else {
455
- await runQueueCheckpoint(args[2], botId, { instanceId: getArg('--instance') });
483
+ await runQueueCheckpoint(args[2], botId, {
484
+ instanceId: getArg("--instance"),
485
+ });
456
486
  }
457
487
  }
458
488
  else {
459
- console.error('Usage: loxtep queue info <id> | loxtep queue checkpoint <id> --bot <bot-id>');
489
+ console.error("Usage: loxtep queue info <id> | loxtep queue checkpoint <id> --bot <bot-id>");
460
490
  process.exitCode = 1;
461
491
  }
462
492
  break;
463
- case 'workflows':
464
- if (sub === 'list') {
493
+ case "workflows":
494
+ if (sub === "list") {
465
495
  await runWorkflowsList({
466
- project_id: getArg('--project-id'),
467
- debug: args.includes('--debug'),
496
+ project_id: getArg("--project-id"),
497
+ debug: args.includes("--debug"),
468
498
  });
469
499
  }
470
- else if (sub === 'get' && args[2]) {
500
+ else if (sub === "get" && args[2]) {
471
501
  await runWorkflowsGet(args[2]);
472
502
  }
473
- else if (sub === 'create') {
474
- const name = getArg('--name');
475
- const projectId = getArg('--project-id');
476
- const templateId = getArg('--template-id');
477
- const description = getArg('--description');
478
- const workflowType = getArg('--workflow-type');
479
- const domainId = getArg('--domain-id');
503
+ else if (sub === "create") {
504
+ const name = getArg("--name");
505
+ const projectId = getArg("--project-id");
506
+ const templateId = getArg("--template-id");
507
+ const description = getArg("--description");
508
+ const workflowType = getArg("--workflow-type");
509
+ const domainId = getArg("--domain-id");
480
510
  if (!name || !projectId) {
481
- console.error('Usage: loxtep workflows create --name <name> --project-id <id> [--workflow-type ingestion|enrichment|delivery] [--domain-id <id>] [--template-id <id>] [--description <text>]');
511
+ console.error("Usage: loxtep workflows create --name <name> --project-id <id> [--workflow-type ingestion|enrichment|delivery] [--domain-id <id>] [--template-id <id>] [--description <text>]");
482
512
  process.exitCode = 1;
483
513
  }
484
514
  else {
@@ -492,13 +522,13 @@ export async function runCli(argv) {
492
522
  });
493
523
  }
494
524
  }
495
- else if (sub === 'deploy') {
496
- const projectId = getArg('--project-id');
497
- const instanceId = getArg('--instance-id');
498
- const versionId = getArg('--version-id');
499
- const force = args.includes('--force');
525
+ else if (sub === "deploy") {
526
+ const projectId = getArg("--project-id");
527
+ const instanceId = getArg("--instance-id");
528
+ const versionId = getArg("--version-id");
529
+ const force = args.includes("--force");
500
530
  if (!projectId) {
501
- console.error('Usage: loxtep workflows deploy --project-id <id> [--instance-id <id>] [--version-id <id>] [--force]');
531
+ console.error("Usage: loxtep workflows deploy --project-id <id> [--instance-id <id>] [--version-id <id>] [--force]");
502
532
  process.exitCode = 1;
503
533
  }
504
534
  else {
@@ -510,51 +540,52 @@ export async function runCli(argv) {
510
540
  });
511
541
  }
512
542
  }
513
- else if (sub === 'preview-query-trigger') {
514
- const workflowId = getArg('--workflow-id');
515
- const query = getArg('--query');
516
- const limitRaw = getArg('--limit');
517
- const primaryKeyRaw = getArg('--primary-key');
543
+ else if (sub === "preview-query-trigger") {
544
+ const workflowId = getArg("--workflow-id");
545
+ const query = getArg("--query");
546
+ const limitRaw = getArg("--limit");
547
+ const primaryKeyRaw = getArg("--primary-key");
518
548
  const primary_key = primaryKeyRaw
519
549
  ? primaryKeyRaw
520
- .split(',')
550
+ .split(",")
521
551
  .map((s) => s.trim())
522
552
  .filter(Boolean)
523
553
  : undefined;
524
- const limit = limitRaw != null && limitRaw !== '' ? Number(limitRaw) : undefined;
525
- if (!workflowId || (limitRaw != null && limitRaw !== '' && Number.isNaN(limit))) {
526
- console.error('Usage: loxtep workflows preview-query-trigger --workflow-id <uuid> [--project-id <uuid>] [--query <sql>] [--limit N] [--primary-key a,b]');
554
+ const limit = limitRaw != null && limitRaw !== "" ? Number(limitRaw) : undefined;
555
+ if (!workflowId ||
556
+ (limitRaw != null && limitRaw !== "" && Number.isNaN(limit))) {
557
+ console.error("Usage: loxtep workflows preview-query-trigger --workflow-id <uuid> [--project-id <uuid>] [--query <sql>] [--limit N] [--primary-key a,b]");
527
558
  process.exitCode = 1;
528
559
  }
529
560
  else {
530
561
  await runWorkflowsPreviewQueryTrigger({
531
562
  workflow_id: workflowId,
532
- project_id: getArg('--project-id'),
563
+ project_id: getArg("--project-id"),
533
564
  query,
534
565
  primary_key,
535
566
  limit,
536
567
  });
537
568
  }
538
569
  }
539
- else if (sub === 'run-query-trigger') {
540
- const workflowId = getArg('--workflow-id');
541
- const query = getArg('--query');
542
- const primaryKeyRaw = getArg('--primary-key');
570
+ else if (sub === "run-query-trigger") {
571
+ const workflowId = getArg("--workflow-id");
572
+ const query = getArg("--query");
573
+ const primaryKeyRaw = getArg("--primary-key");
543
574
  const primary_key = primaryKeyRaw
544
575
  ? primaryKeyRaw
545
- .split(',')
576
+ .split(",")
546
577
  .map((s) => s.trim())
547
578
  .filter(Boolean)
548
579
  : undefined;
549
- const sinkDataProductId = getArg('--sink-data-product-id');
580
+ const sinkDataProductId = getArg("--sink-data-product-id");
550
581
  if (!workflowId) {
551
- console.error('Usage: loxtep workflows run-query-trigger --workflow-id <uuid> [--project-id <uuid>] [--sink-data-product-id <uuid>]');
582
+ console.error("Usage: loxtep workflows run-query-trigger --workflow-id <uuid> [--project-id <uuid>] [--sink-data-product-id <uuid>]");
552
583
  process.exitCode = 1;
553
584
  }
554
585
  else {
555
586
  await runWorkflowsRunQueryTrigger({
556
587
  workflow_id: workflowId,
557
- project_id: getArg('--project-id'),
588
+ project_id: getArg("--project-id"),
558
589
  query,
559
590
  primary_key,
560
591
  sink_data_product_id: sinkDataProductId,
@@ -562,168 +593,173 @@ export async function runCli(argv) {
562
593
  }
563
594
  }
564
595
  else {
565
- console.error('Usage: loxtep workflows list [--project-id <id>] | get <id> | create --name <name> --project-id <id> | deploy --project-id <id> --instance-id <id> | preview-query-trigger --workflow-id <uuid> | run-query-trigger --workflow-id <uuid>');
596
+ console.error("Usage: loxtep workflows list [--project-id <id>] | get <id> | create --name <name> --project-id <id> | deploy --project-id <id> --instance-id <id> | preview-query-trigger --workflow-id <uuid> | run-query-trigger --workflow-id <uuid>");
566
597
  process.exitCode = 1;
567
598
  }
568
599
  break;
569
- case 'bundle':
570
- if (sub === 'save') {
600
+ case "bundle":
601
+ if (sub === "save") {
571
602
  await runBundleSave({
572
- file: getArg('--file'),
573
- project_id: getArg('--project-id'),
574
- dry_run: args.includes('--dry-run'),
603
+ file: getArg("--file"),
604
+ project_id: getArg("--project-id"),
605
+ dry_run: args.includes("--dry-run"),
575
606
  });
576
607
  }
577
608
  else {
578
- console.error('Usage: loxtep bundle save [--file .loxtep/sdk-ingest-bundle.json] [--project-id <id>] [--dry-run]');
609
+ console.error("Usage: loxtep bundle save [--file .loxtep/sdk-ingest-bundle.json] [--project-id <id>] [--dry-run]");
579
610
  process.exitCode = 1;
580
611
  }
581
612
  break;
582
- case 'ingest':
583
- if (sub === 'create' || sub === 'provision') {
584
- if (sub === 'provision') {
585
- console.error('Note: `loxtep ingest provision` is deprecated; use `loxtep ingest create`.');
613
+ case "ingest":
614
+ if (sub === "create" || sub === "provision") {
615
+ if (sub === "provision") {
616
+ console.error("Note: `loxtep ingest provision` is deprecated; use `loxtep ingest create`.");
586
617
  }
587
618
  await runIngestCreate({
588
- name: getArg('--name'),
589
- domain_id: getArg('--domain-id'),
590
- workflow_name: getArg('--workflow-name'),
591
- project_id: getArg('--project-id'),
592
- instance_id: getArg('--instance-id'),
593
- connector_id: getArg('--connector-id'),
594
- dry_run: args.includes('--dry-run'),
595
- deploy: args.includes('--deploy'),
596
- no_deploy: args.includes('--no-deploy'),
597
- iceberg: args.includes('--iceberg'),
619
+ name: getArg("--name"),
620
+ domain_id: getArg("--domain-id"),
621
+ workflow_name: getArg("--workflow-name"),
622
+ project_id: getArg("--project-id"),
623
+ instance_id: getArg("--instance-id"),
624
+ connector_id: getArg("--connector-id"),
625
+ dry_run: args.includes("--dry-run"),
626
+ deploy: args.includes("--deploy"),
627
+ no_deploy: args.includes("--no-deploy"),
628
+ iceberg: args.includes("--iceberg"),
629
+ transport_mode: getArg("--transport-mode"),
598
630
  });
599
631
  }
600
632
  else {
601
- console.error('Usage: loxtep ingest create [--name app-events] [--domain-id <id>] [--connector-id <id>] [--iceberg] [--dry-run] [--deploy]');
633
+ console.error("Usage: loxtep ingest create [--name app-events] [--domain-id <id>] [--connector-id <id>] [--transport-mode default|fast|volume] [--iceberg] [--dry-run] [--deploy]");
602
634
  process.exitCode = 1;
603
635
  }
604
636
  break;
605
- case 'transform':
606
- if (sub === 'create') {
607
- const from = getArg('--from');
637
+ case "transform":
638
+ if (sub === "create") {
639
+ const from = getArg("--from");
608
640
  if (!from) {
609
- console.error('Usage: loxtep transform create --from <upstream-dp> [--name cleaned-…] [--domain-id <id>] [--dry-run]');
641
+ console.error("Usage: loxtep transform create --from <upstream-dp> [--name cleaned-…] [--domain-id <id>] [--transport-mode default|fast|volume] [--dry-run]");
610
642
  process.exitCode = 1;
611
643
  }
612
644
  else {
613
645
  await runTransformCreate({
614
646
  from,
615
- name: getArg('--name'),
616
- project_id: getArg('--project-id'),
617
- domain_id: getArg('--domain-id'),
618
- dry_run: args.includes('--dry-run'),
647
+ name: getArg("--name"),
648
+ project_id: getArg("--project-id"),
649
+ domain_id: getArg("--domain-id"),
650
+ dry_run: args.includes("--dry-run"),
651
+ transport_mode: getArg("--transport-mode"),
619
652
  });
620
653
  }
621
654
  }
622
655
  else {
623
- console.error('Usage: loxtep transform create --from <upstream-dp> [--name cleaned-…] [--dry-run]');
656
+ console.error("Usage: loxtep transform create --from <upstream-dp> [--name cleaned-…] [--transport-mode default|fast|volume] [--dry-run]");
624
657
  process.exitCode = 1;
625
658
  }
626
659
  break;
627
- case 'delivery':
628
- if (sub === 'create') {
629
- const from = getArg('--from');
630
- const connectorId = getArg('--connector-id');
660
+ case "delivery":
661
+ if (sub === "create") {
662
+ const from = getArg("--from");
663
+ const connectorId = getArg("--connector-id");
631
664
  if (!from || !connectorId) {
632
- console.error('Usage: loxtep delivery create --from <dp-name> --connector-id <id> [--table schema.table] [--name …] [--dry-run]');
665
+ console.error("Usage: loxtep delivery create --from <dp-name> --connector-id <id> [--table schema.table] [--name …] [--transport-mode default|fast|volume] [--dry-run]");
633
666
  process.exitCode = 1;
634
667
  }
635
668
  else {
636
669
  await runDeliveryCreate({
637
670
  from,
638
671
  connector_id: connectorId,
639
- name: getArg('--name'),
640
- project_id: getArg('--project-id'),
641
- domain_id: getArg('--domain-id'),
642
- table: getArg('--table'),
643
- schema: getArg('--schema'),
644
- primary_key: getArg('--primary-key'),
645
- dry_run: args.includes('--dry-run'),
672
+ name: getArg("--name"),
673
+ project_id: getArg("--project-id"),
674
+ domain_id: getArg("--domain-id"),
675
+ table: getArg("--table"),
676
+ schema: getArg("--schema"),
677
+ primary_key: getArg("--primary-key"),
678
+ dry_run: args.includes("--dry-run"),
679
+ transport_mode: getArg("--transport-mode"),
646
680
  });
647
681
  }
648
682
  }
649
683
  else {
650
- console.error('Usage: loxtep delivery create --from <dp-name> --connector-id <id> [--table schema.table] [--name …] [--dry-run]');
684
+ console.error("Usage: loxtep delivery create --from <dp-name> --connector-id <id> [--table schema.table] [--name …] [--transport-mode default|fast|volume] [--dry-run]");
651
685
  process.exitCode = 1;
652
686
  }
653
687
  break;
654
- case 'push':
688
+ case "push":
655
689
  await runPush({
656
- project_id: getArg('--project-id'),
657
- workflow_id: getArg('--workflow-id'),
658
- dry_run: args.includes('--dry-run'),
659
- skip_reindex: args.includes('--skip-reindex'),
690
+ project_id: getArg("--project-id"),
691
+ workflow_id: getArg("--workflow-id"),
692
+ dry_run: args.includes("--dry-run"),
693
+ skip_reindex: args.includes("--skip-reindex"),
660
694
  });
661
695
  break;
662
- case 'connectors':
663
- if (sub === 'list') {
664
- await runConnectorsList({ type: getArg('--type') }, { debug: args.includes('--debug') });
696
+ case "connectors":
697
+ if (sub === "list") {
698
+ await runConnectorsList({ type: getArg("--type") }, { debug: args.includes("--debug") });
665
699
  }
666
- else if (sub === 'test' && args[2]) {
667
- await runConnectorsTest(args[2], { debug: args.includes('--debug') });
700
+ else if (sub === "test" && args[2]) {
701
+ await runConnectorsTest(args[2], { debug: args.includes("--debug") });
668
702
  }
669
- else if ((sub === 'list-entities' || sub === 'list_entities') &&
703
+ else if ((sub === "list-entities" || sub === "list_entities") &&
670
704
  args[2]) {
671
- await runConnectorsListEntities(args[2], { debug: args.includes('--debug') });
705
+ await runConnectorsListEntities(args[2], {
706
+ debug: args.includes("--debug"),
707
+ });
672
708
  }
673
- else if ((sub === 'capture-samples' || sub === 'capture_samples') &&
709
+ else if ((sub === "capture-samples" || sub === "capture_samples") &&
674
710
  args[2]) {
675
- const limitRaw = getArg('--limit');
676
- const limit = limitRaw != null && limitRaw !== '' ? Number(limitRaw) : undefined;
711
+ const limitRaw = getArg("--limit");
712
+ const limit = limitRaw != null && limitRaw !== "" ? Number(limitRaw) : undefined;
677
713
  await runConnectorsCaptureSamples({
678
714
  connector_id: args[2],
679
- entity_type: getArg('--entity-type') ?? getArg('--entity'),
715
+ entity_type: getArg("--entity-type") ?? getArg("--entity"),
680
716
  limit: Number.isFinite(limit) ? limit : undefined,
681
- }, { debug: args.includes('--debug') });
717
+ }, { debug: args.includes("--debug") });
682
718
  }
683
719
  else {
684
720
  console.error([
685
- 'Usage:',
686
- ' loxtep connectors list [--type sdk]',
687
- ' loxtep connectors test <connector_id>',
688
- ' loxtep connectors list-entities <connector_id>',
689
- ' loxtep connectors capture-samples <connector_id> --entity-type <name> [--limit N]',
690
- ].join('\n'));
721
+ "Usage:",
722
+ " loxtep connectors list [--type sdk]",
723
+ " loxtep connectors test <connector_id>",
724
+ " loxtep connectors list-entities <connector_id>",
725
+ " loxtep connectors capture-samples <connector_id> --entity-type <name> [--limit N]",
726
+ ].join("\n"));
691
727
  process.exitCode = 1;
692
728
  }
693
729
  break;
694
- case 'observe':
695
- if (sub === 'status') {
730
+ case "observe":
731
+ if (sub === "status") {
696
732
  await runObserveStatus();
697
733
  }
698
734
  else {
699
- console.error('Usage: loxtep observe status');
735
+ console.error("Usage: loxtep observe status");
700
736
  process.exitCode = 1;
701
737
  }
702
738
  break;
703
- case 'triggers':
704
- if (sub === 'list') {
739
+ case "triggers":
740
+ if (sub === "list") {
705
741
  await runTriggersList({
706
- debug: args.includes('--debug'),
707
- project_id: getArg('--project-id'),
708
- workflow_id: getArg('--workflow-id'),
742
+ debug: args.includes("--debug"),
743
+ project_id: getArg("--project-id"),
744
+ workflow_id: getArg("--workflow-id"),
709
745
  });
710
746
  }
711
- else if (sub === 'get' && args[2]) {
747
+ else if (sub === "get" && args[2]) {
712
748
  await runTriggersGet(args[2], {
713
- project_id: getArg('--project-id'),
714
- workflow_id: getArg('--workflow-id'),
749
+ project_id: getArg("--project-id"),
750
+ workflow_id: getArg("--workflow-id"),
715
751
  });
716
752
  }
717
- else if (sub === 'create') {
718
- const name = getArg('--name');
719
- const type = getArg('--type');
720
- const key = getArg('--key');
721
- const data = getArg('--data');
722
- const projectId = getArg('--project-id');
723
- const workflowId = getArg('--workflow-id');
753
+ else if (sub === "create") {
754
+ const name = getArg("--name");
755
+ const type = getArg("--type");
756
+ const key = getArg("--key");
757
+ const data = getArg("--data");
758
+ const projectId = getArg("--project-id");
759
+ const workflowId = getArg("--workflow-id");
724
760
  if (!name || !type || !key || !projectId || !workflowId) {
725
- console.error('Usage: loxtep triggers create --project-id <id> --workflow-id <id> --name <name> --type <database|api|webhook|file> --key <key> [--data <json>]\n' +
726
- 'Prefer: loxtep ingest create');
761
+ console.error("Usage: loxtep triggers create --project-id <id> --workflow-id <id> --name <name> --type <database|api|webhook|file> --key <key> [--data <json>]\n" +
762
+ "Prefer: loxtep ingest create");
727
763
  process.exitCode = 1;
728
764
  }
729
765
  else {
@@ -731,105 +767,107 @@ export async function runCli(argv) {
731
767
  name,
732
768
  type,
733
769
  key,
734
- data: data ?? '{}',
770
+ data: data ?? "{}",
735
771
  project_id: projectId,
736
772
  workflow_id: workflowId,
737
773
  });
738
774
  }
739
775
  }
740
- else if (sub === 'test' && args[2]) {
776
+ else if (sub === "test" && args[2]) {
741
777
  await runTriggersTest(args[2], {
742
- project_id: getArg('--project-id'),
743
- workflow_id: getArg('--workflow-id'),
778
+ project_id: getArg("--project-id"),
779
+ workflow_id: getArg("--workflow-id"),
744
780
  });
745
781
  }
746
- else if (sub === 'reset-backfill' && args[2]) {
782
+ else if (sub === "reset-backfill" && args[2]) {
747
783
  await runTriggersResetBackfill(args[2], {
748
- project_id: getArg('--project-id'),
749
- instance_id: getArg('--instance-id'),
750
- rebaseline_config_hash: args.includes('--rebaseline-config-hash'),
784
+ project_id: getArg("--project-id"),
785
+ instance_id: getArg("--instance-id"),
786
+ rebaseline_config_hash: args.includes("--rebaseline-config-hash"),
751
787
  });
752
788
  }
753
789
  else {
754
- console.error('Usage: loxtep triggers list [--project-id <id>] [--workflow-id <id>] | get <id> [--project-id <id>] [--workflow-id <id>] | create --project-id <id> --workflow-id <id> --name … | test <id> | reset-backfill <connection_id> [--rebaseline-config-hash] [--project-id <id>] [--instance-id <id>]');
790
+ console.error("Usage: loxtep triggers list [--project-id <id>] [--workflow-id <id>] | get <id> [--project-id <id>] [--workflow-id <id>] | create --project-id <id> --workflow-id <id> --name … | test <id> | reset-backfill <connection_id> [--rebaseline-config-hash] [--project-id <id>] [--instance-id <id>]");
755
791
  process.exitCode = 1;
756
792
  }
757
793
  break;
758
- case 'domains':
759
- if (sub === 'list') {
760
- await runDomainsList({ debug: args.includes('--debug') });
794
+ case "domains":
795
+ if (sub === "list") {
796
+ await runDomainsList({ debug: args.includes("--debug") });
761
797
  }
762
- else if (sub === 'get' && args[2]) {
798
+ else if (sub === "get" && args[2]) {
763
799
  await runDomainsGet(args[2]);
764
800
  }
765
801
  else {
766
- console.error('Usage: loxtep domains list | loxtep domains get <id>');
802
+ console.error("Usage: loxtep domains list | loxtep domains get <id>");
767
803
  process.exitCode = 1;
768
804
  }
769
805
  break;
770
- case 'standards':
771
- if (sub === 'list') {
772
- await runStandardsList({ debug: args.includes('--debug') });
806
+ case "standards":
807
+ if (sub === "list") {
808
+ await runStandardsList({ debug: args.includes("--debug") });
773
809
  }
774
- else if (sub === 'get' && args[2]) {
810
+ else if (sub === "get" && args[2]) {
775
811
  await runStandardsGet(args[2]);
776
812
  }
777
813
  else {
778
- console.error('Usage: loxtep standards list | loxtep standards get <id>');
814
+ console.error("Usage: loxtep standards list | loxtep standards get <id>");
779
815
  process.exitCode = 1;
780
816
  }
781
817
  break;
782
- case 'data-contracts':
783
- if (sub === 'list') {
784
- await runDataContractsList({ debug: args.includes('--debug') });
818
+ case "data-contracts":
819
+ if (sub === "list") {
820
+ await runDataContractsList({ debug: args.includes("--debug") });
785
821
  }
786
- else if (sub === 'get' && args[2]) {
822
+ else if (sub === "get" && args[2]) {
787
823
  await runDataContractsGet(args[2]);
788
824
  }
789
- else if (sub === 'create') {
790
- const dpId = getArg('--data-product-id');
791
- const name = getArg('--name');
825
+ else if (sub === "create") {
826
+ const dpId = getArg("--data-product-id");
827
+ const name = getArg("--name");
792
828
  if (!dpId || !name) {
793
- console.error('Usage: loxtep data-contracts create --data-product-id <id> --name <name> [--description <text>]');
829
+ console.error("Usage: loxtep data-contracts create --data-product-id <id> --name <name> [--description <text>]");
794
830
  process.exitCode = 1;
795
831
  }
796
832
  else {
797
- const schemaVersionId = getArg('--schema-version-id');
833
+ const schemaVersionId = getArg("--schema-version-id");
798
834
  await runDataContractsCreate({
799
835
  data_product_id: dpId,
800
836
  name,
801
- description: getArg('--description'),
802
- ...(schemaVersionId ? { schema_version_id: schemaVersionId } : {}),
837
+ description: getArg("--description"),
838
+ ...(schemaVersionId
839
+ ? { schema_version_id: schemaVersionId }
840
+ : {}),
803
841
  });
804
842
  }
805
843
  }
806
- else if (sub === 'update' && args[2]) {
844
+ else if (sub === "update" && args[2]) {
807
845
  await runDataContractsUpdate(args.slice(2));
808
846
  }
809
847
  else {
810
- console.error('Usage: loxtep data-contracts list | get <id> | create --data-product-id <id> --name <name>');
811
- console.error('Bind an existing contract with PUT /dataproducts/datacontracts/{id} (schema_ref or schema_version_id).');
848
+ console.error("Usage: loxtep data-contracts list | get <id> | create --data-product-id <id> --name <name>");
849
+ console.error("Bind an existing contract with PUT /dataproducts/datacontracts/{id} (schema_ref or schema_version_id).");
812
850
  process.exitCode = 1;
813
851
  }
814
852
  break;
815
- case 'promises':
853
+ case "promises":
816
854
  console.warn('Warning: "promises" is deprecated; use "data-contracts" (same behavior).');
817
- if (sub === 'list') {
818
- await runDataContractsList({ debug: args.includes('--debug') });
855
+ if (sub === "list") {
856
+ await runDataContractsList({ debug: args.includes("--debug") });
819
857
  }
820
- else if (sub === 'get' && args[2]) {
858
+ else if (sub === "get" && args[2]) {
821
859
  await runDataContractsGet(args[2]);
822
860
  }
823
861
  else {
824
- console.error('Usage: loxtep data-contracts list | loxtep data-contracts get <id>');
862
+ console.error("Usage: loxtep data-contracts list | loxtep data-contracts get <id>");
825
863
  process.exitCode = 1;
826
864
  }
827
865
  break;
828
- case 'improvements': {
866
+ case "improvements": {
829
867
  const authResult = await requireCliClient();
830
- if (sub === 'list') {
831
- const statusFilter = getArg('--status');
832
- const workflowFilter = getArg('--workflow');
868
+ if (sub === "list") {
869
+ const statusFilter = getArg("--status");
870
+ const workflowFilter = getArg("--workflow");
833
871
  const result = await runImprovementsListCommand(authResult.client, {
834
872
  status: statusFilter,
835
873
  workflow_name: workflowFilter,
@@ -841,7 +879,7 @@ export async function runCli(argv) {
841
879
  if (result.exitCode !== 0)
842
880
  process.exitCode = result.exitCode;
843
881
  }
844
- else if (sub === 'apply' && args[2]) {
882
+ else if (sub === "apply" && args[2]) {
845
883
  const result = await runImprovementsApplyCommand(authResult.client, args[2]);
846
884
  for (const line of result.stdout)
847
885
  console.log(line);
@@ -850,7 +888,7 @@ export async function runCli(argv) {
850
888
  if (result.exitCode !== 0)
851
889
  process.exitCode = result.exitCode;
852
890
  }
853
- else if (sub === 'reject' && args[2]) {
891
+ else if (sub === "reject" && args[2]) {
854
892
  const result = await runImprovementsRejectCommand(authResult.client, args[2]);
855
893
  for (const line of result.stdout)
856
894
  console.log(line);
@@ -860,21 +898,21 @@ export async function runCli(argv) {
860
898
  process.exitCode = result.exitCode;
861
899
  }
862
900
  else {
863
- console.error('Usage: loxtep improvements list [--status proposed|applied|rejected] [--workflow <name>]\n' +
864
- ' loxtep improvements apply <id>\n' +
865
- ' loxtep improvements reject <id>');
901
+ console.error("Usage: loxtep improvements list [--status proposed|applied|rejected] [--workflow <name>]\n" +
902
+ " loxtep improvements apply <id>\n" +
903
+ " loxtep improvements reject <id>");
866
904
  process.exitCode = 1;
867
905
  }
868
906
  break;
869
907
  }
870
- case 'approvals': {
908
+ case "approvals": {
871
909
  const authResult = await requireCliClient();
872
- const orgId = getArg('--organization-id');
873
- if (sub === 'list') {
874
- const statusFilter = getArg('--status');
910
+ const orgId = getArg("--organization-id");
911
+ if (sub === "list") {
912
+ const statusFilter = getArg("--status");
875
913
  const pageFlags = parseApprovalsListNumericFlags({
876
- page: getArg('--page'),
877
- page_size: getArg('--page-size'),
914
+ page: getArg("--page"),
915
+ page_size: getArg("--page-size"),
878
916
  });
879
917
  if (!pageFlags.ok) {
880
918
  console.error(pageFlags.error);
@@ -894,11 +932,11 @@ export async function runCli(argv) {
894
932
  if (result.exitCode !== 0)
895
933
  process.exitCode = result.exitCode;
896
934
  }
897
- else if (sub === 'approve' && args[2]) {
935
+ else if (sub === "approve" && args[2]) {
898
936
  const result = await runApprovalsApproveCommand(authResult.client, args[2], {
899
937
  organization_id: orgId,
900
- response: getArg('--response'),
901
- form_response_json: getArg('--form-response'),
938
+ response: getArg("--response"),
939
+ form_response_json: getArg("--form-response"),
902
940
  });
903
941
  for (const line of result.stdout)
904
942
  console.log(line);
@@ -907,11 +945,11 @@ export async function runCli(argv) {
907
945
  if (result.exitCode !== 0)
908
946
  process.exitCode = result.exitCode;
909
947
  }
910
- else if (sub === 'reject' && args[2]) {
948
+ else if (sub === "reject" && args[2]) {
911
949
  const result = await runApprovalsRejectCommand(authResult.client, args[2], {
912
950
  organization_id: orgId,
913
- response: getArg('--response'),
914
- form_response_json: getArg('--form-response'),
951
+ response: getArg("--response"),
952
+ form_response_json: getArg("--form-response"),
915
953
  });
916
954
  for (const line of result.stdout)
917
955
  console.log(line);
@@ -921,16 +959,16 @@ export async function runCli(argv) {
921
959
  process.exitCode = result.exitCode;
922
960
  }
923
961
  else {
924
- console.error('Usage: loxtep approvals list [--status pending|approved|rejected|expired] [--page N] [--page-size N] [--organization-id <id>]\n' +
925
- ' loxtep approvals approve <approval_request_id> [--response <val>] [--form-response <json>] [--organization-id <id>]\n' +
926
- ' loxtep approvals reject <approval_request_id> [--response <val>] [--form-response <json>] [--organization-id <id>]');
962
+ console.error("Usage: loxtep approvals list [--status pending|approved|rejected|expired] [--page N] [--page-size N] [--organization-id <id>]\n" +
963
+ " loxtep approvals approve <approval_request_id> [--response <val>] [--form-response <json>] [--organization-id <id>]\n" +
964
+ " loxtep approvals reject <approval_request_id> [--response <val>] [--form-response <json>] [--organization-id <id>]");
927
965
  process.exitCode = 1;
928
966
  }
929
967
  break;
930
968
  }
931
- case 'ontology': {
969
+ case "ontology": {
932
970
  const authResult = await requireCliClient();
933
- if (sub === 'link-class') {
971
+ if (sub === "link-class") {
934
972
  const result = await runOntologyLinkClassCommand(authResult.client, args);
935
973
  for (const line of result.stdout)
936
974
  console.log(line);
@@ -940,15 +978,15 @@ export async function runCli(argv) {
940
978
  process.exitCode = result.exitCode;
941
979
  }
942
980
  else {
943
- console.error('Usage: loxtep ontology link-class --source-uri <uri> --predicate-uri <uri> --target-uri <uri> [--description <text>] [--organization-id <id>]');
981
+ console.error("Usage: loxtep ontology link-class --source-uri <uri> --predicate-uri <uri> --target-uri <uri> [--description <text>] [--organization-id <id>]");
944
982
  process.exitCode = 1;
945
983
  }
946
984
  break;
947
985
  }
948
- case 'packs': {
986
+ case "packs": {
949
987
  const authResult = await requireCliClient();
950
- const orgId = getArg('--organization-id');
951
- if (sub === 'list') {
988
+ const orgId = getArg("--organization-id");
989
+ if (sub === "list") {
952
990
  const result = await runPacksListCommand(authResult.client);
953
991
  for (const line of result.stdout)
954
992
  console.log(line);
@@ -957,7 +995,7 @@ export async function runCli(argv) {
957
995
  if (result.exitCode !== 0)
958
996
  process.exitCode = result.exitCode;
959
997
  }
960
- else if (sub === 'activate' && args[2]) {
998
+ else if (sub === "activate" && args[2]) {
961
999
  const result = await runPacksActivateCommand(authResult.client, args[2], {
962
1000
  organization_id: orgId,
963
1001
  });
@@ -968,7 +1006,7 @@ export async function runCli(argv) {
968
1006
  if (result.exitCode !== 0)
969
1007
  process.exitCode = result.exitCode;
970
1008
  }
971
- else if (sub === 'status') {
1009
+ else if (sub === "status") {
972
1010
  const result = await runPacksStatusCommand(authResult.client);
973
1011
  for (const line of result.stdout)
974
1012
  console.log(line);
@@ -978,14 +1016,14 @@ export async function runCli(argv) {
978
1016
  process.exitCode = result.exitCode;
979
1017
  }
980
1018
  else {
981
- console.error('Usage: loxtep packs list\n' +
982
- ' loxtep packs activate <pack_id> [--organization-id <id>]\n' +
983
- ' loxtep packs status');
1019
+ console.error("Usage: loxtep packs list\n" +
1020
+ " loxtep packs activate <pack_id> [--organization-id <id>]\n" +
1021
+ " loxtep packs status");
984
1022
  process.exitCode = 1;
985
1023
  }
986
1024
  break;
987
1025
  }
988
- case 'proposals': {
1026
+ case "proposals": {
989
1027
  const authResult = await requireCliClient();
990
1028
  const printResult = (result) => {
991
1029
  for (const line of result.stdout)
@@ -995,30 +1033,30 @@ export async function runCli(argv) {
995
1033
  if (result.exitCode !== 0)
996
1034
  process.exitCode = result.exitCode;
997
1035
  };
998
- if (sub === 'list') {
999
- const page = getArg('--page');
1000
- const pageSize = getArg('--page-size');
1036
+ if (sub === "list") {
1037
+ const page = getArg("--page");
1038
+ const pageSize = getArg("--page-size");
1001
1039
  printResult(await runProposalsListCommand(authResult.client, {
1002
- disposition: getArg('--disposition') ?? 'pending',
1003
- proposal_type: getArg('--proposal-type'),
1004
- data_product_id: getArg('--data-product-id'),
1040
+ disposition: getArg("--disposition") ?? "pending",
1041
+ proposal_type: getArg("--proposal-type"),
1042
+ data_product_id: getArg("--data-product-id"),
1005
1043
  page: page ? Number(page) : undefined,
1006
1044
  page_size: pageSize ? Number(pageSize) : undefined,
1007
1045
  }));
1008
1046
  }
1009
- else if (sub === 'accept' && args[2]) {
1047
+ else if (sub === "accept" && args[2]) {
1010
1048
  printResult(await runProposalsAcceptCommand(authResult.client, args[2], {
1011
- definition: getArg('--definition'),
1012
- resolution_note: getArg('--resolution-note'),
1049
+ definition: getArg("--definition"),
1050
+ resolution_note: getArg("--resolution-note"),
1013
1051
  }));
1014
1052
  }
1015
- else if (sub === 'reject' && args[2]) {
1053
+ else if (sub === "reject" && args[2]) {
1016
1054
  printResult(await runProposalsRejectCommand(authResult.client, args[2], {
1017
- resolution_note: getArg('--resolution-note'),
1055
+ resolution_note: getArg("--resolution-note"),
1018
1056
  }));
1019
1057
  }
1020
- else if (sub === 'infer-definitions') {
1021
- const ids = args.slice(2).filter(a => a && !a.startsWith('--'));
1058
+ else if (sub === "infer-definitions") {
1059
+ const ids = args.slice(2).filter((a) => a && !a.startsWith("--"));
1022
1060
  printResult(await runProposalsInferDefinitionsCommand(authResult.client, ids));
1023
1061
  }
1024
1062
  else {
@@ -1027,7 +1065,7 @@ export async function runCli(argv) {
1027
1065
  }
1028
1066
  break;
1029
1067
  }
1030
- case 'define': {
1068
+ case "define": {
1031
1069
  const authResult = await requireCliClient();
1032
1070
  const printResult = (result) => {
1033
1071
  for (const line of result.stdout)
@@ -1037,58 +1075,58 @@ export async function runCli(argv) {
1037
1075
  if (result.exitCode !== 0)
1038
1076
  process.exitCode = result.exitCode;
1039
1077
  };
1040
- if (sub === 'status' && args[2]) {
1078
+ if (sub === "status" && args[2]) {
1041
1079
  printResult(await runDefineStatusCommand(authResult.client, args[2]));
1042
1080
  }
1043
- else if (sub === 'evidence' && args[2]) {
1081
+ else if (sub === "evidence" && args[2]) {
1044
1082
  printResult(await runDefineEvidenceCommand(authResult.client, args[2]));
1045
1083
  }
1046
- else if (sub === 'list') {
1084
+ else if (sub === "list") {
1047
1085
  printResult(await runDefineListCommand(authResult.client, {
1048
- data_product_id: getArg('--data-product-id'),
1049
- disposition: getArg('--disposition'),
1050
- proposal_type: getArg('--proposal-type'),
1086
+ data_product_id: getArg("--data-product-id"),
1087
+ disposition: getArg("--disposition"),
1088
+ proposal_type: getArg("--proposal-type"),
1051
1089
  }));
1052
1090
  }
1053
- else if (sub === 'get' && args[2]) {
1091
+ else if (sub === "get" && args[2]) {
1054
1092
  printResult(await runDefineGetCommand(authResult.client, args[2]));
1055
1093
  }
1056
- else if (sub === 'submit-shape' && args[2]) {
1094
+ else if (sub === "submit-shape" && args[2]) {
1057
1095
  printResult(await runDefineSubmitShapeCommand(authResult.client, args[2], {
1058
- definition_json: getArg('--definition'),
1059
- rationale: getArg('--rationale'),
1060
- base_revision: getArg('--base-revision'),
1061
- evidence_refs: getArg('--evidence-refs'),
1096
+ definition_json: getArg("--definition"),
1097
+ rationale: getArg("--rationale"),
1098
+ base_revision: getArg("--base-revision"),
1099
+ evidence_refs: getArg("--evidence-refs"),
1062
1100
  }));
1063
1101
  }
1064
- else if (sub === 'submit-semantic' && args[2]) {
1102
+ else if (sub === "submit-semantic" && args[2]) {
1065
1103
  printResult(await runDefineSubmitSemanticCommand(authResult.client, args[2], {
1066
- definition_json: getArg('--definition'),
1067
- rationale: getArg('--rationale'),
1104
+ definition_json: getArg("--definition"),
1105
+ rationale: getArg("--rationale"),
1068
1106
  }));
1069
1107
  }
1070
- else if (sub === 'approve' && args[2]) {
1108
+ else if (sub === "approve" && args[2]) {
1071
1109
  printResult(await runDefineApproveCommand(authResult.client, args[2]));
1072
1110
  }
1073
- else if (sub === 'apply' && args[2]) {
1111
+ else if (sub === "apply" && args[2]) {
1074
1112
  printResult(await runDefineApplyCommand(authResult.client, args[2]));
1075
1113
  }
1076
- else if (sub === 'withdraw' && args[2]) {
1114
+ else if (sub === "withdraw" && args[2]) {
1077
1115
  printResult(await runDefineWithdrawCommand(authResult.client, args[2]));
1078
1116
  }
1079
- else if (sub === 'skill') {
1117
+ else if (sub === "skill") {
1080
1118
  printResult(await runDefineSkillCommand(authResult.client));
1081
1119
  }
1082
- else if (sub === 'start-procedure' && args[2]) {
1120
+ else if (sub === "start-procedure" && args[2]) {
1083
1121
  printResult(await runDefineStartProcedureCommand(authResult.client, args[2]));
1084
1122
  }
1085
- else if (sub === 'batch') {
1123
+ else if (sub === "batch") {
1086
1124
  printResult(await runDefineBatchCommand(authResult.client, {
1087
- data_product_ids: getArg('--data-product-ids'),
1088
- action: getArg('--action'),
1125
+ data_product_ids: getArg("--data-product-ids"),
1126
+ action: getArg("--action"),
1089
1127
  }));
1090
1128
  }
1091
- else if (sub === 'glossary' || sub === 'apply-glossary') {
1129
+ else if (sub === "glossary" || sub === "apply-glossary") {
1092
1130
  await runDefineGlossary(args.slice(1));
1093
1131
  }
1094
1132
  else {
@@ -1097,16 +1135,16 @@ export async function runCli(argv) {
1097
1135
  }
1098
1136
  break;
1099
1137
  }
1100
- case 'cdlc': {
1138
+ case "cdlc": {
1101
1139
  const authResult = await requireCliClient();
1102
- const orgId = getArg('--organization-id');
1103
- if (sub === 'transition' && args[2]) {
1140
+ const orgId = getArg("--organization-id");
1141
+ if (sub === "transition" && args[2]) {
1104
1142
  const result = await runCdlcTransitionCommand(authResult.client, args[2], {
1105
- from: getArg('--from'),
1106
- to: getArg('--to'),
1143
+ from: getArg("--from"),
1144
+ to: getArg("--to"),
1107
1145
  organization_id: orgId,
1108
- actor: getArg('--actor'),
1109
- owner: getArg('--owner'),
1146
+ actor: getArg("--actor"),
1147
+ owner: getArg("--owner"),
1110
1148
  });
1111
1149
  for (const line of result.stdout)
1112
1150
  console.log(line);
@@ -1115,10 +1153,10 @@ export async function runCli(argv) {
1115
1153
  if (result.exitCode !== 0)
1116
1154
  process.exitCode = result.exitCode;
1117
1155
  }
1118
- else if (sub === 'review-queue') {
1156
+ else if (sub === "review-queue") {
1119
1157
  const result = await runCdlcReviewQueueCommand(authResult.client, {
1120
1158
  organization_id: orgId,
1121
- domain_id: getArg('--domain-id'),
1159
+ domain_id: getArg("--domain-id"),
1122
1160
  });
1123
1161
  for (const line of result.stdout)
1124
1162
  console.log(line);
@@ -1128,21 +1166,21 @@ export async function runCli(argv) {
1128
1166
  process.exitCode = result.exitCode;
1129
1167
  }
1130
1168
  else {
1131
- console.error('Usage: loxtep cdlc transition <artifact_ref> --from <state> --to <state> [--actor <id>] [--owner <id>] [--organization-id <id>]\n' +
1132
- ' loxtep cdlc review-queue [--domain-id <id>] [--organization-id <id>]\n' +
1133
- 'States: draft | in_review | approved | deployed | retired');
1169
+ console.error("Usage: loxtep cdlc transition <artifact_ref> --from <state> --to <state> [--actor <id>] [--owner <id>] [--organization-id <id>]\n" +
1170
+ " loxtep cdlc review-queue [--domain-id <id>] [--organization-id <id>]\n" +
1171
+ "States: draft | in_review | approved | deployed | retired");
1134
1172
  process.exitCode = 1;
1135
1173
  }
1136
1174
  break;
1137
1175
  }
1138
- case 'candidates': {
1176
+ case "candidates": {
1139
1177
  const authResult = await requireCliClient();
1140
- const orgId = getArg('--organization-id');
1141
- if (sub === 'list') {
1178
+ const orgId = getArg("--organization-id");
1179
+ if (sub === "list") {
1142
1180
  const result = await runCandidatesListCommand(authResult.client, {
1143
- candidate_type: getArg('--type'),
1144
- status: getArg('--status'),
1145
- mining_run_id: getArg('--mining-run-id'),
1181
+ candidate_type: getArg("--type"),
1182
+ status: getArg("--status"),
1183
+ mining_run_id: getArg("--mining-run-id"),
1146
1184
  organization_id: orgId,
1147
1185
  });
1148
1186
  for (const line of result.stdout)
@@ -1152,12 +1190,12 @@ export async function runCli(argv) {
1152
1190
  if (result.exitCode !== 0)
1153
1191
  process.exitCode = result.exitCode;
1154
1192
  }
1155
- else if (sub === 'act' && args[2]) {
1193
+ else if (sub === "act" && args[2]) {
1156
1194
  const result = await runCandidatesActCommand(authResult.client, args[2], {
1157
- action: getArg('--action'),
1195
+ action: getArg("--action"),
1158
1196
  organization_id: orgId,
1159
- rationale: getArg('--rationale'),
1160
- actor: getArg('--actor'),
1197
+ rationale: getArg("--rationale"),
1198
+ actor: getArg("--actor"),
1161
1199
  });
1162
1200
  for (const line of result.stdout)
1163
1201
  console.log(line);
@@ -1167,28 +1205,30 @@ export async function runCli(argv) {
1167
1205
  process.exitCode = result.exitCode;
1168
1206
  }
1169
1207
  else {
1170
- console.error('Usage: loxtep candidates list [--type <type>] [--status candidate|approved|rejected] [--mining-run-id <id>] [--organization-id <id>]\n' +
1171
- ' loxtep candidates act <candidate_id> --action approve|reject [--rationale <text>] [--actor <id>] [--organization-id <id>]\n' +
1172
- 'Types: semantic_conflict | procedure | promotion | entity_fact\n' +
1173
- 'approve routes the candidate into CDLC in_review; reject discards it.');
1208
+ console.error("Usage: loxtep candidates list [--type <type>] [--status candidate|approved|rejected] [--mining-run-id <id>] [--organization-id <id>]\n" +
1209
+ " loxtep candidates act <candidate_id> --action approve|reject [--rationale <text>] [--actor <id>] [--organization-id <id>]\n" +
1210
+ "Types: semantic_conflict | procedure | promotion | entity_fact\n" +
1211
+ "approve routes the candidate into CDLC in_review; reject discards it.");
1174
1212
  process.exitCode = 1;
1175
1213
  }
1176
1214
  break;
1177
1215
  }
1178
- case 'deployments': {
1216
+ case "deployments": {
1179
1217
  const authResult = await requireCliClient();
1180
- if (sub === 'list') {
1181
- const pageStr = getArg('--page');
1182
- const pageSizeStr = getArg('--page-size');
1218
+ if (sub === "list") {
1219
+ const pageStr = getArg("--page");
1220
+ const pageSizeStr = getArg("--page-size");
1183
1221
  const page = pageStr != null ? parseInt(pageStr, 10) : undefined;
1184
1222
  const page_size = pageSizeStr != null ? parseInt(pageSizeStr, 10) : undefined;
1185
1223
  const result = await runDeploymentsListCommand(authResult.client, {
1186
- project_id: getArg('--project-id'),
1187
- instance_id: getArg('--instance-id'),
1188
- workflow_id: getArg('--workflow-id'),
1189
- status: getArg('--status'),
1224
+ project_id: getArg("--project-id"),
1225
+ instance_id: getArg("--instance-id"),
1226
+ workflow_id: getArg("--workflow-id"),
1227
+ status: getArg("--status"),
1190
1228
  page: page != null && !Number.isNaN(page) ? page : undefined,
1191
- page_size: page_size != null && !Number.isNaN(page_size) ? page_size : undefined,
1229
+ page_size: page_size != null && !Number.isNaN(page_size)
1230
+ ? page_size
1231
+ : undefined,
1192
1232
  });
1193
1233
  for (const line of result.stdout)
1194
1234
  console.log(line);
@@ -1197,9 +1237,9 @@ export async function runCli(argv) {
1197
1237
  if (result.exitCode !== 0)
1198
1238
  process.exitCode = result.exitCode;
1199
1239
  }
1200
- else if (sub === 'get' && args[2]) {
1240
+ else if (sub === "get" && args[2]) {
1201
1241
  const result = await runDeploymentsGetCommand(authResult.client, args[2], {
1202
- include_versions: args.includes('--include-versions'),
1242
+ include_versions: args.includes("--include-versions"),
1203
1243
  });
1204
1244
  for (const line of result.stdout)
1205
1245
  console.log(line);
@@ -1209,21 +1249,21 @@ export async function runCli(argv) {
1209
1249
  process.exitCode = result.exitCode;
1210
1250
  }
1211
1251
  else {
1212
- console.error('Usage: loxtep deployments list [--project-id <id>] [--instance-id <id>] [--workflow-id <id>] [--status pending|in_progress|deployed|failed|rolled_back|archived]\n' +
1213
- ' loxtep deployments get <deployment_id> [--include-versions]');
1252
+ console.error("Usage: loxtep deployments list [--project-id <id>] [--instance-id <id>] [--workflow-id <id>] [--status pending|in_progress|deployed|failed|rolled_back|archived]\n" +
1253
+ " loxtep deployments get <deployment_id> [--include-versions]");
1214
1254
  process.exitCode = 1;
1215
1255
  }
1216
1256
  break;
1217
1257
  }
1218
- case 'activity': {
1258
+ case "activity": {
1219
1259
  const authResult = await requireCliClient();
1220
- if (sub === 'list') {
1221
- const sourceFilter = getArg('--source');
1222
- const actorFilter = getArg('--actor');
1223
- const resourceTypeFilter = getArg('--resource-type');
1224
- const fromFilter = getArg('--from');
1225
- const toFilter = getArg('--to');
1226
- const limitStr = getArg('--limit');
1260
+ if (sub === "list") {
1261
+ const sourceFilter = getArg("--source");
1262
+ const actorFilter = getArg("--actor");
1263
+ const resourceTypeFilter = getArg("--resource-type");
1264
+ const fromFilter = getArg("--from");
1265
+ const toFilter = getArg("--to");
1266
+ const limitStr = getArg("--limit");
1227
1267
  const limit = limitStr != null ? parseInt(limitStr, 10) : undefined;
1228
1268
  const result = await runActivityListCommand(authResult.client, {
1229
1269
  source: sourceFilter,
@@ -1241,23 +1281,23 @@ export async function runCli(argv) {
1241
1281
  process.exitCode = result.exitCode;
1242
1282
  }
1243
1283
  else {
1244
- console.error('Usage: loxtep activity list [--source cli|sdk|mcp|ui] [--actor <id>] [--resource-type <type>] [--from <date>] [--to <date>] [--limit <n>]');
1284
+ console.error("Usage: loxtep activity list [--source cli|sdk|mcp|ui] [--actor <id>] [--resource-type <type>] [--from <date>] [--to <date>] [--limit <n>]");
1245
1285
  process.exitCode = 1;
1246
1286
  }
1247
1287
  break;
1248
1288
  }
1249
- case 'instances': {
1250
- if (sub === 'list') {
1251
- await runInstancesList({ debug: args.includes('--debug') });
1289
+ case "instances": {
1290
+ if (sub === "list") {
1291
+ await runInstancesList({ debug: args.includes("--debug") });
1252
1292
  }
1253
- else if (sub === 'get' && args[2]) {
1293
+ else if (sub === "get" && args[2]) {
1254
1294
  await runInstancesGet(args[2]);
1255
1295
  }
1256
- else if (sub === 'stream-config') {
1257
- const maybeId = args[2] && !args[2].startsWith('-') ? args[2] : undefined;
1296
+ else if (sub === "stream-config") {
1297
+ const maybeId = args[2] && !args[2].startsWith("-") ? args[2] : undefined;
1258
1298
  await runInstancesStreamConfig(maybeId);
1259
1299
  }
1260
- else if (sub === 'create') {
1300
+ else if (sub === "create") {
1261
1301
  try {
1262
1302
  const input = parseCreateInstanceArgs(args.slice(2));
1263
1303
  await runInstancesCreate(input);
@@ -1267,7 +1307,7 @@ export async function runCli(argv) {
1267
1307
  process.exitCode = 1;
1268
1308
  }
1269
1309
  }
1270
- else if (sub === 'update') {
1310
+ else if (sub === "update") {
1271
1311
  try {
1272
1312
  const { instanceId, input } = parseUpdateInstanceArgs(args.slice(2));
1273
1313
  await runInstancesUpdate(instanceId, input);
@@ -1277,121 +1317,124 @@ export async function runCli(argv) {
1277
1317
  process.exitCode = 1;
1278
1318
  }
1279
1319
  }
1280
- else if (sub === 'redeploy-runtimes' && args[2] && !args[2].startsWith('-')) {
1320
+ else if (sub === "redeploy-runtimes" &&
1321
+ args[2] &&
1322
+ !args[2].startsWith("-")) {
1281
1323
  await runInstancesRedeployRuntimes(args[2]);
1282
1324
  }
1283
- else if (sub === 'deployment-urls') {
1325
+ else if (sub === "deployment-urls") {
1284
1326
  await runInstancesDeploymentUrls();
1285
1327
  }
1286
- else if (sub === 'register') {
1287
- const roleArn = getArg('--cross-account-role-arn');
1288
- const region = getArg('--region');
1328
+ else if (sub === "register") {
1329
+ const roleArn = getArg("--cross-account-role-arn");
1330
+ const region = getArg("--region");
1289
1331
  if (!roleArn) {
1290
- console.error('Usage: loxtep instances register --cross-account-role-arn <arn> [--region <region>]');
1332
+ console.error("Usage: loxtep instances register --cross-account-role-arn <arn> [--region <region>]");
1291
1333
  process.exitCode = 1;
1292
1334
  }
1293
1335
  else {
1294
1336
  await runInstancesRegister(roleArn, region);
1295
1337
  }
1296
1338
  }
1297
- else if (sub === 'registration') {
1339
+ else if (sub === "registration") {
1298
1340
  await runInstancesRegistration();
1299
1341
  }
1300
1342
  else {
1301
- console.error('Usage: loxtep instances list | get <id> | stream-config [<id>] | create --name ... --region ... --type ... | update <id> ... | redeploy-runtimes <id> | deployment-urls | register --cross-account-role-arn <arn> | registration');
1343
+ console.error("Usage: loxtep instances list | get <id> | stream-config [<id>] | create --name ... --region ... --type ... | update <id> ... | redeploy-runtimes <id> | deployment-urls | register --cross-account-role-arn <arn> | registration");
1302
1344
  process.exitCode = 1;
1303
1345
  }
1304
1346
  break;
1305
1347
  }
1306
- case 'bots': {
1307
- const instanceFlag = getArg('--instance');
1308
- if (sub === 'list') {
1348
+ case "bots": {
1349
+ const instanceFlag = getArg("--instance");
1350
+ if (sub === "list") {
1309
1351
  await runBotsList(instanceFlag);
1310
1352
  }
1311
- else if (sub === 'get') {
1312
- const botId = getArg('--bot-id') || (args[2] && !args[2].startsWith('-') ? args[2] : undefined);
1353
+ else if (sub === "get") {
1354
+ const botId = getArg("--bot-id") ||
1355
+ (args[2] && !args[2].startsWith("-") ? args[2] : undefined);
1313
1356
  if (!botId) {
1314
- console.error('Usage: loxtep bots get --instance <id> --bot-id <bot_id>');
1357
+ console.error("Usage: loxtep bots get --instance <id> --bot-id <bot_id>");
1315
1358
  process.exitCode = 1;
1316
1359
  }
1317
1360
  else {
1318
1361
  await runBotsGet(instanceFlag, botId);
1319
1362
  }
1320
1363
  }
1321
- else if (sub === 'register') {
1322
- const name = getArg('--name');
1323
- const lambdaName = getArg('--lambda-name');
1364
+ else if (sub === "register") {
1365
+ const name = getArg("--name");
1366
+ const lambdaName = getArg("--lambda-name");
1324
1367
  if (!name || !lambdaName) {
1325
- console.error('Usage: loxtep bots register --instance <id> --name <n> --lambda-name <fn> [--slug …] [--schedule …] [--paused|--unpaused]');
1368
+ console.error("Usage: loxtep bots register --instance <id> --name <n> --lambda-name <fn> [--slug …] [--schedule …] [--paused|--unpaused]");
1326
1369
  process.exitCode = 1;
1327
1370
  }
1328
1371
  else {
1329
- const paused = args.includes('--unpaused')
1372
+ const paused = args.includes("--unpaused")
1330
1373
  ? false
1331
- : args.includes('--paused')
1374
+ : args.includes("--paused")
1332
1375
  ? true
1333
1376
  : undefined;
1334
- const batchRaw = getArg('--batch-size');
1377
+ const batchRaw = getArg("--batch-size");
1335
1378
  await runBotsRegister(instanceFlag, {
1336
1379
  name,
1337
1380
  lambda_name: lambdaName,
1338
- slug: getArg('--slug'),
1339
- description: getArg('--description'),
1340
- source_queue: getArg('--source-queue'),
1341
- destination_queue: getArg('--destination-queue'),
1342
- error_queue: getArg('--error-queue'),
1343
- schedule: getArg('--schedule'),
1381
+ slug: getArg("--slug"),
1382
+ description: getArg("--description"),
1383
+ source_queue: getArg("--source-queue"),
1384
+ destination_queue: getArg("--destination-queue"),
1385
+ error_queue: getArg("--error-queue"),
1386
+ schedule: getArg("--schedule"),
1344
1387
  batch_size: batchRaw ? Number(batchRaw) : undefined,
1345
1388
  paused,
1346
1389
  });
1347
1390
  }
1348
1391
  }
1349
- else if (sub === 'update') {
1350
- const botId = getArg('--bot-id');
1392
+ else if (sub === "update") {
1393
+ const botId = getArg("--bot-id");
1351
1394
  if (!botId) {
1352
- console.error('Usage: loxtep bots update --instance <id> --bot-id <bot_id> [--name …] [--lambda-name …] …');
1395
+ console.error("Usage: loxtep bots update --instance <id> --bot-id <bot_id> [--name …] [--lambda-name …] …");
1353
1396
  process.exitCode = 1;
1354
1397
  }
1355
1398
  else {
1356
- const paused = args.includes('--unpaused')
1399
+ const paused = args.includes("--unpaused")
1357
1400
  ? false
1358
- : args.includes('--paused')
1401
+ : args.includes("--paused")
1359
1402
  ? true
1360
1403
  : undefined;
1361
- const batchRaw = getArg('--batch-size');
1404
+ const batchRaw = getArg("--batch-size");
1362
1405
  await runBotsUpdate(instanceFlag, botId, {
1363
- name: getArg('--name'),
1364
- lambda_name: getArg('--lambda-name'),
1365
- description: getArg('--description'),
1366
- source_queue: getArg('--source-queue'),
1367
- destination_queue: getArg('--destination-queue'),
1368
- error_queue: getArg('--error-queue'),
1369
- schedule: getArg('--schedule'),
1406
+ name: getArg("--name"),
1407
+ lambda_name: getArg("--lambda-name"),
1408
+ description: getArg("--description"),
1409
+ source_queue: getArg("--source-queue"),
1410
+ destination_queue: getArg("--destination-queue"),
1411
+ error_queue: getArg("--error-queue"),
1412
+ schedule: getArg("--schedule"),
1370
1413
  batch_size: batchRaw ? Number(batchRaw) : undefined,
1371
1414
  paused,
1372
1415
  });
1373
1416
  }
1374
1417
  }
1375
- else if (sub === 'deregister') {
1376
- const botId = getArg('--bot-id');
1418
+ else if (sub === "deregister") {
1419
+ const botId = getArg("--bot-id");
1377
1420
  if (!botId) {
1378
- console.error('Usage: loxtep bots deregister --instance <id> --bot-id <bot_id>');
1421
+ console.error("Usage: loxtep bots deregister --instance <id> --bot-id <bot_id>");
1379
1422
  process.exitCode = 1;
1380
1423
  }
1381
1424
  else {
1382
1425
  await runBotsDeregister(instanceFlag, botId);
1383
1426
  }
1384
1427
  }
1385
- else if (sub === 'reconcile') {
1428
+ else if (sub === "reconcile") {
1386
1429
  await runBotsReconcile(instanceFlag);
1387
1430
  }
1388
1431
  else {
1389
- console.error('Usage: loxtep bots register|list|get|update|deregister|reconcile --instance <id> …');
1432
+ console.error("Usage: loxtep bots register|list|get|update|deregister|reconcile --instance <id> …");
1390
1433
  process.exitCode = 1;
1391
1434
  }
1392
1435
  break;
1393
1436
  }
1394
- case 'quality-rules':
1437
+ case "quality-rules":
1395
1438
  await runQualityRules(args.slice(1));
1396
1439
  break;
1397
1440
  default:
@@ -1403,7 +1446,7 @@ export async function runCli(argv) {
1403
1446
  }
1404
1447
  // Auto-run only when executed as the CLI bin (skip under Jest imports).
1405
1448
  if (process.env.JEST_WORKER_ID === undefined) {
1406
- runCli(process.argv.slice(2)).catch(err => {
1449
+ runCli(process.argv.slice(2)).catch((err) => {
1407
1450
  console.error(formatCliError(err));
1408
1451
  process.exit(1);
1409
1452
  });