@thinkingai/ae-cli 6.1.17 → 6.1.18

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 (99) hide show
  1. package/dist/{auth-2WTQOP77.js → auth-GBMV6TEJ.js} +3 -3
  2. package/dist/{auth-77BUFLGC.js → auth-ROB2EDYV.js} +12 -13
  3. package/dist/{capability-72DTW5M2.js → capability-DKMYUTLC.js} +50 -13
  4. package/dist/{capability-PJHNI4GJ.js → capability-HYVVPG25.js} +49 -12
  5. package/dist/chunk-3FY3RJ26.js +293 -0
  6. package/dist/{chunk-PTE56QPL.js → chunk-3KWQYGYI.js} +4 -0
  7. package/dist/{chunk-UOUS37JQ.js → chunk-4XXOWOTA.js} +3 -3
  8. package/dist/{chunk-GT46FPXN.js → chunk-BYYS3ANB.js} +17 -8
  9. package/dist/{chunk-YA6SMTXG.js → chunk-EFH4XWYC.js} +3 -3
  10. package/dist/{chunk-4SGZG4XY.js → chunk-J2DEBMRF.js} +9 -7
  11. package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
  12. package/dist/{chunk-VR3LCBHW.js → chunk-JRJY5DMJ.js} +5 -5
  13. package/dist/{chunk-ILIU36SU.js → chunk-OMPRXM3V.js} +3 -3
  14. package/dist/{chunk-VPKZ7I72.js → chunk-QNOLN2LJ.js} +2 -2
  15. package/dist/{chunk-SAU3QFIQ.js → chunk-QZ3AS4KK.js} +3 -3
  16. package/dist/chunk-RJDU7NYP.js +1198 -0
  17. package/dist/{chunk-4KVPKXFX.js → chunk-RNAALWJK.js} +2 -2
  18. package/dist/{chunk-C4MGVGJW.js → chunk-SERWF6G5.js} +1 -1
  19. package/dist/{chunk-RGKJGKT7.js → chunk-Y3LOALAV.js} +5 -5
  20. package/dist/{chunk-P3FGXJTU.js → chunk-ZQ47LWTI.js} +4 -4
  21. package/dist/chunk-ZQKDZXDO.js +317 -0
  22. package/dist/{client-TKG4WBHN.js → client-L2YDMHQ6.js} +5 -4
  23. package/dist/{community-report-client-FI4LNVYS.js → community-report-client-C7WDGET3.js} +1 -2
  24. package/dist/{config-RE6CMGPK.js → config-BMYZX2UE.js} +7 -6
  25. package/dist/{data-integration-XQYB4X4F.js → data-integration-QEKDWQDY.js} +1601 -192
  26. package/dist/index.js +131 -1241
  27. package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-4YYHSYD6.js} +1 -2
  28. package/dist/{memory-CHRU2F7W.js → memory-3ORCR7JH.js} +6 -6
  29. package/dist/{memory-YK33G4T7.js → memory-I2WXDTV2.js} +5 -5
  30. package/dist/{metadata-XXR34N5P.js → metadata-I4C2EWUN.js} +10 -10
  31. package/dist/{metadata-UILXHBWF.js → metadata-VUOQJE26.js} +9 -9
  32. package/dist/{model-NR3JHFSJ.js → model-HLHIEFMU.js} +5 -5
  33. package/dist/{model-K3KLWIW6.js → model-UGRDX4MW.js} +6 -6
  34. package/dist/personal-semantic-preference-LIPACBDX.js +239 -0
  35. package/dist/personal-semantic-preference-OEISBRHM.js +239 -0
  36. package/dist/project-semantic-FFPWFPIW.js +1114 -0
  37. package/dist/project-semantic-RT3R2VQD.js +1114 -0
  38. package/dist/{sync-FCKOVWWS.js → sync-HKIOZXQE.js} +6 -6
  39. package/dist/{sync-DAVKYVMW.js → sync-TFHU2UTG.js} +7 -7
  40. package/dist/{te-agent-HLW4VTQK.js → te-agent-BR6VDBNX.js} +9 -8
  41. package/dist/{te-agent-4BKBODMF.js → te-agent-VLYOV7S4.js} +8 -7
  42. package/dist/{te-analysis-ZMNGOVNW.js → te-analysis-4YGQL5RC.js} +437 -38
  43. package/dist/{te-analysis-O6DCO6BS.js → te-analysis-7VUNUYWZ.js} +436 -37
  44. package/dist/{te-community-HLC43QKH.js → te-community-5DMNKJWY.js} +5 -5
  45. package/dist/{te-community-6HPBWJUZ.js → te-community-ISDQWJU7.js} +6 -6
  46. package/dist/{te-dataops-HDRUXY4K.js → te-dataops-6P5IKWNJ.js} +8 -7
  47. package/dist/{te-dataops-EJP56W3K.js → te-dataops-CVULXNVB.js} +7 -6
  48. package/dist/{te-engage-RAK5PESW.js → te-engage-KZPR5R22.js} +9 -9
  49. package/dist/{te-engage-FGBGQ4IY.js → te-engage-N5WI32H6.js} +8 -8
  50. package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BITX4RD.js} +226 -8
  51. package/dist/{te-experiment-VZF7BT6G.js → te-experiment-UVR4HLND.js} +227 -9
  52. package/dist/{te-kb-SQCLHG6X.js → te-kb-RCLSSH2Q.js} +7 -7
  53. package/dist/{te-system-Z77IKZFN.js → te-system-FXITO2JG.js} +5 -5
  54. package/dist/{te-system-YARIK4S5.js → te-system-K2GYMCTB.js} +6 -6
  55. package/dist/{te-team-EFKWYKMK.js → te-team-ADOC2ROP.js} +6 -6
  56. package/dist/{update-OGPSZM5A.js → update-YCYCKJOO.js} +7 -6
  57. package/package.json +1 -1
  58. package/skills/ae-agent/SKILL.md +3 -4
  59. package/skills/ae-agent/references/edit-skill.md +3 -0
  60. package/skills/ae-agent/references/get-skill-content.md +1 -1
  61. package/skills/ae-agent/references/rescan-skills.md +15 -13
  62. package/skills/ae-agent/references/upload-skill.md +7 -4
  63. package/skills/ae-analysis/SKILL.md +45 -4
  64. package/skills/ae-analysis/metadata_resolution.md +38 -4
  65. package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
  66. package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
  67. package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
  68. package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
  69. package/skills/ae-analysis/references/command_index.md +17 -9
  70. package/skills/ae-analysis/references/dashboard_get.md +18 -1
  71. package/skills/ae-analysis/references/dashboard_update.md +3 -0
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
  77. package/skills/ae-data-integration/SKILL.md +23 -4
  78. package/skills/ae-data-integration/references/custom-layer.md +93 -0
  79. package/skills/ae-data-integration/references/error-handling.md +92 -0
  80. package/skills/ae-data-integration/references/handoff.md +77 -18
  81. package/skills/ae-data-integration/references/local-analysis.md +1 -1
  82. package/skills/ae-data-integration/references/reuse.md +9 -5
  83. package/skills/ae-data-integration/references/sink-upload.md +1 -1
  84. package/skills/ae-data-integration/references/source-inspect.md +18 -12
  85. package/skills/ae-data-integration/references/tracking-plan.md +7 -5
  86. package/skills/ae-data-integration/references/transform.md +10 -10
  87. package/skills/ae-data-integration/references/ue-mapping.md +33 -11
  88. package/skills/ae-engage/references/build-task-save-guide.md +9 -0
  89. package/skills/ae-engage/references/save-task.md +82 -0
  90. package/skills/ae-experiment/SKILL.md +8 -2
  91. package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
  92. package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
  93. package/skills/ae-experiment/references/save_experiment.md +1 -1
  94. package/skills/ae-kb/SKILL.md +1 -1
  95. package/skills/ae-project-semantic/SKILL.md +193 -0
  96. package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
  97. package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
  98. package/dist/chunk-QGM4M3NI.js +0 -37
  99. package/dist/chunk-ZZUOD757.js +0 -598
@@ -6,17 +6,17 @@ import {
6
6
  waitForAnalysisRun,
7
7
  withAsyncArtifactLifecycle,
8
8
  withInterruptSignal
9
- } from "./chunk-YA6SMTXG.js";
9
+ } from "./chunk-QZ3AS4KK.js";
10
10
  import {
11
11
  createCapabilityCommand
12
- } from "./chunk-VR3LCBHW.js";
12
+ } from "./chunk-JRJY5DMJ.js";
13
13
  import {
14
14
  registerCapabilityGatewayRoute,
15
15
  resolveGatewayDomain
16
- } from "./chunk-PTE56QPL.js";
16
+ } from "./chunk-3KWQYGYI.js";
17
17
  import {
18
18
  withOutputMetadata
19
- } from "./chunk-GT46FPXN.js";
19
+ } from "./chunk-BYYS3ANB.js";
20
20
  import {
21
21
  CapabilityGatewayError,
22
22
  buildCapabilityGatewayUrl,
@@ -27,17 +27,17 @@ import {
27
27
  requestCapabilityGatewayWithEnvelope,
28
28
  uploadInputFile,
29
29
  validateCapability
30
- } from "./chunk-ILIU36SU.js";
30
+ } from "./chunk-OMPRXM3V.js";
31
31
  import "./chunk-6EIJSNBD.js";
32
32
  import {
33
33
  getCliToken
34
- } from "./chunk-4SGZG4XY.js";
35
- import "./chunk-ZZUOD757.js";
34
+ } from "./chunk-J2DEBMRF.js";
35
+ import "./chunk-ZQKDZXDO.js";
36
+ import "./chunk-3FY3RJ26.js";
36
37
  import {
37
38
  CliValidationError
38
39
  } from "./chunk-UW5UN47B.js";
39
- import "./chunk-LYVNONC4.js";
40
- import "./chunk-QGM4M3NI.js";
40
+ import "./chunk-JHENBQ5B.js";
41
41
 
42
42
  // src/commands/te-analysis/capability-shared.ts
43
43
  var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
@@ -179,6 +179,13 @@ var directoryOffsetFlag = {
179
179
  alias: "o",
180
180
  min: 0
181
181
  };
182
+ var certificationScopeFlag = {
183
+ name: "certification-scope",
184
+ type: "string",
185
+ required: false,
186
+ desc: "Asset certification filter scope: project follows the project switch, certified returns only certified assets, all returns every asset.",
187
+ default: "project"
188
+ };
182
189
  var payloadFlag = {
183
190
  name: "payload",
184
191
  type: "json",
@@ -268,9 +275,18 @@ function listInput(ctx) {
268
275
  function reportListInput(ctx) {
269
276
  return compactInput({
270
277
  ...listInput(ctx),
271
- model_types: optionalJson(ctx, "model-types")
278
+ model_types: optionalJson(ctx, "model-types"),
279
+ certification_scope: certificationScopeInput(ctx)
272
280
  });
273
281
  }
282
+ function certificationScopeInput(ctx) {
283
+ const value = optionalString(ctx, "certification-scope");
284
+ if (value === void 0) return void 0;
285
+ if (!["project", "certified", "all"].includes(value)) {
286
+ throw new Error("--certification-scope must be project, certified, or all.");
287
+ }
288
+ return value;
289
+ }
274
290
  function dashboardReportDataInput(ctx) {
275
291
  return compactInput({
276
292
  ...projectInput(ctx),
@@ -644,7 +660,8 @@ var metadataEventList = createAnalysisMetaCapabilityCommand({
644
660
  fieldsFlag,
645
661
  directoryLimitFlag,
646
662
  directoryOffsetFlag,
647
- { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated events." }
663
+ { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated events." },
664
+ certificationScopeFlag
648
665
  ],
649
666
  risk: "read",
650
667
  validate: validateCatalogListFlags,
@@ -654,9 +671,23 @@ var metadataEventList = createAnalysisMetaCapabilityCommand({
654
671
  fields: optionalJson(ctx, "fields"),
655
672
  limit: optionalNumber(ctx, "limit"),
656
673
  offset: optionalNumber(ctx, "offset"),
657
- authenticated_only: optionalBoolean(ctx, "authenticated-only")
658
- })
674
+ authenticated_only: optionalBoolean(ctx, "authenticated-only"),
675
+ certification_scope: certificationScopeInput(ctx)
676
+ }),
677
+ postProcess: normalizeEventDirectory
659
678
  });
679
+ function normalizeEventDirectory(result) {
680
+ if (result === null || typeof result !== "object" || Array.isArray(result)) {
681
+ return result;
682
+ }
683
+ const directory = result;
684
+ const items = Array.isArray(directory.items) ? directory.items : directory.events;
685
+ if (!Array.isArray(items)) {
686
+ return result;
687
+ }
688
+ const { events: _events, ...rest } = directory;
689
+ return { ...rest, items };
690
+ }
660
691
 
661
692
  // src/commands/te-analysis/metadata-export.ts
662
693
  import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
@@ -935,7 +966,8 @@ var metadataPropertyList = createAnalysisMetaCapabilityCommand({
935
966
  fieldsFlag,
936
967
  directoryLimitFlag,
937
968
  directoryOffsetFlag,
938
- { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated properties." }
969
+ { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated properties." },
970
+ certificationScopeFlag
939
971
  ],
940
972
  risk: "read",
941
973
  validate: validateCatalogListFlags,
@@ -948,7 +980,8 @@ var metadataPropertyList = createAnalysisMetaCapabilityCommand({
948
980
  fields: optionalJson(ctx, "fields"),
949
981
  limit: optionalNumber(ctx, "limit"),
950
982
  offset: optionalNumber(ctx, "offset"),
951
- authenticated_only: optionalBoolean(ctx, "authenticated-only")
983
+ authenticated_only: optionalBoolean(ctx, "authenticated-only"),
984
+ certification_scope: certificationScopeInput(ctx)
952
985
  })
953
986
  });
954
987
 
@@ -1340,7 +1373,8 @@ var metadataMetricList = createAnalysisMetaCapabilityCommand({
1340
1373
  fieldsFlag,
1341
1374
  directoryLimitFlag,
1342
1375
  directoryOffsetFlag,
1343
- { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated metrics." }
1376
+ { name: "authenticated-only", type: "boolean", required: false, desc: "When true, return only authenticated metrics." },
1377
+ certificationScopeFlag
1344
1378
  ],
1345
1379
  risk: "read",
1346
1380
  validate: validateCatalogListFlags,
@@ -1351,7 +1385,8 @@ var metadataMetricList = createAnalysisMetaCapabilityCommand({
1351
1385
  fields: optionalJson(ctx, "fields"),
1352
1386
  limit: optionalNumber(ctx, "limit"),
1353
1387
  offset: optionalNumber(ctx, "offset"),
1354
- authenticated_only: optionalBoolean(ctx, "authenticated-only")
1388
+ authenticated_only: optionalBoolean(ctx, "authenticated-only"),
1389
+ certification_scope: certificationScopeInput(ctx)
1355
1390
  })
1356
1391
  });
1357
1392
 
@@ -1976,13 +2011,14 @@ var metadataCatalogExport = createAnalysisMetaCapabilityCommand({
1976
2011
  materialize: catalogArtifactMaterializer("analysis_metadata")
1977
2012
  },
1978
2013
  description: "Export the complete accessible analysis metadata catalog to JSONL with an integrity sidecar.",
1979
- flags: [projectIdFlag, requestIdFlag, asyncTimeoutSecondsFlag],
2014
+ flags: [projectIdFlag, requestIdFlag, asyncTimeoutSecondsFlag, certificationScopeFlag],
1980
2015
  risk: "read",
1981
2016
  validate: validateCatalogExportFlags,
1982
2017
  buildInput: (ctx) => compactInput({
1983
2018
  ...projectInput(ctx),
1984
2019
  request_id: optionalString(ctx, "request-id"),
1985
- timeout_seconds: optionalNumber(ctx, "timeout-seconds")
2020
+ timeout_seconds: optionalNumber(ctx, "timeout-seconds"),
2021
+ certification_scope: certificationScopeInput(ctx)
1986
2022
  })
1987
2023
  });
1988
2024
 
@@ -2038,7 +2074,8 @@ var metadataCatalogList = createAnalysisMetaCapabilityCommand({
2038
2074
  projectIdFlag,
2039
2075
  queriesFlag,
2040
2076
  resourceTypesFlag,
2041
- limitPerTypeFlag
2077
+ limitPerTypeFlag,
2078
+ certificationScopeFlag
2042
2079
  ],
2043
2080
  risk: "read",
2044
2081
  validate: validateMetadataCatalogList,
@@ -2046,7 +2083,8 @@ var metadataCatalogList = createAnalysisMetaCapabilityCommand({
2046
2083
  ...projectInput(ctx),
2047
2084
  queries: optionalQueries(ctx),
2048
2085
  resource_types: optionalResourceTypes(ctx),
2049
- limit_per_type: ctx.optionalNum("limit-per-type")
2086
+ limit_per_type: ctx.optionalNum("limit-per-type"),
2087
+ certification_scope: certificationScopeInput(ctx)
2050
2088
  })
2051
2089
  });
2052
2090
 
@@ -2289,8 +2327,353 @@ var analysisMetaAssetOperationRecordExport = createAnalysisGovernanceCapabilityC
2289
2327
  buildInput: (ctx) => assetGovernanceInput(ctx, ["record_id"])
2290
2328
  });
2291
2329
 
2330
+ // src/commands/te-analysis/governance/asset-authentication-shared.ts
2331
+ import { createHash as createHash3, randomBytes as randomBytes3 } from "crypto";
2332
+ import { readFileSync, statSync } from "fs";
2333
+ import { mkdir as mkdir3, open as open3, rm as rm3 } from "fs/promises";
2334
+ import { dirname as dirname3, extname as extname3, resolve as resolve3 } from "path";
2335
+ var ASSET_TYPES = /* @__PURE__ */ new Set([
2336
+ "event",
2337
+ "event_prop",
2338
+ "user_prop",
2339
+ "user_tag",
2340
+ "user_cluster",
2341
+ "metric",
2342
+ "report",
2343
+ "dashboard"
2344
+ ]);
2345
+ var OUTPUT_FIELDS = /* @__PURE__ */ new Set([
2346
+ "resource_type",
2347
+ "resource_key",
2348
+ "display_name",
2349
+ "description",
2350
+ "owner_open_id",
2351
+ "owner_name",
2352
+ "authentication_status",
2353
+ "heat_count90d",
2354
+ "user_count90d",
2355
+ "impact_degree"
2356
+ ]);
2357
+ var assetTypesFlag = {
2358
+ name: "asset-types",
2359
+ type: "json",
2360
+ required: false,
2361
+ desc: "Optional JSON array of asset types. Omit for every supported type."
2362
+ };
2363
+ var authenticationStatusFilterFlag = {
2364
+ name: "authentication-status",
2365
+ type: "number",
2366
+ required: false,
2367
+ desc: "Authentication status: 1 for authenticated or 0 for unauthenticated.",
2368
+ min: 0,
2369
+ max: 1
2370
+ };
2371
+ var governanceQueriesFlag = {
2372
+ name: "queries",
2373
+ type: "json",
2374
+ required: false,
2375
+ desc: "Optional JSON array of 1 to 20 keywords matched against identity and display fields."
2376
+ };
2377
+ var heatCountGtFlag = {
2378
+ name: "heat-count-gt",
2379
+ type: "number",
2380
+ required: false,
2381
+ desc: "Strict recent-90-day heat threshold.",
2382
+ min: 0
2383
+ };
2384
+ var userCountGtFlag = {
2385
+ name: "user-count-gt",
2386
+ type: "number",
2387
+ required: false,
2388
+ desc: "Strict recent-90-day user threshold.",
2389
+ min: 0
2390
+ };
2391
+ var impactDegreeGtFlag = {
2392
+ name: "impact-degree-gt",
2393
+ type: "number",
2394
+ required: false,
2395
+ desc: "Strict governance impact threshold.",
2396
+ min: 0
2397
+ };
2398
+ var matchFlag = {
2399
+ name: "match",
2400
+ type: "string",
2401
+ required: false,
2402
+ desc: "Combine multiple numeric thresholds with any or all. Default: all.",
2403
+ default: "all"
2404
+ };
2405
+ var authenticationFieldsFlag = {
2406
+ name: "fields",
2407
+ type: "json",
2408
+ required: false,
2409
+ desc: "Optional JSON array of output fields."
2410
+ };
2411
+ var authenticationExportOutputFlag = {
2412
+ name: "output",
2413
+ type: "string",
2414
+ required: true,
2415
+ desc: "Local .jsonl output path. Integrity metadata is written to <output>.meta.json."
2416
+ };
2417
+ var authenticationFilterFlags = [
2418
+ assetTypesFlag,
2419
+ authenticationStatusFilterFlag,
2420
+ governanceQueriesFlag,
2421
+ heatCountGtFlag,
2422
+ userCountGtFlag,
2423
+ impactDegreeGtFlag,
2424
+ matchFlag,
2425
+ authenticationFieldsFlag
2426
+ ];
2427
+ function validateAuthenticationFilters(ctx) {
2428
+ validateQueriesFlag(ctx);
2429
+ validateStringArray(ctx, "asset-types", ASSET_TYPES);
2430
+ validateStringArray(ctx, "fields", OUTPUT_FIELDS);
2431
+ const match = optionalString(ctx, "match");
2432
+ if (match !== void 0 && match !== "any" && match !== "all") {
2433
+ throw new CliValidationError("--match must be any or all");
2434
+ }
2435
+ }
2436
+ function authenticationFilterInput(ctx) {
2437
+ return compactInput({
2438
+ ...projectInput(ctx),
2439
+ asset_types: optionalJson(ctx, "asset-types"),
2440
+ authentication_status: optionalNumber(ctx, "authentication-status"),
2441
+ queries: optionalJson(ctx, "queries"),
2442
+ heat_count_gt: optionalNumber(ctx, "heat-count-gt"),
2443
+ user_count_gt: optionalNumber(ctx, "user-count-gt"),
2444
+ impact_degree_gt: optionalNumber(ctx, "impact-degree-gt"),
2445
+ match: optionalString(ctx, "match"),
2446
+ fields: optionalJson(ctx, "fields")
2447
+ });
2448
+ }
2449
+ function validateAuthenticationExport(ctx) {
2450
+ validateAuthenticationFilters(ctx);
2451
+ if (extname3(ctx.str("output").trim()).toLowerCase() !== ".jsonl") {
2452
+ throw new CliValidationError("--output must use the .jsonl extension");
2453
+ }
2454
+ }
2455
+ function authenticationExportPostProcess() {
2456
+ return async (result, input, ctx) => {
2457
+ if (typeof result !== "object" || result === null) {
2458
+ throw new Error("Asset-authentication export returned an invalid response");
2459
+ }
2460
+ const data = result;
2461
+ const rows = data.assets;
2462
+ if (!Array.isArray(rows) || data.complete !== true || typeof data.total !== "number" || data.total !== rows.length || typeof data.snapshot_hash !== "string" || typeof data.stat_as_of !== "string") {
2463
+ throw new Error("Asset-authentication export failed completeness or snapshot validation");
2464
+ }
2465
+ const outputPath = resolve3(ctx.str("output").trim());
2466
+ const metaPath = `${outputPath}.meta.json`;
2467
+ await mkdir3(dirname3(outputPath), { recursive: true });
2468
+ await assertRegularFileOrMissing(outputPath);
2469
+ await assertRegularFileOrMissing(metaPath);
2470
+ const suffix = `${process.pid}.${randomBytes3(8).toString("hex")}`;
2471
+ const partPath = `${outputPath}.part.${suffix}`;
2472
+ const metaPartPath = `${metaPath}.part.${suffix}`;
2473
+ const hash = createHash3("sha256");
2474
+ let bytes = 0;
2475
+ let handle;
2476
+ try {
2477
+ handle = await open3(partPath, "w", 384);
2478
+ for (const row of rows) {
2479
+ const line = `${JSON.stringify(row)}
2480
+ `;
2481
+ const buffer = Buffer.from(line, "utf8");
2482
+ hash.update(buffer);
2483
+ bytes += buffer.length;
2484
+ await handle.write(buffer);
2485
+ }
2486
+ await handle.sync();
2487
+ await handle.close();
2488
+ handle = void 0;
2489
+ const checksum = hash.digest("hex");
2490
+ const metadata = {
2491
+ complete: true,
2492
+ project_id: input.project_id,
2493
+ total: rows.length,
2494
+ stat_as_of: data.stat_as_of,
2495
+ snapshot_hash: data.snapshot_hash,
2496
+ checksum
2497
+ };
2498
+ handle = await open3(metaPartPath, "w", 384);
2499
+ await handle.write(`${JSON.stringify(metadata)}
2500
+ `, void 0, "utf8");
2501
+ await handle.sync();
2502
+ await handle.close();
2503
+ handle = void 0;
2504
+ await publishCatalogPair(partPath, outputPath, metaPartPath, metaPath, suffix);
2505
+ return {
2506
+ output_path: outputPath,
2507
+ metadata_path: metaPath,
2508
+ format: "jsonl",
2509
+ row_count: rows.length,
2510
+ bytes,
2511
+ checksum,
2512
+ snapshot_hash: data.snapshot_hash,
2513
+ complete: true
2514
+ };
2515
+ } catch (error) {
2516
+ await handle?.close().catch(() => void 0);
2517
+ await rm3(partPath, { force: true }).catch(() => void 0);
2518
+ await rm3(metaPartPath, { force: true }).catch(() => void 0);
2519
+ throw error;
2520
+ }
2521
+ };
2522
+ }
2523
+ function assetRefsInput(ctx) {
2524
+ const inline = optionalJson(ctx, "asset-refs");
2525
+ const file = optionalString(ctx, "asset-file");
2526
+ const assetType = optionalString(ctx, "asset-type");
2527
+ const assetIds = optionalJson(ctx, "asset-ids");
2528
+ const sources = Number(inline !== void 0) + Number(file !== void 0) + Number(assetType !== void 0 || assetIds !== void 0);
2529
+ if (sources !== 1) {
2530
+ throw new CliValidationError("Use exactly one input: --asset-refs, --asset-file, or --asset-type with --asset-ids");
2531
+ }
2532
+ let values;
2533
+ if (inline !== void 0) {
2534
+ values = inline;
2535
+ } else if (file !== void 0) {
2536
+ const path = resolve3(file);
2537
+ if (!statSync(path, { throwIfNoEntry: false })?.isFile()) {
2538
+ throw new CliValidationError(`--asset-file must be a regular file: ${path}`);
2539
+ }
2540
+ values = readFileSync(path, "utf8").split(/\r?\n/).filter(Boolean).map((line, index) => {
2541
+ try {
2542
+ return JSON.parse(line);
2543
+ } catch {
2544
+ throw new CliValidationError(`--asset-file line ${index + 1} is not valid JSON`);
2545
+ }
2546
+ });
2547
+ } else {
2548
+ if (assetType === void 0 || assetIds === void 0 || !Array.isArray(assetIds)) {
2549
+ throw new CliValidationError("--asset-type and --asset-ids must be provided together");
2550
+ }
2551
+ values = assetIds.map((resourceKey) => ({ resource_type: assetType, resource_key: resourceKey }));
2552
+ }
2553
+ if (!Array.isArray(values) || values.length === 0) {
2554
+ throw new CliValidationError("The selected asset reference set must not be empty");
2555
+ }
2556
+ const refs = values.map((value, index) => normalizeRef(value, index));
2557
+ return [...new Map(refs.map((ref) => [`${ref.resource_type}${ref.resource_key}`, ref])).values()];
2558
+ }
2559
+ function normalizeRef(value, index) {
2560
+ if (typeof value !== "object" || value === null) {
2561
+ throw new CliValidationError(`Asset reference ${index + 1} must be an object`);
2562
+ }
2563
+ const source = value;
2564
+ const resourceType = source.resource_type;
2565
+ const resourceKey = source.resource_key;
2566
+ if (typeof resourceType !== "string" || !ASSET_TYPES.has(resourceType) || typeof resourceKey !== "string" && typeof resourceKey !== "number" || String(resourceKey).trim() === "") {
2567
+ throw new CliValidationError(`Asset reference ${index + 1} requires a supported resource_type and non-empty resource_key`);
2568
+ }
2569
+ return { resource_type: resourceType, resource_key: String(resourceKey) };
2570
+ }
2571
+ function validateStringArray(ctx, name, allowed) {
2572
+ const value = optionalJson(ctx, name);
2573
+ if (value === void 0) return;
2574
+ if (!Array.isArray(value) || value.length === 0 || value.some((item) => typeof item !== "string" || !allowed.has(item))) {
2575
+ throw new CliValidationError(`--${name} must be a non-empty JSON array of supported values`);
2576
+ }
2577
+ }
2578
+
2579
+ // src/commands/te-analysis/governance/asset-authentication-list.ts
2580
+ var analysisGovernanceAssetAuthenticationList = createAnalysisGovernanceCapabilityCommand({
2581
+ resource: "asset-authentication",
2582
+ command: "list",
2583
+ capabilityId: "governance.asset_authentication.list",
2584
+ description: "Preview asset authentication with server-side filtering, sorting, and pagination.",
2585
+ flags: [projectIdFlag, ...authenticationFilterFlags, directoryLimitFlag, directoryOffsetFlag],
2586
+ risk: "read",
2587
+ validate: validateAuthenticationFilters,
2588
+ buildInput: (ctx) => compactInput({
2589
+ ...authenticationFilterInput(ctx),
2590
+ limit: optionalNumber(ctx, "limit"),
2591
+ offset: optionalNumber(ctx, "offset")
2592
+ })
2593
+ });
2594
+
2595
+ // src/commands/te-analysis/governance/asset-authentication-export.ts
2596
+ var analysisGovernanceAssetAuthenticationExport = createAnalysisGovernanceCapabilityCommand({
2597
+ resource: "asset-authentication",
2598
+ command: "export",
2599
+ capabilityId: "governance.asset_authentication.export",
2600
+ description: "Export the complete filtered asset-authentication catalog to JSONL without pagination.",
2601
+ flags: [projectIdFlag, ...authenticationFilterFlags, authenticationExportOutputFlag],
2602
+ risk: "read",
2603
+ validate: validateAuthenticationExport,
2604
+ buildInput: authenticationFilterInput,
2605
+ postProcess: authenticationExportPostProcess()
2606
+ });
2607
+
2608
+ // src/commands/te-analysis/governance/asset-authentication-update.ts
2609
+ var authenticationStatusFlag = {
2610
+ name: "authentication-status",
2611
+ type: "number",
2612
+ required: true,
2613
+ desc: "Target authentication status: 1 authenticates and 0 revokes.",
2614
+ min: 0,
2615
+ max: 1
2616
+ };
2617
+ var assetRefsFlag = {
2618
+ name: "asset-refs",
2619
+ type: "json",
2620
+ required: false,
2621
+ desc: "Inline JSON array of {resource_type,resource_key} asset references."
2622
+ };
2623
+ var assetFileFlag = {
2624
+ name: "asset-file",
2625
+ type: "string",
2626
+ required: false,
2627
+ desc: "JSONL file whose rows contain resource_type and resource_key."
2628
+ };
2629
+ var assetTypeFlag = {
2630
+ name: "asset-type",
2631
+ type: "string",
2632
+ required: false,
2633
+ desc: "Convenience asset type used together with --asset-ids."
2634
+ };
2635
+ var assetIdsFlag = {
2636
+ name: "asset-ids",
2637
+ type: "json",
2638
+ required: false,
2639
+ desc: "Convenience JSON array of business keys used together with --asset-type."
2640
+ };
2641
+ var expectedSnapshotHashFlag = {
2642
+ name: "expected-snapshot-hash",
2643
+ type: "string",
2644
+ required: false,
2645
+ desc: "Optional snapshot_hash from the export sidecar. A mismatch rejects the whole update."
2646
+ };
2647
+ var analysisGovernanceAssetAuthenticationUpdate = createAnalysisGovernanceCapabilityCommand({
2648
+ resource: "asset-authentication",
2649
+ command: "update",
2650
+ capabilityId: "governance.asset_authentication.update",
2651
+ description: "Batch update explicit typed asset references.",
2652
+ flags: [
2653
+ projectIdFlag,
2654
+ authenticationStatusFlag,
2655
+ assetRefsFlag,
2656
+ assetFileFlag,
2657
+ assetTypeFlag,
2658
+ assetIdsFlag,
2659
+ expectedSnapshotHashFlag,
2660
+ requestIdFlag
2661
+ ],
2662
+ risk: "write",
2663
+ buildInput: (ctx) => compactInput({
2664
+ project_id: ctx.num("project-id"),
2665
+ authentication_status: ctx.num("authentication-status"),
2666
+ asset_refs: assetRefsInput(ctx),
2667
+ expected_snapshot_hash: optionalString(ctx, "expected-snapshot-hash"),
2668
+ request_id: optionalString(ctx, "request-id")
2669
+ })
2670
+ });
2671
+
2292
2672
  // src/commands/te-analysis/governance/index.ts
2293
2673
  var commands12 = [
2674
+ analysisGovernanceAssetAuthenticationList,
2675
+ analysisGovernanceAssetAuthenticationExport,
2676
+ analysisGovernanceAssetAuthenticationUpdate,
2294
2677
  analysisMetaAssetUsageList,
2295
2678
  analysisMetaAssetUsageExport,
2296
2679
  analysisMetaAssetBatchInfoExport,
@@ -2320,7 +2703,15 @@ var reportList = createAnalysisCapabilityCommand({
2320
2703
  command: "list",
2321
2704
  capabilityId: "analysis.report.list",
2322
2705
  description: "List analysis reports visible to the current user through the capability gateway.",
2323
- flags: [projectIdFlag, queriesFlag, fieldsFlag, reportModelTypesFlag, reportListLimitFlag, directoryOffsetFlag],
2706
+ flags: [
2707
+ projectIdFlag,
2708
+ queriesFlag,
2709
+ fieldsFlag,
2710
+ reportModelTypesFlag,
2711
+ reportListLimitFlag,
2712
+ directoryOffsetFlag,
2713
+ certificationScopeFlag
2714
+ ],
2324
2715
  risk: "read",
2325
2716
  validate: validateQueriesFlag,
2326
2717
  buildInput: reportListInput
@@ -2340,7 +2731,8 @@ var reportListExport = createAnalysisCapabilityCommand({
2340
2731
  reportModelTypesFlag,
2341
2732
  requestIdFlag,
2342
2733
  artifactFormatFlag,
2343
- asyncTimeoutSecondsFlag
2734
+ asyncTimeoutSecondsFlag,
2735
+ certificationScopeFlag
2344
2736
  ],
2345
2737
  risk: "read",
2346
2738
  validate: validateQueriesFlag,
@@ -2349,6 +2741,7 @@ var reportListExport = createAnalysisCapabilityCommand({
2349
2741
  queries: optionalQueries(ctx),
2350
2742
  fields: optionalJson(ctx, "fields"),
2351
2743
  model_types: optionalJson(ctx, "model-types"),
2744
+ certification_scope: certificationScopeInput(ctx),
2352
2745
  ...exportLifecycleInput(ctx)
2353
2746
  })
2354
2747
  });
@@ -2738,11 +3131,15 @@ var dashboardList = createAnalysisCapabilityCommand({
2738
3131
  alias: "f"
2739
3132
  },
2740
3133
  directoryLimitFlag,
2741
- directoryOffsetFlag
3134
+ directoryOffsetFlag,
3135
+ certificationScopeFlag
2742
3136
  ],
2743
3137
  risk: "read",
2744
3138
  validate: validateQueriesFlag,
2745
- buildInput: listInput
3139
+ buildInput: (ctx) => compactInput({
3140
+ ...listInput(ctx),
3141
+ certification_scope: certificationScopeInput(ctx)
3142
+ })
2746
3143
  });
2747
3144
 
2748
3145
  // src/commands/te-analysis/dashboard/create.ts
@@ -2775,7 +3172,7 @@ var dashboardGet = createAnalysisCapabilityCommand({
2775
3172
  resource: "dashboard",
2776
3173
  command: "get",
2777
3174
  capabilityId: "analysis.dashboard.get",
2778
- description: "Get one dashboard detail, including location, creator, create/update time, settings, reports, notes, and share information.",
3175
+ description: "Get one dashboard detail, including normalized effective settings, saved filter configuration, location, reports, notes, and sharing context.",
2779
3176
  flags: [
2780
3177
  projectIdFlag,
2781
3178
  { name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
@@ -2794,10 +3191,10 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
2794
3191
  resource: "dashboard",
2795
3192
  command: "update",
2796
3193
  capabilityId: "analysis.dashboard.update",
2797
- description: "Update dashboard settings, create/update a dashboard note, or replace the dashboard-level business filter. Use --operation settings, note-upsert, or business-filter.",
3194
+ description: "Update dashboard settings, create/update a dashboard note, save a dashboard-wide default filter, or replace the dashboard-level business filter. Use --operation settings, note-upsert, default-filter, or business-filter.",
2798
3195
  flags: [
2799
3196
  projectIdFlag,
2800
- { name: "operation", type: "string", required: true, desc: "Update operation: settings, note-upsert, or business-filter." },
3197
+ { name: "operation", type: "string", required: true, desc: "Update operation: settings, note-upsert, default-filter, or business-filter." },
2801
3198
  { name: "dashboard-id", type: "number", required: false, desc: "Dashboard ID for a single-dashboard update." },
2802
3199
  { name: "dashboard-ids", type: "json", required: false, desc: "Dashboard ID array for batch settings updates." },
2803
3200
  { name: "dashboard-name", type: "string", required: false, desc: "Dashboard name for single rename." },
@@ -2808,7 +3205,8 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
2808
3205
  { name: "note-title", type: "string", required: false, desc: "Dashboard note title." },
2809
3206
  { name: "description", type: "string", required: false, desc: "Dashboard note description." },
2810
3207
  { name: "ui-config", type: "string", required: false, desc: "Dashboard or note UI config string." },
2811
- { name: "filter", type: "json", required: false, desc: 'Dashboard-level business filter in snake_case QP form. Required with --operation business-filter. Pass {"junction_kind":"and","ta_filters":[]} to clear it.' },
3208
+ { name: "filter-name", type: "string", required: false, desc: "Saved filter name. Required with --operation default-filter." },
3209
+ { name: "filter", type: "json", required: false, desc: 'Saved filter in snake_case QP form. Required with --operation default-filter or business-filter. Pass {"junction_kind":"and","ta_filters":[]} to clear a business filter.' },
2812
3210
  payloadFlag
2813
3211
  ],
2814
3212
  risk: "write",
@@ -2825,6 +3223,7 @@ var dashboardUpdate = createAnalysisCapabilityCommand({
2825
3223
  note_title: optionalString(ctx, "note-title"),
2826
3224
  description: optionalString(ctx, "description"),
2827
3225
  ui_config: optionalString(ctx, "ui-config"),
3226
+ filter_name: optionalString(ctx, "filter-name"),
2828
3227
  filter: optionalJson(ctx, "filter"),
2829
3228
  payload: optionalJson(ctx, "payload")
2830
3229
  })
@@ -3301,7 +3700,7 @@ var commands23 = [
3301
3700
  var run_default = commands23;
3302
3701
 
3303
3702
  // src/commands/te-analysis/artifact/download.ts
3304
- import { resolve as resolve3 } from "path";
3703
+ import { resolve as resolve4 } from "path";
3305
3704
  function artifactPath(runId, artifactId) {
3306
3705
  return `runs/${encodeURIComponent(runId)}/artifacts/${encodeURIComponent(artifactId)}/download`;
3307
3706
  }
@@ -3325,7 +3724,7 @@ var artifactDownload = {
3325
3724
  resolveGatewayDomain("analysis"),
3326
3725
  artifactPath(ctx.str("run-id"), ctx.str("artifact-id"))
3327
3726
  ),
3328
- output_path: resolve3(ctx.str("output")),
3727
+ output_path: resolve4(ctx.str("output")),
3329
3728
  ...ctx.bool("force") ? { force: true } : {}
3330
3729
  }),
3331
3730
  execute: async (ctx) => {
@@ -4664,7 +5063,7 @@ var commands39 = [drilldownUserEventsRun, drilldownUserEventsExport];
4664
5063
  var drilldown_user_events_default = commands39;
4665
5064
 
4666
5065
  // src/commands/te-analysis/user/index.ts
4667
- import { existsSync, statSync } from "fs";
5066
+ import { existsSync, statSync as statSync2 } from "fs";
4668
5067
  var authenticatedOnlyFlag = {
4669
5068
  name: "authenticated-only",
4670
5069
  type: "boolean",
@@ -4894,7 +5293,7 @@ function idImportCapability(command) {
4894
5293
  throw new Error("Pass exactly one of --input-file, --input-file-id, or --file-content");
4895
5294
  }
4896
5295
  const localFile = ctx.str("input-file");
4897
- if (localFile && (!existsSync(localFile) || !statSync(localFile).isFile())) {
5296
+ if (localFile && (!existsSync(localFile) || !statSync2(localFile).isFile())) {
4898
5297
  throw new Error(`--input-file must reference a readable local file: ${localFile}`);
4899
5298
  }
4900
5299
  },
@@ -7832,7 +8231,7 @@ var commands79 = [
7832
8231
  var alert_notice_config_default = commands79;
7833
8232
 
7834
8233
  // src/commands/te-analysis/system/shared.ts
7835
- import { readFileSync, statSync as statSync2 } from "fs";
8234
+ import { readFileSync as readFileSync2, statSync as statSync3 } from "fs";
7836
8235
  var secretValues = /* @__PURE__ */ new WeakMap();
7837
8236
  var companyIdField = {
7838
8237
  flag: "company-id",
@@ -7995,14 +8394,14 @@ function secretValue(ctx, secret) {
7995
8394
  let value;
7996
8395
  const file = ctx.str(`${secret.flag}-file`);
7997
8396
  if (file) {
7998
- const stat = statSync2(file);
8397
+ const stat = statSync3(file);
7999
8398
  if (!stat.isFile()) throw validation(`--${secret.flag}-file must reference a regular file.`);
8000
8399
  if ((stat.mode & 63) !== 0) {
8001
8400
  throw validation(`--${secret.flag}-file must not be readable or writable by group/others (use chmod 600).`);
8002
8401
  }
8003
- value = nonEmptySecret(readFileSync(file, "utf8"), secret.flag);
8402
+ value = nonEmptySecret(readFileSync2(file, "utf8"), secret.flag);
8004
8403
  } else if (ctx.bool(`${secret.flag}-stdin`)) {
8005
- value = nonEmptySecret(readFileSync(0, "utf8"), secret.flag);
8404
+ value = nonEmptySecret(readFileSync2(0, "utf8"), secret.flag);
8006
8405
  }
8007
8406
  values.set(secret.flag, value);
8008
8407
  return value;