@indexnetwork/protocol 1.26.3-rc.226.1 → 1.26.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.
- package/dist/intent/intent.tools.d.ts.map +1 -1
- package/dist/intent/intent.tools.js +3 -1
- package/dist/intent/intent.tools.js.map +1 -1
- package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
- package/dist/opportunity/opportunity.tools.js +33 -19
- package/dist/opportunity/opportunity.tools.js.map +1 -1
- package/dist/profile/profile.tools.js +21 -21
- package/dist/profile/profile.tools.js.map +1 -1
- package/package.json +1 -1
|
@@ -197,7 +197,7 @@ export function createProfileTools(defineTool, deps) {
|
|
|
197
197
|
draft.attributes.interests.length ? `My interests include ${draft.attributes.interests.join(', ')}.` : '',
|
|
198
198
|
].filter((part) => part.trim().length > 0).join('\n');
|
|
199
199
|
}
|
|
200
|
-
async function decomposeApprovedDraftProfile(
|
|
200
|
+
async function decomposeApprovedDraftProfile(profile) {
|
|
201
201
|
const input = buildApprovedDraftProfileInput(profile);
|
|
202
202
|
if (!input.trim())
|
|
203
203
|
return;
|
|
@@ -206,26 +206,28 @@ export function createProfileTools(defineTool, deps) {
|
|
|
206
206
|
traceEmitter?.({ type: "graph_start", name: "profile" });
|
|
207
207
|
try {
|
|
208
208
|
const graphInput = {
|
|
209
|
-
userId:
|
|
209
|
+
userId: profile.userId,
|
|
210
210
|
operationMode: 'write',
|
|
211
211
|
input,
|
|
212
212
|
forceUpdate: true,
|
|
213
213
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
// Always invoked as a background fire-and-forget task (see confirm_user_profile
|
|
215
|
+
// call sites), so decomposition must outlive the originating request — invoke
|
|
216
|
+
// the graph directly and never bind the request abort signal, which would
|
|
217
|
+
// cancel it as soon as the web request completes.
|
|
218
|
+
const result = await graphs.profile.invoke(graphInput);
|
|
217
219
|
if (result.error) {
|
|
218
220
|
const err = new Error(result.error);
|
|
219
221
|
logger.error('Approved draft premise decomposition failed', {
|
|
220
|
-
userId:
|
|
222
|
+
userId: profile.userId,
|
|
221
223
|
error: result.error,
|
|
222
224
|
});
|
|
223
225
|
reportToolError?.(err, {
|
|
224
226
|
subsystem: 'profile',
|
|
225
227
|
operation: 'profile.confirm_draft_decompose',
|
|
226
228
|
toolName: 'confirm_user_profile',
|
|
227
|
-
userId:
|
|
228
|
-
tags: { toolName: 'confirm_user_profile', execution:
|
|
229
|
+
userId: profile.userId,
|
|
230
|
+
tags: { toolName: 'confirm_user_profile', execution: 'background' },
|
|
229
231
|
});
|
|
230
232
|
return;
|
|
231
233
|
}
|
|
@@ -237,15 +239,15 @@ export function createProfileTools(defineTool, deps) {
|
|
|
237
239
|
}
|
|
238
240
|
catch (err) {
|
|
239
241
|
logger.error('Approved draft premise decomposition failed', {
|
|
240
|
-
userId:
|
|
242
|
+
userId: profile.userId,
|
|
241
243
|
error: err instanceof Error ? err.message : String(err),
|
|
242
244
|
});
|
|
243
245
|
reportToolError?.(err, {
|
|
244
246
|
subsystem: 'profile',
|
|
245
247
|
operation: 'profile.confirm_draft_decompose',
|
|
246
248
|
toolName: 'confirm_user_profile',
|
|
247
|
-
userId:
|
|
248
|
-
tags: { toolName: 'confirm_user_profile', execution:
|
|
249
|
+
userId: profile.userId,
|
|
250
|
+
tags: { toolName: 'confirm_user_profile', execution: 'background' },
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
253
|
finally {
|
|
@@ -591,17 +593,15 @@ export function createProfileTools(defineTool, deps) {
|
|
|
591
593
|
const profile = { ...query.draft, userId: context.userId };
|
|
592
594
|
await userDb.saveProfile(profile);
|
|
593
595
|
await persistApprovedProfileContext(profile, user, context.networkId);
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
596
|
+
const decomposeLogLabel = context.isMcp
|
|
597
|
+
? 'Approved draft premise decomposition failed'
|
|
598
|
+
: 'Approved draft premise decomposition failed (web)';
|
|
599
|
+
decomposeApprovedDraftProfile(profile).catch((err) => {
|
|
600
|
+
logger.error(decomposeLogLabel, {
|
|
601
|
+
userId: profile.userId,
|
|
602
|
+
error: err instanceof Error ? err.message : String(err),
|
|
600
603
|
});
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
await decomposeApprovedDraftProfile(context, profile);
|
|
604
|
-
}
|
|
604
|
+
});
|
|
605
605
|
return success({
|
|
606
606
|
created: true,
|
|
607
607
|
message: context.isMcp
|