sim 2.2.9-preview.208.1 → 2.2.9-preview.209.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/dist/index.js CHANGED
@@ -17328,6 +17328,13 @@ var V2_OPERATIONS = {
17328
17328
  }
17329
17329
  };
17330
17330
 
17331
+ // src/runtime/called-operations.ts
17332
+ var CALLED_OPERATIONS = new WeakMap;
17333
+ function callsOperations(command, operations) {
17334
+ CALLED_OPERATIONS.set(command, operations);
17335
+ return command;
17336
+ }
17337
+
17331
17338
  // src/commands/auth.ts
17332
17339
  var MAX_INTERACTIVE_WORKSPACES = 1000;
17333
17340
  function openBrowser(url) {
@@ -17848,7 +17855,7 @@ function presentVerification(verification) {
17848
17855
  }
17849
17856
  }
17850
17857
  function whoamiCommand() {
17851
- return new Command("whoami").description("Show the resolved profile, where each setting came from, and whether it works").option("--no-verify", "Skip the API check and only print the resolved settings").action(async (options, command) => {
17858
+ const whoami = new Command("whoami").description("Show the resolved profile, where each setting came from, and whether it works").option("--no-verify", "Skip the API check and only print the resolved settings").action(async (options, command) => {
17852
17859
  const { client, profile } = clientFrom(command);
17853
17860
  const { sources } = profile;
17854
17861
  const authentication = presentAuthentication(sources.credential);
@@ -17897,6 +17904,7 @@ function whoamiCommand() {
17897
17904
  if (exitCode !== 0)
17898
17905
  setSoftExitCode(exitCode);
17899
17906
  });
17907
+ return callsOperations(whoami, ["getMeta", "getWorkspace"]);
17900
17908
  }
17901
17909
  var PROFILE_COLUMNS = [
17902
17910
  { header: "", value: (row) => row.active ? styles3().green("*") : " " },
@@ -21747,7 +21755,7 @@ function ignoreBrokenPipe(stream) {
21747
21755
  };
21748
21756
  }
21749
21757
  function attachChat(program) {
21750
- program.command("chat").description("Ask Sim and print the reply").argument("<message>", "What to ask Sim").allowExcessArguments(false).option("-c, --conversation <id>", "Continue the conversation with this ID").addHelpText("after", `
21758
+ const chat = program.command("chat").description("Ask Sim and print the reply").argument("<message>", "What to ask Sim").allowExcessArguments(false).option("-c, --conversation <id>", "Continue the conversation with this ID").addHelpText("after", `
21751
21759
  Each turn prints the reply on stdout and the conversation ID on stderr; pass
21752
21760
  that ID back with -c to continue the same conversation. With --output json or
21753
21761
  yaml the reply is not streamed — the finished result is printed as one
@@ -21813,6 +21821,7 @@ Examples:
21813
21821
  restorePipeHandling?.();
21814
21822
  }
21815
21823
  });
21824
+ callsOperations(chat, ["chat"]);
21816
21825
  }
21817
21826
 
21818
21827
  // src/commands/protocol/files-get.ts
@@ -22029,7 +22038,8 @@ function attachFileGet(files) {
22029
22038
  files.command("get").argument("<fileId>", "File whose content to read").allowExcessArguments(false).description("Download a file’s content to stdout or a local file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFile, { fileId }, options));
22030
22039
  }
22031
22040
  function attachFileVersionDownload(versions) {
22032
- versions.command("download").argument("<fileId>", "File identifier.").argument("<version>", "Version number.").allowExcessArguments(false).description("Download the content of one version of a file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, version, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFileVersion, { fileId, version }, options));
22041
+ const download = versions.command("download").argument("<fileId>", "File identifier.").argument("<version>", "Version number.").allowExcessArguments(false).description("Download the content of one version of a file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, version, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFileVersion, { fileId, version }, options));
22042
+ callsOperations(download, ["downloadFileVersion"]);
22033
22043
  }
22034
22044
 
22035
22045
  // src/transfer/upload-session.ts
@@ -0,0 +1,11 @@
1
+ import type { Command } from 'commander';
2
+ import type { V2OperationName } from '../generated/v2-api';
3
+ /**
4
+ * Records the v2 operations a hand-written command calls.
5
+ *
6
+ * A generated command is one operation and the command inventory finds it by path. A
7
+ * hand-written one is opaque until it says what it calls, and the inventory needs that
8
+ * to describe it truthfully, such as whether every call is open to a Mothership caller.
9
+ */
10
+ export declare function callsOperations(command: Command, operations: readonly V2OperationName[]): Command;
11
+ export declare function calledOperations(command: Command): readonly V2OperationName[] | undefined;
package/dist/runtime.js CHANGED
@@ -17377,6 +17377,13 @@ var V2_OPERATIONS = {
17377
17377
  }
17378
17378
  };
17379
17379
 
17380
+ // src/runtime/called-operations.ts
17381
+ var CALLED_OPERATIONS = new WeakMap;
17382
+ function callsOperations(command, operations) {
17383
+ CALLED_OPERATIONS.set(command, operations);
17384
+ return command;
17385
+ }
17386
+
17380
17387
  // src/commands/auth.ts
17381
17388
  var MAX_INTERACTIVE_WORKSPACES = 1000;
17382
17389
  function openBrowser(url) {
@@ -17897,7 +17904,7 @@ function presentVerification(verification) {
17897
17904
  }
17898
17905
  }
17899
17906
  function whoamiCommand() {
17900
- return new Command("whoami").description("Show the resolved profile, where each setting came from, and whether it works").option("--no-verify", "Skip the API check and only print the resolved settings").action(async (options, command) => {
17907
+ const whoami = new Command("whoami").description("Show the resolved profile, where each setting came from, and whether it works").option("--no-verify", "Skip the API check and only print the resolved settings").action(async (options, command) => {
17901
17908
  const { client, profile } = clientFrom(command);
17902
17909
  const { sources } = profile;
17903
17910
  const authentication = presentAuthentication(sources.credential);
@@ -17946,6 +17953,7 @@ function whoamiCommand() {
17946
17953
  if (exitCode !== 0)
17947
17954
  setSoftExitCode(exitCode);
17948
17955
  });
17956
+ return callsOperations(whoami, ["getMeta", "getWorkspace"]);
17949
17957
  }
17950
17958
  var PROFILE_COLUMNS = [
17951
17959
  { header: "", value: (row) => row.active ? styles3().green("*") : " " },
@@ -21796,7 +21804,7 @@ function ignoreBrokenPipe(stream) {
21796
21804
  };
21797
21805
  }
21798
21806
  function attachChat(program) {
21799
- program.command("chat").description("Ask Sim and print the reply").argument("<message>", "What to ask Sim").allowExcessArguments(false).option("-c, --conversation <id>", "Continue the conversation with this ID").addHelpText("after", `
21807
+ const chat = program.command("chat").description("Ask Sim and print the reply").argument("<message>", "What to ask Sim").allowExcessArguments(false).option("-c, --conversation <id>", "Continue the conversation with this ID").addHelpText("after", `
21800
21808
  Each turn prints the reply on stdout and the conversation ID on stderr; pass
21801
21809
  that ID back with -c to continue the same conversation. With --output json or
21802
21810
  yaml the reply is not streamed — the finished result is printed as one
@@ -21862,6 +21870,7 @@ Examples:
21862
21870
  restorePipeHandling?.();
21863
21871
  }
21864
21872
  });
21873
+ callsOperations(chat, ["chat"]);
21865
21874
  }
21866
21875
 
21867
21876
  // src/commands/protocol/files-get.ts
@@ -22078,7 +22087,8 @@ function attachFileGet(files) {
22078
22087
  files.command("get").argument("<fileId>", "File whose content to read").allowExcessArguments(false).description("Download a file’s content to stdout or a local file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFile, { fileId }, options));
22079
22088
  }
22080
22089
  function attachFileVersionDownload(versions) {
22081
- versions.command("download").argument("<fileId>", "File identifier.").argument("<version>", "Version number.").allowExcessArguments(false).description("Download the content of one version of a file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, version, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFileVersion, { fileId, version }, options));
22090
+ const download = versions.command("download").argument("<fileId>", "File identifier.").argument("<version>", "Version number.").allowExcessArguments(false).description("Download the content of one version of a file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, version, options, command) => downloadToOutput(command, V2_OPERATIONS.downloadFileVersion, { fileId, version }, options));
22091
+ callsOperations(download, ["downloadFileVersion"]);
22082
22092
  }
22083
22093
 
22084
22094
  // src/transfer/upload-session.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.2.9-preview.208.1",
3
+ "version": "2.2.9-preview.209.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "imports": {