sim 2.0.0-preview.15.1 → 2.0.0-preview.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +25 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8939,6 +8939,10 @@ var V2_OPERATIONS = {
8939
8939
  kind: "string",
8940
8940
  required: true,
8941
8941
  describe: "Write-only secret value. It is never returned."
8942
+ },
8943
+ description: {
8944
+ kind: "string",
8945
+ describe: "What the secret is for, shown to teammates. Workspace scope only — sending it for a personal secret is rejected. Omit it to leave an existing description untouched; send null or an empty string to clear one."
8942
8946
  }
8943
8947
  }
8944
8948
  },
@@ -9818,7 +9822,7 @@ var CLI_CONTRACT = {
9818
9822
  },
9819
9823
  itemsPath: "results",
9820
9824
  columns: [
9821
- { header: "score", path: "similarity" },
9825
+ { header: "score", path: "similarity", format: "score" },
9822
9826
  { header: "document", path: "documentName" },
9823
9827
  { header: "chunk", path: "chunkIndex" },
9824
9828
  { header: "content" }
@@ -9996,7 +10000,8 @@ var CLI_CONTRACT = {
9996
10000
  { header: "name" },
9997
10001
  { header: "scope" },
9998
10002
  { header: "role" },
9999
- { header: "updated", path: "updatedAt", format: "timestamp" }
10003
+ { header: "updated", path: "updatedAt", format: "timestamp" },
10004
+ { header: "description" }
10000
10005
  ]
10001
10006
  },
10002
10007
  getWorkspace: {
@@ -10809,6 +10814,8 @@ function renderCell(value, format, options = {}) {
10809
10814
  return bool2(value);
10810
10815
  case "cost":
10811
10816
  return typeof value === "number" ? `$${value.toFixed(4)}` : text(null);
10817
+ case "score":
10818
+ return typeof value === "number" ? value.toFixed(4) : text(null);
10812
10819
  case "count":
10813
10820
  return Array.isArray(value) ? String(value.length) : text(null);
10814
10821
  case "folder-path":
@@ -11832,7 +11839,8 @@ var SECRET_RESULT = {
11832
11839
  { header: "name" },
11833
11840
  { header: "scope" },
11834
11841
  { header: "role" },
11835
- { header: "updated", path: "updatedAt", format: "timestamp" }
11842
+ { header: "updated", path: "updatedAt", format: "timestamp" },
11843
+ { header: "description" }
11836
11844
  ]
11837
11845
  };
11838
11846
  function validateSecretValue(value) {
@@ -11843,7 +11851,16 @@ function validateSecretValue(value) {
11843
11851
  }
11844
11852
  return value;
11845
11853
  }
11854
+ function validateDescriptionScope(description, scope) {
11855
+ if (description === undefined)
11856
+ return;
11857
+ if (scope === "personal") {
11858
+ throw new SimApiError("--description is only supported for a workspace secret.", 0);
11859
+ }
11860
+ return description;
11861
+ }
11846
11862
  async function setSecret(name, options, command) {
11863
+ const description = validateDescriptionScope(options.description, options.scope);
11847
11864
  const value = validateSecretValue(options.value ?? await promptSecret());
11848
11865
  const { client, profile } = clientFrom(command);
11849
11866
  const operation = V2_OPERATIONS.setSecret;
@@ -11852,7 +11869,8 @@ async function setSecret(name, options, command) {
11852
11869
  body: {
11853
11870
  workspaceId: client.requireWorkspace(),
11854
11871
  scope: options.scope,
11855
- value
11872
+ value,
11873
+ description
11856
11874
  }
11857
11875
  });
11858
11876
  renderResult("setSecret", profile.output, response.data, SECRET_RESULT);
@@ -11861,7 +11879,7 @@ function attachSecretCommands(program2) {
11861
11879
  const secrets = program2.commands.find((command) => command.name() === "secrets");
11862
11880
  if (!secrets)
11863
11881
  throw new Error("The generated secrets command group is missing");
11864
- secrets.command("set").argument("<name>", "Secret name, as referenced in workflows").description("Create or replace a named secret").addOption(new Option("--scope <scope>", "Secret ownership scope").choices([...SECRET_SCOPES]).makeOptionMandatory()).option("--value <value>", "Secret value; visible to shell history when supplied directly").action((name, options, command) => setSecret(name, options, command));
11882
+ secrets.command("set").argument("<name>", "Secret name, as referenced in workflows").description("Create or replace a named secret").addOption(new Option("--scope <scope>", "Secret ownership scope").choices([...SECRET_SCOPES]).makeOptionMandatory()).option("--value <value>", "Secret value; visible to shell history when supplied directly").option("--description <description>", "What the secret is for, shown to teammates; workspace scope only. Omit to leave an existing description unchanged").action((name, options, command) => setSecret(name, options, command));
11865
11883
  }
11866
11884
 
11867
11885
  // src/runtime/renamed.ts
@@ -12185,7 +12203,8 @@ function buildGeneratedCommands() {
12185
12203
  var PROGRAM_DESCRIPTION = "Talk to the Sim API from your terminal";
12186
12204
  var HELP_EPILOGUE = `
12187
12205
  Profiles work like the AWS CLI: settings live in ~/.sim/config, keys in
12188
- ~/.sim/credentials (0600). Select one with -P, --profile, or SIM_PROFILE.
12206
+ ~/.sim/credentials (0600), or under SIM_CONFIG_DIR when it is set. Select one
12207
+ with -P, --profile, or SIM_PROFILE.
12189
12208
 
12190
12209
  Examples:
12191
12210
  $ sim login Authorize the default profile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.0.0-preview.15.1",
3
+ "version": "2.0.0-preview.17.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "bin": {