@tiangong-lca/cli 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,9 +31,9 @@ checkPaths:
31
31
  - test/auth-identity*.test.ts
32
32
  - test/public-auth-identity-receipt.test.ts
33
33
  - test/lca-release*.test.ts
34
- lastReviewedAt: 2026-09-02
35
- lastReviewedCommit: 3254d6167662121ca871090f6e57ff2a55578f28
36
- lastReviewedNote: 'Reviewed for Issue #266: published CLI 0.1.8 ships zero-config official Production login and complete custom/headless boundaries through the existing verified release path.'
34
+ lastReviewedAt: 2026-09-04
35
+ lastReviewedCommit: b15c074b1f10314e4835fd64cb7079c8aa9fec3d
36
+ lastReviewedNote: 'Reviewed for CLI #272: release-only 0.1.9 after support export #270; runtime, dependencies, lock bytes, public exports and publication mechanics are unchanged.'
37
37
  ---
38
38
 
39
39
  # TianGong LCA CLI
@@ -189,6 +189,16 @@ The callback URI must exactly match the URI registered with the selected Supabas
189
189
 
190
190
  Local logout does not revoke the server grant. To invalidate every refresh token for the CLI client, open Account → Connected applications and disconnect TianGong CLI.
191
191
 
192
+ ## Canonical support export
193
+
194
+ ```sh
195
+ tiangong-lca dataset support-cache export --out-dir ./new-support-export --expected-project-ref <project-ref> --expected-user-id <user-id> --json
196
+ ```
197
+
198
+ Export visible flow properties and unit groups through the CLI OAuth session. The default state filter is `100`; repeat `--state-code` to request other RLS-scoped states. The directory must be new. Two complete ordered reads must agree before private row files and an atomic `export-report.json` completion marker are published. The report includes identity, counts and file hashes; its observed stability is not a database transaction snapshot.
199
+
200
+ Limits are 100,000 rows per table, 1,000 pages per table scan, 8 MiB per response, 64 MiB total response bytes and a 120-second operation deadline. An incomplete or changed read fails without publishing a completion marker. Use a fresh directory for a new attempt; no business data is written.
201
+
192
202
  ## Auth Identity Receipt
193
203
 
194
204
  Use the identity receipt before a production-backed case or any later owner-draft write gate:
package/dist/src/cli.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { DotEnvLoadResult } from './lib/dotenv.js';
2
2
  import type { FetchLike } from './lib/http.js';
3
+ import { type RunDatasetSupportCacheExportOptions, type DatasetSupportCacheExportReport } from './lib/dataset-support-cache.js';
3
4
  import { inspectSupabaseAuthStatus, loginWithSupabaseOAuth, logoutSupabaseUserSession } from './lib/supabase-session.js';
4
5
  import { type AuthIdentityReceipt, type RunAuthIdentityReceiptOptions } from './lib/auth-identity-receipt.js';
5
6
  import { type LifecyclemodelAutoBuildReport, type RunLifecyclemodelAutoBuildOptions } from './lib/lifecyclemodel-auto-build.js';
@@ -68,6 +69,7 @@ import { runFlowIdentity } from './lib/dataset-maintenance-flow-identity-run.js'
68
69
  import { verifyFlowIdentity } from './lib/dataset-maintenance-flow-identity-verify.js';
69
70
  import { type DatasetSourceUploadAttachmentsReport, type RunDatasetSourceUploadAttachmentsOptions } from './lib/dataset-source-upload-attachments.js';
70
71
  export type CliDeps = {
72
+ runDatasetSupportCacheExportImpl?: (options: RunDatasetSupportCacheExportOptions) => Promise<DatasetSupportCacheExportReport>;
71
73
  env: NodeJS.ProcessEnv;
72
74
  dotEnvStatus: DotEnvLoadResult;
73
75
  fetchImpl: FetchLike;
package/dist/src/cli.js CHANGED
@@ -3,6 +3,7 @@ import { buildDoctorReport, readRuntimeEnv } from './lib/env.js';
3
3
  import { CliError, toErrorPayload } from './lib/errors.js';
4
4
  import { stringifyJson } from './lib/io.js';
5
5
  import { loadCliPackageVersion } from './lib/package-version.js';
6
+ import { runDatasetSupportCacheExport, } from './lib/dataset-support-cache.js';
6
7
  import { requireSupabaseRestRuntime } from './lib/supabase-client.js';
7
8
  import { inspectSupabaseAuthStatus, loginWithSupabaseOAuth, logoutSupabaseUserSession, } from './lib/supabase-session.js';
8
9
  import { OAUTH_LOGIN_TIMEOUT_MAX_MS } from './lib/oauth-loopback.js';
@@ -93,7 +94,7 @@ Implemented Commands:
93
94
  auth login | status | whoami | doctor-auth | logout | identity-receipt
94
95
  search flow | process | lifecyclemodel
95
96
  process get | list | identity-preflight | build-plan | scope-statistics | dedup-review | auto-build | resume-build | publish-build | complete-required-fields | save-draft | batch-build | refresh-references | verify-rows
96
- dataset contract get | context-pack | classification children/path/audit/apply | curation-queue build/next/verify | import-lca convert | author | patch apply | save-draft | source upload-attachments | validate | verify-remote | bilingual extract/apply/validate | evidence-search plan/run | references rewrite/refresh-remote | maintenance clear-account/plan/apply/verify/flow-identity
97
+ dataset support-cache export | contract get | context-pack | classification children/path/audit/apply | curation-queue build/next/verify | import-lca convert | author | patch apply | save-draft | source upload-attachments | validate | verify-remote | bilingual extract/apply/validate | evidence-search plan/run | references rewrite/refresh-remote | maintenance clear-account/plan/apply/verify/flow-identity
97
98
  flow get | list | identity-preflight | build-plan | fetch-rows | materialize-decisions | remediate | publish-version | publish-reviewed-data | build-alias-map | scan-process-flow-refs | plan-process-flow-repairs | apply-process-flow-repairs | regen-product | validate-processes
98
99
  lifecyclemodel auto-build | validate-build | publish-build | save-draft | graph | build-resulting-process | publish-resulting-process | orchestrate
99
100
  qa process | flow | lifecyclemodel
@@ -450,6 +451,7 @@ function renderDatasetHelp() {
450
451
  tiangong-lca dataset <subcommand> [options]
451
452
 
452
453
  Implemented Subcommands:
454
+ support-cache export Export complete observed canonical support rows through OAuth
453
455
  contract get Write TIDAS schema / methodology / ruleset contract artifacts
454
456
  context-pack Write an AI-ready TIDAS contract context pack
455
457
  classification Navigate bundled TIDAS classification schemas or apply selected classifications
@@ -6321,6 +6323,46 @@ export async function executeCli(argv, deps) {
6321
6323
  stderr: '',
6322
6324
  };
6323
6325
  }
6326
+ if (command === 'dataset' && subcommand === 'support-cache') {
6327
+ const help = 'Usage: tiangong-lca dataset support-cache export --out-dir <fresh-dir> [--state-code <int>] [--page-size <1..5000>] [--timeout-ms <1..120000>] [--expected-project-ref <ref>] [--expected-user-id <uuid>] [--json]';
6328
+ const action = commandArgs[0];
6329
+ if (!action || action === '--help' || action === '-h')
6330
+ return { exitCode: 0, stdout: help + '\n', stderr: '' };
6331
+ if (action !== 'export')
6332
+ throw new CliError('dataset support-cache action must be export.', {
6333
+ code: 'DATASET_SUPPORT_CACHE_ACTION_INVALID',
6334
+ exitCode: 2,
6335
+ });
6336
+ const { values } = parseArgs({
6337
+ args: commandArgs.slice(1),
6338
+ strict: true,
6339
+ allowPositionals: false,
6340
+ options: {
6341
+ 'out-dir': { type: 'string' },
6342
+ 'state-code': { type: 'string', multiple: true },
6343
+ 'page-size': { type: 'string' },
6344
+ 'timeout-ms': { type: 'string' },
6345
+ 'expected-project-ref': { type: 'string' },
6346
+ 'expected-user-id': { type: 'string' },
6347
+ json: { type: 'boolean' },
6348
+ help: { type: 'boolean', short: 'h' },
6349
+ },
6350
+ });
6351
+ if (values.help)
6352
+ return { exitCode: 0, stdout: help + '\n', stderr: '' };
6353
+ const report = await (deps.runDatasetSupportCacheExportImpl ?? runDatasetSupportCacheExport)({
6354
+ outDir: values['out-dir'] ?? '',
6355
+ env: deps.env,
6356
+ fetchImpl: deps.fetchImpl,
6357
+ cliVersion: loadCliPackageVersion(import.meta.url),
6358
+ stateCodes: values['state-code']?.map((value) => value.trim() ? Number(value) : Number.NaN),
6359
+ pageSize: values['page-size'] === undefined ? undefined : Number(values['page-size']),
6360
+ timeoutMs: values['timeout-ms'] === undefined ? undefined : Number(values['timeout-ms']),
6361
+ expectedProjectRef: values['expected-project-ref'],
6362
+ expectedUserId: values['expected-user-id'],
6363
+ });
6364
+ return { exitCode: 0, stdout: stringifyJson(report, values.json ?? false), stderr: '' };
6365
+ }
6324
6366
  if (command === 'dataset' && subcommand === 'verify-remote') {
6325
6367
  const datasetFlags = parseDatasetRemoteVerifyFlags(commandArgs);
6326
6368
  if (datasetFlags.help) {