@indexnetwork/protocol 16.1.1-rc.478.1 → 17.0.1-rc.480.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.
- package/CHANGELOG.md +47 -0
- package/dist/chat/chat.agent.js +0 -1
- package/dist/chat/negotiator.persona.d.ts +1 -1
- package/dist/chat/negotiator.persona.js +1 -4
- package/dist/chat/negotiator.prompt.js +1 -2
- package/dist/chat/onboarding.persona.js +0 -1
- package/dist/chat/reporter.persona.js +0 -1
- package/dist/chat/signal.persona.js +0 -1
- package/dist/contacts/application/contact.tools.d.ts +6 -9
- package/dist/contacts/application/contact.tools.js +11 -92
- package/dist/contacts/application/index.d.ts +2 -14
- package/dist/contacts/application/index.js +2 -13
- package/dist/contacts/domain/contact.types.d.ts +0 -23
- package/dist/contacts/domain/index.d.ts +2 -6
- package/dist/contacts/index.d.ts +1 -1
- package/dist/contacts/index.js +1 -1
- package/dist/contacts/ports/contact.repository.port.d.ts +5 -12
- package/dist/contacts/ports/contact.repository.port.js +4 -6
- package/dist/contacts/ports/contact.tools.port.d.ts +1 -3
- package/dist/contacts/ports/contact.tools.port.js +1 -2
- package/dist/contacts/ports/index.d.ts +1 -1
- package/dist/contacts/ports/index.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/mcp/mcp.server.js +2 -4
- package/dist/shared/agent/tool.factory.js +0 -8
- package/dist/shared/agent/tool.helpers.d.ts +0 -45
- package/dist/shared/agent/tool.helpers.js +1 -2
- package/dist/shared/agent/tool.registry.js +1 -3
- package/dist/shared/agent/tool.runtime.js +0 -2
- package/dist/shared/agent/utility.tools.js +9 -13
- package/dist/shared/interfaces/database.member-queries.d.ts +1 -8
- package/package.json +2 -2
- package/dist/contacts/application/contact.inviter.d.ts +0 -49
- package/dist/contacts/application/contact.inviter.js +0 -64
- package/dist/integrations/application/index.d.ts +0 -14
- package/dist/integrations/application/index.js +0 -14
- package/dist/integrations/application/integration.tools.d.ts +0 -27
- package/dist/integrations/application/integration.tools.js +0 -98
- package/dist/integrations/domain/index.d.ts +0 -16
- package/dist/integrations/domain/index.js +0 -1
- package/dist/integrations/domain/integration.types.d.ts +0 -51
- package/dist/integrations/domain/integration.types.js +0 -9
- package/dist/integrations/index.d.ts +0 -10
- package/dist/integrations/index.js +0 -8
- package/dist/integrations/ports/index.d.ts +0 -25
- package/dist/integrations/ports/index.js +0 -23
- package/dist/integrations/ports/integration.adapter.port.d.ts +0 -62
- package/dist/integrations/ports/integration.adapter.port.js +0 -15
- package/dist/integrations/ports/integration.importer.port.d.ts +0 -31
- package/dist/integrations/ports/integration.importer.port.js +0 -15
- package/dist/integrations/ports/integration.tools.port.d.ts +0 -25
- package/dist/integrations/ports/integration.tools.port.js +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,53 @@ went 6.7.1 → 8.0.2 with no 7.x in between because the whole 7.x line shipped a
|
|
|
20
20
|
prereleases between the two promotions. To track every change, read `rc`; to
|
|
21
21
|
pin a supported release, use `latest`.
|
|
22
22
|
|
|
23
|
+
## 17.0.1 - 2026-08-17
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
|
|
27
|
+
- Remove `src/architecture/tests/` (`capability-barrels`, `package-entry`,
|
|
28
|
+
`execution-matrix`). These asserted that source files contain particular
|
|
29
|
+
strings — including the wording of `capability-boundaries.ts`'s own violation
|
|
30
|
+
messages — and duplicated the model assertions already in
|
|
31
|
+
`scripts/architecture/tests/capability-model.spec.ts`. Enforcement is
|
|
32
|
+
unchanged: `architecture:host-isolation` and `architecture:capabilities` walk
|
|
33
|
+
the real import graph and are what the CI gate depends on. `test:architecture`
|
|
34
|
+
now runs `scripts/architecture/tests` only.
|
|
35
|
+
|
|
36
|
+
## 17.0.0 - 2026-08-17
|
|
37
|
+
|
|
38
|
+
### Removed
|
|
39
|
+
|
|
40
|
+
- **BREAKING**: Remove the `integrations` capability entirely
|
|
41
|
+
(`src/integrations/`) and its public exports: `IntegrationAdapter`,
|
|
42
|
+
`IntegrationConnection`, `IntegrationSession`, `IntegrationSessionOptions`,
|
|
43
|
+
`ToolActionResponse`. Hosts that typed a Composio adapter against these
|
|
44
|
+
should declare the shape locally — `services/api` already carries a
|
|
45
|
+
structurally identical copy in `adapters/integration.adapter.ts`.
|
|
46
|
+
- **BREAKING**: Remove `generateInviteMessage` (and `InviteInput` /
|
|
47
|
+
`InviteOutput`). It generated outreach copy for ghost-user counterparts and
|
|
48
|
+
required `recipient.isGhost`; with ghost users retired it can never fire.
|
|
49
|
+
- **BREAKING**: Remove the `import_gmail_contacts`, `import_contacts` and
|
|
50
|
+
`add_contact` tools. These were the only paths that minted ghost users.
|
|
51
|
+
Contacts are now established solely by accepting an opportunity, which writes
|
|
52
|
+
the mutual `contact` memberships. `list_contacts`, `remove_contact` and
|
|
53
|
+
`search_contacts` are unchanged.
|
|
54
|
+
- **BREAKING**: Remove `contactsEnabled` from `ToolDeps`, the tool-registry
|
|
55
|
+
composition deps, and `resolveChatContext`. The `CONTACTS_ENABLED` flag gated
|
|
56
|
+
only the removed write paths and no longer exists.
|
|
57
|
+
- **BREAKING**: Remove `integration` and `integrationImporter` from `ToolDeps`.
|
|
58
|
+
Nothing in the protocol consumed them once the integration tools were removed.
|
|
59
|
+
- Remove `createGhostUser` from the database interface. No protocol code path
|
|
60
|
+
creates users any more.
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- `ContactServiceAdapter` narrows to `listContacts` / `removeContact` /
|
|
65
|
+
`searchContacts`; `importContacts` and `addContact` are gone, along with the
|
|
66
|
+
`ContactInput`, `ContactResult` and `ContactImportResult` domain types.
|
|
67
|
+
- Orchestrator, negotiator, signal and onboarding prompt surfaces no longer
|
|
68
|
+
advertise contact import or Gmail import.
|
|
69
|
+
|
|
23
70
|
## 16.1.0 - 2026-08-17
|
|
24
71
|
|
|
25
72
|
### Removed
|
package/dist/chat/chat.agent.js
CHANGED
|
@@ -204,7 +204,6 @@ export class ChatAgent {
|
|
|
204
204
|
userId: context.userId,
|
|
205
205
|
networkId: scopedNetworkId,
|
|
206
206
|
sessionId: context.sessionId,
|
|
207
|
-
contactsEnabled: context.contactsEnabled,
|
|
208
207
|
actionToolsEnabled: context.actionToolsEnabled,
|
|
209
208
|
});
|
|
210
209
|
if (explicitScope.scopeType && explicitScope.scopeId) {
|
|
@@ -25,7 +25,7 @@ export declare const NEGOTIATOR_PERSONA_ID = "negotiator";
|
|
|
25
25
|
* - agent management (`register/update/delete_agent`, permission grants),
|
|
26
26
|
* - `confirm_opportunity_delivery` (OpenClaw ledger write, never chat).
|
|
27
27
|
*/
|
|
28
|
-
export declare const NEGOTIATOR_TOOL_NAMES: readonly ["list_negotiations", "get_negotiation", "respond_to_negotiation", "list_opportunities", "update_opportunity", "read_pending_questions", "answer_pending_question", "read_intents", "create_intent", "update_intent", "delete_intent", "search_intents", "read_intent_indexes", "create_intent_index", "delete_intent_index", "read_user_contexts", "create_user_context", "update_user_context", "confirm_user_context", "preview_user_context", "read_premises", "create_premise", "update_premise", "retract_premise", "read_networks", "read_network_memberships", "create_network_membership", "delete_network_membership", "list_contacts", "search_contacts", "
|
|
28
|
+
export declare const NEGOTIATOR_TOOL_NAMES: readonly ["list_negotiations", "get_negotiation", "respond_to_negotiation", "list_opportunities", "update_opportunity", "read_pending_questions", "answer_pending_question", "read_intents", "create_intent", "update_intent", "delete_intent", "search_intents", "read_intent_indexes", "create_intent_index", "delete_intent_index", "read_user_contexts", "create_user_context", "update_user_context", "confirm_user_context", "preview_user_context", "read_premises", "create_premise", "update_premise", "retract_premise", "read_networks", "read_network_memberships", "create_network_membership", "delete_network_membership", "list_contacts", "search_contacts", "remove_contact", "scrape_url"];
|
|
29
29
|
/**
|
|
30
30
|
* Filters a full chat-tool registry down to the negotiator allowlist.
|
|
31
31
|
* Exported separately so the scoping rule is unit-testable without
|
|
@@ -73,13 +73,10 @@ export const NEGOTIATOR_TOOL_NAMES = [
|
|
|
73
73
|
"read_network_memberships",
|
|
74
74
|
"create_network_membership",
|
|
75
75
|
"delete_network_membership",
|
|
76
|
-
// Contacts —
|
|
76
|
+
// Contacts — read/remove only; contacts arise from accepted opportunities
|
|
77
77
|
"list_contacts",
|
|
78
78
|
"search_contacts",
|
|
79
|
-
"add_contact",
|
|
80
79
|
"remove_contact",
|
|
81
|
-
"import_contacts",
|
|
82
|
-
"import_gmail_contacts",
|
|
83
80
|
// Utility — create_intent's own contract instructs scraping pasted URLs
|
|
84
81
|
// before synthesizing a signal description (P4.5)
|
|
85
82
|
"scrape_url",
|
|
@@ -145,8 +145,7 @@ ${profileContext}
|
|
|
145
145
|
| **read_premises** / **create_premise** / **update_premise** / **retract_premise** | ... | The client's premises (facts they've established) |
|
|
146
146
|
| **read_networks** / **read_network_memberships** | — | The client's communities and memberships |
|
|
147
147
|
| **create_network_membership** / **delete_network_membership** | networkId | Join/leave a community on instruction |
|
|
148
|
-
| **list_contacts** / **search_contacts** / **
|
|
149
|
-
| **import_contacts** / **import_gmail_contacts** | ... | Bulk contact import on instruction |
|
|
148
|
+
| **list_contacts** / **search_contacts** / **remove_contact** | ... | The client's contacts |
|
|
150
149
|
| **scrape_url** | url, objective | Read a link the client pasted (e.g. before drafting a signal from it) |${memoryToolsRows}
|
|
151
150
|
|
|
152
151
|
## Grounding rules
|
|
@@ -56,7 +56,6 @@ export async function createOnboardingTools(deps, preResolvedContext) {
|
|
|
56
56
|
userId: deps.userId,
|
|
57
57
|
networkId: explicitScope.scopeType === "network" ? explicitScope.scopeId : deps.networkId,
|
|
58
58
|
sessionId: deps.sessionId,
|
|
59
|
-
contactsEnabled: deps.contactsEnabled,
|
|
60
59
|
});
|
|
61
60
|
if (explicitScope.scopeType && explicitScope.scopeId) {
|
|
62
61
|
resolvedContext.scopeType = explicitScope.scopeType;
|
|
@@ -179,7 +179,6 @@ export async function createReporterTools(deps, preResolvedContext) {
|
|
|
179
179
|
userId: deps.userId,
|
|
180
180
|
networkId: explicitScope.scopeType === "network" ? explicitScope.scopeId : deps.networkId,
|
|
181
181
|
sessionId: deps.sessionId,
|
|
182
|
-
contactsEnabled: deps.contactsEnabled,
|
|
183
182
|
actionToolsEnabled: deps.actionToolsEnabled,
|
|
184
183
|
});
|
|
185
184
|
if (explicitScope.scopeType && explicitScope.scopeId) {
|
|
@@ -289,7 +289,6 @@ export async function createSignalTools(deps, preResolvedContext) {
|
|
|
289
289
|
userId: deps.userId,
|
|
290
290
|
networkId: explicitScope.scopeType === "network" ? explicitScope.scopeId : deps.networkId,
|
|
291
291
|
sessionId: deps.sessionId,
|
|
292
|
-
contactsEnabled: deps.contactsEnabled,
|
|
293
292
|
});
|
|
294
293
|
if (explicitScope.scopeType && explicitScope.scopeId) {
|
|
295
294
|
resolvedContext.scopeType = explicitScope.scopeType;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* contacts/application — createContactTools canonical implementation.
|
|
3
3
|
*
|
|
4
|
-
* Creates contact management tools for the chat agent. Enables
|
|
5
|
-
*
|
|
4
|
+
* Creates contact management tools for the chat agent. Enables listing,
|
|
5
|
+
* removing, and searching the user's personal network.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* IND-549: moved from contact/contact.tools.ts into the canonical
|
|
12
|
-
* contacts/application layer.
|
|
7
|
+
* Contacts are established by accepting an opportunity — opportunity accept
|
|
8
|
+
* and start-chat write the mutual `contact` memberships. There is no import or
|
|
9
|
+
* manual-add path, and no ghost users: every contact is a real account.
|
|
13
10
|
*/
|
|
14
11
|
import type { DefineTool } from '../../shared/agent/tool.helpers.js';
|
|
15
12
|
import type { ContactToolDeps } from '../ports/index.js';
|
|
16
13
|
/**
|
|
17
14
|
* Creates contact management tools for the chat agent.
|
|
18
|
-
* Enables
|
|
15
|
+
* Enables listing, searching, and removing entries in the user's network.
|
|
19
16
|
*/
|
|
20
17
|
export declare function createContactTools(defineTool: DefineTool, deps: ContactToolDeps): any[];
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* contacts/application — createContactTools canonical implementation.
|
|
3
3
|
*
|
|
4
|
-
* Creates contact management tools for the chat agent. Enables
|
|
5
|
-
*
|
|
4
|
+
* Creates contact management tools for the chat agent. Enables listing,
|
|
5
|
+
* removing, and searching the user's personal network.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* IND-549: moved from contact/contact.tools.ts into the canonical
|
|
12
|
-
* contacts/application layer.
|
|
7
|
+
* Contacts are established by accepting an opportunity — opportunity accept
|
|
8
|
+
* and start-chat write the mutual `contact` memberships. There is no import or
|
|
9
|
+
* manual-add path, and no ghost users: every contact is a real account.
|
|
13
10
|
*/
|
|
14
11
|
import { z } from 'zod';
|
|
15
12
|
import { success, error } from '../../shared/agent/tool.helpers.js';
|
|
@@ -17,58 +14,18 @@ import { protocolLogger } from '../../shared/observability/protocol.logger.js';
|
|
|
17
14
|
const logger = protocolLogger('ChatTools:Contact');
|
|
18
15
|
/**
|
|
19
16
|
* Creates contact management tools for the chat agent.
|
|
20
|
-
* Enables
|
|
17
|
+
* Enables listing, searching, and removing entries in the user's network.
|
|
21
18
|
*/
|
|
22
19
|
export function createContactTools(defineTool, deps) {
|
|
23
20
|
const { contactService } = deps;
|
|
24
|
-
// Contact import / manual-add create ghost users. These are gated behind the
|
|
25
|
-
// CONTACTS_ENABLED flag (injected as deps.contactsEnabled). Read/remove/search
|
|
26
|
-
// tools below are always available so existing contacts stay manageable.
|
|
27
|
-
const contactsEnabled = deps.contactsEnabled === true;
|
|
28
|
-
// Only register when enabled: in the registry path defineTool registers as a
|
|
29
|
-
// side effect, so the call itself must be gated, not just the returned array.
|
|
30
|
-
const import_contacts = contactsEnabled ? defineTool({
|
|
31
|
-
name: 'import_contacts',
|
|
32
|
-
description: "Bulk-imports contacts into the authenticated user's personal network (personal network). Contacts become members of the user's " +
|
|
33
|
-
"personal network with 'contact' permission, making their approved signals eligible for background matching.\n\n" +
|
|
34
|
-
"**What happens:** Each contact is matched by email. If the email belongs to an existing user, they're linked directly. " +
|
|
35
|
-
"If not, a 'ghost user' is created — a placeholder account enriched with public profile data (from LinkedIn, GitHub, etc.) " +
|
|
36
|
-
"that participates in opportunity matching even before the person joins the platform.\n\n" +
|
|
37
|
-
"**When to use:** When the user provides a list of contacts to add (from CSV, manual input, or any source other than Gmail). " +
|
|
38
|
-
"For Gmail specifically, use import_gmail_contacts instead.\n\n" +
|
|
39
|
-
"**Returns:** Import statistics: imported (total processed), skipped (invalid), newContacts (ghost users created), " +
|
|
40
|
-
"existingContacts (already in network). Use list_contacts to see all contacts after import.",
|
|
41
|
-
querySchema: z.object({
|
|
42
|
-
contacts: z.array(z.object({
|
|
43
|
-
name: z.string().describe('Full name of the contact (e.g. "Jane Smith")'),
|
|
44
|
-
email: z.string().describe('Email address — used as the unique identifier for matching existing users'),
|
|
45
|
-
})).describe('Array of contact objects to import. Each must have name and email. Duplicates (by email) are skipped.'),
|
|
46
|
-
}),
|
|
47
|
-
handler: async ({ context, query }) => {
|
|
48
|
-
try {
|
|
49
|
-
const result = await contactService.importContacts(context.userId, query.contacts);
|
|
50
|
-
return success({
|
|
51
|
-
message: `Imported ${result.imported} contacts to your network.`,
|
|
52
|
-
imported: result.imported,
|
|
53
|
-
skipped: result.skipped,
|
|
54
|
-
newContacts: result.newContacts,
|
|
55
|
-
existingContacts: result.existingContacts,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
logger.error('Failed to import contacts', { err });
|
|
60
|
-
return error('Failed to import contacts. Please try again.');
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
}) : null;
|
|
64
21
|
const list_contacts = defineTool({
|
|
65
22
|
name: 'list_contacts',
|
|
66
|
-
description: "Lists all contacts in the authenticated user's personal network. Contacts are people the user has
|
|
67
|
-
"
|
|
23
|
+
description: "Lists all contacts in the authenticated user's personal network. Contacts are people the user has " +
|
|
24
|
+
"accepted an opportunity with, stored as members of their personal network.\n\n" +
|
|
68
25
|
"**When to use:** To see who's in the user's network, find a contact's userId for other operations, " +
|
|
69
26
|
"or check if a specific person is already a contact.\n\n" +
|
|
70
|
-
"**Returns:** Array of contacts, each with userId (use with read_user_contexts), name, email, avatar URL
|
|
71
|
-
"
|
|
27
|
+
"**Returns:** Array of contacts, each with userId (use with read_user_contexts), name, email, and avatar URL. " +
|
|
28
|
+
"Use read_user_contexts(userId) to get the full profile. " +
|
|
72
29
|
"Approved signals are matched in the background; list_opportunities only reviews persisted results.",
|
|
73
30
|
querySchema: z.object({
|
|
74
31
|
limit: z.number().optional().describe('Maximum number of contacts to return. Omit to return all contacts. Use for large networks to paginate results.'),
|
|
@@ -96,38 +53,6 @@ export function createContactTools(defineTool, deps) {
|
|
|
96
53
|
}
|
|
97
54
|
},
|
|
98
55
|
});
|
|
99
|
-
const add_contact = contactsEnabled ? defineTool({
|
|
100
|
-
name: 'add_contact',
|
|
101
|
-
description: "Adds a single contact to the authenticated user's personal network by email address. " +
|
|
102
|
-
"For bulk imports, use import_contacts instead.\n\n" +
|
|
103
|
-
"**What happens:** Looks up the email. If an account exists, links that user as a contact. " +
|
|
104
|
-
"If not, creates a ghost user (placeholder enriched with public profile data) and adds them. " +
|
|
105
|
-
"Their approved signals can then become eligible for background matching within the user's personal network.\n\n" +
|
|
106
|
-
"**When to use:** When the user wants to add a specific person (e.g. 'add john@example.com to my network').\n\n" +
|
|
107
|
-
"**Returns:** Confirmation with the contact's userId and whether a new ghost user was created (isNewGhost). " +
|
|
108
|
-
"Background matching may create persisted opportunities from approved signals; list_opportunities only reviews those results.",
|
|
109
|
-
querySchema: z.object({
|
|
110
|
-
email: z.string().describe('Email address of the person to add. Used as unique identifier — if already a contact, the operation is idempotent.'),
|
|
111
|
-
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.'),
|
|
112
|
-
}),
|
|
113
|
-
handler: async ({ context, query }) => {
|
|
114
|
-
try {
|
|
115
|
-
const result = await contactService.addContact(context.userId, query.email, { name: query.name, restore: true });
|
|
116
|
-
return success({
|
|
117
|
-
added: true,
|
|
118
|
-
message: result.isNew
|
|
119
|
-
? `Added ${query.name || query.email} to your network. Their profile is being enriched.`
|
|
120
|
-
: `Added ${query.name || query.email} to your network.`,
|
|
121
|
-
userId: result.userId,
|
|
122
|
-
isNewGhost: result.isNew,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
catch (err) {
|
|
126
|
-
logger.error('Failed to add contact', { err });
|
|
127
|
-
return error('Failed to add contact. Please try again.');
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
}) : null;
|
|
131
56
|
const remove_contact = defineTool({
|
|
132
57
|
name: 'remove_contact',
|
|
133
58
|
description: "Removes a contact from the authenticated user's personal network. The contact relationship is deleted — " +
|
|
@@ -181,11 +106,5 @@ export function createContactTools(defineTool, deps) {
|
|
|
181
106
|
}
|
|
182
107
|
},
|
|
183
108
|
});
|
|
184
|
-
return [
|
|
185
|
-
...(import_contacts ? [import_contacts] : []),
|
|
186
|
-
...(add_contact ? [add_contact] : []),
|
|
187
|
-
list_contacts,
|
|
188
|
-
remove_contact,
|
|
189
|
-
search_contacts,
|
|
190
|
-
];
|
|
109
|
+
return [list_contacts, remove_contact, search_contacts];
|
|
191
110
|
}
|
|
@@ -4,19 +4,7 @@
|
|
|
4
4
|
* ## Exports
|
|
5
5
|
*
|
|
6
6
|
* ### Tool factory
|
|
7
|
-
* - `createContactTools` — creates contact management MCP tools
|
|
8
|
-
* list,
|
|
9
|
-
* deps.contactsEnabled; read/remove/search are always registered.
|
|
10
|
-
*
|
|
11
|
-
* ### Invite generator
|
|
12
|
-
* - `generateInviteMessage` — LLM-based invite message generator for ghost
|
|
13
|
-
* users; produces short, contextual messages referencing the opportunity.
|
|
14
|
-
*
|
|
15
|
-
* IND-549: canonical application layer for the contacts capability.
|
|
16
|
-
* Legacy paths:
|
|
17
|
-
* - contact/contact.tools.ts → thin compatibility shim pointing here
|
|
18
|
-
* - contact/contact.inviter.ts → thin compatibility shim pointing here
|
|
7
|
+
* - `createContactTools` — creates contact management MCP tools
|
|
8
|
+
* (list, remove, search).
|
|
19
9
|
*/
|
|
20
10
|
export { createContactTools } from "./contact.tools.js";
|
|
21
|
-
export { generateInviteMessage } from "./contact.inviter.js";
|
|
22
|
-
export type { InviteInput, InviteOutput } from "./contact.inviter.js";
|
|
@@ -4,18 +4,7 @@
|
|
|
4
4
|
* ## Exports
|
|
5
5
|
*
|
|
6
6
|
* ### Tool factory
|
|
7
|
-
* - `createContactTools` — creates contact management MCP tools
|
|
8
|
-
* list,
|
|
9
|
-
* deps.contactsEnabled; read/remove/search are always registered.
|
|
10
|
-
*
|
|
11
|
-
* ### Invite generator
|
|
12
|
-
* - `generateInviteMessage` — LLM-based invite message generator for ghost
|
|
13
|
-
* users; produces short, contextual messages referencing the opportunity.
|
|
14
|
-
*
|
|
15
|
-
* IND-549: canonical application layer for the contacts capability.
|
|
16
|
-
* Legacy paths:
|
|
17
|
-
* - contact/contact.tools.ts → thin compatibility shim pointing here
|
|
18
|
-
* - contact/contact.inviter.ts → thin compatibility shim pointing here
|
|
7
|
+
* - `createContactTools` — creates contact management MCP tools
|
|
8
|
+
* (list, remove, search).
|
|
19
9
|
*/
|
|
20
10
|
export { createContactTools } from "./contact.tools.js";
|
|
21
|
-
export { generateInviteMessage } from "./contact.inviter.js";
|
|
@@ -5,29 +5,6 @@
|
|
|
5
5
|
*
|
|
6
6
|
* IND-549: canonical domain layer for the contacts capability.
|
|
7
7
|
*/
|
|
8
|
-
/** Input for importing a single contact. */
|
|
9
|
-
export interface ContactInput {
|
|
10
|
-
name: string;
|
|
11
|
-
email: string;
|
|
12
|
-
}
|
|
13
|
-
/** Result of adding a single contact. */
|
|
14
|
-
export interface ContactResult {
|
|
15
|
-
userId: string;
|
|
16
|
-
isNew: boolean;
|
|
17
|
-
isGhost: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** Result of importing contacts in bulk. */
|
|
20
|
-
export interface ContactImportResult {
|
|
21
|
-
imported: number;
|
|
22
|
-
skipped: number;
|
|
23
|
-
newContacts: number;
|
|
24
|
-
existingContacts: number;
|
|
25
|
-
details: Array<{
|
|
26
|
-
email: string;
|
|
27
|
-
userId: string;
|
|
28
|
-
isNew: boolean;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
8
|
/** Contact with user details, as returned by listContacts. */
|
|
32
9
|
export interface ContactEntry {
|
|
33
10
|
userId: string;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* contacts/domain — pure contact entity value types and constants.
|
|
3
3
|
*
|
|
4
|
-
* Contains
|
|
5
|
-
* and ContactSearchResult.
|
|
4
|
+
* Contains ContactEntry and ContactSearchResult.
|
|
6
5
|
*
|
|
7
6
|
* ## What does NOT live here
|
|
8
7
|
*
|
|
9
8
|
* - ContactServiceAdapter: persistence port — lives in contacts/ports.
|
|
10
9
|
* - ContactToolDeps: tool host port — lives in contacts/ports.
|
|
11
10
|
* - createContactTools: application layer — lives in contacts/application.
|
|
12
|
-
* - generateInviteMessage: application layer — lives in contacts/application.
|
|
13
|
-
*
|
|
14
|
-
* IND-549: canonical domain layer for the contacts capability.
|
|
15
11
|
*/
|
|
16
|
-
export type {
|
|
12
|
+
export type { ContactEntry, ContactSearchResult, } from "./contact.types.js";
|
package/dist/contacts/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Supersedes the capabilities/contacts.facade.ts + contacts/public/ pair; the
|
|
6
6
|
* export list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
7
|
*/
|
|
8
|
-
export { createContactTools
|
|
8
|
+
export { createContactTools } from "./application/index.js";
|
|
9
9
|
export type { ContactServiceAdapter, ContactToolDeps, } from "./ports/index.js";
|
package/dist/contacts/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Supersedes the capabilities/contacts.facade.ts + contacts/public/ pair; the
|
|
6
6
|
* export list is the union of the facades it replaces, so the contract is unchanged.
|
|
7
7
|
*/
|
|
8
|
-
export { createContactTools
|
|
8
|
+
export { createContactTools } from "./application/index.js";
|
|
@@ -4,25 +4,18 @@
|
|
|
4
4
|
* Injected boundary for contact management persistence. Implemented by
|
|
5
5
|
* the host application and passed into the protocol layer at the composition root.
|
|
6
6
|
*
|
|
7
|
-
* Retains participant reachability semantics:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* IND-549: extracted from shared/interfaces/contact.interface.ts into the
|
|
12
|
-
* contacts capability's dedicated ports layer.
|
|
7
|
+
* Retains participant reachability semantics: listContacts, removeContact,
|
|
8
|
+
* and searchContacts scope all operations to the owning user's personal
|
|
9
|
+
* network. Contact rows are created by the opportunity accept / start-chat
|
|
10
|
+
* flow, not through this port.
|
|
13
11
|
*/
|
|
14
|
-
import type {
|
|
12
|
+
import type { ContactEntry, ContactSearchResult } from "../domain/index.js";
|
|
15
13
|
/**
|
|
16
14
|
* Contact management operations used by chat tools.
|
|
17
15
|
* Consumers must provide a concrete implementation (e.g. backed by ContactService).
|
|
18
16
|
*/
|
|
19
17
|
export interface ContactServiceAdapter {
|
|
20
|
-
importContacts(ownerId: string, contacts: ContactInput[]): Promise<ContactImportResult>;
|
|
21
18
|
listContacts(ownerId: string): Promise<ContactEntry[]>;
|
|
22
|
-
addContact(ownerId: string, email: string, options?: {
|
|
23
|
-
name?: string;
|
|
24
|
-
restore?: boolean;
|
|
25
|
-
}): Promise<ContactResult>;
|
|
26
19
|
removeContact(ownerId: string, contactUserId: string): Promise<void>;
|
|
27
20
|
searchContacts(ownerId: string, q: string, limit?: number): Promise<ContactSearchResult[]>;
|
|
28
21
|
}
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
* Injected boundary for contact management persistence. Implemented by
|
|
5
5
|
* the host application and passed into the protocol layer at the composition root.
|
|
6
6
|
*
|
|
7
|
-
* Retains participant reachability semantics:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* IND-549: extracted from shared/interfaces/contact.interface.ts into the
|
|
12
|
-
* contacts capability's dedicated ports layer.
|
|
7
|
+
* Retains participant reachability semantics: listContacts, removeContact,
|
|
8
|
+
* and searchContacts scope all operations to the owning user's personal
|
|
9
|
+
* network. Contact rows are created by the opportunity accept / start-chat
|
|
10
|
+
* flow, not through this port.
|
|
13
11
|
*/
|
|
14
12
|
export {};
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* contacts/ports — ContactToolDeps tool host port.
|
|
3
3
|
*
|
|
4
4
|
* Narrow port type consumed by createContactTools. The host provides a
|
|
5
|
-
* ContactServiceAdapter
|
|
6
|
-
* write-path tools (import_contacts, add_contact).
|
|
5
|
+
* ContactServiceAdapter.
|
|
7
6
|
*
|
|
8
7
|
* NOTE: This type is intentionally defined inline rather than derived from
|
|
9
8
|
* ToolRegistryCompositionDeps, keeping the capability port independent from
|
|
@@ -19,5 +18,4 @@ import type { ContactServiceAdapter } from "./contact.repository.port.js";
|
|
|
19
18
|
/** Host capabilities consumed by contact tools. */
|
|
20
19
|
export type ContactToolDeps = {
|
|
21
20
|
contactService: ContactServiceAdapter;
|
|
22
|
-
contactsEnabled?: boolean;
|
|
23
21
|
};
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* contacts/ports — ContactToolDeps tool host port.
|
|
3
3
|
*
|
|
4
4
|
* Narrow port type consumed by createContactTools. The host provides a
|
|
5
|
-
* ContactServiceAdapter
|
|
6
|
-
* write-path tools (import_contacts, add_contact).
|
|
5
|
+
* ContactServiceAdapter.
|
|
7
6
|
*
|
|
8
7
|
* NOTE: This type is intentionally defined inline rather than derived from
|
|
9
8
|
* ToolRegistryCompositionDeps, keeping the capability port independent from
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* ## Port groups
|
|
9
9
|
*
|
|
10
10
|
* ### Persistence port
|
|
11
|
-
* - ContactServiceAdapter — contact
|
|
11
|
+
* - ContactServiceAdapter — contact reads and removal: list, remove, search.
|
|
12
12
|
*
|
|
13
13
|
* ### Tool host port
|
|
14
14
|
* - ContactToolDeps — host capabilities for contact management tools.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* ## Port groups
|
|
9
9
|
*
|
|
10
10
|
* ### Persistence port
|
|
11
|
-
* - ContactServiceAdapter — contact
|
|
11
|
+
* - ContactServiceAdapter — contact reads and removal: list, remove, search.
|
|
12
12
|
*
|
|
13
13
|
* ### Tool host port
|
|
14
14
|
* - ContactToolDeps — host capabilities for contact management tools.
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export { NegotiationSummarizer } from "./negotiations/index.js";
|
|
|
17
17
|
export type { ContactServiceAdapter } from "./contacts/index.js";
|
|
18
18
|
export type { ChatGraphCompositeDatabase, UserDatabase, SystemDatabase, OpportunityGraphDatabase, OpportunityControllerDatabase, OutcomeOutbox, RadarGraphDatabase, IntentGraphDatabase, HydeGraphDatabase, EnrichmentGraphDatabase, PremiseGraphDatabase, NegotiationGraphDatabase, NegotiationContinuationExecution, NegotiationContinuationReceipt, Opportunity, OpportunityActor, OpportunityStatus, AssignmentNetworkMembership, IntentNetworkFinalAssignmentResult, CreateOpportunityData, } from "./shared/interfaces/database.interface.js";
|
|
19
19
|
export type { Embedder, VectorStoreOption, VectorSearchResult, HydeCandidate, HydeSearchOptions, LensEmbedding } from "./shared/interfaces/embedder.interface.js";
|
|
20
|
-
export type { IntegrationAdapter, IntegrationConnection, IntegrationSession, IntegrationSessionOptions, ToolActionResponse } from "./integrations/index.js";
|
|
21
20
|
export type { IntentGraphQueue } from "./shared/interfaces/queue.interface.js";
|
|
22
21
|
export type { Scraper } from "./shared/interfaces/scraper.interface.js";
|
|
23
22
|
export type { EnrichmentRunInput, EnrichmentRunRecord } from "./shared/interfaces/enrichment-run.interface.js";
|
|
@@ -61,7 +60,6 @@ export { ChatInterruptClassifier } from "./agents/index.js";
|
|
|
61
60
|
export { ChatSummarizer } from "./agents/index.js";
|
|
62
61
|
export { HydeGenerator } from "./discovery/index.js";
|
|
63
62
|
export { SuggestionGenerator } from "./agents/index.js";
|
|
64
|
-
export { generateInviteMessage } from "./contacts/index.js";
|
|
65
63
|
export { IntentIndexer } from "./intents/index.js";
|
|
66
64
|
export type { IntentIndexerOutput } from "./intents/index.js";
|
|
67
65
|
export { SignalIntakePackGenerator } from "./intents/index.js";
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,6 @@ export { ChatInterruptClassifier } from "./agents/index.js";
|
|
|
54
54
|
export { ChatSummarizer } from "./agents/index.js";
|
|
55
55
|
export { HydeGenerator } from "./discovery/index.js";
|
|
56
56
|
export { SuggestionGenerator } from "./agents/index.js";
|
|
57
|
-
export { generateInviteMessage } from "./contacts/index.js";
|
|
58
57
|
export { IntentIndexer } from "./intents/index.js";
|
|
59
58
|
export { SignalIntakePackGenerator } from "./intents/index.js";
|
|
60
59
|
export { SignalIntakeOrchestrator, FALLBACK_WHO_QUESTION, } from "./intents/index.js";
|
package/dist/mcp/mcp.server.js
CHANGED
|
@@ -23,9 +23,8 @@ const mcpToolMetadataCache = new Map();
|
|
|
23
23
|
* the cached metadata set is automatically invalidated.
|
|
24
24
|
*/
|
|
25
25
|
export function getMcpToolMetadataCacheKey(deps) {
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
// the flag can never change the MCP tool set.
|
|
26
|
+
// Contact tools are omitted from the MCP surface entirely (IND-596), so no
|
|
27
|
+
// contacts-related input can change the MCP tool set.
|
|
29
28
|
return [
|
|
30
29
|
`chat:${deps.chatSession ? '1' : '0'}`,
|
|
31
30
|
`agent:${deps.agentDatabase ? '1' : '0'}`,
|
|
@@ -391,7 +390,6 @@ export function createMcpServer(deps, authResolver, scopedDepsFactory, policyOpt
|
|
|
391
390
|
const context = await resolveChatContext({
|
|
392
391
|
database: deps.database,
|
|
393
392
|
userId: authenticated.identity.userId,
|
|
394
|
-
contactsEnabled: deps.contactsEnabled,
|
|
395
393
|
});
|
|
396
394
|
context.isMcp = true;
|
|
397
395
|
if (authenticated.identity.agentId) {
|
|
@@ -18,7 +18,6 @@ import { createIntentTools } from "../../intents/application/intent.tools.js";
|
|
|
18
18
|
import { createNetworkTools } from "../../networks/index.js";
|
|
19
19
|
import { createOpportunityTools } from "../../opportunities/index.js";
|
|
20
20
|
import { createUtilityTools } from "./utility.tools.js";
|
|
21
|
-
import { createIntegrationTools } from "../../integrations/index.js";
|
|
22
21
|
import { createContactTools } from "../../contacts/index.js";
|
|
23
22
|
// The composition root reaches the leaf directly (it is exempt from the barrel
|
|
24
23
|
// rule by design): importing agents/index.js here would pull in the
|
|
@@ -54,7 +53,6 @@ export async function createChatTools(deps, preResolvedContext) {
|
|
|
54
53
|
userId: deps.userId,
|
|
55
54
|
networkId: explicitScope.scopeType === 'network' ? explicitScope.scopeId : deps.networkId,
|
|
56
55
|
sessionId: deps.sessionId,
|
|
57
|
-
contactsEnabled: deps.contactsEnabled,
|
|
58
56
|
actionToolsEnabled: deps.actionToolsEnabled,
|
|
59
57
|
}));
|
|
60
58
|
if (!preResolvedContext && explicitScope.scopeType && explicitScope.scopeId) {
|
|
@@ -146,7 +144,6 @@ export async function createChatTools(deps, preResolvedContext) {
|
|
|
146
144
|
const systemDb = deps.systemDb ?? deps.createSystemDatabase(database, resolvedContext.userId, allowedNetworkIds, embedder);
|
|
147
145
|
// ─── Assemble dependencies ─────────────────────────────────────────────────
|
|
148
146
|
const cache = deps.cache;
|
|
149
|
-
const integration = deps.integration;
|
|
150
147
|
const toolDeps = {
|
|
151
148
|
database,
|
|
152
149
|
userDb,
|
|
@@ -154,10 +151,7 @@ export async function createChatTools(deps, preResolvedContext) {
|
|
|
154
151
|
scraper,
|
|
155
152
|
embedder,
|
|
156
153
|
cache,
|
|
157
|
-
integration,
|
|
158
154
|
contactService: deps.contactService,
|
|
159
|
-
contactsEnabled: deps.contactsEnabled,
|
|
160
|
-
integrationImporter: deps.integrationImporter,
|
|
161
155
|
enricher: deps.enricher,
|
|
162
156
|
negotiationDatabase: deps.negotiationDatabase,
|
|
163
157
|
negotiationTimeoutQueue: deps.negotiationTimeoutQueue,
|
|
@@ -204,7 +198,6 @@ export async function createChatTools(deps, preResolvedContext) {
|
|
|
204
198
|
const utilityTools = createUtilityTools(defineTool, toolDeps);
|
|
205
199
|
const contactTools = createContactTools(defineTool, toolDeps);
|
|
206
200
|
const agentTools = createAgentTools(defineTool, toolDeps);
|
|
207
|
-
const integrationTools = createIntegrationTools(defineTool, toolDeps);
|
|
208
201
|
const negotiationTools = deps.agentDispatcher
|
|
209
202
|
? createNegotiationTools(defineTool, toolDeps)
|
|
210
203
|
: [];
|
|
@@ -227,7 +220,6 @@ export async function createChatTools(deps, preResolvedContext) {
|
|
|
227
220
|
...networkTools,
|
|
228
221
|
...opportunityToolsForChat,
|
|
229
222
|
...utilityTools,
|
|
230
|
-
...integrationTools,
|
|
231
223
|
...contactTools,
|
|
232
224
|
...agentTools,
|
|
233
225
|
...negotiationTools,
|