@uru-intelligence/cli 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -84,6 +84,8 @@
84
84
  - Action: Nothing to do. If an older server answers with an envelope this CLI does not read, the error now says the operation may have completed and to check with uru library ls before retrying.
85
85
  - Tip library_fs read refusals toward library_query, and ship labels/list aliases that need a live catalog with list_labels/create_label. — surfaces: cli, docs; reference: PR #5379 CF001; PR #5381 staging labels catalog
86
86
  - Action: Prefer published CLI >= 0.4.15. Use uru sharing labels_list / label_create (or operations sharing.labels_list / sharing.label_create). library_fs read ops should point callers at library_query instead of an opaque safety refusal.
87
+ - uru operations inspect <id> and uru <family> <verb> --get-schema print the operation's real input schema, narrowed to its op, with the op's examples, instead of Input schema: {}. — surfaces: cli; reference: URU-1425
88
+ - Action: Nothing to change. A not-logged-in inspect prints a pointer to uru login and exits 0; operations ls stays local and schema-free.
87
89
  - Use the shared SemVer contract when deciding whether to show a CLI update notice. — surfaces: cli, release; reference: docs/plans/cli-sdk-native-release-modernization/PLAN.md
88
90
  - Action: No action is required; prerelease and malformed registry versions now follow the same validation and ordering rules as release publication.
89
91
 
package/dist/library.mjs CHANGED
@@ -6334,6 +6334,15 @@ var zArtifactBuildDiagnostic = object({
6334
6334
  rawDiagnosticId: string2().nullish(),
6335
6335
  relatedLocations: array(zArtifactBuildDiagnosticLocation).optional().default([])
6336
6336
  });
6337
+ var zArtifactBuildJob = object({
6338
+ attempts: int().optional().default(0),
6339
+ createdAt: string2().nullish(),
6340
+ id: string2(),
6341
+ lastError: string2().nullish(),
6342
+ leaseExpiresAt: string2().nullish(),
6343
+ status: string2(),
6344
+ updatedAt: string2().nullish()
6345
+ }).nullable();
6337
6346
  var zArtifactBuildRequest = object({
6338
6347
  content: string2().nullish(),
6339
6348
  currentSourceRevisionId: string2().nullish(),
@@ -6544,6 +6553,7 @@ var zArtifactBuildDescriptor = object({
6544
6553
  assets: record(string2(), zArtifactFileDescriptor).optional(),
6545
6554
  buildDiagnostics: array(zArtifactBuildDiagnostic).optional().default([]),
6546
6555
  buildErrors: array(string2()).optional().default([]),
6556
+ buildJob: zArtifactBuildJob.optional(),
6547
6557
  buildPipelineVersion: string2().nullish(),
6548
6558
  buildStatus: string2().nullish(),
6549
6559
  bundleStatus: string2().nullish(),
@@ -7084,6 +7094,9 @@ var zClientIdMetadataDocument = object({
7084
7094
  scope: string2().min(1),
7085
7095
  token_endpoint_auth_method: _enum(["none"])
7086
7096
  });
7097
+ var zCloneArtifactRequest = object({
7098
+ sourceRevisionId: uuid2().optional()
7099
+ });
7087
7100
  var zCollectionGateAccessResponse = object({
7088
7101
  accessToken: string2(),
7089
7102
  expiresAt: string2(),
@@ -7614,6 +7627,13 @@ var zDebugEntityResponse = object({
7614
7627
  entityId: string2(),
7615
7628
  userId: string2()
7616
7629
  });
7630
+ var zDeleteGemVersionResponse = strictObject({
7631
+ deleted: literal(true),
7632
+ linksChanged: literal(false),
7633
+ sourceRevisionId: string2(),
7634
+ versionId: string2(),
7635
+ versionNumber: int()
7636
+ });
7617
7637
  var zDeleteNotificationsRequest = object({
7618
7638
  notificationIds: array(uuid2())
7619
7639
  });
@@ -16178,6 +16198,10 @@ var zDiffGemVersionsQuery = object({
16178
16198
  fromVersion: string2().min(1),
16179
16199
  toVersion: string2().min(1)
16180
16200
  });
16201
+ var zDeleteGemVersionPath = object({
16202
+ gemRef: string2().min(1),
16203
+ resourceId: string2().min(1)
16204
+ });
16181
16205
  var zGetGemVersionPath = object({
16182
16206
  gemRef: string2().min(1),
16183
16207
  resourceId: string2().min(1)
@@ -16987,6 +17011,14 @@ var zCspViolationReportApiSecurityCspViolationReportPostBody = string2().default
16987
17011
  var zThreadShareReadPath = object({
16988
17012
  shareId: string2().min(1).max(128)
16989
17013
  });
17014
+ var zThreadShareFileContentHeaders = object({
17015
+ Range: string2().optional()
17016
+ });
17017
+ var zThreadShareFileContentPath = object({
17018
+ shareId: string2().min(1).max(128),
17019
+ fileId: string2().min(1).max(200)
17020
+ });
17021
+ var zThreadShareFileContentResponse = string2();
16990
17022
  var zBackfillSharedContentMetadataApiSharingBackfillMetadataPostResponse = record(string2(), string2());
16991
17023
  var zDeleteNotificationsApiSharingNotificationsDeleteResponse = record(string2(), unknown());
16992
17024
  var zGetNotificationsApiSharingNotificationsGetQuery = object({
@@ -17530,7 +17562,7 @@ function pickString(record2, keys) {
17530
17562
  // package.json
17531
17563
  var package_default = {
17532
17564
  name: "@uru-intelligence/cli",
17533
- version: "0.5.0",
17565
+ version: "0.5.1",
17534
17566
  private: false,
17535
17567
  description: "Uru full-platform command line interface",
17536
17568
  repository: {
package/dist/uru.mjs CHANGED
@@ -880,6 +880,84 @@ var cliNativeOperationContracts = [
880
880
  function getCliNativeOperationContract(operationId) {
881
881
  return cliNativeOperationContracts.find((contract) => contract.operationId === operationId);
882
882
  }
883
+ // ../../packages/platform-operations/src/narrow_tool_input_schema.ts
884
+ function narrowToolInputSchemaToOperation(inputSchema, backendOp) {
885
+ if (backendOp === undefined) {
886
+ return inputSchema;
887
+ }
888
+ const union = unionBranchesOf(inputSchema);
889
+ if (union === undefined) {
890
+ return withoutOpKey(inputSchema);
891
+ }
892
+ const keptBranches = union.branches.filter((branch) => branchDeclaresOp(branch, backendOp)).map(withoutOpKey);
893
+ if (keptBranches.length === 0) {
894
+ return withoutOpKey(inputSchema);
895
+ }
896
+ if (keptBranches.length === 1) {
897
+ return withCarriedOverShape(keptBranches[0], inputSchema);
898
+ }
899
+ return { type: "object", oneOf: keptBranches };
900
+ }
901
+ function isSchemaObject(value) {
902
+ return typeof value === "object" && value !== null && !Array.isArray(value);
903
+ }
904
+ function unionBranchesOf(schema) {
905
+ for (const key of ["oneOf", "anyOf"]) {
906
+ const candidate = schema[key];
907
+ if (Array.isArray(candidate)) {
908
+ return { branches: candidate.filter(isSchemaObject) };
909
+ }
910
+ }
911
+ return;
912
+ }
913
+ function branchDeclaresOp(branch, backendOp) {
914
+ const properties = branch["properties"];
915
+ if (!isSchemaObject(properties)) {
916
+ return false;
917
+ }
918
+ const opSchema = properties["op"];
919
+ if (!isSchemaObject(opSchema)) {
920
+ return false;
921
+ }
922
+ if (opSchema["const"] === backendOp) {
923
+ return true;
924
+ }
925
+ const enumValues = opSchema["enum"];
926
+ return Array.isArray(enumValues) && enumValues.includes(backendOp);
927
+ }
928
+ function withoutOpKey(schema) {
929
+ const properties = schema["properties"];
930
+ const required = schema["required"];
931
+ const hasOpProperty = isSchemaObject(properties) && "op" in properties;
932
+ const hasOpRequired = Array.isArray(required) && required.includes("op");
933
+ if (!hasOpProperty && !hasOpRequired) {
934
+ return schema;
935
+ }
936
+ const next = { ...schema };
937
+ if (hasOpProperty) {
938
+ const { op: _op, ...restProperties } = properties;
939
+ next["properties"] = restProperties;
940
+ }
941
+ if (hasOpRequired) {
942
+ next["required"] = required.filter((value) => value !== "op");
943
+ }
944
+ return next;
945
+ }
946
+ function withCarriedOverShape(branch, unionSchema) {
947
+ const missingType = branch["type"] === undefined;
948
+ const missingDescription = branch["description"] === undefined && unionSchema["description"] !== undefined;
949
+ if (!missingType && !missingDescription) {
950
+ return branch;
951
+ }
952
+ const next = { ...branch };
953
+ if (missingType) {
954
+ next["type"] = unionSchema["type"] ?? "object";
955
+ }
956
+ if (missingDescription) {
957
+ next["description"] = unionSchema["description"];
958
+ }
959
+ return next;
960
+ }
883
961
  // ../../packages/platform-operations/src/internal_tool_ids.ts
884
962
  var internalOnlyPlatformToolIds = new Set([
885
963
  "CFO_NEWSLETTER_SQL",
@@ -1762,7 +1840,7 @@ function datasetPathSpecs() {
1762
1840
  const datasetId = [required("dataset-id")];
1763
1841
  const pageFlags = [valueFlag("--limit"), valueFlag("--cursor")];
1764
1842
  return [
1765
- pathSpec(["datasets"], "datasets", [optional("operation")], [paramsJsonFlag()], { dynamicFamily: "datasets" }),
1843
+ pathSpec(["datasets"], "datasets", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "datasets" }),
1766
1844
  pathSpec(["datasets", "create"], "datasets", [], [paramsJsonFlag()]),
1767
1845
  pathSpec(["datasets", "update"], "datasets", [], [paramsJsonFlag()]),
1768
1846
  pathSpec(["datasets", "rows"], "datasets", [], [paramsJsonFlag()]),
@@ -1830,7 +1908,7 @@ function distributionPathSpecs() {
1830
1908
  paramsJsonFlag()
1831
1909
  ];
1832
1910
  return [
1833
- pathSpec(["distribution"], "distribution", [optional("operation")], [paramsJsonFlag()], { dynamicFamily: "distribution" }),
1911
+ pathSpec(["distribution"], "distribution", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "distribution" }),
1834
1912
  pathSpec(["distribution", "list"], "distribution", [], pageFlags, {
1835
1913
  aliases: [["distribution", "ls"]]
1836
1914
  }),
@@ -2499,21 +2577,12 @@ function tokenEnvSecretPathSpecs() {
2499
2577
  }
2500
2578
  function registryFamilyPathSpecs() {
2501
2579
  return [
2502
- pathSpec(["workspace"], "workspace", [optional("operation")], [paramsJsonFlag()], { dynamicFamily: "workspace" }),
2503
- pathSpec(["sharing"], "sharing", [optional("operation")], [paramsJsonFlag()], {
2504
- dynamicFamily: "sharing"
2505
- }),
2506
- pathSpec(["web"], "web", [optional("operation")], [paramsJsonFlag()], {
2507
- dynamicFamily: "web"
2508
- }),
2509
- pathSpec(["files"], "files", [optional("operation")], [paramsJsonFlag()], {
2510
- aliases: [["file"]],
2511
- dynamicFamily: "files"
2512
- }),
2513
- pathSpec(["home"], "home", [optional("operation")], [paramsJsonFlag()], {
2514
- dynamicFamily: "home"
2515
- }),
2516
- pathSpec(["business-sql"], "business_sql", [optional("operation")], [paramsJsonFlag()], { aliases: [["business_sql"]], dynamicFamily: "business_sql" })
2580
+ pathSpec(["workspace"], "workspace", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "workspace" }),
2581
+ pathSpec(["sharing"], "sharing", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "sharing" }),
2582
+ pathSpec(["web"], "web", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "web" }),
2583
+ pathSpec(["files"], "files", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { aliases: [["file"]], dynamicFamily: "files" }),
2584
+ pathSpec(["home"], "home", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { dynamicFamily: "home" }),
2585
+ pathSpec(["business-sql"], "business_sql", [optional("operation")], [paramsJsonFlag(), booleanFlag("--get-schema")], { aliases: [["business_sql"]], dynamicFamily: "business_sql" })
2517
2586
  ];
2518
2587
  }
2519
2588
  var commandPathSpecsByPath = new Map;
@@ -2992,7 +3061,7 @@ function spec(id, summary, auth, workspace, safety, outputModes, cancellation =
2992
3061
  // package.json
2993
3062
  var package_default = {
2994
3063
  name: "@uru-intelligence/cli",
2995
- version: "0.5.0",
3064
+ version: "0.5.1",
2996
3065
  private: false,
2997
3066
  description: "Uru full-platform command line interface",
2998
3067
  repository: {
@@ -9564,6 +9633,15 @@ var zArtifactBuildDiagnostic = object({
9564
9633
  rawDiagnosticId: string2().nullish(),
9565
9634
  relatedLocations: array(zArtifactBuildDiagnosticLocation).optional().default([])
9566
9635
  });
9636
+ var zArtifactBuildJob = object({
9637
+ attempts: int().optional().default(0),
9638
+ createdAt: string2().nullish(),
9639
+ id: string2(),
9640
+ lastError: string2().nullish(),
9641
+ leaseExpiresAt: string2().nullish(),
9642
+ status: string2(),
9643
+ updatedAt: string2().nullish()
9644
+ }).nullable();
9567
9645
  var zArtifactBuildRequest = object({
9568
9646
  content: string2().nullish(),
9569
9647
  currentSourceRevisionId: string2().nullish(),
@@ -9774,6 +9852,7 @@ var zArtifactBuildDescriptor = object({
9774
9852
  assets: record(string2(), zArtifactFileDescriptor).optional(),
9775
9853
  buildDiagnostics: array(zArtifactBuildDiagnostic).optional().default([]),
9776
9854
  buildErrors: array(string2()).optional().default([]),
9855
+ buildJob: zArtifactBuildJob.optional(),
9777
9856
  buildPipelineVersion: string2().nullish(),
9778
9857
  buildStatus: string2().nullish(),
9779
9858
  bundleStatus: string2().nullish(),
@@ -10314,6 +10393,9 @@ var zClientIdMetadataDocument = object({
10314
10393
  scope: string2().min(1),
10315
10394
  token_endpoint_auth_method: _enum(["none"])
10316
10395
  });
10396
+ var zCloneArtifactRequest = object({
10397
+ sourceRevisionId: uuid2().optional()
10398
+ });
10317
10399
  var zCollectionGateAccessResponse = object({
10318
10400
  accessToken: string2(),
10319
10401
  expiresAt: string2(),
@@ -10844,6 +10926,13 @@ var zDebugEntityResponse = object({
10844
10926
  entityId: string2(),
10845
10927
  userId: string2()
10846
10928
  });
10929
+ var zDeleteGemVersionResponse = strictObject({
10930
+ deleted: literal(true),
10931
+ linksChanged: literal(false),
10932
+ sourceRevisionId: string2(),
10933
+ versionId: string2(),
10934
+ versionNumber: int()
10935
+ });
10847
10936
  var zDeleteNotificationsRequest = object({
10848
10937
  notificationIds: array(uuid2())
10849
10938
  });
@@ -19408,6 +19497,10 @@ var zDiffGemVersionsQuery = object({
19408
19497
  fromVersion: string2().min(1),
19409
19498
  toVersion: string2().min(1)
19410
19499
  });
19500
+ var zDeleteGemVersionPath = object({
19501
+ gemRef: string2().min(1),
19502
+ resourceId: string2().min(1)
19503
+ });
19411
19504
  var zGetGemVersionPath = object({
19412
19505
  gemRef: string2().min(1),
19413
19506
  resourceId: string2().min(1)
@@ -20217,6 +20310,14 @@ var zCspViolationReportApiSecurityCspViolationReportPostBody = string2().default
20217
20310
  var zThreadShareReadPath = object({
20218
20311
  shareId: string2().min(1).max(128)
20219
20312
  });
20313
+ var zThreadShareFileContentHeaders = object({
20314
+ Range: string2().optional()
20315
+ });
20316
+ var zThreadShareFileContentPath = object({
20317
+ shareId: string2().min(1).max(128),
20318
+ fileId: string2().min(1).max(200)
20319
+ });
20320
+ var zThreadShareFileContentResponse = string2();
20220
20321
  var zBackfillSharedContentMetadataApiSharingBackfillMetadataPostResponse = record(string2(), string2());
20221
20322
  var zDeleteNotificationsApiSharingNotificationsDeleteResponse = record(string2(), unknown());
20222
20323
  var zGetNotificationsApiSharingNotificationsGetQuery = object({
@@ -22118,7 +22219,7 @@ function formatWorkspaces(workspaces, style = PLAIN_VISUAL, currentWorkspaceId)
22118
22219
  currentId !== undefined && workspace.id === currentId ? "current" : ""
22119
22220
  ]));
22120
22221
  }
22121
- function formatOperationContract(contract) {
22222
+ function formatOperationContract(contract, options = {}) {
22122
22223
  const id = typeof contract["id"] === "string" ? contract["id"] : "unknown";
22123
22224
  const family = typeof contract["family"] === "string" ? contract["family"] : "unknown";
22124
22225
  const summary = typeof contract["summary"] === "string" ? contract["summary"] : "";
@@ -22135,8 +22236,19 @@ function formatOperationContract(contract) {
22135
22236
  if (safety !== "") {
22136
22237
  lines.push(`Safety: ${safety}`);
22137
22238
  }
22138
- lines.push("Input schema:");
22139
- lines.push(JSON.stringify(contract["inputSchema"] ?? {}, null, 2));
22239
+ const inputSchema = contract["inputSchema"];
22240
+ if (inputSchema !== undefined) {
22241
+ lines.push("Input schema:");
22242
+ lines.push(JSON.stringify(inputSchema, null, 2));
22243
+ } else {
22244
+ const pointer = options.inputSchemaNote ?? (backend === "" ? "not loaded" : `not loaded — run \`uru tools schema ${backend}\``);
22245
+ lines.push(`Input schema: ${pointer}`);
22246
+ }
22247
+ const examples = contract["examples"];
22248
+ if (Array.isArray(examples) && examples.length > 0) {
22249
+ lines.push("Examples:");
22250
+ lines.push(JSON.stringify(examples, null, 2));
22251
+ }
22140
22252
  return lines.join(`
22141
22253
  `);
22142
22254
  }
@@ -24439,6 +24551,47 @@ function operationForJson(operation) {
24439
24551
  }
24440
24552
  };
24441
24553
  }
24554
+ async function operationContractForInspect(ctx, operation) {
24555
+ const baseContract = operationForJson(operation);
24556
+ if (getCliNativeOperationContract(operation.id) !== undefined) {
24557
+ return { contract: baseContract, text: formatOperationContract(baseContract) };
24558
+ }
24559
+ if (ctx.token === undefined || ctx.token.trim() === "") {
24560
+ return {
24561
+ contract: baseContract,
24562
+ text: formatOperationContract(baseContract, {
24563
+ inputSchemaNote: `not loaded (not logged in) — run \`uru login\`, or \`uru tools schema ${operation.backendToolName}\``
24564
+ })
24565
+ };
24566
+ }
24567
+ try {
24568
+ await withWorkspace(ctx);
24569
+ } catch {
24570
+ return { contract: baseContract, text: formatOperationContract(baseContract) };
24571
+ }
24572
+ const enrichedContract = await withLiveInputSchema(ctx, operation, baseContract);
24573
+ return { contract: enrichedContract, text: formatOperationContract(enrichedContract) };
24574
+ }
24575
+ async function withLiveInputSchema(ctx, operation, baseContract) {
24576
+ let rawSchema;
24577
+ try {
24578
+ rawSchema = await client(ctx).getToolSchema(operation.backendToolName);
24579
+ } catch {
24580
+ return baseContract;
24581
+ }
24582
+ if (!isJsonObject2(rawSchema)) {
24583
+ return baseContract;
24584
+ }
24585
+ const rawInputSchema = rawSchema["inputSchema"];
24586
+ const inputSchema = isJsonObject2(rawInputSchema) ? narrowToolInputSchemaToOperation(rawInputSchema, operation.backendOp) : undefined;
24587
+ const rawExamples = rawSchema["examples"];
24588
+ const examples = Array.isArray(rawExamples) ? rawExamples.filter((example) => operation.backendOp === undefined || isJsonObject2(example) && isJsonObject2(example["parameters"]) && example["parameters"]["op"] === operation.backendOp) : undefined;
24589
+ return {
24590
+ ...baseContract,
24591
+ ...inputSchema === undefined ? {} : { inputSchema },
24592
+ ...examples !== undefined && examples.length > 0 ? { examples } : {}
24593
+ };
24594
+ }
24442
24595
  async function dispatchOperations(ctx, sub, args) {
24443
24596
  if (sub === "ls" || sub === "list") {
24444
24597
  const flags = parseLocalFlags(args, ["operations", "ls"]);
@@ -24459,8 +24612,8 @@ async function dispatchOperations(ctx, sub, args) {
24459
24612
  if (operation === undefined) {
24460
24613
  throw new CliError(`Unknown operation: ${operationId}. Run \`uru operations ls\`.`);
24461
24614
  }
24462
- const contract = operationForJson(operation);
24463
- emitValue(ctx, contract, formatOperationContract(contract));
24615
+ const { contract, text } = await operationContractForInspect(ctx, operation);
24616
+ emitValue(ctx, contract, text);
24464
24617
  return;
24465
24618
  }
24466
24619
  if (sub === "run") {
@@ -24477,7 +24630,13 @@ async function dispatchRegistryFamily(ctx, family, sub, args) {
24477
24630
  if (operation === undefined) {
24478
24631
  throw new CliError(`Unknown ${family} operation: ${verb}. Run \`uru operations ls --family ${family}\`.`);
24479
24632
  }
24480
- await emitTool(ctx, operation.id, adaptRegistryFamilyParams(await paramsJson(args, [family.replace("_", "-")], paramsJsonOptions(ctx))));
24633
+ const commandPath = [family.replace("_", "-")];
24634
+ if (parseLocalFlags(args, commandPath).booleans.has("--get-schema")) {
24635
+ const { contract, text } = await operationContractForInspect(ctx, operation);
24636
+ emitValue(ctx, contract, text);
24637
+ return;
24638
+ }
24639
+ await emitTool(ctx, operation.id, adaptRegistryFamilyParams(await paramsJson(args, commandPath, paramsJsonOptions(ctx))));
24481
24640
  }
24482
24641
  function adaptRegistryFamilyParams(params) {
24483
24642
  const adapted = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uru-intelligence/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "private": false,
5
5
  "description": "Uru full-platform command line interface",
6
6
  "repository": {