@whatcode-ai/whatcode 1.9.0 → 1.10.0

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/cli.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createWhatcodeServer, resetWhatcodeServer } from '@whatcode-ai/sdk';
3
+ import { logger } from '@whatcode-ai/sdk/logger';
4
+ import { printQrCode } from "./qrcode.js";
3
5
  import yargs from 'yargs';
4
6
  import { hideBin } from 'yargs/helpers';
5
7
  import updateNotifier from 'update-notifier';
@@ -21,11 +23,18 @@ const { tailscale, reset, port, opencodePort, debug, password } = await yargs(hi
21
23
  if (reset) {
22
24
  await resetWhatcodeServer();
23
25
  }
24
- await createWhatcodeServer({
26
+ const { url } = await createWhatcodeServer({
25
27
  tailscale,
26
28
  ...(port !== undefined && { port }),
27
29
  ...(opencodePort !== undefined && { opencodePort }),
28
30
  ...(debug !== undefined && { debug }),
29
31
  ...(password !== undefined && { password }),
30
32
  });
33
+ if (url) {
34
+ logger.info('whatcode', `use this URL in the app: ${url}`);
35
+ printQrCode(url, password);
36
+ }
37
+ else {
38
+ logger.info('whatcode', 'could not determine local IP — find your machine IP in your network settings and connect manually');
39
+ }
31
40
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,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E,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,uDAAuD,EAAE,CAAC;KAC1G,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yEAAyE,EAAE,CAAC;KAC9H,UAAU,EAAE,CAAC;AAEhB,IAAI,KAAK,EAAE,CAAC;IACV,MAAM,mBAAmB,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,oBAAoB,CAAC;IACzC,SAAS;IACT,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC;IACnC,GAAG,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,CAAC;IACnD,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;IACrC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,IAAI,GAAG,EAAE,CAAC;IACR,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,4BAA4B,GAAG,EAAE,CAAC,CAAC;IAC3D,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC;KAAM,CAAC;IACN,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,mGAAmG,CAAC,CAAC;AAC/H,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CLIENT_URL = "https://www.whatcode.app";
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,6BAA6B,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,2 @@
1
+ export const CLIENT_URL = 'https://www.whatcode.app';
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const printQrCode: (url: string, password?: string) => void;
2
+ //# sourceMappingURL=qrcode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcode.d.ts","sourceRoot":"","sources":["../src/qrcode.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,KAAG,IAO5D,CAAC"}
package/dist/qrcode.js ADDED
@@ -0,0 +1,12 @@
1
+ import qrcode from 'qrcode-terminal';
2
+ import { CLIENT_URL } from "./config.js";
3
+ export const printQrCode = (url, password) => {
4
+ const params = new URLSearchParams({ url });
5
+ if (password)
6
+ params.set('password', password);
7
+ // TODO [2026-05-01] we should handle this connection with url
8
+ // usefull if user try to scan the qr directly from the camera (outside our app)
9
+ const deepLink = `${CLIENT_URL}/connect?${params.toString()}`;
10
+ qrcode.generate(deepLink, { small: true });
11
+ };
12
+ //# sourceMappingURL=qrcode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qrcode.js","sourceRoot":"","sources":["../src/qrcode.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,QAAiB,EAAQ,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5C,IAAI,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/C,8DAA8D;IAC9D,gFAAgF;IAChF,MAAM,QAAQ,GAAG,GAAG,UAAU,YAAY,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whatcode-ai/whatcode",
3
3
  "description": "SDK and CLI to start opencode and optionally expose it over HTTPS via Tailscale.",
4
- "version": "1.9.0",
4
+ "version": "1.10.0",
5
5
  "keywords": [
6
6
  "opencode",
7
7
  "tailscale",
@@ -32,6 +32,10 @@
32
32
  ".": {
33
33
  "types": "./dist/index.d.ts",
34
34
  "import": "./dist/index.js"
35
+ },
36
+ "./logger": {
37
+ "types": "./dist/logger.d.ts",
38
+ "import": "./dist/logger.js"
35
39
  }
36
40
  },
37
41
  "publishConfig": {
@@ -43,6 +47,10 @@
43
47
  ".": {
44
48
  "types": "./dist/index.d.ts",
45
49
  "import": "./dist/index.js"
50
+ },
51
+ "./logger": {
52
+ "types": "./dist/logger.d.ts",
53
+ "import": "./dist/logger.js"
46
54
  }
47
55
  }
48
56
  },
@@ -62,7 +70,8 @@
62
70
  "README.md"
63
71
  ],
64
72
  "dependencies": {
65
- "@whatcode-ai/sdk": "1.9.0",
73
+ "@whatcode-ai/sdk": "1.10.0",
74
+ "qrcode-terminal": "^0.12.0",
66
75
  "update-notifier": "^7.3.1",
67
76
  "yargs": "^18.0.0"
68
77
  },
@@ -71,6 +80,7 @@
71
80
  "@goatjs/rimraf": "^2.2.0",
72
81
  "@goatjs/typescript-config": "^2.1.0",
73
82
  "@types/node": "^25.6.0",
83
+ "@types/qrcode-terminal": "^0.12.2",
74
84
  "@types/update-notifier": "^6.0.8",
75
85
  "@types/yargs": "^17.0.35",
76
86
  "eslint": "^10.2.1",