@indexnetwork/protocol 0.3.3 → 0.4.0-rc.13.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 (84) hide show
  1. package/README.md +8 -3
  2. package/dist/agent/agent.tools.d.ts +3 -0
  3. package/dist/agent/agent.tools.d.ts.map +1 -0
  4. package/dist/agent/agent.tools.js +330 -0
  5. package/dist/agent/agent.tools.js.map +1 -0
  6. package/dist/contact/contact.tools.d.ts.map +1 -1
  7. package/dist/contact/contact.tools.js +37 -22
  8. package/dist/contact/contact.tools.js.map +1 -1
  9. package/dist/index.d.ts +6 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/integration/integration.tools.d.ts.map +1 -1
  14. package/dist/integration/integration.tools.js +10 -8
  15. package/dist/integration/integration.tools.js.map +1 -1
  16. package/dist/intent/intent.tools.d.ts.map +1 -1
  17. package/dist/intent/intent.tools.js +112 -23
  18. package/dist/intent/intent.tools.js.map +1 -1
  19. package/dist/mcp/mcp.server.d.ts +1 -1
  20. package/dist/mcp/mcp.server.d.ts.map +1 -1
  21. package/dist/mcp/mcp.server.js +8 -4
  22. package/dist/mcp/mcp.server.js.map +1 -1
  23. package/dist/negotiation/negotiation.graph.d.ts +37 -1
  24. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  25. package/dist/negotiation/negotiation.graph.js +48 -6
  26. package/dist/negotiation/negotiation.graph.js.map +1 -1
  27. package/dist/negotiation/negotiation.state.d.ts +12 -0
  28. package/dist/negotiation/negotiation.state.d.ts.map +1 -1
  29. package/dist/negotiation/negotiation.state.js +16 -0
  30. package/dist/negotiation/negotiation.state.js.map +1 -1
  31. package/dist/negotiation/negotiation.tools.d.ts +7 -0
  32. package/dist/negotiation/negotiation.tools.d.ts.map +1 -0
  33. package/dist/negotiation/negotiation.tools.js +547 -0
  34. package/dist/negotiation/negotiation.tools.js.map +1 -0
  35. package/dist/network/network.tools.d.ts.map +1 -1
  36. package/dist/network/network.tools.js +65 -21
  37. package/dist/network/network.tools.js.map +1 -1
  38. package/dist/opportunity/opportunity.graph.d.ts +31 -0
  39. package/dist/opportunity/opportunity.graph.d.ts.map +1 -1
  40. package/dist/opportunity/opportunity.graph.js +49 -4
  41. package/dist/opportunity/opportunity.graph.js.map +1 -1
  42. package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
  43. package/dist/opportunity/opportunity.tools.js +62 -30
  44. package/dist/opportunity/opportunity.tools.js.map +1 -1
  45. package/dist/profile/profile.graph.d.ts +12 -12
  46. package/dist/profile/profile.graph.d.ts.map +1 -1
  47. package/dist/profile/profile.graph.js +22 -15
  48. package/dist/profile/profile.graph.js.map +1 -1
  49. package/dist/profile/profile.tools.d.ts.map +1 -1
  50. package/dist/profile/profile.tools.js +62 -19
  51. package/dist/profile/profile.tools.js.map +1 -1
  52. package/dist/shared/agent/tool.factory.d.ts.map +1 -1
  53. package/dist/shared/agent/tool.factory.js +17 -1
  54. package/dist/shared/agent/tool.factory.js.map +1 -1
  55. package/dist/shared/agent/tool.helpers.d.ts +33 -0
  56. package/dist/shared/agent/tool.helpers.d.ts.map +1 -1
  57. package/dist/shared/agent/tool.helpers.js.map +1 -1
  58. package/dist/shared/agent/tool.registry.d.ts.map +1 -1
  59. package/dist/shared/agent/tool.registry.js +6 -0
  60. package/dist/shared/agent/tool.registry.js.map +1 -1
  61. package/dist/shared/agent/utility.tools.d.ts.map +1 -1
  62. package/dist/shared/agent/utility.tools.js +215 -46
  63. package/dist/shared/agent/utility.tools.js.map +1 -1
  64. package/dist/shared/interfaces/agent.interface.d.ts +176 -0
  65. package/dist/shared/interfaces/agent.interface.d.ts.map +1 -0
  66. package/dist/shared/interfaces/agent.interface.js +15 -0
  67. package/dist/shared/interfaces/agent.interface.js.map +1 -0
  68. package/dist/shared/interfaces/auth.interface.d.ts +10 -3
  69. package/dist/shared/interfaces/auth.interface.d.ts.map +1 -1
  70. package/dist/shared/interfaces/database.interface.d.ts +52 -0
  71. package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
  72. package/dist/shared/interfaces/negotiation-events.interface.d.ts +58 -0
  73. package/dist/shared/interfaces/negotiation-events.interface.d.ts.map +1 -0
  74. package/dist/shared/interfaces/negotiation-events.interface.js +7 -0
  75. package/dist/shared/interfaces/negotiation-events.interface.js.map +1 -0
  76. package/dist/shared/interfaces/webhook.interface.d.ts +25 -0
  77. package/dist/shared/interfaces/webhook.interface.d.ts.map +1 -0
  78. package/dist/shared/interfaces/webhook.interface.js +2 -0
  79. package/dist/shared/interfaces/webhook.interface.js.map +1 -0
  80. package/dist/webhook/webhook.tools.d.ts +7 -0
  81. package/dist/webhook/webhook.tools.d.ts.map +1 -0
  82. package/dist/webhook/webhook.tools.js +127 -0
  83. package/dist/webhook/webhook.tools.js.map +1 -0
  84. package/package.json +4 -2
package/README.md CHANGED
@@ -99,13 +99,18 @@ const server = createMcpServer(
99
99
 
100
100
  ## Publishing
101
101
 
102
- Publishing is handled via CI. Tag a release to trigger the workflow:
102
+ Publishing is handled via CI:
103
103
 
104
104
  ```bash
105
- git tag protocol-vX.Y.Z
106
- git push upstream protocol-vX.Y.Z
105
+ # dev pushes publish an rc prerelease
106
+ git push <remote> dev
107
+
108
+ # main pushes publish the stable release if the package version is new
109
+ git push <remote> main
107
110
  ```
108
111
 
112
+ `dev` publishes prerelease versions derived from `package.json` using npm's `rc` tag, for example `0.4.0-rc.123.1`. `main` publishes the base version from `package.json` to `latest`.
113
+
109
114
  Or publish manually from `packages/protocol/`:
110
115
 
111
116
  ```bash
@@ -0,0 +1,3 @@
1
+ import type { DefineTool, ToolDeps } from '../shared/agent/tool.helpers.js';
2
+ export declare function createAgentTools(defineTool: DefineTool, deps: ToolDeps): never[] | readonly [any, any, any, any, any, any];
3
+ //# sourceMappingURL=agent.tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.tools.d.ts","sourceRoot":"","sources":["../../src/agent/agent.tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AA4D5E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,qDAmTtE"}
@@ -0,0 +1,330 @@
1
+ import { z } from 'zod';
2
+ import { error, success } from '../shared/agent/tool.helpers.js';
3
+ const AGENT_ACTIONS = [
4
+ 'manage:profile',
5
+ 'manage:intents',
6
+ 'manage:networks',
7
+ 'manage:contacts',
8
+ 'manage:negotiations',
9
+ ];
10
+ function invalidActionMessage(action) {
11
+ return `Invalid action: ${action}. Valid actions: ${AGENT_ACTIONS.join(', ')}`;
12
+ }
13
+ function isValidAction(action) {
14
+ return AGENT_ACTIONS.includes(action);
15
+ }
16
+ function requireAgentDatabase(deps) {
17
+ if (!deps.agentDatabase) {
18
+ return null;
19
+ }
20
+ return deps.agentDatabase;
21
+ }
22
+ function ensureAgentScopedAccess(context, requestedAgentId) {
23
+ if (context.agentId && context.agentId !== requestedAgentId) {
24
+ return 'This agent can only manage its own registration.';
25
+ }
26
+ return null;
27
+ }
28
+ function sanitizeAgentForOutput(agent) {
29
+ return {
30
+ ...agent,
31
+ transports: agent.transports?.map((transport) => ({
32
+ ...transport,
33
+ config: transport.channel === 'webhook'
34
+ ? Object.fromEntries(Object.entries(transport.config).filter(([key]) => key !== 'secret'))
35
+ : transport.config,
36
+ })),
37
+ };
38
+ }
39
+ function normalizeWebhookEvents(events) {
40
+ return [...new Set((events ?? []).map((event) => event.trim()).filter(Boolean))];
41
+ }
42
+ function sanitizeAgentName(name) {
43
+ const cleanName = name.trim();
44
+ return cleanName ? cleanName : null;
45
+ }
46
+ function normalizePermissions(permissions) {
47
+ return [...new Set((permissions ?? []).map((action) => action.trim()).filter(Boolean))];
48
+ }
49
+ export function createAgentTools(defineTool, deps) {
50
+ const agentDb = requireAgentDatabase(deps);
51
+ if (!agentDb) {
52
+ return [];
53
+ }
54
+ const registerAgent = defineTool({
55
+ name: 'register_agent',
56
+ description: 'Register a new personal agent for the current user. Optionally configure a webhook transport and initial permissions. ' +
57
+ 'Use this when connecting an external agent to Index.',
58
+ querySchema: z.object({
59
+ name: z.string().min(1).describe('Display name for the agent.'),
60
+ description: z.string().optional().describe('What the agent does.'),
61
+ webhook_url: z.string().optional().describe('Optional webhook URL for deliveries.'),
62
+ webhook_secret: z.string().optional().describe('Optional webhook secret stored in transport config.'),
63
+ webhook_events: z.array(z.string()).optional().describe('Subscribed webhook event names.'),
64
+ permissions: z.array(z.string()).optional().describe('Optional initial permission actions to grant.'),
65
+ }),
66
+ handler: async ({ context, query }) => {
67
+ if (context.agentId) {
68
+ return error('This agent can only manage its own registration.');
69
+ }
70
+ try {
71
+ const name = sanitizeAgentName(query.name);
72
+ if (!name) {
73
+ return error('Agent name is required.');
74
+ }
75
+ const permissions = normalizePermissions(query.permissions);
76
+ for (const permission of permissions) {
77
+ if (!isValidAction(permission)) {
78
+ return error(invalidActionMessage(permission));
79
+ }
80
+ }
81
+ let transportConfig;
82
+ if (query.webhook_url?.trim()) {
83
+ const webhookEvents = normalizeWebhookEvents(query.webhook_events);
84
+ if (webhookEvents.length === 0) {
85
+ return error('Webhook events are required.');
86
+ }
87
+ let parsedUrl;
88
+ try {
89
+ parsedUrl = new URL(query.webhook_url);
90
+ }
91
+ catch {
92
+ return error('Invalid webhook URL.');
93
+ }
94
+ if (parsedUrl.protocol !== 'https:' && process.env.NODE_ENV === 'production') {
95
+ return error('Webhook URL must use HTTPS in production.');
96
+ }
97
+ transportConfig = {
98
+ url: parsedUrl.toString(),
99
+ events: webhookEvents,
100
+ ...(query.webhook_secret?.trim() ? { secret: query.webhook_secret.trim() } : {}),
101
+ };
102
+ }
103
+ const agent = await agentDb.createAgent({
104
+ ownerId: context.userId,
105
+ name,
106
+ description: query.description?.trim() || undefined,
107
+ type: 'personal',
108
+ });
109
+ try {
110
+ if (transportConfig) {
111
+ await agentDb.createTransport({
112
+ agentId: agent.id,
113
+ channel: 'webhook',
114
+ config: transportConfig,
115
+ });
116
+ }
117
+ if (permissions.length > 0) {
118
+ await agentDb.grantPermission({
119
+ agentId: agent.id,
120
+ userId: context.userId,
121
+ scope: 'global',
122
+ actions: permissions,
123
+ });
124
+ }
125
+ }
126
+ catch (setupError) {
127
+ try {
128
+ await agentDb.deleteAgent(agent.id);
129
+ }
130
+ catch {
131
+ // Best-effort cleanup to avoid leaving partially registered agents behind.
132
+ }
133
+ throw setupError;
134
+ }
135
+ const fullAgent = await agentDb.getAgentWithRelations(agent.id);
136
+ return success({
137
+ message: `Agent "${agent.name}" registered successfully.`,
138
+ agent: sanitizeAgentForOutput(fullAgent ?? ({ ...agent, transports: [], permissions: [] })),
139
+ });
140
+ }
141
+ catch (err) {
142
+ return error(`Failed to register agent: ${err instanceof Error ? err.message : String(err)}`);
143
+ }
144
+ },
145
+ });
146
+ const listAgents = defineTool({
147
+ name: 'list_agents',
148
+ description: 'List all agents the current user owns or has authorized.',
149
+ querySchema: z.object({}),
150
+ handler: async ({ context }) => {
151
+ try {
152
+ const agents = await agentDb.listAgentsForUser(context.userId);
153
+ const filteredAgents = context.agentId
154
+ ? agents.filter((agent) => agent.id === context.agentId)
155
+ : agents;
156
+ return success({
157
+ agents: filteredAgents.map((agent) => sanitizeAgentForOutput(agent)),
158
+ count: filteredAgents.length,
159
+ });
160
+ }
161
+ catch (err) {
162
+ return error(`Failed to list agents: ${err instanceof Error ? err.message : String(err)}`);
163
+ }
164
+ },
165
+ });
166
+ const updateAgent = defineTool({
167
+ name: 'update_agent',
168
+ description: 'Update an agent name, description, or status.',
169
+ querySchema: z.object({
170
+ agent_id: z.string().min(1).describe('The agent ID to update.'),
171
+ name: z.string().optional().describe('Updated display name.'),
172
+ description: z.string().optional().describe('Updated description.'),
173
+ status: z.enum(['active', 'inactive']).optional().describe('Updated status.'),
174
+ }),
175
+ handler: async ({ context, query }) => {
176
+ const scopeError = ensureAgentScopedAccess(context, query.agent_id);
177
+ if (scopeError) {
178
+ return error(scopeError);
179
+ }
180
+ try {
181
+ const agent = await agentDb.getAgent(query.agent_id);
182
+ if (!agent || agent.ownerId !== context.userId) {
183
+ return error('Agent not found');
184
+ }
185
+ if (agent.type === 'system') {
186
+ return error('System agents cannot be modified');
187
+ }
188
+ const updates = {};
189
+ if (query.name !== undefined) {
190
+ const name = query.name.trim();
191
+ if (!name) {
192
+ return error('Agent name is required');
193
+ }
194
+ updates.name = name;
195
+ }
196
+ if (query.description !== undefined) {
197
+ updates.description = query.description.trim() || null;
198
+ }
199
+ if (query.status) {
200
+ updates.status = query.status;
201
+ }
202
+ if (Object.keys(updates).length === 0) {
203
+ return error('At least one field is required.');
204
+ }
205
+ const updated = await agentDb.updateAgent(query.agent_id, updates);
206
+ if (!updated) {
207
+ return error('Agent not found');
208
+ }
209
+ const fullAgent = await agentDb.getAgentWithRelations(query.agent_id);
210
+ return success({
211
+ message: 'Agent updated.',
212
+ agent: sanitizeAgentForOutput(fullAgent ?? ({ ...updated, transports: [], permissions: [] })),
213
+ });
214
+ }
215
+ catch (err) {
216
+ return error(`Failed to update agent: ${err instanceof Error ? err.message : String(err)}`);
217
+ }
218
+ },
219
+ });
220
+ const deleteAgent = defineTool({
221
+ name: 'delete_agent',
222
+ description: 'Soft-delete a personal agent and deactivate its transports.',
223
+ querySchema: z.object({
224
+ agent_id: z.string().min(1).describe('The agent ID to delete.'),
225
+ }),
226
+ handler: async ({ context, query }) => {
227
+ const scopeError = ensureAgentScopedAccess(context, query.agent_id);
228
+ if (scopeError) {
229
+ return error(scopeError);
230
+ }
231
+ try {
232
+ const agent = await agentDb.getAgent(query.agent_id);
233
+ if (!agent || agent.ownerId !== context.userId) {
234
+ return error('Agent not found');
235
+ }
236
+ if (agent.type === 'system') {
237
+ return error('System agents cannot be deleted');
238
+ }
239
+ await agentDb.deleteAgent(query.agent_id);
240
+ return success({ message: `Agent "${agent.name}" deleted.` });
241
+ }
242
+ catch (err) {
243
+ return error(`Failed to delete agent: ${err instanceof Error ? err.message : String(err)}`);
244
+ }
245
+ },
246
+ });
247
+ const grantAgentPermission = defineTool({
248
+ name: 'grant_agent_permission',
249
+ description: 'Grant one or more permissions to an agent for the current user.',
250
+ querySchema: z.object({
251
+ agent_id: z.string().min(1).describe('The agent ID to grant permissions to.'),
252
+ actions: z.array(z.string()).min(1).describe('Permission actions to grant.'),
253
+ scope: z.enum(['global', 'node', 'network']).optional().describe('Optional permission scope.'),
254
+ scope_id: z.string().optional().describe('Scope target ID for node/network scopes.'),
255
+ }),
256
+ handler: async ({ context, query }) => {
257
+ const scopeError = ensureAgentScopedAccess(context, query.agent_id);
258
+ if (scopeError) {
259
+ return error(scopeError);
260
+ }
261
+ const actions = [...new Set(query.actions.map((action) => action.trim()).filter(Boolean))];
262
+ if (actions.length === 0) {
263
+ return error('At least one non-empty action is required.');
264
+ }
265
+ for (const action of actions) {
266
+ if (!isValidAction(action)) {
267
+ return error(invalidActionMessage(action));
268
+ }
269
+ }
270
+ if ((query.scope === 'network' || query.scope === 'node') && !query.scope_id?.trim()) {
271
+ return error(`scope_id is required for ${query.scope} permissions.`);
272
+ }
273
+ try {
274
+ const agent = await agentDb.getAgent(query.agent_id);
275
+ if (!agent || agent.ownerId !== context.userId) {
276
+ return error('Agent not found');
277
+ }
278
+ const permission = await agentDb.grantPermission({
279
+ agentId: query.agent_id,
280
+ userId: context.userId,
281
+ scope: query.scope,
282
+ scopeId: query.scope === 'global' || query.scope === undefined ? undefined : query.scope_id?.trim(),
283
+ actions,
284
+ });
285
+ return success({ message: 'Permission granted.', permission });
286
+ }
287
+ catch (err) {
288
+ return error(`Failed to grant permission: ${err instanceof Error ? err.message : String(err)}`);
289
+ }
290
+ },
291
+ });
292
+ const revokeAgentPermission = defineTool({
293
+ name: 'revoke_agent_permission',
294
+ description: 'Revoke a specific permission from an agent.',
295
+ querySchema: z.object({
296
+ agent_id: z.string().min(1).describe('The agent ID that owns the permission.'),
297
+ permission_id: z.string().min(1).describe('The permission ID to revoke.'),
298
+ }),
299
+ handler: async ({ context, query }) => {
300
+ const scopeError = ensureAgentScopedAccess(context, query.agent_id);
301
+ if (scopeError) {
302
+ return error(scopeError);
303
+ }
304
+ try {
305
+ const agent = await agentDb.getAgentWithRelations(query.agent_id);
306
+ if (!agent || agent.ownerId !== context.userId) {
307
+ return error('Agent not found');
308
+ }
309
+ const permission = agent.permissions.find((item) => item.id === query.permission_id);
310
+ if (!permission) {
311
+ return error('Permission not found');
312
+ }
313
+ await agentDb.revokePermission(query.permission_id);
314
+ return success({ message: 'Permission revoked.' });
315
+ }
316
+ catch (err) {
317
+ return error(`Failed to revoke permission: ${err instanceof Error ? err.message : String(err)}`);
318
+ }
319
+ },
320
+ });
321
+ return [
322
+ registerAgent,
323
+ listAgents,
324
+ updateAgent,
325
+ deleteAgent,
326
+ grantAgentPermission,
327
+ revokeAgentPermission,
328
+ ];
329
+ }
330
+ //# sourceMappingURL=agent.tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.tools.js","sourceRoot":"","sources":["../../src/agent/agent.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,aAAa,GAAG;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,qBAAqB;CACb,CAAC;AAEX,SAAS,oBAAoB,CAAC,MAAc;IAC1C,OAAO,mBAAmB,MAAM,oBAAoB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACjF,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACnC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAc;IAC1C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;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,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,aAAa,CAAC,CAAC;gBACrF,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,OAAO,KAAK,CAAC,sBAAsB,CAAC,CAAC;gBACvC,CAAC;gBAED,MAAM,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;gBACpD,OAAO,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;YACrD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACnG,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO;QACL,aAAa;QACb,UAAU;QACV,WAAW;QACX,WAAW;QACX,oBAAoB;QACpB,qBAAqB;KACb,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contact.tools.d.ts","sourceRoot":"","sources":["../../src/contact/contact.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG5E;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,SAkHxE"}
1
+ {"version":3,"file":"contact.tools.d.ts","sourceRoot":"","sources":["../../src/contact/contact.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG5E;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,SAqIxE"}
@@ -8,17 +8,20 @@ export function createContactTools(defineTool, deps) {
8
8
  const { contactService } = deps;
9
9
  const import_contacts = defineTool({
10
10
  name: 'import_contacts',
11
- description: `Import contacts into the user's network from any integration or manual input.
12
-
13
- Each contact needs a name and email. Contacts without existing accounts become "ghost users"
14
- that are enriched with public profile data and can be matched in opportunity discovery.
15
-
16
- Returns import statistics including how many were imported, skipped, and how many new ghost users were created.`,
11
+ description: "Bulk-imports contacts into the authenticated user's personal network (personal index). Contacts become members of the user's " +
12
+ "personal index with 'contact' permission, making them available for opportunity discovery.\n\n" +
13
+ "**What happens:** Each contact is matched by email. If the email belongs to an existing user, they're linked directly. " +
14
+ "If not, a 'ghost user' is created — a placeholder account enriched with public profile data (from LinkedIn, GitHub, etc.) " +
15
+ "that participates in opportunity matching even before the person joins the platform.\n\n" +
16
+ "**When to use:** When the user provides a list of contacts to add (from CSV, manual input, or any source other than Gmail). " +
17
+ "For Gmail specifically, use import_gmail_contacts instead.\n\n" +
18
+ "**Returns:** Import statistics: imported (total processed), skipped (invalid), newContacts (ghost users created), " +
19
+ "existingContacts (already in network). Use list_contacts to see all contacts after import.",
17
20
  querySchema: z.object({
18
21
  contacts: z.array(z.object({
19
- name: z.string().describe('Contact name'),
20
- email: z.string().describe('Contact email address'),
21
- })).describe('Array of contacts to import'),
22
+ name: z.string().describe('Full name of the contact (e.g. "Jane Smith")'),
23
+ email: z.string().describe('Email address — used as the unique identifier for matching existing users'),
24
+ })).describe('Array of contact objects to import. Each must have name and email. Duplicates (by email) are skipped.'),
22
25
  }),
23
26
  handler: async ({ context, query }) => {
24
27
  try {
@@ -38,12 +41,15 @@ Returns import statistics including how many were imported, skipped, and how man
38
41
  });
39
42
  const list_contacts = defineTool({
40
43
  name: 'list_contacts',
41
- description: `List the user's network contacts. Returns all contacts with their details.
42
- Each contact includes userId, name, email, avatar, and isGhost flag.
43
- Ghost users (contacts without accounts) are marked with isGhost: true.
44
- Use the userId field with read_user_profiles to look up a contact's full profile.`,
44
+ description: "Lists all contacts in the authenticated user's personal network. Contacts are people the user has added " +
45
+ "(via import_contacts, add_contact, or import_gmail_contacts) stored as members of their personal index.\n\n" +
46
+ "**When to use:** To see who's in the user's network, find a contact's userId for other operations, " +
47
+ "or check if a specific person is already a contact.\n\n" +
48
+ "**Returns:** Array of contacts, each with: userId (use with read_user_profiles or create_opportunities), " +
49
+ "name, email, avatar URL, and isGhost (true = no account yet, profile enriched from public data). " +
50
+ "Use the userId with read_user_profiles(userId) to get the full profile, or with create_opportunities(targetUserId) to connect.",
45
51
  querySchema: z.object({
46
- limit: z.number().optional().describe('Maximum number of contacts to return (default: all)'),
52
+ limit: z.number().optional().describe('Maximum number of contacts to return. Omit to return all contacts. Use for large networks to paginate results.'),
47
53
  }),
48
54
  handler: async ({ context, query }) => {
49
55
  try {
@@ -69,12 +75,17 @@ Use the userId field with read_user_profiles to look up a contact's full profile
69
75
  });
70
76
  const add_contact = defineTool({
71
77
  name: 'add_contact',
72
- description: `Manually add a single contact to the user's network by email.
73
- Use this when the user wants to add a specific person to their network.
74
- If no account exists for that email, a ghost user is created and enriched with public data.`,
78
+ description: "Adds a single contact to the authenticated user's personal network by email address. " +
79
+ "For bulk imports, use import_contacts instead.\n\n" +
80
+ "**What happens:** Looks up the email. If an account exists, links that user as a contact. " +
81
+ "If not, creates a ghost user (placeholder enriched with public profile data) and adds them. " +
82
+ "The contact can then appear in opportunity discovery within the user's personal index.\n\n" +
83
+ "**When to use:** When the user wants to add a specific person (e.g. 'add john@example.com to my network').\n\n" +
84
+ "**Returns:** Confirmation with the contact's userId and whether a new ghost user was created (isNewGhost). " +
85
+ "Use the userId with create_opportunities(targetUserId) to find connection opportunities.",
75
86
  querySchema: z.object({
76
- email: z.string().describe('Email address of the contact to add'),
77
- name: z.string().optional().describe('Name of the contact (optional, will use email prefix if not provided)'),
87
+ email: z.string().describe('Email address of the person to add. Used as unique identifier — if already a contact, the operation is idempotent.'),
88
+ name: z.string().optional().describe('Full name of the contact. Optional — if omitted, the email prefix is used as name. Provide when known for better profile enrichment.'),
78
89
  }),
79
90
  handler: async ({ context, query }) => {
80
91
  try {
@@ -95,10 +106,14 @@ If no account exists for that email, a ghost user is created and enriched with p
95
106
  });
96
107
  const remove_contact = defineTool({
97
108
  name: 'remove_contact',
98
- description: `Remove a contact from the user's network.
99
- Use the contact's userId from list_contacts. This removes the contact relationship.`,
109
+ description: "Removes a contact from the authenticated user's personal network. The contact relationship is deleted — " +
110
+ "the person is no longer a member of the user's personal index and won't appear in personal-index-scoped discovery.\n\n" +
111
+ "**When to use:** When the user wants to remove someone from their network (e.g. 'remove John from my contacts').\n\n" +
112
+ "**Note:** This only removes the contact relationship. If the contact is a real user (not a ghost), " +
113
+ "they still exist on the platform and may appear in shared index discovery.\n\n" +
114
+ "**Returns:** Confirmation that the contact was removed.",
100
115
  querySchema: z.object({
101
- contactUserId: z.string().describe('The user ID of the contact to remove (from list_contacts)'),
116
+ contactUserId: z.string().describe('The userId of the contact to remove. Get this from list_contacts results.'),
102
117
  }),
103
118
  handler: async ({ context, query }) => {
104
119
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"contact.tools.js","sourceRoot":"","sources":["../../src/contact/contact.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAsB,EAAE,IAAc;IACvE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAEhC,MAAM,eAAe,GAAG,UAAU,CAAC;QACjC,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;;;;;gHAK+F;QAC5G,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;gBACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;gBAC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,OAAO,EAAE,oCAAoC,EAAE,CAAC,CAAC;YACnF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,6BAA6B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChG,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;AACvE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,6 +15,10 @@ export type * from "./shared/interfaces/integration.interface.js";
15
15
  export type * from "./shared/interfaces/queue.interface.js";
16
16
  export type * from "./shared/interfaces/scraper.interface.js";
17
17
  export type * from "./shared/interfaces/storage.interface.js";
18
+ export type * from "./shared/interfaces/webhook.interface.js";
19
+ export type * from "./shared/interfaces/negotiation-events.interface.js";
20
+ export type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase, } from './shared/interfaces/agent.interface.js';
21
+ export { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';
18
22
  export { ChatGraphFactory } from "./chat/chat.graph.js";
19
23
  export { HomeGraphFactory } from "./opportunity/feed/feed.graph.js";
20
24
  export { HydeGraphFactory } from "./shared/hyde/hyde.graph.js";
@@ -54,9 +58,10 @@ export { presentOpportunity } from "./opportunity/opportunity.presentation.js";
54
58
  export type { UserInfo } from "./opportunity/opportunity.presentation.js";
55
59
  export { stripUuids, stripIntroducerMentions } from "./opportunity/opportunity.presentation.js";
56
60
  export { createToolRegistry } from "./shared/agent/tool.registry.js";
61
+ export { createAgentTools } from './agent/agent.tools.js';
57
62
  export { createMcpServer } from "./mcp/mcp.server.js";
58
63
  export type { ScopedDepsFactory } from "./mcp/mcp.server.js";
59
- export type { UserNegotiationContext, NegotiationTurn, SeedAssessment, NegotiationGraphLike, } from "./negotiation/negotiation.state.js";
64
+ export type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment, NegotiationGraphLike, } from "./negotiation/negotiation.state.js";
60
65
  export { ChatStreamer } from "./chat/chat.streamer.js";
61
66
  export { ResponseStreamer } from "./shared/agent/response.streamer.js";
62
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACjF,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,YAAY,GACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAI5F,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,+CAA+C,CAAC;AACnE,mBAAmB,0CAA0C,CAAC;AAC9D,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,2CAA2C,CAAC;AAC/D,mBAAmB,6CAA6C,CAAC;AACjE,mBAAmB,8CAA8C,CAAC;AAClE,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,0CAA0C,CAAC;AAC9D,mBAAmB,0CAA0C,CAAC;AAI9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB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B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  export { createChatTools } from "./shared/agent/tool.factory.js";
3
3
  export { configureProtocol } from "./shared/agent/model.config.js";
4
4
  export { ChatContextAccessError, resolveChatContext } from "./shared/agent/tool.helpers.js";
5
+ export { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';
5
6
  // ─── Graph factories ──────────────────────────────────────────────────────────
6
7
  export { ChatGraphFactory } from "./chat/chat.graph.js";
7
8
  export { HomeGraphFactory } from "./opportunity/feed/feed.graph.js";
@@ -36,6 +37,7 @@ export { presentOpportunity } from "./opportunity/opportunity.presentation.js";
36
37
  export { stripUuids, stripIntroducerMentions } from "./opportunity/opportunity.presentation.js";
37
38
  // ─── Tools ────────────────────────────────────────────────────────────────────
38
39
  export { createToolRegistry } from "./shared/agent/tool.registry.js";
40
+ export { createAgentTools } from './agent/agent.tools.js';
39
41
  // ─── MCP ──────────────────────────────────────────────────────────────────────
40
42
  export { createMcpServer } from "./mcp/mcp.server.js";
41
43
  // ─── Streamers ────────────────────────────────────────────────────────────────
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAYnE,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAgB5F,iFAAiF;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MA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mC,CAAC;AAEtE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,yCAAyC,CAAC;AAMjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEhG,iFAAiF;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAatD,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"integration.tools.d.ts","sourceRoot":"","sources":["../../src/integration/integration.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAO5E;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,SAmE5E"}
1
+ {"version":3,"file":"integration.tools.d.ts","sourceRoot":"","sources":["../../src/integration/integration.tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAO5E;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,SAsE5E"}
@@ -17,14 +17,16 @@ export function createIntegrationTools(defineTool, deps) {
17
17
  const { integration, integrationImporter } = deps;
18
18
  const import_gmail_contacts = defineTool({
19
19
  name: 'import_gmail_contacts',
20
- description: `Import contacts from the user's Gmail/Google account into their network.
21
-
22
- If the user hasn't connected their Gmail account yet, returns an auth URL they need to visit first.
23
-
24
- After successful import, contacts are added to the user's network as ghost users
25
- (enriched with public profile data) and can be matched in opportunity discovery.
26
-
27
- Returns import statistics or an auth URL if authentication is needed.`,
20
+ description: "Imports contacts from the user's connected Gmail/Google account into their personal network. " +
21
+ "This is the preferred method for importing Google Contacts — handles OAuth authentication, pagination, and deduplication automatically.\n\n" +
22
+ "**Authentication flow:** If Gmail is not yet connected, returns an `authUrl` the user must visit to grant access. " +
23
+ "After they complete OAuth, call this tool again to perform the actual import.\n\n" +
24
+ "**What happens on import:** All Gmail contacts with valid name+email are imported. " +
25
+ "Contacts without existing platform accounts become ghost users (enriched with public profile data from LinkedIn, GitHub, etc.). " +
26
+ "All imported contacts are added to the user's personal index for opportunity discovery.\n\n" +
27
+ "**When to use:** When the user asks to import or sync their Gmail/Google contacts. No parameters needed.\n\n" +
28
+ "**Returns:** Either `{ requiresAuth: true, authUrl }` (user needs to authenticate) or import statistics: " +
29
+ "imported (total), newContacts (ghost users created), existingContacts (already in network), skipped (invalid entries).",
28
30
  querySchema: z.object({}),
29
31
  handler: async ({ context }) => {
30
32
  try {