@nordsym/apiclaw 1.2.1 → 1.2.2
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/.env.prod +1 -0
- package/convex/http.ts +32 -0
- package/data/combined-02-25.json +5602 -0
- package/data/night-batch-02-25.json +2732 -0
- package/data/night-expansion-02-25.json +2872 -0
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +15 -0
- package/dist/credentials.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +76 -0
- package/dist/execute.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +1 -1
- package/dist/proxy.js.map +1 -1
- package/dist/registry/apis.json +44476 -174
- package/landing/src/app/api/auth/magic-link/route.ts +8 -1
- package/landing/src/app/api/auth/verify/route.ts +7 -4
- package/landing/src/app/docs/page.tsx +20 -20
- package/landing/src/app/earn/page.tsx +8 -8
- package/landing/src/app/page.tsx +147 -15
- package/landing/src/app/providers/page.tsx +6 -5
- package/landing/src/app/providers/register/page.tsx +1 -1
- package/landing/src/lib/convex-client.ts +6 -2
- package/landing/src/lib/stats.json +1 -1
- package/package.json +2 -1
- package/scripts/merge-to-registry.py +77 -0
- package/scripts/night-batch-02-24.py +391 -0
- package/scripts/night-batch-02-25.py +479 -0
- package/scripts/night-batch-03-24-b2.py +387 -0
- package/scripts/night-batch-03-24-b3.py +284 -0
- package/scripts/night-batch-03-24.py +447 -0
- package/scripts/night-batch-06-24-b2.py +695 -0
- package/scripts/night-batch-06-24-b3.py +696 -0
- package/scripts/night-batch-06-24.py +825 -0
- package/scripts/night-expansion-02-24-02.py +708 -0
- package/scripts/night-expansion-02-25.py +668 -0
- package/src/credentials.ts +16 -0
- package/src/execute.ts +86 -0
- package/src/index.ts +2 -0
- package/src/proxy.ts +1 -1
- package/src/registry/apis.json +44476 -174
package/src/credentials.ts
CHANGED
|
@@ -155,6 +155,18 @@ const providers: Record<string, ProviderCredential> = {
|
|
|
155
155
|
return null;
|
|
156
156
|
},
|
|
157
157
|
},
|
|
158
|
+
|
|
159
|
+
e2b: {
|
|
160
|
+
type: 'api_key',
|
|
161
|
+
get(): APICredentials | null {
|
|
162
|
+
const env = loadEnvFile('e2b.env');
|
|
163
|
+
const key = env.E2B_API_KEY || process.env.E2B_API_KEY;
|
|
164
|
+
if (key) {
|
|
165
|
+
return { type: 'api_key', api_key: key };
|
|
166
|
+
}
|
|
167
|
+
return null;
|
|
168
|
+
},
|
|
169
|
+
},
|
|
158
170
|
};
|
|
159
171
|
|
|
160
172
|
/**
|
|
@@ -199,6 +211,10 @@ export function hasRealCredentials(providerId: string): boolean {
|
|
|
199
211
|
const env = loadEnvFile('replicate.env');
|
|
200
212
|
return !!(env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_TOKEN);
|
|
201
213
|
}
|
|
214
|
+
if (providerId === 'e2b') {
|
|
215
|
+
const env = loadEnvFile('e2b.env');
|
|
216
|
+
return !!(env.E2B_API_KEY || process.env.E2B_API_KEY);
|
|
217
|
+
}
|
|
202
218
|
return false;
|
|
203
219
|
}
|
|
204
220
|
|
package/src/execute.ts
CHANGED
|
@@ -646,6 +646,92 @@ const handlers: Record<string, Record<string, (params: any, creds: any) => Promi
|
|
|
646
646
|
};
|
|
647
647
|
},
|
|
648
648
|
},
|
|
649
|
+
|
|
650
|
+
// E2B - Code Sandbox for AI Agents
|
|
651
|
+
// Uses @e2b/code-interpreter SDK
|
|
652
|
+
e2b: {
|
|
653
|
+
run_code: async (params, creds) => {
|
|
654
|
+
const { code, language = 'python' } = params;
|
|
655
|
+
|
|
656
|
+
if (!code) {
|
|
657
|
+
return { success: false, provider: 'e2b', action: 'run_code', error: 'Missing required param: code' };
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
try {
|
|
661
|
+
// Dynamic import to avoid issues if SDK not installed
|
|
662
|
+
const { Sandbox } = await import('@e2b/code-interpreter');
|
|
663
|
+
|
|
664
|
+
// Set API key via env (SDK reads from E2B_API_KEY)
|
|
665
|
+
process.env.E2B_API_KEY = creds.api_key;
|
|
666
|
+
|
|
667
|
+
const sandbox = await Sandbox.create();
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
const execution = await sandbox.runCode(code);
|
|
671
|
+
|
|
672
|
+
return {
|
|
673
|
+
success: true,
|
|
674
|
+
provider: 'e2b',
|
|
675
|
+
action: 'run_code',
|
|
676
|
+
data: {
|
|
677
|
+
text: execution.text,
|
|
678
|
+
logs: execution.logs,
|
|
679
|
+
results: execution.results,
|
|
680
|
+
},
|
|
681
|
+
};
|
|
682
|
+
} finally {
|
|
683
|
+
await sandbox.kill().catch(() => {});
|
|
684
|
+
}
|
|
685
|
+
} catch (error: any) {
|
|
686
|
+
return {
|
|
687
|
+
success: false,
|
|
688
|
+
provider: 'e2b',
|
|
689
|
+
action: 'run_code',
|
|
690
|
+
error: error.message || 'Code execution failed'
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
|
|
695
|
+
run_shell: async (params, creds) => {
|
|
696
|
+
const { command } = params;
|
|
697
|
+
|
|
698
|
+
if (!command) {
|
|
699
|
+
return { success: false, provider: 'e2b', action: 'run_shell', error: 'Missing required param: command' };
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
try {
|
|
703
|
+
const { Sandbox } = await import('@e2b/code-interpreter');
|
|
704
|
+
|
|
705
|
+
process.env.E2B_API_KEY = creds.api_key;
|
|
706
|
+
|
|
707
|
+
const sandbox = await Sandbox.create();
|
|
708
|
+
|
|
709
|
+
try {
|
|
710
|
+
const result = await sandbox.commands.run(command);
|
|
711
|
+
|
|
712
|
+
return {
|
|
713
|
+
success: true,
|
|
714
|
+
provider: 'e2b',
|
|
715
|
+
action: 'run_shell',
|
|
716
|
+
data: {
|
|
717
|
+
stdout: result.stdout,
|
|
718
|
+
stderr: result.stderr,
|
|
719
|
+
exitCode: result.exitCode,
|
|
720
|
+
},
|
|
721
|
+
};
|
|
722
|
+
} finally {
|
|
723
|
+
await sandbox.kill().catch(() => {});
|
|
724
|
+
}
|
|
725
|
+
} catch (error: any) {
|
|
726
|
+
return {
|
|
727
|
+
success: false,
|
|
728
|
+
provider: 'e2b',
|
|
729
|
+
action: 'run_shell',
|
|
730
|
+
error: error.message || 'Shell execution failed'
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
},
|
|
649
735
|
};
|
|
650
736
|
|
|
651
737
|
// Get available actions for a provider
|
package/src/index.ts
CHANGED
|
@@ -230,6 +230,8 @@ Available direct-call providers:
|
|
|
230
230
|
• elevenlabs — Text-to-speech
|
|
231
231
|
• replicate — AI models (images, video, audio)
|
|
232
232
|
• firecrawl — Web scraping & crawling
|
|
233
|
+
• github — Code repos & developer data
|
|
234
|
+
• e2b — Code sandbox for AI agents
|
|
233
235
|
|
|
234
236
|
BROWSE:
|
|
235
237
|
list_categories()
|
package/src/proxy.ts
CHANGED
|
@@ -21,4 +21,4 @@ export async function callProxy(provider: string, params: any): Promise<any> {
|
|
|
21
21
|
return response.json();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const PROXY_PROVIDERS = ["openrouter", "brave_search", "resend", "elevenlabs", "46elks", "twilio", "replicate", "firecrawl"];
|
|
24
|
+
export const PROXY_PROVIDERS = ["openrouter", "brave_search", "resend", "elevenlabs", "46elks", "twilio", "replicate", "firecrawl", "e2b"];
|