{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { run as runCmd } from \"cmd-ts\";\nimport { app } from \"./app\";\nimport { telemetry } from \"./telemetry\";\n\nexport function createApp(opts: { withoutAuth: boolean; appName: string }) {\n  const instance = app(opts);\n  return {\n    async run(args: string[]) {\n      await telemetry.trackInvocation({ appName: opts.appName, argv: args });\n      try {\n        await runCmd(instance, args);\n        telemetry.trackExitCode(0);\n      } catch (error) {\n        telemetry.trackExitCode(1);\n        throw error;\n      } finally {\n        await telemetry.flush();\n      }\n    },\n  };\n}\n"],"mappings":";;;;;;;AAIA,SAAgB,UAAU,MAAiD;CACzE,MAAM,WAAW,IAAI,KAAK;AAC1B,QAAO,EACL,MAAM,IAAI,MAAgB;AACxB,QAAM,UAAU,gBAAgB;GAAE,SAAS,KAAK;GAAS,MAAM;GAAM,CAAC;AACtE,MAAI;AACF,6BAAa,UAAU,KAAK;AAC5B,aAAU,cAAc,EAAE;WACnB,OAAO;AACd,aAAU,cAAc,EAAE;AAC1B,SAAM;YACE;AACR,SAAM,UAAU,OAAO;;IAG5B"}