@hasna/machines 0.0.14 → 0.0.15

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,55 @@
1
+ import type { MachinePlatform } from "./types.js";
2
+ export interface TopologyCommandResult {
3
+ stdout: string;
4
+ stderr: string;
5
+ exitCode: number;
6
+ }
7
+ export type TopologyCommandRunner = (command: string) => TopologyCommandResult;
8
+ export interface MachineTopologyOptions {
9
+ includeTailscale?: boolean;
10
+ runner?: TopologyCommandRunner;
11
+ now?: Date;
12
+ }
13
+ export interface MachineRouteHint {
14
+ kind: "local" | "lan" | "tailscale" | "ssh";
15
+ target: string;
16
+ reachable: boolean | null;
17
+ }
18
+ export interface MachineTopologyEntry {
19
+ machine_id: string;
20
+ hostname: string | null;
21
+ platform: MachinePlatform | string | null;
22
+ os: string | null;
23
+ user: string | null;
24
+ workspace_path: string | null;
25
+ manifest_declared: boolean;
26
+ heartbeat_status: "online" | "offline" | "unknown";
27
+ last_heartbeat_at: string | null;
28
+ tailscale: {
29
+ dns_name: string | null;
30
+ ips: string[];
31
+ online: boolean | null;
32
+ active: boolean | null;
33
+ last_seen: string | null;
34
+ };
35
+ ssh: {
36
+ address: string | null;
37
+ route: "local" | "lan" | "tailscale" | "unknown";
38
+ command_target: string | null;
39
+ };
40
+ route_hints: MachineRouteHint[];
41
+ tags: string[];
42
+ metadata: Record<string, unknown>;
43
+ }
44
+ export interface MachineTopology {
45
+ generated_at: string;
46
+ local_machine_id: string;
47
+ local_hostname: string;
48
+ current_platform: MachinePlatform | string;
49
+ manifest_path_known: boolean;
50
+ machines: MachineTopologyEntry[];
51
+ warnings: string[];
52
+ }
53
+ export declare function discoverMachineTopology(options?: MachineTopologyOptions): MachineTopology;
54
+ export declare function getLocalMachineTopology(options?: MachineTopologyOptions): MachineTopologyEntry;
55
+ //# sourceMappingURL=topology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topology.d.ts","sourceRoot":"","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,IAAI,CAAC;KAC1B,CAAC;IACF,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;QACjD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B,CAAC;IACF,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC3C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAyKD,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAmC7F;AAED,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,sBAA2B,GAAG,oBAAoB,CAkBlG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/machines",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Machine fleet management CLI + MCP for developers",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -10,6 +10,10 @@
10
10
  ".": {
11
11
  "import": "./dist/index.js",
12
12
  "types": "./dist/index.d.ts"
13
+ },
14
+ "./storage": {
15
+ "import": "./dist/storage.js",
16
+ "types": "./dist/storage.d.ts"
13
17
  }
14
18
  },
15
19
  "bin": {
@@ -22,7 +26,7 @@
22
26
  "README.md"
23
27
  ],
24
28
  "scripts": {
25
- "build": "bun build src/cli/index.ts --outdir dist/cli --target bun && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk && bun build src/agent/index.ts --outdir dist/agent --target bun && bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --outDir dist",
29
+ "build": "rm -rf dist && bun build src/cli/index.ts --outdir dist/cli --target bun --external pg && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk --external pg && bun build src/agent/index.ts --outdir dist/agent --target bun && bun build src/index.ts src/storage.ts --outdir dist --target bun --external pg && tsc --emitDeclarationOnly --outDir dist",
26
30
  "typecheck": "tsc --noEmit",
27
31
  "test": "bun test",
28
32
  "dev": "bun run src/cli/index.ts",
@@ -59,11 +63,13 @@
59
63
  "@modelcontextprotocol/sdk": "^1.26.0",
60
64
  "chalk": "^5.6.2",
61
65
  "commander": "^13.1.0",
66
+ "pg": "^8.16.3",
62
67
  "zod": "^3.24.2"
63
68
  },
64
69
  "devDependencies": {
65
70
  "@types/bun": "latest",
66
71
  "@types/node": "^20.14.0",
72
+ "@types/pg": "^8.15.6",
67
73
  "typescript": "^5.7.3"
68
74
  }
69
75
  }