@yugenlab/vaayu 0.1.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +365 -0
  3. package/chunks/chunk-E5A3SCDJ.js +246 -0
  4. package/chunks/chunk-G5VYCA6O.js +69 -0
  5. package/chunks/chunk-H76V36OF.js +1029 -0
  6. package/chunks/chunk-HAPVUJ6A.js +238 -0
  7. package/chunks/chunk-IEKAYVA3.js +137 -0
  8. package/chunks/chunk-IGKYKEKT.js +43 -0
  9. package/chunks/chunk-IIET2K6D.js +7728 -0
  10. package/chunks/chunk-ITIVYGUG.js +347 -0
  11. package/chunks/chunk-JAWZ7ANC.js +208 -0
  12. package/chunks/chunk-JZU37VQ5.js +714 -0
  13. package/chunks/chunk-KC6NRZ7U.js +198 -0
  14. package/chunks/chunk-KDRROLVN.js +433 -0
  15. package/chunks/chunk-L7JICQBW.js +1006 -0
  16. package/chunks/chunk-MINFB5LT.js +1479 -0
  17. package/chunks/chunk-MJ74G5RB.js +5816 -0
  18. package/chunks/chunk-S4TBVCL2.js +2158 -0
  19. package/chunks/chunk-SMVJRPAH.js +2753 -0
  20. package/chunks/chunk-U6OLJ36B.js +438 -0
  21. package/chunks/chunk-URGEODS5.js +752 -0
  22. package/chunks/chunk-YSU3BWV6.js +123 -0
  23. package/chunks/consolidation-indexer-TOTTDZXW.js +21 -0
  24. package/chunks/day-consolidation-NKO63HZQ.js +24 -0
  25. package/chunks/graphrag-ZI2FSU7S.js +13 -0
  26. package/chunks/hierarchical-temporal-search-ZD46UMKR.js +8 -0
  27. package/chunks/hybrid-search-ZVLZVGFS.js +19 -0
  28. package/chunks/memory-store-KNJPMBLQ.js +17 -0
  29. package/chunks/periodic-consolidation-BPKOZDGB.js +10 -0
  30. package/chunks/postgres-3ZXBYTPC.js +8 -0
  31. package/chunks/recall-GMVHWQWW.js +20 -0
  32. package/chunks/search-7HZETVMZ.js +18 -0
  33. package/chunks/session-store-XKPGKXUS.js +44 -0
  34. package/chunks/sqlite-JPF5TICX.js +152 -0
  35. package/chunks/src-6GVZTUH6.js +12 -0
  36. package/chunks/src-QAXOD5SB.js +273 -0
  37. package/chunks/suncalc-NOHGYHDU.js +186 -0
  38. package/chunks/tree-RSHKDTCR.js +10 -0
  39. package/gateway.js +61944 -0
  40. package/package.json +51 -0
  41. package/pair-cli.js +133 -0
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@yugenlab/vaayu",
3
+ "version": "0.1.0",
4
+ "description": "AI gateway — multi-provider, multi-channel personal AI assistant with memory",
5
+ "type": "module",
6
+ "author": "Srinivas Pendela",
7
+ "license": "MIT",
8
+ "engines": {
9
+ "node": ">=22"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "bin": {
15
+ "vaayu": "./gateway.js",
16
+ "vaayu-pair": "./pair-cli.js"
17
+ },
18
+ "main": "./gateway.js",
19
+ "files": [
20
+ "*.js",
21
+ "chunks",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "dependencies": {
26
+ "better-sqlite3": "^11.5.0",
27
+ "sqlite-vec": "^0.1.7-alpha.2",
28
+ "pg": "^8.13.0"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/sriinnu/auriva.git",
33
+ "directory": "vaayu"
34
+ },
35
+ "keywords": [
36
+ "vaayu",
37
+ "ai",
38
+ "gateway",
39
+ "assistant",
40
+ "multi-provider",
41
+ "telegram",
42
+ "whatsapp",
43
+ "memory",
44
+ "mcp",
45
+ "chitragupta"
46
+ ],
47
+ "homepage": "https://github.com/sriinnu/auriva#readme",
48
+ "bugs": {
49
+ "url": "https://github.com/sriinnu/auriva/issues"
50
+ }
51
+ }
package/pair-cli.js ADDED
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ renderPairDisplay,
4
+ renderPairStatus
5
+ } from "./chunks/chunk-MJ74G5RB.js";
6
+ import "./chunks/chunk-IGKYKEKT.js";
7
+
8
+ // apps/gateway/dist/pair-cli.js
9
+ var DEFAULT_BASE = process.env.VAAYU_GATEWAY_URL ?? "http://localhost:18369";
10
+ var POLL_INTERVAL_MS = 2e3;
11
+ var VALID_CHANNELS = /* @__PURE__ */ new Set([
12
+ "telegram",
13
+ "whatsapp",
14
+ "discord",
15
+ "slack",
16
+ "signal",
17
+ "imessage",
18
+ "hub"
19
+ ]);
20
+ async function main() {
21
+ const args = process.argv.slice(2);
22
+ const subcommand = args[0]?.toLowerCase();
23
+ if (!subcommand || subcommand === "help" || subcommand === "--help") {
24
+ printHelp();
25
+ return;
26
+ }
27
+ if (subcommand === "list") {
28
+ await listPaired();
29
+ return;
30
+ }
31
+ if (!VALID_CHANNELS.has(subcommand)) {
32
+ console.error(`Unknown channel: ${subcommand}`);
33
+ console.error(`Valid channels: ${[...VALID_CHANNELS].join(", ")}`);
34
+ process.exit(1);
35
+ }
36
+ await createPairing(subcommand);
37
+ }
38
+ async function createPairing(channel) {
39
+ const baseUrl = DEFAULT_BASE;
40
+ const createRes = await fetch(`${baseUrl}/api/bandha/${channel}`, {
41
+ method: "POST",
42
+ headers: { "content-type": "application/json" },
43
+ body: JSON.stringify({ ttlSeconds: 300 })
44
+ });
45
+ if (!createRes.ok) {
46
+ const err = await createRes.json().catch(() => ({ error: "unknown" }));
47
+ console.error(`Failed to create pairing: ${err.error ?? createRes.statusText}`);
48
+ process.exit(1);
49
+ }
50
+ const descriptor = await createRes.json();
51
+ console.clear();
52
+ console.log();
53
+ console.log(renderPairDisplay({
54
+ channel,
55
+ mantra: descriptor.mantra,
56
+ pairingUri: descriptor.pairingUri,
57
+ expiresAt: descriptor.expiresAt
58
+ }));
59
+ console.log();
60
+ const pollUrl = `${baseUrl}/api/bandha/${channel}/${descriptor.id}`;
61
+ let lastStatus = descriptor.status;
62
+ const timer = setInterval(async () => {
63
+ try {
64
+ const res = await fetch(pollUrl);
65
+ if (!res.ok) {
66
+ clearInterval(timer);
67
+ console.error("\nPairing expired or was cancelled.");
68
+ process.exit(1);
69
+ }
70
+ const updated = await res.json();
71
+ if (updated.status !== lastStatus) {
72
+ lastStatus = updated.status;
73
+ console.log(renderPairStatus(updated.status, channel));
74
+ if (updated.status === "approved") {
75
+ clearInterval(timer);
76
+ process.exit(0);
77
+ }
78
+ }
79
+ } catch {
80
+ }
81
+ }, POLL_INTERVAL_MS);
82
+ process.on("SIGINT", () => {
83
+ clearInterval(timer);
84
+ console.log("\nPairing cancelled.");
85
+ fetch(`${baseUrl}/api/bandha/${channel}/${descriptor.id}`, {
86
+ method: "DELETE"
87
+ }).catch((err) => {
88
+ console.error(`Failed to cancel pairing: ${err instanceof Error ? err.message : String(err)}`);
89
+ });
90
+ process.exit(0);
91
+ });
92
+ }
93
+ async function listPaired() {
94
+ const baseUrl = DEFAULT_BASE;
95
+ const res = await fetch(`${baseUrl}/api/bandha/paired`);
96
+ if (!res.ok) {
97
+ console.error("Failed to list paired channels.");
98
+ process.exit(1);
99
+ }
100
+ const data = await res.json();
101
+ if (!data.channels.length) {
102
+ console.log("No channels paired yet.");
103
+ return;
104
+ }
105
+ console.log("\x1B[1mPaired Channels\x1B[0m\n");
106
+ for (const ch of data.channels) {
107
+ const note = ch.note ? ` (${ch.note})` : "";
108
+ const since = ch.allowedAt ? ` \u2014 since ${new Date(ch.allowedAt).toLocaleDateString()}` : "";
109
+ console.log(` \x1B[38;2;31;111;104m\u25CF\x1B[0m ${ch.channel} \u2192 ${ch.chatId}${note}${since}`);
110
+ }
111
+ console.log();
112
+ }
113
+ function printHelp() {
114
+ console.log(`
115
+ \x1B[1m\u0935\u093E\u092F\u0941 \u092C\u0928\u094D\u0927 \u2014 Vaayu Pair\x1B[0m
116
+
117
+ Usage:
118
+ vaayu pair <channel> Create a new channel pairing
119
+ vaayu pair list Show all paired channels
120
+ vaayu pair help Show this help
121
+
122
+ Channels:
123
+ telegram whatsapp discord slack signal imessage hub
124
+
125
+ Environment:
126
+ VAAYU_GATEWAY_URL Gateway base URL (default: http://localhost:18369)
127
+ `);
128
+ }
129
+ main().catch((err) => {
130
+ console.error(err);
131
+ process.exit(1);
132
+ });
133
+ //# sourceMappingURL=pair-cli.js.map