@indexnetwork/protocol 66.0.0-rc.648.1 → 66.0.0-rc.651.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/dist/capabilities/intents.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/intents/graph/intent.graph.d.ts +8 -0
- package/dist/internal/intents/graph/intent.graph.execute.js +2 -1
- package/dist/internal/intents/graph/intent.graph.state.d.ts +4 -0
- package/dist/internal/intents/graph/intent.graph.state.js +10 -0
- package/dist/internal/intents/intent.mutuality.d.ts +12 -0
- package/dist/internal/intents/intent.mutuality.js +26 -0
- package/dist/internal/intents/intent.preparer.d.ts +1 -0
- package/dist/internal/intents/intent.preparer.js +9 -18
- package/dist/internal/shared/agent/model.config.d.ts +8 -3
- package/dist/internal/shared/agent/model.config.js +3 -2
- package/dist/internal/shared/agent/model.resolver.d.ts +4 -3
- package/dist/internal/shared/agent/model.resolver.js +3 -2
- package/dist/platform/database/entities.d.ts +7 -7
- package/dist/platform/database/network-queries.d.ts +2 -2
- package/dist/platform/database/port.d.ts +1 -1
- package/package.json +1 -1
|
@@ -77,6 +77,8 @@ export declare class Intents {
|
|
|
77
77
|
sourceId: string | null | undefined;
|
|
78
78
|
networkId: string | undefined;
|
|
79
79
|
networkIds: string[] | undefined;
|
|
80
|
+
visibility: "networks_only" | "mutuals_only" | undefined;
|
|
81
|
+
isPrivate: boolean | undefined;
|
|
80
82
|
scopeType: import("../index.js").ScopeType | undefined;
|
|
81
83
|
scopeId: string | undefined;
|
|
82
84
|
activeIntentIds: string[];
|
|
@@ -129,6 +131,8 @@ export declare class Intents {
|
|
|
129
131
|
sourceId?: string | null | undefined;
|
|
130
132
|
networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
|
|
131
133
|
networkIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined;
|
|
134
|
+
visibility?: "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined;
|
|
135
|
+
isPrivate?: boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined;
|
|
132
136
|
scopeType?: import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined;
|
|
133
137
|
scopeId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
|
|
134
138
|
activeIntentIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[]> | undefined;
|
|
@@ -230,6 +234,8 @@ export declare class Intents {
|
|
|
230
234
|
};
|
|
231
235
|
networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
232
236
|
networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
|
|
237
|
+
visibility: import("@langchain/langgraph").BaseChannel<"networks_only" | "mutuals_only" | undefined, "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined, unknown>;
|
|
238
|
+
isPrivate: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
|
|
233
239
|
scopeType: import("@langchain/langgraph").BaseChannel<import("../index.js").ScopeType | undefined, import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined, unknown>;
|
|
234
240
|
scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
235
241
|
activeIntentIds: import("@langchain/langgraph").BaseChannel<string[], string[] | import("@langchain/langgraph").OverwriteValue<string[]>, unknown>;
|
|
@@ -352,6 +358,8 @@ export declare class Intents {
|
|
|
352
358
|
};
|
|
353
359
|
networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
354
360
|
networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
|
|
361
|
+
visibility: import("@langchain/langgraph").BaseChannel<"networks_only" | "mutuals_only" | undefined, "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined, unknown>;
|
|
362
|
+
isPrivate: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
|
|
355
363
|
scopeType: import("@langchain/langgraph").BaseChannel<import("../index.js").ScopeType | undefined, import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined, unknown>;
|
|
356
364
|
scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
357
365
|
activeIntentIds: import("@langchain/langgraph").BaseChannel<string[], string[] | import("@langchain/langgraph").OverwriteValue<string[]>, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export type { NetworksDeps } from "./capabilities/networks.js";
|
|
|
33
33
|
export { Intents } from "./capabilities/intents.js";
|
|
34
34
|
export type { PrepareAnswer, PrepareInput, PrepareResult, RecoveryField, RecoveryFieldKind, RecoveryFieldOption, IntentsDeps, IntentSemanticMetadata, PreparedIntent, } from "./capabilities/intents.js";
|
|
35
35
|
export { IntentSuggester } from "./internal/intents/intent.suggester.js";
|
|
36
|
+
export { sideIsInterested, type MutualitySide } from "./internal/intents/intent.mutuality.js";
|
|
36
37
|
export type { IntentSuggestion, IntentSuggestionInput, IntentSuggestions } from "./internal/intents/intent.suggester.js";
|
|
37
38
|
export { normalizeTelegramHandle } from './internal/shared/utils/telegram-handle.js';
|
|
38
39
|
/**
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ export { NetworkPulseSummarizer } from "./internal/networks/network.pulse-summar
|
|
|
37
37
|
// payload preparation.
|
|
38
38
|
export { Intents } from "./capabilities/intents.js";
|
|
39
39
|
export { IntentSuggester } from "./internal/intents/intent.suggester.js";
|
|
40
|
+
export { sideIsInterested } from "./internal/intents/intent.mutuality.js";
|
|
40
41
|
// ─── Agents ───────────────────────────────────────────────────────────────────
|
|
41
42
|
export { normalizeTelegramHandle } from './internal/shared/utils/telegram-handle.js';
|
|
42
43
|
// ─── Opportunity compatibility exports ─────────────────────────────────────
|
|
@@ -35,6 +35,8 @@ export declare class IntentGraphFactory {
|
|
|
35
35
|
sourceId: string | null | undefined;
|
|
36
36
|
networkId: string | undefined;
|
|
37
37
|
networkIds: string[] | undefined;
|
|
38
|
+
visibility: "networks_only" | "mutuals_only" | undefined;
|
|
39
|
+
isPrivate: boolean | undefined;
|
|
38
40
|
scopeType: import("../../../index.js").ScopeType | undefined;
|
|
39
41
|
scopeId: string | undefined;
|
|
40
42
|
activeIntentIds: string[];
|
|
@@ -87,6 +89,8 @@ export declare class IntentGraphFactory {
|
|
|
87
89
|
sourceId?: string | null | undefined;
|
|
88
90
|
networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
|
|
89
91
|
networkIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined;
|
|
92
|
+
visibility?: "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined;
|
|
93
|
+
isPrivate?: boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined;
|
|
90
94
|
scopeType?: import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined;
|
|
91
95
|
scopeId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
|
|
92
96
|
activeIntentIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[]> | undefined;
|
|
@@ -188,6 +192,8 @@ export declare class IntentGraphFactory {
|
|
|
188
192
|
};
|
|
189
193
|
networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
190
194
|
networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
|
|
195
|
+
visibility: import("@langchain/langgraph").BaseChannel<"networks_only" | "mutuals_only" | undefined, "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined, unknown>;
|
|
196
|
+
isPrivate: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
|
|
191
197
|
scopeType: import("@langchain/langgraph").BaseChannel<import("../../../index.js").ScopeType | undefined, import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined, unknown>;
|
|
192
198
|
scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
193
199
|
activeIntentIds: import("@langchain/langgraph").BaseChannel<string[], string[] | import("@langchain/langgraph").OverwriteValue<string[]>, unknown>;
|
|
@@ -310,6 +316,8 @@ export declare class IntentGraphFactory {
|
|
|
310
316
|
};
|
|
311
317
|
networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
312
318
|
networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
|
|
319
|
+
visibility: import("@langchain/langgraph").BaseChannel<"networks_only" | "mutuals_only" | undefined, "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined, unknown>;
|
|
320
|
+
isPrivate: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
|
|
313
321
|
scopeType: import("@langchain/langgraph").BaseChannel<import("../../../index.js").ScopeType | undefined, import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined, unknown>;
|
|
314
322
|
scopeId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
315
323
|
activeIntentIds: import("@langchain/langgraph").BaseChannel<string[], string[] | import("@langchain/langgraph").OverwriteValue<string[]>, unknown>;
|
|
@@ -41,6 +41,7 @@ export async function executorNode(state, deps) {
|
|
|
41
41
|
inferenceType: 'explicit',
|
|
42
42
|
sourceType: state.sourceType ?? null,
|
|
43
43
|
sourceId: state.sourceId ?? null,
|
|
44
|
+
isPrivate: state.isPrivate ?? false,
|
|
44
45
|
embedding: flatEmbedding,
|
|
45
46
|
semanticEntropy: metadata?.semanticEntropy ?? null,
|
|
46
47
|
referentialAnchor: metadata?.referentialAnchor ?? null,
|
|
@@ -241,7 +242,7 @@ async function linkIntentToNetworks(deps, state, intentId) {
|
|
|
241
242
|
});
|
|
242
243
|
const linked = [];
|
|
243
244
|
for (const networkId of requested) {
|
|
244
|
-
const outcome = await deps.database.assignIntentToNetworkIfMember(state.userId, intentId, networkId, metadata.finalScore, metadata.metadata);
|
|
245
|
+
const outcome = await deps.database.assignIntentToNetworkIfMember(state.userId, intentId, networkId, metadata.finalScore, metadata.metadata, state.visibility);
|
|
245
246
|
if (outcome.kind === 'assigned' || outcome.kind === 'already_assigned') {
|
|
246
247
|
linked.push(networkId);
|
|
247
248
|
}
|
|
@@ -178,6 +178,10 @@ export declare const IntentGraphState: import("@langchain/langgraph").Annotation
|
|
|
178
178
|
* nothing is inferred or scored. An empty list creates an unlinked intent.
|
|
179
179
|
*/
|
|
180
180
|
networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
|
|
181
|
+
/** Applied to every network this create links. Omitted means networks_only. */
|
|
182
|
+
visibility: import("@langchain/langgraph").BaseChannel<"networks_only" | "mutuals_only" | undefined, "networks_only" | "mutuals_only" | import("@langchain/langgraph").OverwriteValue<"networks_only" | "mutuals_only" | undefined> | undefined, unknown>;
|
|
183
|
+
/** Only the owner's agent reads this intent. Skips admission when set on create. */
|
|
184
|
+
isPrivate: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
|
|
181
185
|
/** Focused request scope type for write-side assignment and follow-up queues. */
|
|
182
186
|
scopeType: import("@langchain/langgraph").BaseChannel<ScopeType | undefined, ScopeType | import("@langchain/langgraph").OverwriteValue<ScopeType | undefined> | undefined, unknown>;
|
|
183
187
|
/** Focused request scope id. When scopeType is `network`, this is the focused network id. */
|
|
@@ -86,6 +86,16 @@ export const IntentGraphState = Annotation.Root({
|
|
|
86
86
|
reducer: (curr, next) => next ?? curr,
|
|
87
87
|
default: () => undefined,
|
|
88
88
|
}),
|
|
89
|
+
/** Applied to every network this create links. Omitted means networks_only. */
|
|
90
|
+
visibility: Annotation({
|
|
91
|
+
reducer: (curr, next) => next ?? curr,
|
|
92
|
+
default: () => undefined,
|
|
93
|
+
}),
|
|
94
|
+
/** Only the owner's agent reads this intent. Skips admission when set on create. */
|
|
95
|
+
isPrivate: Annotation({
|
|
96
|
+
reducer: (curr, next) => next ?? curr,
|
|
97
|
+
default: () => undefined,
|
|
98
|
+
}),
|
|
89
99
|
/** Focused request scope type for write-side assignment and follow-up queues. */
|
|
90
100
|
scopeType: Annotation({
|
|
91
101
|
reducer: (curr, next) => next ?? curr,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** One side of a mutual check. The other side's private intents never appear here. */
|
|
2
|
+
export interface MutualitySide {
|
|
3
|
+
statement: string;
|
|
4
|
+
privateIntents: string[];
|
|
5
|
+
otherStatement: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Whether one side wants the other, given only that side's statement, its private intents, and the other statement.
|
|
9
|
+
* @param side - The check input the host built. A future envelope replaces how the host builds it.
|
|
10
|
+
* @returns True only on an explicit yes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sideIsInterested(side: MutualitySide): Promise<boolean>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
|
|
3
|
+
import { createStructuredModel } from "../shared/agent/model.config.js";
|
|
4
|
+
const AnswerSchema = z.object({ yes: z.boolean() });
|
|
5
|
+
const SYSTEM = [
|
|
6
|
+
"You answer one yes-or-no question about two people's intents.",
|
|
7
|
+
"Yes only when the other statement plainly satisfies this side's statement.",
|
|
8
|
+
"This side's private intents are rules. If the other statement plainly breaks one, answer no.",
|
|
9
|
+
"Answer no when it is unclear. Return only the boolean.",
|
|
10
|
+
].join(" ");
|
|
11
|
+
/**
|
|
12
|
+
* Whether one side wants the other, given only that side's statement, its private intents, and the other statement.
|
|
13
|
+
* @param side - The check input the host built. A future envelope replaces how the host builds it.
|
|
14
|
+
* @returns True only on an explicit yes.
|
|
15
|
+
*/
|
|
16
|
+
export async function sideIsInterested(side) {
|
|
17
|
+
const model = createStructuredModel("intentMutuality", AnswerSchema, { name: "mutuality" });
|
|
18
|
+
const rules = side.privateIntents.length
|
|
19
|
+
? side.privateIntents.map((text) => `- ${text}`).join("\n")
|
|
20
|
+
: "(none)";
|
|
21
|
+
const result = await model.invoke([
|
|
22
|
+
new SystemMessage(SYSTEM),
|
|
23
|
+
new HumanMessage(`This side wants:\n${side.statement}\n\nThis side's private intents:\n${rules}\n\nThe other side's statement:\n${side.otherStatement}\n\nDoes the other statement satisfy what this side wants?`),
|
|
24
|
+
]);
|
|
25
|
+
return result.yes === true;
|
|
26
|
+
}
|
|
@@ -49,4 +49,5 @@ export declare class IntentPreparer {
|
|
|
49
49
|
* @throws When rewriting, verification, or recovery generation fails; callers must retain the input for retry.
|
|
50
50
|
*/
|
|
51
51
|
invoke(input: PrepareInput, profileContext?: string): Promise<PrepareResult>;
|
|
52
|
+
private recoveryForm;
|
|
52
53
|
}
|
|
@@ -58,30 +58,21 @@ export class IntentPreparer {
|
|
|
58
58
|
]);
|
|
59
59
|
payload = payloadSchema.parse(result).payload;
|
|
60
60
|
}
|
|
61
|
+
// The form starts with verification: it only needs the draft, so a failed draft doesn't wait for it twice.
|
|
62
|
+
const recovery = this.recoveryForm(payload, answers);
|
|
63
|
+
recovery.catch(() => { }); // Unused when the draft is ready, or when verification throws first.
|
|
61
64
|
const verdict = await this.verifier.invoke(payload, profileContext);
|
|
62
65
|
const failure = admissionFailure(payload, verdict);
|
|
63
66
|
if (!failure)
|
|
64
67
|
return { status: "ready", payload, metadata: semanticMetadata(verdict) };
|
|
68
|
+
return { status: "needs_revision", payload, feedback: failure.message, recovery: await recovery };
|
|
69
|
+
}
|
|
70
|
+
async recoveryForm(payload, answers) {
|
|
65
71
|
const model = createStructuredModel("intentClarifier", recoverySchema, { name: "intent_recovery" });
|
|
66
72
|
const result = await invokeWithAbortSignal(model, [
|
|
67
|
-
new SystemMessage("Build one recovery form that helps the person concretize their intent. Return 2-6 fields. Each field needs a draft-specific label, a kind (single, multi, or text), and for single/multi 2-5 concrete options anchored to the draft. Text fields need a placeholder. Never re-ask what the draft or answers already settle. Options must be matchable and specific. Do not expose scores, classifications, JSON, or internal vocabulary."),
|
|
68
|
-
new HumanMessage(JSON.stringify({
|
|
69
|
-
payload,
|
|
70
|
-
answers,
|
|
71
|
-
feedback: failure.message,
|
|
72
|
-
category: failure.category,
|
|
73
|
-
classification: verdict.classification,
|
|
74
|
-
clarity: verdict.felicity_scores.clarity,
|
|
75
|
-
entropy: verdict.semantic_entropy,
|
|
76
|
-
referentialBreadth: verdict.referential_breadth,
|
|
77
|
-
missingConstraints: verdict.missing_selectional_constraints,
|
|
78
|
-
})),
|
|
73
|
+
new SystemMessage("Build one recovery form that helps the person concretize their intent. Assume the draft is too broad to match anyone yet: ask for whatever is missing among role, outcome, location, timeframe, domain, and concrete need. Return 2-6 fields. Each field needs a draft-specific label, a kind (single, multi, or text), and for single/multi 2-5 concrete options anchored to the draft. Text fields need a placeholder. Never re-ask what the draft or answers already settle. Options must be matchable and specific. Do not expose scores, classifications, JSON, or internal vocabulary."),
|
|
74
|
+
new HumanMessage(JSON.stringify({ payload, answers })),
|
|
79
75
|
]);
|
|
80
|
-
return
|
|
81
|
-
status: "needs_revision",
|
|
82
|
-
payload,
|
|
83
|
-
feedback: failure.message,
|
|
84
|
-
recovery: parseRecoveryFields(recoverySchema.parse(result)),
|
|
85
|
-
};
|
|
76
|
+
return parseRecoveryFields(recoverySchema.parse(result));
|
|
86
77
|
}
|
|
87
78
|
}
|
|
@@ -32,15 +32,20 @@ export interface ModelConfig {
|
|
|
32
32
|
chatReasoningEffort?: 'low' | 'medium' | 'high';
|
|
33
33
|
}
|
|
34
34
|
/** Per-agent model settings before canonical assignments are applied. */
|
|
35
|
-
declare function getBaseModelConfig(config?: ModelConfig): { [Agent in "intentInferrer" | "intentVerifier" | "intentClarifier" | "profileGenerator" | "opportunityPresenter" | "negotiator" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "negotiationSummarizer" | "inviteGenerator" | "userContextGenerator" | "networkRecommender" | "networkPulseSummarizer" | "interruptClassifier" | "chat"]: Omit<{
|
|
35
|
+
declare function getBaseModelConfig(config?: ModelConfig): { [Agent in "intentInferrer" | "intentVerifier" | "intentMutuality" | "intentClarifier" | "profileGenerator" | "opportunityPresenter" | "negotiator" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "negotiationSummarizer" | "inviteGenerator" | "userContextGenerator" | "networkRecommender" | "networkPulseSummarizer" | "interruptClassifier" | "chat"]: Omit<{
|
|
36
36
|
readonly intentInferrer: {
|
|
37
37
|
readonly model: "google/gemini-3.7-flash";
|
|
38
38
|
};
|
|
39
39
|
readonly intentVerifier: {
|
|
40
|
-
readonly model: "google/gemini-
|
|
40
|
+
readonly model: "google/gemini-2.5-flash";
|
|
41
|
+
};
|
|
42
|
+
readonly intentMutuality: {
|
|
43
|
+
readonly model: "google/gemini-2.5-flash";
|
|
44
|
+
readonly temperature: 0;
|
|
45
|
+
readonly maxTokens: 32;
|
|
41
46
|
};
|
|
42
47
|
readonly intentClarifier: {
|
|
43
|
-
readonly model: "google/gemini-
|
|
48
|
+
readonly model: "google/gemini-2.5-flash";
|
|
44
49
|
};
|
|
45
50
|
readonly profileGenerator: {
|
|
46
51
|
readonly model: "google/gemini-3.7-flash";
|
|
@@ -5,8 +5,9 @@ const GEMINI_3_7_FLASH_MODEL = "google/gemini-3.7-flash";
|
|
|
5
5
|
function getBaseModelConfig(config) {
|
|
6
6
|
const settings = {
|
|
7
7
|
intentInferrer: { model: "google/gemini-3.7-flash" },
|
|
8
|
-
intentVerifier: { model: "google/gemini-
|
|
9
|
-
|
|
8
|
+
intentVerifier: { model: "google/gemini-2.5-flash" },
|
|
9
|
+
intentMutuality: { model: "google/gemini-2.5-flash", temperature: 0, maxTokens: 32 },
|
|
10
|
+
intentClarifier: { model: "google/gemini-2.5-flash" },
|
|
10
11
|
profileGenerator: { model: "google/gemini-3.7-flash" },
|
|
11
12
|
opportunityPresenter: { model: "google/gemini-3.7-flash" },
|
|
12
13
|
negotiator: { model: "google/gemini-3.7-flash" },
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const CANONICAL_AGENT_MODEL_DEFAULTS: Readonly<{
|
|
9
9
|
readonly intentInferrer: "google/gemini-3.7-flash";
|
|
10
|
-
readonly intentVerifier: "google/gemini-
|
|
11
|
-
readonly
|
|
10
|
+
readonly intentVerifier: "google/gemini-2.5-flash";
|
|
11
|
+
readonly intentMutuality: "google/gemini-2.5-flash";
|
|
12
|
+
readonly intentClarifier: "google/gemini-2.5-flash";
|
|
12
13
|
readonly profileGenerator: "google/gemini-3.7-flash";
|
|
13
14
|
readonly opportunityPresenter: "google/gemini-3.7-flash";
|
|
14
15
|
readonly negotiator: "google/gemini-3.7-flash";
|
|
@@ -28,7 +29,7 @@ export declare const CANONICAL_AGENT_MODEL_DEFAULTS: Readonly<{
|
|
|
28
29
|
}>;
|
|
29
30
|
export type CanonicalModelAgent = keyof typeof CANONICAL_AGENT_MODEL_DEFAULTS;
|
|
30
31
|
export type CanonicalAllAgentModels = Readonly<Record<CanonicalModelAgent, string>>;
|
|
31
|
-
export declare const CANONICAL_MODEL_AGENTS: readonly ("intentInferrer" | "intentVerifier" | "intentClarifier" | "profileGenerator" | "opportunityPresenter" | "negotiator" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "negotiationSummarizer" | "inviteGenerator" | "userContextGenerator" | "networkRecommender" | "networkPulseSummarizer" | "interruptClassifier" | "chat")[];
|
|
32
|
+
export declare const CANONICAL_MODEL_AGENTS: readonly ("intentInferrer" | "intentVerifier" | "intentMutuality" | "intentClarifier" | "profileGenerator" | "opportunityPresenter" | "negotiator" | "negotiationReflector" | "homeCategorizer" | "suggestionGenerator" | "chatTitleGenerator" | "negotiationInsights" | "chatContextSummarizer" | "negotiationSummarizer" | "inviteGenerator" | "userContextGenerator" | "networkRecommender" | "networkPulseSummarizer" | "interruptClassifier" | "chat")[];
|
|
32
33
|
export declare function resolveCanonicalAllAgentModels(environment: Readonly<Record<string, string | undefined>>, options?: {
|
|
33
34
|
applyEvalOverrides?: boolean;
|
|
34
35
|
}): CanonicalAllAgentModels;
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const CANONICAL_AGENT_MODEL_DEFAULTS = Object.freeze({
|
|
9
9
|
intentInferrer: "google/gemini-3.7-flash",
|
|
10
|
-
intentVerifier: "google/gemini-
|
|
11
|
-
|
|
10
|
+
intentVerifier: "google/gemini-2.5-flash",
|
|
11
|
+
intentMutuality: "google/gemini-2.5-flash",
|
|
12
|
+
intentClarifier: "google/gemini-2.5-flash",
|
|
12
13
|
profileGenerator: "google/gemini-3.7-flash",
|
|
13
14
|
opportunityPresenter: "google/gemini-3.7-flash",
|
|
14
15
|
negotiator: "google/gemini-3.7-flash",
|
|
@@ -78,7 +78,7 @@ export interface UserSocial {
|
|
|
78
78
|
}
|
|
79
79
|
/** Detection metadata recorded when an opportunity is created. */
|
|
80
80
|
export interface OpportunityDetection {
|
|
81
|
-
source: 'opportunity_graph' | 'chat' | 'cron' | 'member_added' | 'introducer';
|
|
81
|
+
source: 'opportunity_graph' | 'chat' | 'cron' | 'member_added' | 'introducer' | 'mutual_check';
|
|
82
82
|
createdBy?: Id<'users'> | string;
|
|
83
83
|
createdByName?: string;
|
|
84
84
|
triggeredBy?: Id<'intents'>;
|
|
@@ -151,8 +151,8 @@ export interface CreateIntentData {
|
|
|
151
151
|
summary?: string | null;
|
|
152
152
|
/** Pre-computed embedding vector (optional, will be generated if not provided) */
|
|
153
153
|
embedding?: number[];
|
|
154
|
-
/**
|
|
155
|
-
|
|
154
|
+
/** Only the owner's agent reads this intent. */
|
|
155
|
+
isPrivate?: boolean;
|
|
156
156
|
/** Network IDs to associate with (optional, uses dynamic scoping if empty) */
|
|
157
157
|
networkIds?: string[];
|
|
158
158
|
/** Client-owned label, stored and returned unchanged */
|
|
@@ -189,8 +189,8 @@ export interface UpdateIntentData {
|
|
|
189
189
|
summary?: string | null;
|
|
190
190
|
/** Updated embedding vector */
|
|
191
191
|
embedding?: number[];
|
|
192
|
-
/** Updated
|
|
193
|
-
|
|
192
|
+
/** Updated privacy. A private intent cannot be made public again. */
|
|
193
|
+
isPrivate?: boolean;
|
|
194
194
|
/** Client-owned label; null clears it */
|
|
195
195
|
sourceType?: string | null;
|
|
196
196
|
/** Client-owned reference; null clears it */
|
|
@@ -231,8 +231,8 @@ export interface CreatedIntent {
|
|
|
231
231
|
payload: string;
|
|
232
232
|
/** Generated or provided summary */
|
|
233
233
|
summary: string | null;
|
|
234
|
-
/**
|
|
235
|
-
|
|
234
|
+
/** Whether only the owner's agent reads this intent. */
|
|
235
|
+
isPrivate: boolean;
|
|
236
236
|
/** Creation timestamp */
|
|
237
237
|
createdAt: Date;
|
|
238
238
|
/** Last update timestamp */
|
|
@@ -44,13 +44,13 @@ export interface DatabaseNetworkQueries {
|
|
|
44
44
|
/**
|
|
45
45
|
* Assigns an intent to a network (inserts intent_networks row).
|
|
46
46
|
*/
|
|
47
|
-
assignIntentToNetwork(intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata): Promise<void>;
|
|
47
|
+
assignIntentToNetwork(intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata, visibility?: 'networks_only' | 'mutuals_only'): Promise<void>;
|
|
48
48
|
/**
|
|
49
49
|
* Atomically assign an owned, non-archived intent only while the exact
|
|
50
50
|
* accepted network membership and network remain active. Implementations
|
|
51
51
|
* hold intent, network, and membership row locks through the insert.
|
|
52
52
|
*/
|
|
53
|
-
assignIntentToNetworkIfMember(userId: string, intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata): Promise<IntentNetworkFinalAssignmentResult>;
|
|
53
|
+
assignIntentToNetworkIfMember(userId: string, intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata, visibility?: 'networks_only' | 'mutuals_only'): Promise<IntentNetworkFinalAssignmentResult>;
|
|
54
54
|
/**
|
|
55
55
|
* Returns per-network relevancy scores for an intent's network assignments.
|
|
56
56
|
*/
|
|
@@ -77,7 +77,7 @@ export interface UserDatabase {
|
|
|
77
77
|
/** Associate an intent with networks. */
|
|
78
78
|
associateIntentWithNetworks(intentId: string, networkIds: string[]): Promise<void>;
|
|
79
79
|
/** Assign an intent to a network. */
|
|
80
|
-
assignIntentToNetwork(intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata): Promise<void>;
|
|
80
|
+
assignIntentToNetwork(intentId: string, networkId: string, relevancyScore?: number, assignmentMetadata?: NetworkAssignmentMetadata, visibility?: 'networks_only' | 'mutuals_only'): Promise<void>;
|
|
81
81
|
/** Unassign an intent from a network. */
|
|
82
82
|
unassignIntentFromNetwork(intentId: string, networkId: string): Promise<void>;
|
|
83
83
|
/** Get network IDs for an intent. */
|