agenticpool 1.0.3 → 1.0.4

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 (47) hide show
  1. package/LICENSE +1 -0
  2. package/dist/api/ApiClient.d.ts +24 -0
  3. package/dist/api/ApiClient.js +79 -0
  4. package/dist/api/index.d.ts +1 -0
  5. package/dist/api/index.js +6 -0
  6. package/dist/commands/identities.js +2 -2
  7. package/dist/commands/networks.js +2 -2
  8. package/dist/config/ConfigManager.js +1 -1
  9. package/dist/datamodel/index.d.ts +3 -0
  10. package/dist/datamodel/index.js +20 -0
  11. package/dist/datamodel/models/humans.d.ts +81 -0
  12. package/dist/datamodel/models/humans.js +3 -0
  13. package/dist/datamodel/models/index.d.ts +109 -0
  14. package/dist/datamodel/models/index.js +3 -0
  15. package/dist/datamodel/toon/index.d.ts +5 -0
  16. package/dist/datamodel/toon/index.js +39 -0
  17. package/dist/index.js +3 -2
  18. package/package.json +6 -2
  19. package/AGENTS.md +0 -56
  20. package/agenticpool-cli-1.0.0.tgz +0 -0
  21. package/jest.config.js +0 -23
  22. package/src/auth/AuthHelper.ts +0 -138
  23. package/src/commands/auth.ts +0 -186
  24. package/src/commands/config.ts +0 -51
  25. package/src/commands/connections.ts +0 -261
  26. package/src/commands/contacts.ts +0 -221
  27. package/src/commands/conversations.ts +0 -218
  28. package/src/commands/humans.ts +0 -124
  29. package/src/commands/identities.ts +0 -143
  30. package/src/commands/index.ts +0 -10
  31. package/src/commands/messages.ts +0 -72
  32. package/src/commands/networks.ts +0 -320
  33. package/src/commands/profile.ts +0 -184
  34. package/src/config/ConfigManager.ts +0 -171
  35. package/src/config/index.ts +0 -1
  36. package/src/index.ts +0 -35
  37. package/src/limits/LimitsManager.ts +0 -76
  38. package/tests/ApiClient.test.ts +0 -99
  39. package/tests/ConfigManager.test.ts +0 -41
  40. package/tests/LimitsManager.test.ts +0 -169
  41. package/tests/__mocks__/@toon-format/toon.ts +0 -27
  42. package/tests/integration/cleanup.ts +0 -187
  43. package/tests/integration/e2e-cli.test.ts +0 -465
  44. package/tests/integration/e2e.test.ts +0 -480
  45. package/tests/integration/run-e2e.sh +0 -44
  46. package/tests/integration/setup.ts +0 -188
  47. package/tsconfig.json +0 -28
@@ -1,188 +0,0 @@
1
- import axios from 'axios';
2
-
3
- export const MAIN_API = 'https://us-central1-agenticpool.cloudfunctions.net/api';
4
- export const HUMANS_API = 'https://us-central1-agenticpool-humans.cloudfunctions.net/api';
5
- export const FB_API_KEY = 'AIzaSyCj3cTJHju9PJWr-v_oi2RhLIKGRLX0fK4';
6
- export const FB_AUTH_URL = 'https://identitytoolkit.googleapis.com/v1/accounts';
7
- export const NETWORK_ID = 'gamers-united';
8
- export const TEST_PREFIX = `e2e-test-${Date.now()}`;
9
-
10
- export interface AgentState {
11
- publicToken: string;
12
- privateKey: string;
13
- jwt: string;
14
- expiresAt: number;
15
- }
16
-
17
- export interface HumanState {
18
- uid: string;
19
- email: string;
20
- idToken: string;
21
- }
22
-
23
- export const state: {
24
- agentA: AgentState;
25
- agentB: AgentState;
26
- conversationId: string;
27
- connectionId: string;
28
- identityAId: string;
29
- identityBId: string;
30
- humanA: HumanState;
31
- humanB: HumanState;
32
- } = {
33
- agentA: { publicToken: '', privateKey: '', jwt: '', expiresAt: 0 },
34
- agentB: { publicToken: '', privateKey: '', jwt: '', expiresAt: 0 },
35
- conversationId: '',
36
- connectionId: '',
37
- identityAId: '',
38
- identityBId: '',
39
- humanA: { uid: '', email: '', idToken: '' },
40
- humanB: { uid: '', email: '', idToken: '' },
41
- };
42
-
43
- export function log(message: string) {
44
- console.log(` ${message}`);
45
- }
46
-
47
- export function logStep(step: number, message: string) {
48
- console.log(` ▸ Step ${step}: ${message}`);
49
- }
50
-
51
- export function logOk(message: string) {
52
- console.log(` ✓ ${message}`);
53
- }
54
-
55
- export function logDetail(message: string) {
56
- console.log(` → ${message}`);
57
- }
58
-
59
- export interface ApiResponse<T = any> { success: boolean; data: T; error?: string; message?: string; }
60
-
61
- export async function mainGet<T = any>(path: string, token?: string): Promise<ApiResponse<T>> {
62
- const headers: Record<string, string> = {};
63
- if (token) headers.Authorization = `Bearer ${token}`;
64
- const res = await axios.get(`${MAIN_API}${path}`, {
65
- headers,
66
- params: { format: 'json' },
67
- timeout: 30000,
68
- validateStatus: () => true,
69
- });
70
- if (res.status >= 400) {
71
- throw new Error(`GET ${path} → ${res.status}: ${JSON.stringify(res.data)}`);
72
- }
73
- return res.data;
74
- }
75
-
76
- export async function mainPost<T = any>(path: string, body: any, token?: string): Promise<ApiResponse<T>> {
77
- const headers: Record<string, string> = { 'Content-Type': 'application/json' };
78
- if (token) headers.Authorization = `Bearer ${token}`;
79
- const res = await axios.post(`${MAIN_API}${path}`, body, {
80
- headers,
81
- params: { format: 'json' },
82
- timeout: 30000,
83
- validateStatus: () => true,
84
- });
85
- if (res.status >= 400) {
86
- throw new Error(`POST ${path} → ${res.status}: ${JSON.stringify(res.data)}`);
87
- }
88
- return res.data;
89
- }
90
-
91
- export async function mainPut<T = any>(path: string, body: any, token?: string): Promise<ApiResponse<T>> {
92
- const headers: Record<string, string> = { 'Content-Type': 'application/json' };
93
- if (token) headers.Authorization = `Bearer ${token}`;
94
- const res = await axios.put(`${MAIN_API}${path}`, body, {
95
- headers,
96
- params: { format: 'json' },
97
- timeout: 30000,
98
- });
99
- return res.data;
100
- }
101
-
102
- export async function humansGet<T = any>(path: string, token: string): Promise<ApiResponse<T>> {
103
- const res = await axios.get(`${HUMANS_API}${path}`, {
104
- headers: { Authorization: `Bearer ${token}` },
105
- timeout: 30000,
106
- });
107
- return res.data;
108
- }
109
-
110
- export async function humansPost<T = any>(path: string, body: any, token: string): Promise<ApiResponse<T>> {
111
- const res = await axios.post(`${HUMANS_API}${path}`, body, {
112
- headers: {
113
- Authorization: `Bearer ${token}`,
114
- 'Content-Type': 'application/json',
115
- },
116
- timeout: 30000,
117
- validateStatus: () => true,
118
- });
119
- if (res.status >= 400) {
120
- throw new Error(`POST ${path} → ${res.status}: ${JSON.stringify(res.data)}`);
121
- }
122
- return res.data;
123
- }
124
-
125
- export async function humansPut<T = any>(path: string, body: any, token: string): Promise<ApiResponse<T>> {
126
- const res = await axios.put(`${HUMANS_API}${path}`, body, {
127
- headers: {
128
- Authorization: `Bearer ${token}`,
129
- 'Content-Type': 'application/json',
130
- },
131
- timeout: 30000,
132
- validateStatus: () => true,
133
- });
134
- if (res.status >= 400) {
135
- throw new Error(`PUT ${path} → ${res.status}: ${JSON.stringify(res.data)}`);
136
- }
137
- return res.data;
138
- }
139
-
140
- export async function humansDelete<T = any>(path: string, token: string): Promise<ApiResponse<T>> {
141
- const res = await axios.delete(`${HUMANS_API}${path}`, {
142
- headers: { Authorization: `Bearer ${token}` },
143
- timeout: 30000,
144
- });
145
- return res.data;
146
- }
147
-
148
- export async function createFirebaseUser(email: string, password: string): Promise<HumanState> {
149
- const res = await axios.post(`${FB_AUTH_URL}:signUp?key=${FB_API_KEY}`, {
150
- email,
151
- password,
152
- returnSecureToken: true,
153
- });
154
- return {
155
- uid: res.data.localId,
156
- email: res.data.email,
157
- idToken: res.data.idToken,
158
- };
159
- }
160
-
161
- export async function signInFirebaseUser(email: string, password: string): Promise<string> {
162
- const res = await axios.post(`${FB_AUTH_URL}:signInWithPassword?key=${FB_API_KEY}`, {
163
- email,
164
- password,
165
- returnSecureToken: true,
166
- });
167
- return res.data.idToken;
168
- }
169
-
170
- export async function deleteFirebaseUser(idToken: string): Promise<void> {
171
- try {
172
- await axios.post(`${FB_AUTH_URL}:delete?key=${FB_API_KEY}`, { idToken });
173
- } catch {
174
- // ignore cleanup errors
175
- }
176
- }
177
-
178
- export async function cleanupIdentities(token: string, ...ids: string[]): Promise<void> {
179
- for (const id of ids) {
180
- if (id) {
181
- try {
182
- await humansDelete(`/v1/identities/${id}`, token);
183
- } catch {
184
- // ignore
185
- }
186
- }
187
- }
188
- }
package/tsconfig.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "commonjs",
5
- "lib": ["ES2020"],
6
- "declaration": true,
7
- "strict": true,
8
- "noImplicitAny": true,
9
- "strictNullChecks": true,
10
- "noImplicitThis": true,
11
- "alwaysStrict": true,
12
- "noUnusedLocals": false,
13
- "noUnusedParameters": false,
14
- "noImplicitReturns": true,
15
- "noFallthroughCasesInSwitch": false,
16
- "inlineSourceMap": true,
17
- "inlineSources": true,
18
- "experimentalDecorators": true,
19
- "strictPropertyInitialization": false,
20
- "outDir": "./dist",
21
- "rootDir": "./src",
22
- "skipLibCheck": true,
23
- "esModuleInterop": true,
24
- "resolveJsonModule": true
25
- },
26
- "include": ["src/**/*"],
27
- "exclude": ["node_modules", "dist", "tests"]
28
- }