@getpochi/cli 0.5.18 → 0.5.19

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/cli.js +20 -16
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -339469,6 +339469,14 @@ var WebsiteTaskCreateEvent = exports_external2.object({
339469
339469
  githubTemplateUrl: exports_external2.string().optional()
339470
339470
  })
339471
339471
  });
339472
+ // ../common/src/vscode-webui-bridge/index.ts
339473
+ var DevBaseUrl = "http://localhost:4113";
339474
+ var ProdBaseUrl = "https://app.getpochi.com";
339475
+ var isDev = process.env.POCHI_LOCAL_SERVER === "true";
339476
+ function getServerBaseUrl() {
339477
+ return isDev ? DevBaseUrl : ProdBaseUrl;
339478
+ }
339479
+
339472
339480
  // ../common/src/configuration/mcp.ts
339473
339481
  var McpServerTransportStdioFields = {
339474
339482
  command: v4_default.string(),
@@ -339567,7 +339575,7 @@ function makePochiConfig(strict = false) {
339567
339575
  }
339568
339576
 
339569
339577
  // ../common/src/configuration/config-manager.ts
339570
- var PochiConfigFilePath = path2.join(os.homedir(), ".pochi", "config.jsonc");
339578
+ var PochiConfigFilePath = path2.join(os.homedir(), ".pochi", isDev ? "dev-config.jsonc" : "config.jsonc");
339571
339579
  var logger = getLogger("PochiConfigManager");
339572
339580
 
339573
339581
  class PochiConfigManager {
@@ -339699,6 +339707,9 @@ class VendorBase {
339699
339707
  });
339700
339708
  return newUser;
339701
339709
  }
339710
+ logout() {
339711
+ return updateVendorConfig(this.vendorId, null);
339712
+ }
339702
339713
  get authenticated() {
339703
339714
  const config3 = getVendorConfig(this.vendorId);
339704
339715
  return !!config3?.credentials;
@@ -339732,14 +339743,6 @@ var deviceLinkClient = () => {
339732
339743
  };
339733
339744
  };
339734
339745
 
339735
- // ../common/src/vscode-webui-bridge/index.ts
339736
- var DevBaseUrl = "http://localhost:4113";
339737
- var ProdBaseUrl = "https://app.getpochi.com";
339738
- var isDev = process.env.POCHI_LOCAL_SERVER === "true";
339739
- function getServerBaseUrl() {
339740
- return isDev ? DevBaseUrl : ProdBaseUrl;
339741
- }
339742
-
339743
339746
  // ../../node_modules/nanostores/clean-stores/index.js
339744
339747
  var clean = Symbol("clean");
339745
339748
 
@@ -343952,7 +343955,7 @@ var {
343952
343955
  // package.json
343953
343956
  var package_default = {
343954
343957
  name: "@getpochi/cli",
343955
- version: "0.5.18",
343958
+ version: "0.5.19",
343956
343959
  type: "module",
343957
343960
  bin: {
343958
343961
  pochi: "src/cli.ts"
@@ -382416,7 +382419,7 @@ function toError2(e11) {
382416
382419
  // package.json
382417
382420
  var package_default2 = {
382418
382421
  name: "@getpochi/cli",
382419
- version: "0.5.18",
382422
+ version: "0.5.19",
382420
382423
  type: "module",
382421
382424
  bin: {
382422
382425
  pochi: "src/cli.ts"
@@ -382817,12 +382820,13 @@ async function parseTaskInput(options5, program6) {
382817
382820
  return { uid, prompt };
382818
382821
  }
382819
382822
  async function createApiClient2() {
382820
- const token = getPochiCredentials()?.token;
382823
+ const pochi = getVendor2("pochi");
382824
+ const credentials = await pochi.getCredentials().catch(() => null);
382821
382825
  const apiClient = hc(prodServerUrl, {
382822
- fetch(input, init4) {
382826
+ async fetch(input, init4) {
382823
382827
  const headers = new Headers(init4?.headers);
382824
- if (token) {
382825
- headers.append("Authorization", `Bearer ${token}`);
382828
+ if (credentials?.token) {
382829
+ headers.append("Authorization", `Bearer ${credentials.token}`);
382826
382830
  }
382827
382831
  headers.set("User-Agent", userAgent);
382828
382832
  return fetch(input, {
@@ -382834,7 +382838,7 @@ async function createApiClient2() {
382834
382838
  const proxed = new Proxy(apiClient, {
382835
382839
  get(target3, prop, receiver2) {
382836
382840
  if (prop === "authenticated") {
382837
- return !!token;
382841
+ return !!credentials?.token;
382838
382842
  }
382839
382843
  return Reflect.get(target3, prop, receiver2);
382840
382844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpochi/cli",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pochi": "src/cli.ts"