mcpaas 0.1.0 → 1.0.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Wolfe James
3
+ Copyright (c) 2026 WolfeJam
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,127 +1,115 @@
1
1
  # mcpaas
2
2
 
3
- **Your AI forgets you every session. MCPaaS remembers.**
3
+ TypeScript SDK for [MCPaaS](https://mcpaas.live) Context, on-demand.
4
4
 
5
- You re-explain your stack to Claude. Switch to Gemini re-explain everything. Open Cursor again. Every session. Every tool. Every time.
6
-
7
- That's the drift tax. [$49M/day](https://fafdev.tools/value) burned industry-wide.
8
-
9
- This SDK connects you to [MCPaaS](https://mcpaas.live) — persistent AI context that follows you across tools, sessions, and teams.
5
+ Zero dependencies. Works with Bun, Node 18+, Deno, browsers, and edge runtimes.
10
6
 
11
7
  ## Install
12
8
 
13
9
  ```bash
14
10
  npm install mcpaas
11
+ # or
12
+ bun add mcpaas
15
13
  ```
16
14
 
17
15
  ## Quick Start
18
16
 
19
17
  ```typescript
20
- import { Radio } from 'mcpaas';
18
+ import { MCPaaS } from 'mcpaas';
21
19
 
22
- const radio = new Radio('wss://mcpaas.live/beacon/radio');
23
- await radio.connect();
20
+ const m = new MCPaaS();
24
21
 
25
- // Tune to your project's frequency
26
- await radio.tune('91.0');
22
+ // Read a soul
23
+ const soul = await m.getRawSoul('spacex');
24
+ console.log(soul);
27
25
 
28
- // Your context arrives — from any AI, any session
29
- radio.onBroadcast((frequency, context) => {
30
- console.log(`Context update on ${frequency} FM:`, context);
31
- });
32
- ```
26
+ // Score a namepoint
27
+ const result = await m.score('faf');
28
+ console.log(result.score, result.tierReady);
33
29
 
34
- That's it. Your context persists. Zero drift.
30
+ // Check handle availability
31
+ const check = await m.check('myhandle');
32
+ console.log(check.available);
33
+ ```
35
34
 
36
- ## How It Works
35
+ ## API
37
36
 
38
- MCPaaS uses the **Radio Protocol** — broadcast once, every AI receives.
37
+ ### Souls
39
38
 
40
- ```
41
- Traditional (the tax):
42
- You Claude (send 50KB context)
43
- You Grok (send 50KB again)
44
- You → Gemini (send 50KB again)
45
- = 3x cost, 3x latency, context drift
46
-
47
- Radio Protocol (the fix):
48
- You → Broadcast to 91.0 FM (send once)
49
- Claude ← tuned to 91.0
50
- Grok ← tuned to 91.0
51
- Gemini ← tuned to 91.0
52
- = 1x cost, instant, zero drift
39
+ ```typescript
40
+ m.getSoul('faf') // Structured soul content
41
+ m.getRawSoul('spacex') // Plain text soul
42
+ m.listSouls() // Stats: counts, top souls, operations
53
43
  ```
54
44
 
55
- ## Multi-AI Example
45
+ ### Scoring
56
46
 
57
47
  ```typescript
58
- import { Radio } from 'mcpaas';
59
-
60
- const claude = new Radio('wss://mcpaas.live/beacon/radio');
61
- const grok = new Radio('wss://mcpaas.live/beacon/radio');
62
- const gemini = new Radio('wss://mcpaas.live/beacon/radio');
48
+ m.score('faf') // Score a namepoint
49
+ m.scoreRepo('owner/repo') // Score a GitHub repo
50
+ m.leaderboard() // Top scored repos
51
+ ```
63
52
 
64
- await Promise.all([claude.connect(), grok.connect(), gemini.connect()]);
65
- await Promise.all([claude.tune('91.0'), grok.tune('91.0'), gemini.tune('91.0')]);
53
+ ### Directory & Discovery
66
54
 
67
- // All three AIs now share the same context, in real time
68
- claude.onBroadcast((f, ctx) => console.log('Claude:', ctx));
69
- grok.onBroadcast((f, ctx) => console.log('Grok:', ctx));
70
- gemini.onBroadcast((f, ctx) => console.log('Gemini:', ctx));
55
+ ```typescript
56
+ m.directory() // Full namepoint directory
57
+ m.check('handle') // Handle availability + pricing
58
+ m.count() // Claimed/remaining counts
59
+ m.discover() // Discovery feed (namepoints + souls)
71
60
  ```
72
61
 
73
- ## API
74
-
75
- ### Constructor
62
+ ### Tag Intel
76
63
 
77
64
  ```typescript
78
- const radio = new Radio(url: string, options?: {
79
- reconnect?: boolean; // Auto-reconnect (default: true)
80
- maxReconnectAttempts?: number; // Max attempts (default: 5)
81
- reconnectDelay?: number; // Delay in ms (default: 1000)
82
- heartbeatInterval?: number; // Ping interval (default: 30000)
83
- debug?: boolean; // Debug logging (default: false)
84
- });
65
+ m.tagIntel() // Tag patterns, co-occurrence, candidates, merges
66
+ m.suggestTags('handle') // Suggest tags for a namepoint
85
67
  ```
86
68
 
87
- ### Methods
69
+ ### Badges
88
70
 
89
- | Method | Description |
90
- |--------|-------------|
91
- | `connect()` | Connect to MCPaaS |
92
- | `tune(frequency)` | Subscribe to a frequency |
93
- | `untune(frequency)` | Unsubscribe from a frequency |
94
- | `disconnect()` | Disconnect |
95
- | `getState()` | `'DISCONNECTED'` \| `'CONNECTING'` \| `'CONNECTED'` \| `'RECONNECTING'` \| `'CLOSED'` |
96
- | `getTunedFrequencies()` | Set of tuned frequencies |
71
+ ```typescript
72
+ m.badge('owner', 'repo') // Returns SVG badge URL (sync)
73
+ // => https://mcpaas.live/badge/owner/repo.svg
74
+ ```
97
75
 
98
- ### Events
76
+ ### Globe
99
77
 
100
- | Event | Callback |
101
- |-------|----------|
102
- | `onBroadcast(fn)` | `(frequency, context) => void` |
103
- | `onConnect(fn)` | `() => void` |
104
- | `onDisconnect(fn)` | `(code?, reason?) => void` |
105
- | `onError(fn)` | `(error) => void` |
106
- | `onTuned(fn)` | `(frequency) => void` |
107
- | `onUntuned(fn)` | `(frequency) => void` |
78
+ ```typescript
79
+ m.globe() // Edge location stats from 300+ Cloudflare colos
80
+ ```
108
81
 
109
- ## Why Bun?
82
+ ### Platform
110
83
 
111
- Anthropic acquired Bun in December 2025. Bun now powers Claude Code. This library is built for Bun first — native TypeScript, 7x faster WebSockets, zero config.
84
+ ```typescript
85
+ m.health() // Health check
86
+ m.info() // Server info
87
+ ```
112
88
 
113
- ## Namepoints
89
+ ## Configuration
114
90
 
115
- Every frequency maps to a **namepoint** on MCPaaS — your permanent AI identity.
91
+ ```typescript
92
+ const m = new MCPaaS({
93
+ baseUrl: 'https://mcpaas.live', // default
94
+ });
95
+ ```
116
96
 
117
- Free namepoints work. But `yourname.mcpaas.live` hits different than `user-38291.mcpaas.live`.
97
+ ## Error Handling
118
98
 
119
- **Claim yours before someone else does:** [mcpaas.live/claim](https://mcpaas.live/claim)
99
+ ```typescript
100
+ import { MCPaaS, MCPaaSError } from 'mcpaas';
101
+
102
+ try {
103
+ await m.getSoul('nonexistent');
104
+ } catch (e) {
105
+ if (e instanceof MCPaaSError) {
106
+ console.log(e.status); // HTTP status code
107
+ console.log(e.body); // Response body
108
+ console.log(e.path); // Request path
109
+ }
110
+ }
111
+ ```
120
112
 
121
113
  ## License
122
114
 
123
115
  MIT
124
-
125
- ---
126
-
127
- Built by [Wolfe James](https://github.com/Wolfe-Jam) | Powered by [MCPaaS](https://mcpaas.live) | Format: [FAF](https://faf.one)
@@ -0,0 +1,191 @@
1
+ /**
2
+ * MCPaaS SDK — Context, on-demand.
3
+ * =================================
4
+ * Zero-dependency TypeScript client for the MCPaaS platform.
5
+ * Works with Bun, Node 18+, Deno, browsers, and edge runtimes.
6
+ *
7
+ * Usage:
8
+ * import { MCPaaS } from 'mcpaas';
9
+ * const m = new MCPaaS();
10
+ * const soul = await m.getRawSoul('spacex');
11
+ */
12
+ export interface MCPaaSOptions {
13
+ /** Base URL of the MCPaaS instance. Default: https://mcpaas.live */
14
+ baseUrl?: string;
15
+ }
16
+ export interface SoulStats {
17
+ date: string;
18
+ total_souls: number;
19
+ operations_today: Record<string, number>;
20
+ top_souls: Array<{
21
+ soul: string;
22
+ reads: number;
23
+ }>;
24
+ }
25
+ export interface ScoreResult {
26
+ handle: string;
27
+ score: number;
28
+ tierReady: boolean;
29
+ valid: boolean;
30
+ engine: string;
31
+ }
32
+ export interface RepoScore {
33
+ score: number;
34
+ repo: string;
35
+ hasFaf: boolean;
36
+ language: string;
37
+ stars: number;
38
+ description: string;
39
+ }
40
+ export interface LeaderboardResult {
41
+ top: Array<{
42
+ repo: string;
43
+ score: number;
44
+ language: string;
45
+ }>;
46
+ recent: Array<{
47
+ repo: string;
48
+ score: number;
49
+ language: string;
50
+ }>;
51
+ total: number;
52
+ }
53
+ export interface DirectoryEntry {
54
+ handle: string;
55
+ name: string;
56
+ tagline: string;
57
+ role: string;
58
+ avatar: number;
59
+ tags: string[];
60
+ userTags: string[];
61
+ score: number;
62
+ }
63
+ export interface DirectoryResult {
64
+ count: number;
65
+ namepoints: DirectoryEntry[];
66
+ userTagIndex: Array<{
67
+ tag: string;
68
+ count: number;
69
+ }>;
70
+ }
71
+ export interface CheckResult {
72
+ handle: string;
73
+ available: boolean;
74
+ price?: number;
75
+ tier?: string;
76
+ }
77
+ export interface CountResult {
78
+ claimed: number;
79
+ remaining: number;
80
+ tier: string;
81
+ price: string;
82
+ annual: string;
83
+ names: string[];
84
+ }
85
+ export interface DiscoverResult {
86
+ namepoints: DirectoryEntry[];
87
+ souls: string[];
88
+ totalSouls: number;
89
+ }
90
+ export interface TagProfile {
91
+ tag: string;
92
+ count: number;
93
+ cooccurs: Array<{
94
+ tag: string;
95
+ overlap: number;
96
+ }>;
97
+ }
98
+ export interface TagCandidate {
99
+ term: string;
100
+ count: number;
101
+ source: string;
102
+ }
103
+ export interface TagMerge {
104
+ canonical: string;
105
+ variants: string[];
106
+ }
107
+ export interface TagIntelResult {
108
+ tags: TagProfile[];
109
+ candidates: TagCandidate[];
110
+ merges: TagMerge[];
111
+ analysed: number;
112
+ updatedAt: string;
113
+ }
114
+ export interface SuggestResult {
115
+ handle: string;
116
+ existingTags: string[];
117
+ suggestions: string[];
118
+ }
119
+ export interface GlobeLocation {
120
+ code: string;
121
+ count: number;
122
+ lat: number;
123
+ lng: number;
124
+ city: string;
125
+ active: boolean;
126
+ }
127
+ export interface GlobeResult {
128
+ total: number;
129
+ activeLocations: number;
130
+ totalLocations: number;
131
+ locations: GlobeLocation[];
132
+ updated: string;
133
+ }
134
+ export interface HealthResult {
135
+ status: string;
136
+ engine: string;
137
+ engineStatus: string;
138
+ engineScore: number;
139
+ engineSize: string;
140
+ [key: string]: unknown;
141
+ }
142
+ export interface InfoResult {
143
+ name: string;
144
+ version: string;
145
+ [key: string]: unknown;
146
+ }
147
+ export declare class MCPaaS {
148
+ private baseUrl;
149
+ constructor(options?: MCPaaSOptions);
150
+ /** Fetch structured soul content by name */
151
+ getSoul(name: string): Promise<string>;
152
+ /** Fetch raw plain-text soul content */
153
+ getRawSoul(name: string): Promise<string>;
154
+ /** Get soul stats (counts, top souls, operations) */
155
+ listSouls(): Promise<SoulStats>;
156
+ /** Score a namepoint by handle */
157
+ score(handle: string): Promise<ScoreResult>;
158
+ /** Score a GitHub repo (owner/repo or full URL) */
159
+ scoreRepo(repo: string): Promise<RepoScore>;
160
+ /** Get the scoring leaderboard */
161
+ leaderboard(): Promise<LeaderboardResult>;
162
+ /** Get the full namepoint directory */
163
+ directory(): Promise<DirectoryResult>;
164
+ /** Check if a handle is available */
165
+ check(handle: string): Promise<CheckResult>;
166
+ /** Get namepoint counts */
167
+ count(): Promise<CountResult>;
168
+ /** Discovery feed (namepoints + souls) */
169
+ discover(): Promise<DiscoverResult>;
170
+ /** Full tag intelligence: patterns, co-occurrence, candidates, merges */
171
+ tagIntel(): Promise<TagIntelResult>;
172
+ /** Suggest tags for a namepoint based on content patterns */
173
+ suggestTags(handle: string): Promise<SuggestResult>;
174
+ /** Get the badge URL for a GitHub repo (synchronous — returns URL string) */
175
+ badge(owner: string, repo: string): string;
176
+ /** Get edge location execution stats from 300+ Cloudflare colos */
177
+ globe(): Promise<GlobeResult>;
178
+ /** Health check */
179
+ health(): Promise<HealthResult>;
180
+ /** Server info */
181
+ info(): Promise<InfoResult>;
182
+ private json;
183
+ private text;
184
+ }
185
+ export declare class MCPaaSError extends Error {
186
+ status: number;
187
+ body: string;
188
+ path: string;
189
+ constructor(status: number, body: string, path: string);
190
+ }
191
+ export default MCPaaS;