rax-flow 0.1.5 → 0.1.7

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 (223) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bin.js +27 -3
  3. package/dist/bin.js.map +1 -1
  4. package/dist/hub/__tests__/commands.test.d.ts.map +1 -0
  5. package/dist/hub/__tests__/commands.test.js +72 -0
  6. package/dist/hub/__tests__/commands.test.js.map +1 -0
  7. package/dist/hub/__tests__/history.test.d.ts.map +1 -0
  8. package/dist/hub/__tests__/history.test.js +119 -0
  9. package/dist/hub/__tests__/history.test.js.map +1 -0
  10. package/dist/hub/__tests__/parser.test.d.ts.map +1 -0
  11. package/dist/hub/__tests__/parser.test.js +92 -0
  12. package/dist/hub/__tests__/parser.test.js.map +1 -0
  13. package/dist/hub/chat/ChatApp.d.ts +2 -0
  14. package/dist/hub/chat/ChatApp.d.ts.map +1 -0
  15. package/dist/hub/chat/ChatApp.js +146 -0
  16. package/dist/hub/chat/ChatApp.js.map +1 -0
  17. package/dist/hub/chat/components/ChatInput.d.ts +9 -0
  18. package/dist/hub/chat/components/ChatInput.d.ts.map +1 -0
  19. package/dist/hub/chat/components/ChatInput.js +19 -0
  20. package/dist/hub/chat/components/ChatInput.js.map +1 -0
  21. package/dist/hub/chat/components/MessageList.d.ts +7 -0
  22. package/dist/hub/chat/components/MessageList.d.ts.map +1 -0
  23. package/dist/hub/chat/components/MessageList.js +6 -0
  24. package/dist/hub/chat/components/MessageList.js.map +1 -0
  25. package/dist/hub/chat/context.d.ts.map +1 -0
  26. package/dist/hub/chat/context.js +42 -0
  27. package/dist/hub/chat/context.js.map +1 -0
  28. package/dist/hub/chat/hooks/useChatHistory.d.ts +7 -0
  29. package/dist/hub/chat/hooks/useChatHistory.d.ts.map +1 -0
  30. package/dist/hub/chat/hooks/useChatHistory.js +31 -0
  31. package/dist/hub/chat/hooks/useChatHistory.js.map +1 -0
  32. package/dist/hub/chat/index.d.ts.map +1 -0
  33. package/dist/hub/chat/index.js +7 -0
  34. package/dist/hub/chat/index.js.map +1 -0
  35. package/dist/hub/chat/intent-parser.d.ts.map +1 -0
  36. package/dist/hub/chat/intent-parser.js +48 -0
  37. package/dist/hub/chat/intent-parser.js.map +1 -0
  38. package/dist/hub/chat/types.d.ts.map +1 -0
  39. package/dist/hub/chat/types.js +2 -0
  40. package/dist/hub/chat/types.js.map +1 -0
  41. package/dist/hub/commands/agents.d.ts.map +1 -0
  42. package/dist/hub/commands/agents.js +36 -0
  43. package/dist/hub/commands/agents.js.map +1 -0
  44. package/dist/hub/commands/index.d.ts.map +1 -0
  45. package/dist/hub/commands/index.js +120 -0
  46. package/dist/hub/commands/index.js.map +1 -0
  47. package/dist/hub/commands/logs.d.ts.map +1 -0
  48. package/dist/hub/commands/logs.js +53 -0
  49. package/dist/hub/commands/logs.js.map +1 -0
  50. package/dist/hub/commands/memory.d.ts.map +1 -0
  51. package/dist/hub/commands/memory.js +40 -0
  52. package/dist/hub/commands/memory.js.map +1 -0
  53. package/dist/hub/commands/metrics.d.ts.map +1 -0
  54. package/dist/hub/commands/metrics.js +35 -0
  55. package/dist/hub/commands/metrics.js.map +1 -0
  56. package/dist/hub/commands/providers.d.ts.map +1 -0
  57. package/dist/hub/commands/providers.js +26 -0
  58. package/dist/hub/commands/providers.js.map +1 -0
  59. package/dist/hub/commands/run.d.ts.map +1 -0
  60. package/dist/hub/commands/run.js +31 -0
  61. package/dist/hub/commands/run.js.map +1 -0
  62. package/dist/hub/commands/status.d.ts.map +1 -0
  63. package/dist/hub/commands/status.js +61 -0
  64. package/dist/hub/commands/status.js.map +1 -0
  65. package/dist/hub/commands/workflows.d.ts.map +1 -0
  66. package/dist/hub/commands/workflows.js +45 -0
  67. package/dist/hub/commands/workflows.js.map +1 -0
  68. package/dist/hub/config-loader.d.ts.map +1 -0
  69. package/dist/hub/config-loader.js +27 -0
  70. package/dist/hub/config-loader.js.map +1 -0
  71. package/dist/hub/event-listener.d.ts.map +1 -0
  72. package/dist/hub/event-listener.js +8 -0
  73. package/dist/hub/event-listener.js.map +1 -0
  74. package/dist/hub/history.d.ts.map +1 -0
  75. package/dist/hub/history.js +59 -0
  76. package/dist/hub/history.js.map +1 -0
  77. package/dist/hub/index.d.ts.map +1 -0
  78. package/dist/hub/index.js +102 -0
  79. package/dist/hub/index.js.map +1 -0
  80. package/dist/hub/parser.d.ts.map +1 -0
  81. package/dist/hub/parser.js +98 -0
  82. package/dist/hub/parser.js.map +1 -0
  83. package/dist/hub/styles/borders.d.ts.map +1 -0
  84. package/dist/hub/styles/borders.js +64 -0
  85. package/dist/hub/styles/borders.js.map +1 -0
  86. package/dist/hub/styles/colors.d.ts.map +1 -0
  87. package/dist/hub/styles/colors.js +115 -0
  88. package/dist/hub/styles/colors.js.map +1 -0
  89. package/dist/hub/styles/typography.d.ts.map +1 -0
  90. package/dist/hub/styles/typography.js +60 -0
  91. package/dist/hub/styles/typography.js.map +1 -0
  92. package/dist/hub/tui/App.d.ts +2 -0
  93. package/dist/hub/tui/App.d.ts.map +1 -0
  94. package/dist/hub/tui/App.js +53 -0
  95. package/dist/hub/tui/App.js.map +1 -0
  96. package/dist/hub/tui/components/AgentQueue.d.ts +6 -0
  97. package/dist/hub/tui/components/AgentQueue.d.ts.map +1 -0
  98. package/dist/hub/tui/components/AgentQueue.js +20 -0
  99. package/dist/hub/tui/components/AgentQueue.js.map +1 -0
  100. package/dist/hub/tui/components/DAGPanel.d.ts +16 -0
  101. package/dist/hub/tui/components/DAGPanel.d.ts.map +1 -0
  102. package/dist/hub/tui/components/DAGPanel.js +51 -0
  103. package/dist/hub/tui/components/DAGPanel.js.map +1 -0
  104. package/dist/hub/tui/components/Header.d.ts +7 -0
  105. package/dist/hub/tui/components/Header.d.ts.map +1 -0
  106. package/dist/hub/tui/components/Header.js +17 -0
  107. package/dist/hub/tui/components/Header.js.map +1 -0
  108. package/dist/hub/tui/components/LogsPanel.d.ts +6 -0
  109. package/dist/hub/tui/components/LogsPanel.d.ts.map +1 -0
  110. package/dist/hub/tui/components/LogsPanel.js +26 -0
  111. package/dist/hub/tui/components/LogsPanel.js.map +1 -0
  112. package/dist/hub/tui/components/StatusBar.d.ts +8 -0
  113. package/dist/hub/tui/components/StatusBar.d.ts.map +1 -0
  114. package/dist/hub/tui/components/StatusBar.js +7 -0
  115. package/dist/hub/tui/components/StatusBar.js.map +1 -0
  116. package/dist/hub/tui/hooks/useEvents.d.ts +2 -0
  117. package/dist/hub/tui/hooks/useEvents.d.ts.map +1 -0
  118. package/dist/hub/tui/hooks/useEvents.js +13 -0
  119. package/dist/hub/tui/hooks/useEvents.js.map +1 -0
  120. package/dist/hub/tui/index.d.ts.map +1 -0
  121. package/dist/hub/tui/index.js +7 -0
  122. package/dist/hub/tui/index.js.map +1 -0
  123. package/dist/hub/tui/types.d.ts.map +1 -0
  124. package/dist/hub/tui/types.js +2 -0
  125. package/dist/hub/tui/types.js.map +1 -0
  126. package/dist/hub/types.d.ts.map +1 -0
  127. package/dist/hub/types.js +2 -0
  128. package/dist/hub/types.js.map +1 -0
  129. package/dist/tui/App.d.ts +2 -0
  130. package/dist/tui/App.d.ts.map +1 -0
  131. package/dist/tui/App.js +31 -0
  132. package/dist/tui/App.js.map +1 -0
  133. package/dist/tui/components/ChatPanel.d.ts +14 -0
  134. package/dist/tui/components/ChatPanel.d.ts.map +1 -0
  135. package/dist/tui/components/ChatPanel.js +30 -0
  136. package/dist/tui/components/ChatPanel.js.map +1 -0
  137. package/dist/tui/components/Header.d.ts +9 -0
  138. package/dist/tui/components/Header.d.ts.map +1 -0
  139. package/dist/tui/components/Header.js +17 -0
  140. package/dist/tui/components/Header.js.map +1 -0
  141. package/dist/tui/components/InputBar.d.ts +8 -0
  142. package/dist/tui/components/InputBar.d.ts.map +1 -0
  143. package/dist/tui/components/InputBar.js +16 -0
  144. package/dist/tui/components/InputBar.js.map +1 -0
  145. package/dist/tui/components/StatusPanel.d.ts +20 -0
  146. package/dist/tui/components/StatusPanel.d.ts.map +1 -0
  147. package/dist/tui/components/StatusPanel.js +20 -0
  148. package/dist/tui/components/StatusPanel.js.map +1 -0
  149. package/dist/tui/hooks/useAppState.d.ts +38 -0
  150. package/dist/tui/hooks/useAppState.d.ts.map +1 -0
  151. package/dist/tui/hooks/useAppState.js +127 -0
  152. package/dist/tui/hooks/useAppState.js.map +1 -0
  153. package/dist/tui/index.d.ts +3 -0
  154. package/dist/tui/index.d.ts.map +1 -0
  155. package/dist/tui/index.js +8 -0
  156. package/dist/tui/index.js.map +1 -0
  157. package/package.json +17 -11
  158. package/src/bin.ts +29 -3
  159. package/src/hub/__tests__/commands.test.ts +84 -0
  160. package/src/hub/__tests__/history.test.ts +137 -0
  161. package/src/hub/__tests__/parser.test.ts +105 -0
  162. package/src/hub/commands/agents.ts +53 -0
  163. package/src/hub/commands/index.ts +137 -0
  164. package/src/hub/commands/logs.ts +70 -0
  165. package/src/hub/commands/memory.ts +47 -0
  166. package/src/hub/commands/metrics.ts +49 -0
  167. package/src/hub/commands/providers.ts +39 -0
  168. package/src/hub/commands/run.ts +37 -0
  169. package/src/hub/commands/status.ts +69 -0
  170. package/src/hub/commands/workflows.ts +64 -0
  171. package/src/hub/config-loader.ts +37 -0
  172. package/src/hub/event-listener.ts +13 -0
  173. package/src/hub/history.ts +66 -0
  174. package/src/hub/index.ts +120 -0
  175. package/src/hub/parser.ts +107 -0
  176. package/src/hub/styles/borders.ts +74 -0
  177. package/src/hub/styles/colors.ts +129 -0
  178. package/src/hub/styles/typography.ts +68 -0
  179. package/src/hub/types.ts +31 -0
  180. package/src/tui/App.tsx +61 -0
  181. package/src/tui/components/ChatPanel.tsx +79 -0
  182. package/src/tui/components/Header.tsx +53 -0
  183. package/src/tui/components/InputBar.tsx +55 -0
  184. package/src/tui/components/StatusPanel.tsx +85 -0
  185. package/src/tui/hooks/useAppState.ts +168 -0
  186. package/src/tui/index.ts +9 -0
  187. package/tsconfig.json +19 -3
  188. package/tsconfig.tsbuildinfo +1 -0
  189. package/dist/benchmark.d.ts +0 -10
  190. package/dist/bin.d.ts +0 -3
  191. package/dist/bootstrap.d.ts +0 -8
  192. package/dist/bridge-adapter-templates.d.ts +0 -4
  193. package/dist/bridge-test.d.ts +0 -7
  194. package/dist/dashboard.d.ts +0 -4
  195. package/dist/doctor.d.ts +0 -6
  196. package/dist/evolve.d.ts +0 -7
  197. package/dist/host-init-templates.d.ts +0 -16
  198. package/dist/index.d.ts +0 -11
  199. package/dist/init-host.d.ts +0 -10
  200. package/dist/install.d.ts +0 -8
  201. package/dist/run.d.ts +0 -16
  202. package/dist/styles.d.ts +0 -12
  203. package/dist/vendor-manifests.d.ts +0 -22
  204. package/package/dashboard/index.html +0 -420
  205. package/package/package.json +0 -28
  206. package/package/src/benchmark.ts +0 -156
  207. package/package/src/bin.ts +0 -127
  208. package/package/src/bootstrap.ts +0 -36
  209. package/package/src/bridge-adapter-templates.ts +0 -181
  210. package/package/src/bridge-test.ts +0 -107
  211. package/package/src/dashboard.ts +0 -51
  212. package/package/src/doctor.ts +0 -92
  213. package/package/src/evolve.ts +0 -74
  214. package/package/src/host-init-templates.ts +0 -134
  215. package/package/src/index.ts +0 -10
  216. package/package/src/init-host.ts +0 -285
  217. package/package/src/install.ts +0 -118
  218. package/package/src/run.ts +0 -317
  219. package/package/src/styles.ts +0 -12
  220. package/package/src/vendor-manifests.ts +0 -113
  221. package/package/src/ws-relay.ts +0 -156
  222. package/package/tsconfig.json +0 -12
  223. package/rax-flow-0.1.1.tgz +0 -0
@@ -1,16 +0,0 @@
1
- export type HostTarget = "claude-code" | "codex" | "opencode" | "kilo" | "generic";
2
- export interface HostTemplate {
3
- id: HostTarget;
4
- title: string;
5
- envHint: string;
6
- chatHint: string;
7
- bootstrapPromptBase: string[];
8
- quickCommands: string[];
9
- autoInjectMode: "native" | "scripted" | "manual";
10
- sessionEntryExamples: string[];
11
- }
12
- export declare const HOST_TEMPLATES: Record<HostTarget, HostTemplate>;
13
- export declare function parseHostTarget(value: string | undefined): HostTarget;
14
- export declare function listHostTargets(): HostTarget[];
15
- export declare function buildBootstrapPrompt(target: HostTarget, task?: string): string;
16
- //# sourceMappingURL=host-init-templates.d.ts.map
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export * from "./install.js";
2
- export * from "./run.js";
3
- export * from "./benchmark.js";
4
- export * from "./doctor.js";
5
- export * from "./bridge-test.js";
6
- export * from "./init-host.js";
7
- export * from "./bootstrap.js";
8
- export * from "./host-init-templates.js";
9
- export * from "./bridge-adapter-templates.js";
10
- export * from "./vendor-manifests.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +0,0 @@
1
- interface InitHostOptions {
2
- cwd: string;
3
- target?: string;
4
- printOnly?: boolean;
5
- all?: boolean;
6
- task?: string;
7
- }
8
- export declare function runInitHost(options: InitHostOptions): Promise<number>;
9
- export {};
10
- //# sourceMappingURL=init-host.d.ts.map
package/dist/install.d.ts DELETED
@@ -1,8 +0,0 @@
1
- interface InstallOptions {
2
- cwd: string;
3
- openUi: boolean;
4
- autoConfirm?: boolean;
5
- }
6
- export declare function runInstall(options: InstallOptions): Promise<number>;
7
- export {};
8
- //# sourceMappingURL=install.d.ts.map
package/dist/run.d.ts DELETED
@@ -1,16 +0,0 @@
1
- interface RunOptions {
2
- cwd: string;
3
- prompt: string;
4
- workflowPath?: string;
5
- asJson?: boolean;
6
- stream?: boolean;
7
- maxParallel?: number;
8
- noCachePersist?: boolean;
9
- providerOverride?: string;
10
- bridgeCommandOverride?: string;
11
- ui?: boolean;
12
- yolo?: boolean;
13
- }
14
- export declare function runWorkflow(options: RunOptions): Promise<number>;
15
- export {};
16
- //# sourceMappingURL=run.d.ts.map
package/dist/styles.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export declare const c: {
2
- blue: (s: string) => string;
3
- green: (s: string) => string;
4
- yellow: (s: string) => string;
5
- red: (s: string) => string;
6
- magenta: (s: string) => string;
7
- cyan: (s: string) => string;
8
- white: (s: string) => string;
9
- gray: (s: string) => string;
10
- bold: (s: string) => string;
11
- };
12
- //# sourceMappingURL=styles.d.ts.map
@@ -1,22 +0,0 @@
1
- import { HostTarget } from "./host-init-templates.js";
2
- export interface HostManifestModel {
3
- version: number;
4
- target: HostTarget;
5
- title: string;
6
- autoInjectMode: "native" | "scripted" | "manual";
7
- bridgeCommand: string;
8
- quickCommands: string[];
9
- sessionEntryExamples: string[];
10
- task: string | null;
11
- files: {
12
- bootstrapPrompt: string;
13
- instructions: string;
14
- bridgeAdapter: string;
15
- bridgeRuntimeConfig: string;
16
- bridgeSmokeTest: string;
17
- vendorManifest: string;
18
- };
19
- }
20
- export declare function generateVendorManifest(target: HostTarget, baseDir: string, manifest: HostManifestModel): Record<string, unknown>;
21
- export declare function vendorManifestFilename(target: HostTarget): string;
22
- //# sourceMappingURL=vendor-manifests.d.ts.map
@@ -1,420 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>RAX | Internal Explorer</title>
8
- <script src="https://cdn.tailwindcss.com"></script>
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
10
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
- <link
12
- href="https://fonts.googleapis.com/css2?family=Geist:wght@100;400;600;900&family=Geist+Mono:wght@400;600&display=swap"
13
- rel="stylesheet">
14
- <style>
15
- :root {
16
- --vercel-bg: #000;
17
- --vercel-gray: #111;
18
- --vercel-border: #333;
19
- --vercel-text: #fff;
20
- --vercel-accent: #0070f3;
21
- }
22
-
23
- body {
24
- font-family: 'Geist', sans-serif;
25
- background-color: var(--vercel-bg);
26
- color: var(--vercel-text);
27
- -webkit-font-smoothing: antialiased;
28
- overflow-x: hidden;
29
- }
30
-
31
- .mono {
32
- font-family: 'Geist Mono', monospace;
33
- }
34
-
35
- .card {
36
- background: var(--vercel-bg);
37
- border: 1px solid var(--vercel-border);
38
- border-radius: 8px;
39
- transition: border-color 0.2s ease;
40
- }
41
-
42
- .card:hover {
43
- border-color: #666;
44
- }
45
-
46
- input[type="password"],
47
- textarea {
48
- background: #000;
49
- border: 1px solid var(--vercel-border);
50
- color: white;
51
- padding: 8px 12px;
52
- border-radius: 6px;
53
- font-size: 13px;
54
- outline: none;
55
- transition: border-color 0.2s;
56
- }
57
-
58
- input[type="password"]:focus,
59
- textarea:focus {
60
- border-color: var(--vercel-accent);
61
- }
62
-
63
- .btn-primary {
64
- background: white;
65
- color: black;
66
- font-weight: 600;
67
- padding: 6px 12px;
68
- border-radius: 6px;
69
- font-size: 13px;
70
- transition: opacity 0.2s;
71
- }
72
-
73
- .btn-primary:hover {
74
- opacity: 0.9;
75
- }
76
-
77
- .custom-scrollbar::-webkit-scrollbar {
78
- width: 4px;
79
- }
80
-
81
- .custom-scrollbar::-webkit-scrollbar-track {
82
- background: transparent;
83
- }
84
-
85
- .custom-scrollbar::-webkit-scrollbar-thumb {
86
- background: #333;
87
- border-radius: 10px;
88
- }
89
-
90
- /* Fix for stretching: explicit height constraints on chart containers */
91
- .chart-container {
92
- position: relative;
93
- height: 180px;
94
- width: 100%;
95
- }
96
- </style>
97
- </head>
98
-
99
- <body class="selection:bg-blue-500/30">
100
- <!-- Navbar -->
101
- <nav
102
- class="border-b border-zinc-800 px-8 h-14 flex items-center justify-between sticky top-0 bg-black/80 backdrop-blur-md z-50">
103
- <div class="flex items-center gap-8">
104
- <span class="font-bold tracking-tighter text-lg uppercase">RAX Authority</span>
105
- <div class="h-4 w-px bg-zinc-800 hidden md:block"></div>
106
- <div class="hidden md:flex gap-6 text-xs font-medium text-zinc-400">
107
- <a href="#" class="text-white">Home</a>
108
- <a href="#" class="hover:text-white transition-colors">Mutations</a>
109
- <a href="#" class="hover:text-white transition-colors">Security</a>
110
- </div>
111
- </div>
112
- <button onclick="syncAll()"
113
- class="bg-zinc-100 text-black font-black text-[9px] uppercase tracking-widest px-4 py-1.5 rounded hover:bg-white transition-colors">
114
- Sync Explorer Data
115
- </button>
116
- </nav>
117
-
118
- <main class="max-w-5xl mx-auto p-8 space-y-10">
119
- <!-- Project Header -->
120
- <div class="flex justify-between items-center border-b border-zinc-800 pb-6">
121
- <div class="space-y-1">
122
- <h2 class="text-xl font-bold tracking-tight">Internal Flow Insights</h2>
123
- <p class="text-zinc-500 text-[11px]">Private, local-only monitoring of your AI orchestrator's health.
124
- </p>
125
- </div>
126
- <div id="statusBadge"
127
- class="px-2 py-0.5 bg-zinc-900 border border-zinc-800 rounded text-[9px] font-bold text-zinc-500 uppercase tracking-widest">
128
- OFFLINE
129
- </div>
130
- </div>
131
-
132
- <!-- Metrics Grid (Rigid 6 columns) -->
133
- <div
134
- class="grid grid-cols-2 md:grid-cols-6 border border-zinc-800 rounded-lg divide-x divide-z divide-zinc-800 overflow-hidden bg-zinc-900/20 mb-6">
135
- <div class="p-5">
136
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Invocations</p>
137
- <span class="text-xl font-bold tracking-tighter mono" id="invocations">--</span>
138
- </div>
139
- <div class="p-5">
140
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Avg Clear</p>
141
- <span class="text-xl font-bold tracking-tighter mono text-emerald-500" id="avgScore">--</span>
142
- </div>
143
- <div class="p-5">
144
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Darwin Rate</p>
145
- <span class="text-xl font-bold tracking-tighter mono text-amber-500" id="mutationRate">--</span>
146
- </div>
147
- <div class="p-5">
148
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Active Hubs</p>
149
- <span class="text-xl font-bold tracking-tighter mono text-blue-500" id="clusters">--</span>
150
- </div>
151
- <div class="p-5">
152
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Graph Nodes</p>
153
- <span class="text-xl font-bold tracking-tighter mono text-indigo-500" id="graphNodes">--</span>
154
- </div>
155
- <div class="p-5">
156
- <p class="text-zinc-500 text-[9px] font-black uppercase tracking-widest mb-1">Graph Edges</p>
157
- <span class="text-xl font-bold tracking-tighter mono text-violet-500" id="graphEdges">--</span>
158
- </div>
159
- </div>
160
-
161
- <!-- Charts Section -->
162
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
163
- <div class="card p-5 space-y-4">
164
- <div class="flex items-center justify-between">
165
- <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-400">Logic Accuracy</h3>
166
- <div class="text-[9px] mono text-emerald-500">LIVE</div>
167
- </div>
168
- <div class="chart-container">
169
- <canvas id="accuracyChart"></canvas>
170
- </div>
171
- </div>
172
- <div class="card p-5 space-y-4">
173
- <div class="flex items-center justify-between">
174
- <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-400">Mutation Efficiency</h3>
175
- <div class="text-[9px] mono text-blue-500">AGGREGATE</div>
176
- </div>
177
- <div class="chart-container">
178
- <canvas id="efficiencyChart"></canvas>
179
- </div>
180
- </div>
181
- </div>
182
-
183
- <!-- Feeds Section -->
184
- <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
185
- <div class="space-y-4">
186
- <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-500">Global Mutation Log</h3>
187
- <div
188
- class="border border-zinc-800 rounded-lg overflow-hidden bg-black h-64 overflow-y-auto custom-scrollbar">
189
- <table class="w-full text-left border-collapse">
190
- <thead
191
- class="bg-zinc-900/50 text-[9px] font-bold text-zinc-500 uppercase tracking-tight border-b border-zinc-800 sticky top-0">
192
- <tr>
193
- <th class="px-5 py-2.5">Time</th>
194
- <th class="px-5 py-2.5">Mutation</th>
195
- <th class="px-5 py-2.5 text-right">Impact</th>
196
- </tr>
197
- </thead>
198
- <tbody id="mutationTableBody" class="divide-y divide-zinc-800 text-[11px]">
199
- <tr>
200
- <td colspan="3" class="px-5 py-4 text-center text-zinc-600 italic">No data synced.</td>
201
- </tr>
202
- </tbody>
203
- </table>
204
- </div>
205
- </div>
206
- <div class="space-y-4">
207
- <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-500">Live Semantic Links</h3>
208
- <div class="border border-zinc-800 rounded-lg overflow-hidden bg-black h-64 overflow-y-auto custom-scrollbar p-1"
209
- id="semanticFeed">
210
- <div class="px-5 py-4 text-center text-zinc-600 italic text-[11px]">No active traversal.</div>
211
- </div>
212
- </div>
213
- </div>
214
-
215
-
216
- <!-- Security Tool -->
217
- <div class="card p-6 bg-zinc-950/40 border-dashed border-zinc-700">
218
- <div class="flex flex-col md:flex-row md:items-center justify-between gap-4 mb-4">
219
- <div>
220
- <h3 class="text-xs font-bold uppercase tracking-widest text-zinc-400">HMAC Command Generator
221
- </h3>
222
- <p class="text-[10px] text-zinc-500">Generate cryptographically signed requests for any kernel
223
- payload.</p>
224
- </div>
225
- <div class="flex gap-2">
226
- <input type="password" id="hmacSecret" placeholder="Hub Admin Secret"
227
- class="bg-black border border-zinc-800 rounded px-3 py-1 text-[10px] w-48 focus:border-zinc-500 outline-none"
228
- oninput="autoSign()">
229
- </div>
230
- </div>
231
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
232
- <textarea id="payloadInput" class="h-28 w-full mono text-xs p-3" placeholder='{"action": "admin_stats"}'
233
- oninput="autoSign()"></textarea>
234
- <div class="bg-black border border-zinc-800 rounded-md p-3 text-[10px] mono text-blue-400 overflow-auto break-all h-28 custom-scrollbar font-normal"
235
- id="signedOutput">
236
- {}
237
- </div>
238
- </div>
239
- </div>
240
- </main>
241
-
242
- <script>
243
- let charts = {};
244
-
245
- function initCharts() {
246
- Chart.defaults.color = '#555';
247
- Chart.defaults.font.family = 'Geist Mono';
248
- Chart.defaults.font.size = 9;
249
-
250
- const ctx1 = document.getElementById('accuracyChart').getContext('2d');
251
- charts.accuracy = new Chart(ctx1, {
252
- type: 'line',
253
- data: {
254
- labels: ['T-6h', 'T-5h', 'T-4h', 'T-3h', 'T-2h', 'T-1h', 'Now'],
255
- datasets: [{
256
- data: [0.65, 0.68, 0.72, 0.70, 0.78, 0.82, 0.84],
257
- borderColor: '#0070f3',
258
- backgroundColor: (c) => {
259
- const gradient = c.chart.ctx.createLinearGradient(0, 0, 0, 180);
260
- gradient.addColorStop(0, 'rgba(0, 112, 243, 0.2)');
261
- gradient.addColorStop(1, 'transparent');
262
- return gradient;
263
- },
264
- fill: true,
265
- tension: 0.4,
266
- borderWidth: 2,
267
- pointRadius: 0
268
- }]
269
- },
270
- options: {
271
- responsive: true,
272
- maintainAspectRatio: false,
273
- plugins: { legend: { display: false } },
274
- scales: {
275
- y: { min: 0.5, max: 1, grid: { color: '#1a1a1a' }, border: { display: false } },
276
- x: { grid: { display: false }, border: { display: false } }
277
- }
278
- }
279
- });
280
-
281
- const ctx2 = document.getElementById('efficiencyChart').getContext('2d');
282
- charts.efficiency = new Chart(ctx2, {
283
- type: 'bar',
284
- data: {
285
- labels: ['Cons', 'Log', 'Eff', 'Ada', 'Rel'],
286
- datasets: [{
287
- data: [0.85, 0.76, 0.92, 0.81, 0.98],
288
- backgroundColor: '#333',
289
- borderRadius: 4
290
- }]
291
- },
292
- options: {
293
- responsive: true,
294
- maintainAspectRatio: false,
295
- plugins: { legend: { display: false } },
296
- scales: {
297
- y: { grid: { color: '#1a1a1a' }, border: { display: false }, ticks: { display: false } },
298
- x: { grid: { display: false }, border: { display: false } }
299
- }
300
- }
301
- });
302
- }
303
-
304
- function generateSignature(payloadStr, secret) {
305
- const timestamp = (Date.now() / 1000).toString();
306
- const message = payloadStr + "|" + timestamp;
307
- const signature = CryptoJS.HmacSHA256(message, secret).toString();
308
- return { signature, timestamp };
309
- }
310
-
311
- function autoSign() {
312
- const secret = document.getElementById('hmacSecret').value;
313
- const payloadStr = document.getElementById('payloadInput').value || '{"action": "admin_stats"}';
314
- if (!secret) return;
315
-
316
- try {
317
- const { signature, timestamp } = generateSignature(payloadStr, secret);
318
- const fullRequest = {
319
- action: "admin_stats",
320
- payload: JSON.parse(payloadStr),
321
- signature: signature,
322
- timestamp: timestamp
323
- };
324
- document.getElementById('signedOutput').innerText = JSON.stringify(fullRequest, null, 2);
325
- } catch (e) { }
326
- }
327
-
328
- function syncAll() {
329
- // Local User Dashboard is "easily accessible" - no mandatory secret for stats
330
- const statusBadge = document.getElementById('statusBadge');
331
- statusBadge.innerText = "RETRIEVING LOCAL STATS...";
332
- statusBadge.className = "px-2 py-0.5 bg-blue-500/10 border border-blue-500/20 rounded text-[9px] font-bold text-blue-500 uppercase tracking-widest animate-pulse";
333
-
334
- // Simulating a request to 'user_stats' (unsecured)
335
- setTimeout(() => {
336
- statusBadge.innerText = "USER ACCESS VERIFIED";
337
- statusBadge.className = "px-2 py-0.5 bg-emerald-500/10 border border-emerald-500/20 rounded text-[9px] font-bold text-emerald-500 uppercase tracking-widest";
338
-
339
- // MOCK RESPONSE from Kernel admin_stats
340
- const mockResponse = {
341
- aggregates: {
342
- global_success_rate: 0.864,
343
- total_mutations: 124,
344
- graph_nodes: 156,
345
- graph_edges: 432
346
- },
347
- history: [
348
- { timestamp: new Date(Date.now() - 1000 * 60 * 2).toISOString(), score: { overall: 0.88 }, mutation: { type: 'ARCHITECTURAL_INSERT', id: 'mut_x82f' } },
349
- { timestamp: new Date(Date.now() - 1000 * 60 * 12).toISOString(), score: { overall: 0.76 }, mutation: { type: 'PARAMETER_TWEAK', id: 'mut_a921' } },
350
- { timestamp: new Date(Date.now() - 1000 * 60 * 60).toISOString(), score: { overall: 0.92 }, mutation: null },
351
- { timestamp: new Date(Date.now() - 1000 * 60 * 60 * 4).toISOString(), score: { overall: 0.81 }, mutation: { type: 'UPGRADE_TO_ORACLE', id: 'mut_k912' } }
352
- ]
353
- };
354
-
355
- updateDynamicContent(mockResponse);
356
- }, 800);
357
- }
358
-
359
- function updateDynamicContent(data) {
360
- const stats = data.aggregates;
361
-
362
- // Stats
363
- document.getElementById('invocations').innerText = "1,248,092";
364
- document.getElementById('avgScore').innerText = stats.global_success_rate.toFixed(3);
365
- document.getElementById('mutationRate').innerText = "94.2%";
366
- document.getElementById('graphNodes').innerText = stats.graph_nodes;
367
- document.getElementById('graphEdges').innerText = stats.graph_edges;
368
-
369
- // Update Line Chart with new data point
370
- charts.accuracy.data.datasets[0].data.push(0.85 + (Math.random() * 0.1));
371
- charts.accuracy.data.datasets[0].data.shift();
372
- charts.accuracy.update();
373
-
374
- // Update Bar Chart
375
- charts.efficiency.data.datasets[0].data = charts.efficiency.data.datasets[0].data.map(v => v + (Math.random() - 0.5) * 0.05);
376
- charts.efficiency.update();
377
-
378
- // Table update
379
- const body = document.getElementById('mutationTableBody');
380
- const history = data.history.filter(h => h.mutation);
381
-
382
- body.innerHTML = history.map(h => `
383
- <tr class="hover:bg-zinc-900/40 transition-colors">
384
- <td class="px-5 py-3 text-zinc-500 mono">${new Date(h.timestamp).toLocaleTimeString()}</td>
385
- <td class="px-5 py-3 font-semibold">${h.mutation.id || h.mutation.type}</td>
386
- <td class="px-5 py-3 text-right text-emerald-500 font-bold mono">+4.2%</td>
387
- </tr>
388
- `).join('');
389
-
390
- // Semantic Feed update
391
- const feed = document.getElementById('semanticFeed');
392
- const links = [
393
- { from: 'auth_api', to: 'login_agent', type: 'depends_on' },
394
- { from: 'login_agent', to: 'audit_log', type: 'produced' },
395
- { from: 'audit_log', to: 'compliance_report', type: 'relates_to' },
396
- { from: 'checkout_logic', to: 'payment_agent', type: 'triggered_by' }
397
- ];
398
- feed.innerHTML = links.map(l => `
399
- <div class="flex items-center gap-2 p-2 hover:bg-zinc-900/40 rounded transition-colors border-b border-zinc-900 last:border-0 group">
400
- <div class="text-[10px] mono text-zinc-400 truncate w-24 text-right">${l.from}</div>
401
- <div class="flex-1 h-px bg-zinc-800 relative">
402
- <div class="absolute inset-0 flex items-center justify-center">
403
- <span class="bg-black px-1 text-[8px] mono text-zinc-600 group-hover:text-blue-500 transition-colors uppercase leading-none">${l.type}</span>
404
- </div>
405
- </div>
406
- <div class="text-[10px] mono text-zinc-400 truncate w-24">${l.to}</div>
407
- </div>
408
- `).join('');
409
- }
410
-
411
- function copyToClipboard() {
412
- const text = document.getElementById('signedOutput').innerText;
413
- navigator.clipboard.writeText(text).then(() => alert("Signed JSON copied to clipboard."));
414
- }
415
-
416
- window.onload = initCharts;
417
- </script>
418
- </body>
419
-
420
- </html>
@@ -1,28 +0,0 @@
1
- {
2
- "name": "rax-flow",
3
- "version": "0.1.1",
4
- "type": "module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "rax-flow": "dist/bin.js"
9
- },
10
- "scripts": {
11
- "build": "tsc -p tsconfig.json",
12
- "dev": "tsx src/bin.ts",
13
- "test": "vitest run --passWithNoTests",
14
- "typecheck": "tsc -p tsconfig.json --noEmit"
15
- },
16
- "dependencies": {
17
- "rax-flow-agents": "0.1.1",
18
- "rax-flow-core": "0.1.1",
19
- "rax-flow-providers": "0.1.1",
20
- "ws": "^8.19.0"
21
- },
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "devDependencies": {
26
- "@types/ws": "^8.18.1"
27
- }
28
- }