@nordsym/apiclaw 2.1.0 → 2.2.1

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 (185) hide show
  1. package/README.md +15 -2
  2. package/dist/bin-http.js +0 -0
  3. package/dist/bin.bundled.js +79288 -0
  4. package/dist/funnel-client.d.ts +24 -0
  5. package/dist/funnel-client.d.ts.map +1 -0
  6. package/dist/funnel-client.js +131 -0
  7. package/dist/funnel-client.js.map +1 -0
  8. package/dist/funnel.test.d.ts +2 -0
  9. package/dist/funnel.test.d.ts.map +1 -0
  10. package/dist/funnel.test.js +145 -0
  11. package/dist/funnel.test.js.map +1 -0
  12. package/dist/gateway-client.d.ts.map +1 -1
  13. package/dist/gateway-client.js +24 -2
  14. package/dist/gateway-client.js.map +1 -1
  15. package/dist/index.bundled.js +61263 -0
  16. package/dist/index.js +161 -74
  17. package/dist/index.js.map +1 -1
  18. package/dist/postinstall.d.ts +0 -5
  19. package/dist/postinstall.d.ts.map +1 -1
  20. package/dist/postinstall.js +24 -3
  21. package/dist/postinstall.js.map +1 -1
  22. package/dist/registration-guard.d.ts +29 -0
  23. package/dist/registration-guard.d.ts.map +1 -0
  24. package/dist/registration-guard.js +87 -0
  25. package/dist/registration-guard.js.map +1 -0
  26. package/package.json +7 -2
  27. package/.claude/settings.local.json +0 -9
  28. package/.env.prod +0 -1
  29. package/apiclaw-README.md +0 -494
  30. package/convex/_generated/api.d.ts +0 -137
  31. package/convex/_generated/api.js +0 -23
  32. package/convex/_generated/dataModel.d.ts +0 -60
  33. package/convex/_generated/server.d.ts +0 -143
  34. package/convex/_generated/server.js +0 -93
  35. package/convex/adminActivate.ts +0 -53
  36. package/convex/adminStats.ts +0 -306
  37. package/convex/agents.ts +0 -939
  38. package/convex/analytics.ts +0 -187
  39. package/convex/apiKeys.ts +0 -220
  40. package/convex/backfillAnalytics.ts +0 -272
  41. package/convex/backfillSearchLogs.ts +0 -35
  42. package/convex/billing.ts +0 -834
  43. package/convex/capabilities.ts +0 -157
  44. package/convex/chains.ts +0 -1318
  45. package/convex/credits.ts +0 -211
  46. package/convex/crons.ts +0 -50
  47. package/convex/debugFilestackLogs.ts +0 -16
  48. package/convex/debugGetToken.ts +0 -18
  49. package/convex/directCall.ts +0 -713
  50. package/convex/earnProgress.ts +0 -753
  51. package/convex/email.ts +0 -329
  52. package/convex/feedback.ts +0 -265
  53. package/convex/http.ts +0 -3430
  54. package/convex/inbound.ts +0 -32
  55. package/convex/logs.ts +0 -701
  56. package/convex/migrateFilestack.ts +0 -81
  57. package/convex/migratePartnersProd.ts +0 -174
  58. package/convex/migratePratham.ts +0 -126
  59. package/convex/migrateProviderWorkspaces.ts +0 -175
  60. package/convex/mou.ts +0 -91
  61. package/convex/providerKeys.ts +0 -289
  62. package/convex/providers.ts +0 -1135
  63. package/convex/purchases.ts +0 -183
  64. package/convex/ratelimit.ts +0 -104
  65. package/convex/schema.ts +0 -869
  66. package/convex/searchLogs.ts +0 -265
  67. package/convex/seedAPILayerAPIs.ts +0 -191
  68. package/convex/seedDirectCallConfigs.ts +0 -336
  69. package/convex/seedPratham.ts +0 -149
  70. package/convex/spendAlerts.ts +0 -442
  71. package/convex/stripeActions.ts +0 -607
  72. package/convex/teams.ts +0 -243
  73. package/convex/telemetry.ts +0 -81
  74. package/convex/tsconfig.json +0 -25
  75. package/convex/updateAPIStatus.ts +0 -44
  76. package/convex/usage.ts +0 -260
  77. package/convex/usageReports.ts +0 -357
  78. package/convex/waitlist.ts +0 -55
  79. package/convex/webhooks.ts +0 -494
  80. package/convex/workspaceSettings.ts +0 -143
  81. package/convex/workspaces.ts +0 -1331
  82. package/convex.json +0 -3
  83. package/direct-test.mjs +0 -51
  84. package/email-templates/filestack-provider-outreach.html +0 -162
  85. package/email-templates/partnership-template.html +0 -116
  86. package/email-templates/pratham-draft-preview.txt +0 -57
  87. package/email-templates/pratham-partnership-draft.html +0 -141
  88. package/reports/APIClaw-Session-Report-2026-04-05.pdf +0 -0
  89. package/reports/pipeline/PIPELINE-REPORT.json +0 -153
  90. package/reports/pipeline/acquire_apisguru.json +0 -17
  91. package/reports/pipeline/capabilities.json +0 -38
  92. package/reports/pipeline/discover_azure_recursive.json +0 -1551
  93. package/reports/pipeline/discover_github.json +0 -25
  94. package/reports/pipeline/discover_github_repos.json +0 -49
  95. package/reports/pipeline/discover_swaggerhub.json +0 -24
  96. package/reports/pipeline/discover_well_known.json +0 -23
  97. package/reports/pipeline/fetch_specs.json +0 -19
  98. package/reports/pipeline/generate_providers.json +0 -14
  99. package/reports/pipeline/match_registry.json +0 -11
  100. package/reports/pipeline/parse_specs.json +0 -17
  101. package/reports/pipeline/promote_candidates.json +0 -34
  102. package/reports/pipeline/validate.json +0 -30
  103. package/reports/pipeline/validate_smoke_details.json +0 -3835
  104. package/reports/session-report-2026-04-05.html +0 -433
  105. package/seed-apis-direct.mjs +0 -106
  106. package/src/access-control.ts +0 -174
  107. package/src/adapters/base.ts +0 -364
  108. package/src/adapters/claude-desktop.ts +0 -41
  109. package/src/adapters/cline.ts +0 -88
  110. package/src/adapters/continue.ts +0 -91
  111. package/src/adapters/cursor.ts +0 -43
  112. package/src/adapters/custom.ts +0 -188
  113. package/src/adapters/detect.ts +0 -202
  114. package/src/adapters/index.ts +0 -47
  115. package/src/adapters/windsurf.ts +0 -44
  116. package/src/bin-http.ts +0 -45
  117. package/src/bin.ts +0 -34
  118. package/src/capability-router.ts +0 -331
  119. package/src/chainExecutor.ts +0 -730
  120. package/src/chainResolver.test.ts +0 -246
  121. package/src/chainResolver.ts +0 -658
  122. package/src/cli/commands/demo.ts +0 -109
  123. package/src/cli/commands/doctor.ts +0 -435
  124. package/src/cli/commands/index.ts +0 -9
  125. package/src/cli/commands/login.ts +0 -203
  126. package/src/cli/commands/mcp-install.ts +0 -373
  127. package/src/cli/commands/restore.ts +0 -333
  128. package/src/cli/commands/setup.ts +0 -297
  129. package/src/cli/commands/uninstall.ts +0 -240
  130. package/src/cli/index.ts +0 -148
  131. package/src/cli.ts +0 -370
  132. package/src/confirmation.ts +0 -296
  133. package/src/credentials.ts +0 -455
  134. package/src/credits.ts +0 -329
  135. package/src/crypto.ts +0 -75
  136. package/src/discovery.ts +0 -568
  137. package/src/enterprise/env.ts +0 -156
  138. package/src/enterprise/index.ts +0 -7
  139. package/src/enterprise/script-generator.ts +0 -481
  140. package/src/execute-dynamic.ts +0 -617
  141. package/src/execute.ts +0 -2386
  142. package/src/gateway-client.ts +0 -192
  143. package/src/hivr-whitelist.ts +0 -110
  144. package/src/http-api.ts +0 -286
  145. package/src/http-server-minimal.ts +0 -154
  146. package/src/index.ts +0 -2611
  147. package/src/intelligent-gateway.ts +0 -339
  148. package/src/mcp-analytics.ts +0 -156
  149. package/src/metered.ts +0 -149
  150. package/src/open-apis-generated.ts +0 -157
  151. package/src/open-apis.ts +0 -558
  152. package/src/postinstall.ts +0 -18
  153. package/src/product-whitelist.ts +0 -246
  154. package/src/proxy.ts +0 -36
  155. package/src/session.ts +0 -129
  156. package/src/stripe.ts +0 -497
  157. package/src/telemetry.ts +0 -71
  158. package/src/test.ts +0 -135
  159. package/src/types/convex-api.d.ts +0 -20
  160. package/src/types/convex-api.ts +0 -21
  161. package/src/types.ts +0 -109
  162. package/src/ui/colors.ts +0 -219
  163. package/src/ui/errors.ts +0 -394
  164. package/src/ui/index.ts +0 -17
  165. package/src/ui/prompts.ts +0 -390
  166. package/src/ui/spinner.ts +0 -325
  167. package/src/utils/backup.ts +0 -224
  168. package/src/utils/config.ts +0 -318
  169. package/src/utils/os.ts +0 -124
  170. package/src/utils/paths.ts +0 -203
  171. package/src/webhook.ts +0 -107
  172. package/test-10-working.cjs +0 -97
  173. package/test-14-final.cjs +0 -96
  174. package/test-actual-handlers.ts +0 -92
  175. package/test-apilayer-all-14.ts +0 -249
  176. package/test-apilayer-fixed.ts +0 -248
  177. package/test-direct-endpoints.ts +0 -174
  178. package/test-exact-endpoints.ts +0 -144
  179. package/test-final.ts +0 -83
  180. package/test-full-routing.ts +0 -100
  181. package/test-handlers-correct.ts +0 -217
  182. package/test-numverify-key.ts +0 -41
  183. package/test-via-handlers.ts +0 -92
  184. package/test-worldnews.mjs +0 -26
  185. package/tsconfig.json +0 -20
@@ -1,20 +0,0 @@
1
- /**
2
- * Type shim for Convex generated API.
3
- *
4
- * Replaces the direct import from `../convex/_generated/api.js` which
5
- * caused TypeScript to transitively process all convex/*.ts source files
6
- * under the main tsconfig (NodeNext strict), producing hundreds of
7
- * irrelevant errors. The convex/ directory has its own tsconfig
8
- * (Bundler moduleResolution) and is compiled separately via `npx convex deploy`.
9
- *
10
- * If you add new api.X.Y usages in the codebase, add the shape here.
11
- */
12
-
13
- declare const api: {
14
- analytics: {
15
- log: any;
16
- };
17
- [key: string]: any; // forward-compatible: won't break on new api.* usage
18
- };
19
-
20
- export { api };
@@ -1,21 +0,0 @@
1
- /**
2
- * Runtime shim for Convex API references.
3
- * Provides the `api` object with the correct path structure
4
- * for use with ConvexHttpClient without importing generated code.
5
- */
6
-
7
- export const api: any = new Proxy(
8
- {},
9
- {
10
- get(_, module: string) {
11
- return new Proxy(
12
- {},
13
- {
14
- get(_, fn: string) {
15
- return `${module}:${fn}`;
16
- },
17
- },
18
- );
19
- },
20
- },
21
- );
package/src/types.ts DELETED
@@ -1,109 +0,0 @@
1
- // Core types for APIvault
2
-
3
- export interface APIProvider {
4
- id: string;
5
- name: string;
6
- description: string;
7
- category: string;
8
- capabilities: string[];
9
- keywords: string[];
10
- pricing: APIPricing;
11
- auth_type: string; // api_key, basic, oauth, bearer
12
- docs_url: string;
13
- base_url: string;
14
- endpoints: APIEndpoint[];
15
- features: string[];
16
- compliance: string[];
17
- regions: string[];
18
- agent_success_rate: number;
19
- avg_latency_ms: number;
20
- }
21
-
22
- export interface APIPricing {
23
- model: string; // per_unit, per_query, per_token, per_character, subscription
24
- free_tier: boolean;
25
- minimum_purchase: number | null;
26
- [key: string]: string | number | boolean | null | undefined;
27
- }
28
-
29
- export interface APIEndpoint {
30
- name: string;
31
- method: string;
32
- path: string;
33
- params: string[];
34
- }
35
-
36
- export interface SearchResult {
37
- provider: APIProvider;
38
- relevance_score: number;
39
- match_reasons: string[];
40
- }
41
-
42
- export interface AgentCredits {
43
- agent_id: string;
44
- balance_usd: number;
45
- currency: string;
46
- created_at: string;
47
- updated_at: string;
48
- }
49
-
50
- export interface Purchase {
51
- id: string;
52
- agent_id: string;
53
- provider_id: string;
54
- amount_usd: number;
55
- credits_purchased: number;
56
- status: 'pending' | 'active' | 'exhausted' | 'refunded';
57
- credentials?: APICredentials;
58
- created_at: string;
59
- }
60
-
61
- export interface APICredentials {
62
- type: string; // api_key, basic, bearer
63
- api_key?: string;
64
- username?: string;
65
- password?: string;
66
- token?: string;
67
- expires_at?: string;
68
- }
69
-
70
- export interface UsageRecord {
71
- purchase_id: string;
72
- provider_id: string;
73
- units_used: number;
74
- units_remaining: number;
75
- cost_incurred_usd: number;
76
- last_used_at: string;
77
- }
78
-
79
- /**
80
- * Enhanced API details response
81
- * Supports both full and compact (minified) modes
82
- */
83
- export interface APIDetailsResponse {
84
- id: string;
85
- type: 'direct_call' | 'open' | 'registry';
86
-
87
- // Full mode fields
88
- name?: string;
89
- description?: string;
90
- category?: string;
91
- auth_type?: string;
92
- base_url?: string;
93
- docs_url?: string;
94
- pricing?: APIPricing | string;
95
- direct_call?: boolean;
96
- free?: boolean;
97
- note?: string;
98
-
99
- // Compact mode fields
100
- desc?: string;
101
- auth?: string;
102
- url?: string;
103
-
104
- // Actions (for direct_call and open types)
105
- actions?: Record<string, {
106
- description?: string;
107
- params: { name: string; required: boolean; desc: string }[] | string[];
108
- }>;
109
- }
package/src/ui/colors.ts DELETED
@@ -1,219 +0,0 @@
1
- /**
2
- * APIClaw MCP Auto-Setup - Color Utilities
3
- *
4
- * Chalk-based color helpers for consistent terminal output.
5
- * Supports color detection and graceful fallback.
6
- */
7
-
8
- import chalk from 'chalk';
9
-
10
- // Re-export chalk for direct access
11
- export { chalk };
12
-
13
- /**
14
- * Semantic colors for APIClaw CLI output
15
- */
16
- export const colors = {
17
- // Status colors
18
- success: chalk.green,
19
- error: chalk.red,
20
- warning: chalk.yellow,
21
- info: chalk.blue,
22
-
23
- // Emphasis
24
- primary: chalk.cyan,
25
- secondary: chalk.gray,
26
- muted: chalk.dim,
27
- highlight: chalk.bold,
28
-
29
- // Branded
30
- brand: chalk.hex('#6366F1'), // APIClaw purple
31
-
32
- // Semantic actions
33
- action: chalk.cyan.bold,
34
- code: chalk.gray.italic,
35
- path: chalk.underline,
36
- link: chalk.blue.underline,
37
-
38
- // Labels
39
- label: chalk.white.bold,
40
- value: chalk.white,
41
- } as const;
42
-
43
- /**
44
- * Icons for visual feedback
45
- */
46
- export const icons = {
47
- // Status icons
48
- success: chalk.green('✓'),
49
- error: chalk.red('✗'),
50
- warning: chalk.yellow('⚠'),
51
- info: chalk.blue('ℹ'),
52
-
53
- // Progress icons
54
- pending: chalk.gray('○'),
55
- active: chalk.cyan('●'),
56
-
57
- // Actions
58
- arrow: chalk.cyan('→'),
59
- bullet: chalk.gray('•'),
60
- plus: chalk.green('+'),
61
- minus: chalk.red('-'),
62
-
63
- // Objects
64
- folder: '📁',
65
- file: '📄',
66
- config: '⚙️',
67
- search: '🔍',
68
- rocket: '🚀',
69
- shield: '🛡️',
70
- key: '🔑',
71
- check: '✅',
72
- cross: '❌',
73
- wrench: '🔧',
74
- package: '📦',
75
- } as const;
76
-
77
- /**
78
- * Format a header with brand styling
79
- */
80
- export function header(text: string): string {
81
- return chalk.bold.cyan(`\n${text}\n${'═'.repeat(text.length)}\n`);
82
- }
83
-
84
- /**
85
- * Format a section title
86
- */
87
- export function section(text: string): string {
88
- return chalk.bold.white(`\n${text}\n${'-'.repeat(text.length)}`);
89
- }
90
-
91
- /**
92
- * Format a key-value pair for display
93
- */
94
- export function keyValue(key: string, value: string, indent = 0): string {
95
- const padding = ' '.repeat(indent);
96
- return `${padding}${colors.label(key)}: ${colors.value(value)}`;
97
- }
98
-
99
- /**
100
- * Format a status line with icon
101
- */
102
- export function status(
103
- state: 'success' | 'error' | 'warning' | 'info' | 'pending',
104
- message: string
105
- ): string {
106
- const iconMap = {
107
- success: icons.success,
108
- error: icons.error,
109
- warning: icons.warning,
110
- info: icons.info,
111
- pending: icons.pending,
112
- };
113
- return `${iconMap[state]} ${message}`;
114
- }
115
-
116
- /**
117
- * Format a diff-style addition
118
- */
119
- export function added(text: string): string {
120
- return chalk.green(`+ ${text}`);
121
- }
122
-
123
- /**
124
- * Format a diff-style removal
125
- */
126
- export function removed(text: string): string {
127
- return chalk.red(`- ${text}`);
128
- }
129
-
130
- /**
131
- * Format a code block
132
- */
133
- export function codeBlock(code: string, indent = 2): string {
134
- const padding = ' '.repeat(indent);
135
- return code
136
- .split('\n')
137
- .map(line => `${padding}${chalk.gray(line)}`)
138
- .join('\n');
139
- }
140
-
141
- /**
142
- * Format a command suggestion
143
- */
144
- export function command(cmd: string): string {
145
- return chalk.cyan.bold(` ${cmd}`);
146
- }
147
-
148
- /**
149
- * Format a help link
150
- */
151
- export function helpLink(url: string): string {
152
- return chalk.blue.underline(url);
153
- }
154
-
155
- /**
156
- * Create a boxed message
157
- */
158
- export function box(
159
- content: string,
160
- options: { title?: string; padding?: number; borderColor?: typeof chalk } = {}
161
- ): string {
162
- const { title, padding = 1, borderColor = chalk.gray } = options;
163
- const lines = content.split('\n');
164
- const maxWidth = Math.max(...lines.map(l => stripAnsi(l).length), title?.length || 0);
165
- const width = maxWidth + padding * 2;
166
-
167
- const pad = ' '.repeat(padding);
168
- const top = title
169
- ? borderColor(`┌─ ${title} ${'─'.repeat(Math.max(0, width - title.length - 4))}┐`)
170
- : borderColor(`┌${'─'.repeat(width)}┐`);
171
- const bottom = borderColor(`└${'─'.repeat(width)}┘`);
172
-
173
- const body = lines.map(line => {
174
- const stripped = stripAnsi(line);
175
- const rightPad = ' '.repeat(Math.max(0, maxWidth - stripped.length));
176
- return `${borderColor('│')}${pad}${line}${rightPad}${pad}${borderColor('│')}`;
177
- });
178
-
179
- return [top, ...body, bottom].join('\n');
180
- }
181
-
182
- /**
183
- * Strip ANSI escape codes from string (for width calculations)
184
- */
185
- function stripAnsi(str: string): string {
186
- // eslint-disable-next-line no-control-regex
187
- return str.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
188
- }
189
-
190
- /**
191
- * Format a table-like list
192
- */
193
- export function table(rows: [string, string][], indent = 0): string {
194
- const padding = ' '.repeat(indent);
195
- const maxKeyLen = Math.max(...rows.map(([k]) => stripAnsi(k).length));
196
-
197
- return rows
198
- .map(([key, value]) => {
199
- const keyPad = ' '.repeat(maxKeyLen - stripAnsi(key).length);
200
- return `${padding}${key}${keyPad} ${value}`;
201
- })
202
- .join('\n');
203
- }
204
-
205
- /**
206
- * Format a list with bullets
207
- */
208
- export function bulletList(items: string[], indent = 0): string {
209
- const padding = ' '.repeat(indent);
210
- return items.map(item => `${padding}${icons.bullet} ${item}`).join('\n');
211
- }
212
-
213
- /**
214
- * Format numbered list
215
- */
216
- export function numberedList(items: string[], indent = 0): string {
217
- const padding = ' '.repeat(indent);
218
- return items.map((item, i) => `${padding}${chalk.gray(`${i + 1}.`)} ${item}`).join('\n');
219
- }