tru-mcp 0.14.9 → 0.14.11

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.
@@ -4,7 +4,7 @@ import { checkExistingAuth, loginViaBrowser } from "tru-cli/auth";
4
4
  export const authenticateTool = {
5
5
  name: "login",
6
6
  description: "Authenticate with tru via the browser. " +
7
- "Opens a browser window where you verify your identity, then waits until authentication is complete. " +
7
+ "Opens a browser window where the user selects their account and verifies their identity, then waits until authentication is complete. " +
8
8
  "Credentials are stored locally for future sessions. " +
9
9
  "Set switch_account to true to log out and re-authenticate as a different user. " +
10
10
  "Before calling this tool, tell the user: 'Opening your browser to verify your identity with tru — complete the login there and I\\'ll continue automatically.'",
@@ -21,15 +21,7 @@ export const authenticateTool = {
21
21
  content: [
22
22
  {
23
23
  type: "text",
24
- text: `Already authenticated as ${existing.email}.\n\n` +
25
- `Use AskUserQuestion to confirm this is the right account:\n` +
26
- ` question: "You're logged in as ${existing.email}. Is this the account you want to use?"\n` +
27
- ` options:\n` +
28
- ` - label: "Yes, continue"\n` +
29
- ` description: "Use ${existing.email}"\n` +
30
- ` - label: "Switch account"\n` +
31
- ` description: "Log in with a different email"\n` +
32
- `If they choose "Switch account", call login(switch_account: true).`,
24
+ text: `Already authenticated as ${existing.email}. Credentials are valid.`,
33
25
  },
34
26
  ],
35
27
  };
@@ -38,30 +30,11 @@ export const authenticateTool = {
38
30
  const result = await loginViaBrowser({
39
31
  switchAccount: args.switch_account,
40
32
  });
41
- // After a switch, the user already made their choice in the browser — just proceed
42
- if (args.switch_account) {
43
- return {
44
- content: [
45
- {
46
- type: "text",
47
- text: `Switched to ${result.email}. Credentials saved locally.`,
48
- },
49
- ],
50
- };
51
- }
52
33
  return {
53
34
  content: [
54
35
  {
55
36
  type: "text",
56
- text: `Authenticated successfully as ${result.email}. Credentials saved locally.\n\n` +
57
- `Use AskUserQuestion to confirm this is the right account:\n` +
58
- ` question: "You're now logged in as ${result.email}. Is this the account you want to use?"\n` +
59
- ` options:\n` +
60
- ` - label: "Yes, continue"\n` +
61
- ` description: "Use ${result.email} for this setup"\n` +
62
- ` - label: "Switch account"\n` +
63
- ` description: "Log in with a different email"\n` +
64
- `If they choose "Switch account", call login(switch_account: true).`,
37
+ text: `Authenticated as ${result.email}. Credentials saved locally.`,
65
38
  },
66
39
  ],
67
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../src/tools/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,OAAO;IACb,WAAW,EACT,yCAAyC;QACzC,sGAAsG;QACtG,sDAAsD;QACtD,iFAAiF;QACjF,gKAAgK;IAClK,WAAW,EAAE;QACX,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;KACtG;IACD,OAAO,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE;QACpD,IAAI,CAAC;YACH,6DAA6D;YAC7D,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;gBACzB,MAAM,QAAQ,GAAG,MAAM,iBAAiB,EAAE,CAAC;gBAC3C,IAAI,QAAQ,EAAE,CAAC;oBACb,OAAO;wBACL,OAAO,EAAE;4BACP;gCACE,IAAI,EAAE,MAAe;gCACrB,IAAI,EAAE,4BAA4B,QAAQ,CAAC,KAAK,OAAO;oCACrD,6DAA6D;oCAC7D,oCAAoC,QAAQ,CAAC,KAAK,2CAA2C;oCAC7F,cAAc;oCACd,gCAAgC;oCAChC,2BAA2B,QAAQ,CAAC,KAAK,KAAK;oCAC9C,iCAAiC;oCACj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,7 @@ Drive through all sections in order. Each section depends on the previous one. D
85
85
 
86
86
  ### App Profile
87
87
 
88
- **Authenticate**
89
-
90
- Run \`login()\` immediately. This opens a browser window where the developer verifies their identity with tru. Credentials are stored locally for 7 days.
91
-
92
- **Register the app**
93
-
94
- Before calling \`dev_register_app\`, explore the project's codebase to auto-fill everything:
88
+ **Explore the codebase first** (before authenticating) to auto-fill the registration:
95
89
  - \`package.json\` → name, description, homepage
96
90
  - \`README.md\`, docs folders, marketing copy → app name, description
97
91
  - Source code, route files, API handlers → understand what the app does
@@ -106,6 +100,8 @@ Before calling \`dev_register_app\`, explore the project's codebase to auto-fill
106
100
 
107
101
  Don't ask them to fill in anything you can figure out from the code — just confirm what you found.
108
102
 
103
+ **After they confirm**, authenticate with \`login()\`. This opens a browser where the developer signs in with tru. Credentials are stored locally for 7 days. Once login completes, register the app:
104
+
109
105
  \`\`\`
110
106
  dev_register_app(
111
107
  service_name: "my-app",
@@ -1 +1 @@
1
- {"version":3,"file":"get_started.js","sourceRoot":"","sources":["../../src/tools/get_started.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAExC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAE7D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,IAAI,OAAO,GAAG,OAAO,CAAC;AACtB,IAAI,CAAC;IACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA8ZG,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqLtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,wDAAwD;QACxD,sEAAsE;QACtE,2DAA2D;IAC7D,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE;QAC9C,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tru-mcp",
3
- "version": "0.14.9",
3
+ "version": "0.14.11",
4
4
  "description": "MCP server for tru — auth, billing, and risk signals in one API",
5
5
  "type": "module",
6
6
  "bin": {