@tarout/cli 0.2.2 → 0.4.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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,55 @@
1
+ import {
2
+ getApiUrl,
3
+ getToken,
4
+ isLoggedIn
5
+ } from "../chunk-5DAFGMBH.js";
6
+
7
+ // src/mcp/stdio.ts
8
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
9
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
10
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
11
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
12
+ import {
13
+ CallToolRequestSchema,
14
+ ListToolsRequestSchema
15
+ } from "@modelcontextprotocol/sdk/types.js";
16
+ async function main() {
17
+ if (!isLoggedIn()) {
18
+ console.error(
19
+ "tarout-mcp: not authenticated. Run `tarout auth login` or set TAROUT_TOKEN."
20
+ );
21
+ process.exit(1);
22
+ }
23
+ const token = getToken();
24
+ const apiUrl = getApiUrl();
25
+ const upstream = new Client(
26
+ { name: "tarout-mcp-bridge", version: "0.1.0" },
27
+ { capabilities: {} }
28
+ );
29
+ const upstreamTransport = new StreamableHTTPClientTransport(
30
+ new URL(`${apiUrl}/api/mcp`),
31
+ {
32
+ requestInit: {
33
+ headers: token ? { "x-api-key": token } : {}
34
+ }
35
+ }
36
+ );
37
+ await upstream.connect(upstreamTransport);
38
+ const server = new Server(
39
+ { name: "tarout", version: "0.1.0" },
40
+ { capabilities: { tools: {} } }
41
+ );
42
+ server.setRequestHandler(
43
+ ListToolsRequestSchema,
44
+ async () => upstream.listTools()
45
+ );
46
+ server.setRequestHandler(
47
+ CallToolRequestSchema,
48
+ async (request) => upstream.callTool(request.params)
49
+ );
50
+ await server.connect(new StdioServerTransport());
51
+ }
52
+ main().catch((err) => {
53
+ console.error("tarout-mcp bridge failed:", err);
54
+ process.exit(1);
55
+ });
@@ -4,8 +4,8 @@ import {
4
4
  password,
5
5
  promptOrEmit,
6
6
  select
7
- } from "./chunk-CJMIX35A.js";
8
- import "./chunk-KL3JNPAY.js";
7
+ } from "./chunk-DI66W4S5.js";
8
+ import "./chunk-K7JK5HIL.js";
9
9
  export {
10
10
  confirm,
11
11
  input,
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tarout/cli",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "Tarout CLI — the Saudi cloud platform for coding agents",
5
5
  "type": "module",
6
6
  "bin": {
7
- "tarout": "./bin/tarout"
7
+ "tarout": "./bin/tarout",
8
+ "tarout-mcp": "./bin/tarout-mcp"
8
9
  },
9
10
  "main": "./dist/index.js",
10
11
  "types": "./dist/index.d.ts",
@@ -13,14 +14,15 @@
13
14
  "dist"
14
15
  ],
15
16
  "scripts": {
16
- "build": "tsup src/index.ts --format esm --dts --clean",
17
- "dev": "tsup src/index.ts --format esm --watch",
17
+ "build": "tsup src/index.ts src/mcp/stdio.ts --format esm --dts --clean",
18
+ "dev": "tsup src/index.ts src/mcp/stdio.ts --format esm --watch",
18
19
  "typecheck": "tsc --noEmit",
19
20
  "lint": "biome check src/",
20
21
  "start": "node dist/index.js",
21
22
  "prepublishOnly": "bun run build"
22
23
  },
23
24
  "dependencies": {
25
+ "@modelcontextprotocol/sdk": "^1.29.0",
24
26
  "@trpc/client": "^10.45.2",
25
27
  "@trpc/server": "^10.45.2",
26
28
  "chalk": "^5.3.0",
@@ -1,11 +0,0 @@
1
- import {
2
- pollCheckoutUntilTerminal,
3
- registerBillingCommands
4
- } from "./chunk-5XBVQICT.js";
5
- import "./chunk-7YS2WBLB.js";
6
- import "./chunk-CJMIX35A.js";
7
- import "./chunk-KL3JNPAY.js";
8
- export {
9
- pollCheckoutUntilTerminal,
10
- registerBillingCommands
11
- };