@indexnetwork/protocol 2.0.1 → 3.0.0
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/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/intent/intent.graph.d.ts +26 -26
- package/dist/intent/intent.inferrer.d.ts +8 -8
- package/dist/intent/intent.reconciler.d.ts +12 -12
- package/dist/intent/intent.state.d.ts +6 -6
- package/dist/mcp/mcp.server.d.ts +5 -0
- package/dist/mcp/mcp.server.d.ts.map +1 -1
- package/dist/mcp/mcp.server.js +43 -2
- package/dist/mcp/mcp.server.js.map +1 -1
- package/dist/opportunity/opportunity.evaluator.d.ts +3 -3
- package/dist/premise/premise.analyzer.d.ts +2 -2
- package/dist/premise/premise.decomposer.d.ts +2 -2
- package/dist/premise/premise.tools.js.map +1 -1
- package/dist/shared/agent/tool.factory.js.map +1 -1
- package/dist/shared/agent/tool.helpers.d.ts +1 -1
- package/dist/shared/agent/tool.helpers.d.ts.map +1 -1
- package/dist/shared/agent/tool.helpers.js.map +1 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +1 -1
- package/dist/shared/interfaces/agent-dispatcher.interface.js.map +1 -1
- package/dist/shared/interfaces/auth.interface.d.ts +16 -9
- package/dist/shared/interfaces/auth.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/auth.interface.js.map +1 -1
- package/dist/shared/interfaces/database.interface.d.ts +2 -2
- package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/database.interface.js.map +1 -1
- package/dist/shared/interfaces/question-generator.interface.d.ts +1 -1
- package/dist/shared/interfaces/question-generator.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/question-generator.interface.js.map +1 -1
- package/dist/shared/schemas/discovery-question.schema.d.ts +242 -0
- package/dist/shared/schemas/discovery-question.schema.d.ts.map +1 -0
- package/dist/shared/schemas/discovery-question.schema.js +49 -0
- package/dist/shared/schemas/discovery-question.schema.js.map +1 -0
- package/dist/shared/schemas/mcp-auth.schema.d.ts +18 -0
- package/dist/shared/schemas/mcp-auth.schema.d.ts.map +1 -0
- package/dist/shared/schemas/mcp-auth.schema.js +2 -0
- package/dist/shared/schemas/mcp-auth.schema.js.map +1 -0
- package/dist/shared/schemas/negotiation-digest.schema.d.ts +2 -2
- package/dist/shared/schemas/negotiation-state.schema.d.ts +118 -0
- package/dist/shared/schemas/negotiation-state.schema.d.ts.map +1 -0
- package/dist/shared/schemas/negotiation-state.schema.js +29 -0
- package/dist/shared/schemas/negotiation-state.schema.js.map +1 -0
- package/dist/shared/schemas/profile.schema.d.ts +100 -0
- package/dist/shared/schemas/profile.schema.d.ts.map +1 -0
- package/dist/shared/schemas/profile.schema.js +26 -0
- package/dist/shared/schemas/profile.schema.js.map +1 -0
- package/dist/shared/schemas/question.schema.d.ts +8 -8
- package/package.json +1 -2
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiscoveryQuestionInput and nested types.
|
|
3
|
+
* Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is
|
|
4
|
+
* a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,
|
|
5
|
+
* ChatContextDigest) to avoid Zod cross-schema runtime coupling.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { DiscoveryNegotiationDigest } from "./negotiation-digest.schema.js";
|
|
9
|
+
import type { ChatContextDigest } from "./chat-context.schema.js";
|
|
10
|
+
export declare const NegotiationRoleSchema: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
11
|
+
export type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;
|
|
12
|
+
export declare const DiscoveryTurnSchema: z.ZodObject<{
|
|
13
|
+
action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
|
|
14
|
+
reasoning: z.ZodString;
|
|
15
|
+
suggestedRoles: z.ZodObject<{
|
|
16
|
+
ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
17
|
+
otherUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
ownUser: "agent" | "patient" | "peer";
|
|
20
|
+
otherUser: "agent" | "patient" | "peer";
|
|
21
|
+
}, {
|
|
22
|
+
ownUser: "agent" | "patient" | "peer";
|
|
23
|
+
otherUser: "agent" | "patient" | "peer";
|
|
24
|
+
}>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
reasoning: string;
|
|
27
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
28
|
+
suggestedRoles: {
|
|
29
|
+
ownUser: "agent" | "patient" | "peer";
|
|
30
|
+
otherUser: "agent" | "patient" | "peer";
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
reasoning: string;
|
|
34
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
35
|
+
suggestedRoles: {
|
|
36
|
+
ownUser: "agent" | "patient" | "peer";
|
|
37
|
+
otherUser: "agent" | "patient" | "peer";
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
export type DiscoveryTurn = z.infer<typeof DiscoveryTurnSchema>;
|
|
41
|
+
export declare const DiscoveryOutcomeSchema: z.ZodObject<{
|
|
42
|
+
hasOpportunity: z.ZodBoolean;
|
|
43
|
+
reasoning: z.ZodString;
|
|
44
|
+
agreedRoles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
45
|
+
userId: z.ZodString;
|
|
46
|
+
role: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
userId: string;
|
|
49
|
+
role: "agent" | "patient" | "peer";
|
|
50
|
+
}, {
|
|
51
|
+
userId: string;
|
|
52
|
+
role: "agent" | "patient" | "peer";
|
|
53
|
+
}>, "many">>;
|
|
54
|
+
reason: z.ZodOptional<z.ZodEnum<["turn_cap", "timeout"]>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
reasoning: string;
|
|
57
|
+
hasOpportunity: boolean;
|
|
58
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
59
|
+
agreedRoles?: {
|
|
60
|
+
userId: string;
|
|
61
|
+
role: "agent" | "patient" | "peer";
|
|
62
|
+
}[] | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
reasoning: string;
|
|
65
|
+
hasOpportunity: boolean;
|
|
66
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
67
|
+
agreedRoles?: {
|
|
68
|
+
userId: string;
|
|
69
|
+
role: "agent" | "patient" | "peer";
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export type DiscoveryOutcome = z.infer<typeof DiscoveryOutcomeSchema>;
|
|
73
|
+
export declare const DiscoveryNegotiationSchema: z.ZodObject<{
|
|
74
|
+
counterpartyId: z.ZodString;
|
|
75
|
+
counterpartyHint: z.ZodString;
|
|
76
|
+
indexContext: z.ZodString;
|
|
77
|
+
turns: z.ZodArray<z.ZodObject<{
|
|
78
|
+
action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
|
|
79
|
+
reasoning: z.ZodString;
|
|
80
|
+
suggestedRoles: z.ZodObject<{
|
|
81
|
+
ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
82
|
+
otherUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
ownUser: "agent" | "patient" | "peer";
|
|
85
|
+
otherUser: "agent" | "patient" | "peer";
|
|
86
|
+
}, {
|
|
87
|
+
ownUser: "agent" | "patient" | "peer";
|
|
88
|
+
otherUser: "agent" | "patient" | "peer";
|
|
89
|
+
}>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
reasoning: string;
|
|
92
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
93
|
+
suggestedRoles: {
|
|
94
|
+
ownUser: "agent" | "patient" | "peer";
|
|
95
|
+
otherUser: "agent" | "patient" | "peer";
|
|
96
|
+
};
|
|
97
|
+
}, {
|
|
98
|
+
reasoning: string;
|
|
99
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
100
|
+
suggestedRoles: {
|
|
101
|
+
ownUser: "agent" | "patient" | "peer";
|
|
102
|
+
otherUser: "agent" | "patient" | "peer";
|
|
103
|
+
};
|
|
104
|
+
}>, "many">;
|
|
105
|
+
outcome: z.ZodObject<{
|
|
106
|
+
hasOpportunity: z.ZodBoolean;
|
|
107
|
+
reasoning: z.ZodString;
|
|
108
|
+
agreedRoles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
userId: z.ZodString;
|
|
110
|
+
role: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
userId: string;
|
|
113
|
+
role: "agent" | "patient" | "peer";
|
|
114
|
+
}, {
|
|
115
|
+
userId: string;
|
|
116
|
+
role: "agent" | "patient" | "peer";
|
|
117
|
+
}>, "many">>;
|
|
118
|
+
reason: z.ZodOptional<z.ZodEnum<["turn_cap", "timeout"]>>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
reasoning: string;
|
|
121
|
+
hasOpportunity: boolean;
|
|
122
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
123
|
+
agreedRoles?: {
|
|
124
|
+
userId: string;
|
|
125
|
+
role: "agent" | "patient" | "peer";
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
reasoning: string;
|
|
129
|
+
hasOpportunity: boolean;
|
|
130
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
131
|
+
agreedRoles?: {
|
|
132
|
+
userId: string;
|
|
133
|
+
role: "agent" | "patient" | "peer";
|
|
134
|
+
}[] | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
seedAssessmentScore: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
outcome: {
|
|
139
|
+
reasoning: string;
|
|
140
|
+
hasOpportunity: boolean;
|
|
141
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
142
|
+
agreedRoles?: {
|
|
143
|
+
userId: string;
|
|
144
|
+
role: "agent" | "patient" | "peer";
|
|
145
|
+
}[] | undefined;
|
|
146
|
+
};
|
|
147
|
+
counterpartyHint: string;
|
|
148
|
+
indexContext: string;
|
|
149
|
+
turns: {
|
|
150
|
+
reasoning: string;
|
|
151
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
152
|
+
suggestedRoles: {
|
|
153
|
+
ownUser: "agent" | "patient" | "peer";
|
|
154
|
+
otherUser: "agent" | "patient" | "peer";
|
|
155
|
+
};
|
|
156
|
+
}[];
|
|
157
|
+
counterpartyId: string;
|
|
158
|
+
seedAssessmentScore?: number | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
outcome: {
|
|
161
|
+
reasoning: string;
|
|
162
|
+
hasOpportunity: boolean;
|
|
163
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
164
|
+
agreedRoles?: {
|
|
165
|
+
userId: string;
|
|
166
|
+
role: "agent" | "patient" | "peer";
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
};
|
|
169
|
+
counterpartyHint: string;
|
|
170
|
+
indexContext: string;
|
|
171
|
+
turns: {
|
|
172
|
+
reasoning: string;
|
|
173
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
174
|
+
suggestedRoles: {
|
|
175
|
+
ownUser: "agent" | "patient" | "peer";
|
|
176
|
+
otherUser: "agent" | "patient" | "peer";
|
|
177
|
+
};
|
|
178
|
+
}[];
|
|
179
|
+
counterpartyId: string;
|
|
180
|
+
seedAssessmentScore?: number | undefined;
|
|
181
|
+
}>;
|
|
182
|
+
export type DiscoveryNegotiation = z.infer<typeof DiscoveryNegotiationSchema>;
|
|
183
|
+
export declare const DiscoverySummarySchema: z.ZodObject<{
|
|
184
|
+
totalCandidates: z.ZodNumber;
|
|
185
|
+
opportunitiesFound: z.ZodNumber;
|
|
186
|
+
noOpportunityCount: z.ZodNumber;
|
|
187
|
+
timeoutCount: z.ZodNumber;
|
|
188
|
+
roleDistribution: z.ZodRecord<z.ZodEnum<["agent", "patient", "peer"]>, z.ZodNumber>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
totalCandidates: number;
|
|
191
|
+
opportunitiesFound: number;
|
|
192
|
+
noOpportunityCount: number;
|
|
193
|
+
timeoutCount: number;
|
|
194
|
+
roleDistribution: Partial<Record<"agent" | "patient" | "peer", number>>;
|
|
195
|
+
}, {
|
|
196
|
+
totalCandidates: number;
|
|
197
|
+
opportunitiesFound: number;
|
|
198
|
+
noOpportunityCount: number;
|
|
199
|
+
timeoutCount: number;
|
|
200
|
+
roleDistribution: Partial<Record<"agent" | "patient" | "peer", number>>;
|
|
201
|
+
}>;
|
|
202
|
+
export type DiscoverySummary = {
|
|
203
|
+
totalCandidates: number;
|
|
204
|
+
opportunitiesFound: number;
|
|
205
|
+
noOpportunityCount: number;
|
|
206
|
+
timeoutCount: number;
|
|
207
|
+
roleDistribution: Partial<Record<NegotiationRole, number>>;
|
|
208
|
+
};
|
|
209
|
+
export declare const DiscoverySourceProfileSchema: z.ZodObject<{
|
|
210
|
+
name: z.ZodOptional<z.ZodString>;
|
|
211
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
212
|
+
location: z.ZodOptional<z.ZodString>;
|
|
213
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
214
|
+
interests: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
name?: string | undefined;
|
|
217
|
+
bio?: string | undefined;
|
|
218
|
+
location?: string | undefined;
|
|
219
|
+
interests?: string[] | undefined;
|
|
220
|
+
skills?: string[] | undefined;
|
|
221
|
+
}, {
|
|
222
|
+
name?: string | undefined;
|
|
223
|
+
bio?: string | undefined;
|
|
224
|
+
location?: string | undefined;
|
|
225
|
+
interests?: string[] | undefined;
|
|
226
|
+
skills?: string[] | undefined;
|
|
227
|
+
}>;
|
|
228
|
+
export type DiscoverySourceProfile = z.infer<typeof DiscoverySourceProfileSchema>;
|
|
229
|
+
/**
|
|
230
|
+
* Full input to the question generator.
|
|
231
|
+
* Defined as a pure interface so it can reference DiscoveryNegotiationDigest
|
|
232
|
+
* and ChatContextDigest from sibling schemas without Zod runtime coupling.
|
|
233
|
+
*/
|
|
234
|
+
export interface DiscoveryQuestionInput {
|
|
235
|
+
query: string;
|
|
236
|
+
sourceProfile: DiscoverySourceProfile;
|
|
237
|
+
negotiationDigests: DiscoveryNegotiationDigest[];
|
|
238
|
+
summary: DiscoverySummary;
|
|
239
|
+
chatContext?: ChatContextDigest;
|
|
240
|
+
now: string;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=discovery-question.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery-question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/discovery-question.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,eAAO,MAAM,qBAAqB,yCAAuC,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAIlF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,sBAAsB,CAAC;IACtC,kBAAkB,EAAE,0BAA0B,EAAE,CAAC;IACjD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiscoveryQuestionInput and nested types.
|
|
3
|
+
* Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is
|
|
4
|
+
* a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,
|
|
5
|
+
* ChatContextDigest) to avoid Zod cross-schema runtime coupling.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
// ─── Primitives ───────────────────────────────────────────────────────────────
|
|
9
|
+
export const NegotiationRoleSchema = z.enum(["agent", "patient", "peer"]);
|
|
10
|
+
export const DiscoveryTurnSchema = z.object({
|
|
11
|
+
action: z.enum(["propose", "accept", "reject", "counter", "question"]),
|
|
12
|
+
reasoning: z.string(),
|
|
13
|
+
suggestedRoles: z.object({
|
|
14
|
+
ownUser: NegotiationRoleSchema,
|
|
15
|
+
otherUser: NegotiationRoleSchema,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
export const DiscoveryOutcomeSchema = z.object({
|
|
19
|
+
hasOpportunity: z.boolean(),
|
|
20
|
+
reasoning: z.string(),
|
|
21
|
+
agreedRoles: z.array(z.object({
|
|
22
|
+
userId: z.string(),
|
|
23
|
+
role: NegotiationRoleSchema,
|
|
24
|
+
})).optional(),
|
|
25
|
+
reason: z.enum(["turn_cap", "timeout"]).optional(),
|
|
26
|
+
});
|
|
27
|
+
export const DiscoveryNegotiationSchema = z.object({
|
|
28
|
+
counterpartyId: z.string(),
|
|
29
|
+
counterpartyHint: z.string(),
|
|
30
|
+
indexContext: z.string(),
|
|
31
|
+
turns: z.array(DiscoveryTurnSchema),
|
|
32
|
+
outcome: DiscoveryOutcomeSchema,
|
|
33
|
+
seedAssessmentScore: z.number().optional(),
|
|
34
|
+
});
|
|
35
|
+
export const DiscoverySummarySchema = z.object({
|
|
36
|
+
totalCandidates: z.number(),
|
|
37
|
+
opportunitiesFound: z.number(),
|
|
38
|
+
noOpportunityCount: z.number(),
|
|
39
|
+
timeoutCount: z.number(),
|
|
40
|
+
roleDistribution: z.record(NegotiationRoleSchema, z.number()),
|
|
41
|
+
});
|
|
42
|
+
export const DiscoverySourceProfileSchema = z.object({
|
|
43
|
+
name: z.string().optional(),
|
|
44
|
+
bio: z.string().optional(),
|
|
45
|
+
location: z.string().optional(),
|
|
46
|
+
skills: z.array(z.string()).optional(),
|
|
47
|
+
interests: z.array(z.string()).optional(),
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=discovery-question.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery-question.schema.js","sourceRoot":"/","sources":["shared/schemas/discovery-question.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,iFAAiF;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAG1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACtE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;QACvB,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,qBAAqB;KACjC,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,qBAAqB;KAC5B,CAAC,CAAC,CAAC,QAAQ,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACnC,OAAO,EAAE,sBAAsB;IAC/B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9D,CAAC,CAAC;AASH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * DiscoveryQuestionInput and nested types.\n * Leaf types have full Zod schemas. The composite DiscoveryQuestionInput is\n * a pure interface referencing cross-schema types (DiscoveryNegotiationDigest,\n * ChatContextDigest) to avoid Zod cross-schema runtime coupling.\n */\nimport { z } from \"zod\";\nimport type { DiscoveryNegotiationDigest } from \"./negotiation-digest.schema.js\";\nimport type { ChatContextDigest } from \"./chat-context.schema.js\";\n\n// ─── Primitives ───────────────────────────────────────────────────────────────\n\nexport const NegotiationRoleSchema = z.enum([\"agent\", \"patient\", \"peer\"]);\nexport type NegotiationRole = z.infer<typeof NegotiationRoleSchema>;\n\nexport const DiscoveryTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\"]),\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: NegotiationRoleSchema,\n otherUser: NegotiationRoleSchema,\n }),\n});\nexport type DiscoveryTurn = z.infer<typeof DiscoveryTurnSchema>;\n\nexport const DiscoveryOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n reasoning: z.string(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: NegotiationRoleSchema,\n })).optional(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type DiscoveryOutcome = z.infer<typeof DiscoveryOutcomeSchema>;\n\nexport const DiscoveryNegotiationSchema = z.object({\n counterpartyId: z.string(),\n counterpartyHint: z.string(),\n indexContext: z.string(),\n turns: z.array(DiscoveryTurnSchema),\n outcome: DiscoveryOutcomeSchema,\n seedAssessmentScore: z.number().optional(),\n});\nexport type DiscoveryNegotiation = z.infer<typeof DiscoveryNegotiationSchema>;\n\nexport const DiscoverySummarySchema = z.object({\n totalCandidates: z.number(),\n opportunitiesFound: z.number(),\n noOpportunityCount: z.number(),\n timeoutCount: z.number(),\n roleDistribution: z.record(NegotiationRoleSchema, z.number()),\n});\nexport type DiscoverySummary = {\n totalCandidates: number;\n opportunitiesFound: number;\n noOpportunityCount: number;\n timeoutCount: number;\n roleDistribution: Partial<Record<NegotiationRole, number>>;\n};\n\nexport const DiscoverySourceProfileSchema = z.object({\n name: z.string().optional(),\n bio: z.string().optional(),\n location: z.string().optional(),\n skills: z.array(z.string()).optional(),\n interests: z.array(z.string()).optional(),\n});\nexport type DiscoverySourceProfile = z.infer<typeof DiscoverySourceProfileSchema>;\n\n// ─── Composite input (pure interface — references cross-schema types) ─────────\n\n/**\n * Full input to the question generator.\n * Defined as a pure interface so it can reference DiscoveryNegotiationDigest\n * and ChatContextDigest from sibling schemas without Zod runtime coupling.\n */\nexport interface DiscoveryQuestionInput {\n query: string;\n sourceProfile: DiscoverySourceProfile;\n negotiationDigests: DiscoveryNegotiationDigest[];\n summary: DiscoverySummary;\n chatContext?: ChatContextDigest;\n now: string;\n}"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* McpAuthInput — plain DTO extracted from the MCP HTTP request at the transport
|
|
3
|
+
* edge before the protocol auth resolver is called. Keeps the shared auth
|
|
4
|
+
* interface free of platform-specific `Request` coupling.
|
|
5
|
+
*/
|
|
6
|
+
export interface McpAuthInput {
|
|
7
|
+
/** Authorization Bearer token (JWT or opaque session token). */
|
|
8
|
+
bearerToken?: string;
|
|
9
|
+
/** API key for agent/API-key authentication. */
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
/** Client surface hint for UI branching (telegram vs web). */
|
|
12
|
+
clientSurface?: 'telegram' | 'web';
|
|
13
|
+
/** Telegram handle for identity verification (extracted from request headers). */
|
|
14
|
+
telegramHandle?: string;
|
|
15
|
+
/** Telegram username for identity verification (extracted from request headers). */
|
|
16
|
+
telegramUsername?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mcp-auth.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-auth.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/mcp-auth.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;IACnC,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-auth.schema.js","sourceRoot":"/","sources":["shared/schemas/mcp-auth.schema.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * McpAuthInput — plain DTO extracted from the MCP HTTP request at the transport\n * edge before the protocol auth resolver is called. Keeps the shared auth\n * interface free of platform-specific `Request` coupling.\n */\nexport interface McpAuthInput {\n /** Authorization Bearer token (JWT or opaque session token). */\n bearerToken?: string;\n /** API key for agent/API-key authentication. */\n apiKey?: string;\n /** Client surface hint for UI branching (telegram vs web). */\n clientSurface?: 'telegram' | 'web';\n /** Telegram handle for identity verification (extracted from request headers). */\n telegramHandle?: string;\n /** Telegram username for identity verification (extracted from request headers). */\n telegramUsername?: string;\n}"]}
|
|
@@ -42,7 +42,7 @@ export declare const DiscoveryNegotiationDigestSchema: z.ZodObject<{
|
|
|
42
42
|
counterpartyHint: string;
|
|
43
43
|
indexContext: string;
|
|
44
44
|
outcomeRole: "opportunity" | "no-opportunity";
|
|
45
|
-
outcomeReason: "
|
|
45
|
+
outcomeReason: "stalled" | "rejected" | "timeout" | "turn_cap" | null;
|
|
46
46
|
keyTake: string;
|
|
47
47
|
}, {
|
|
48
48
|
suggestedRoles: {
|
|
@@ -50,7 +50,7 @@ export declare const DiscoveryNegotiationDigestSchema: z.ZodObject<{
|
|
|
50
50
|
otherUser: "agent" | "patient" | "peer";
|
|
51
51
|
} | null;
|
|
52
52
|
outcomeRole: "opportunity" | "no-opportunity";
|
|
53
|
-
outcomeReason: "
|
|
53
|
+
outcomeReason: "stalled" | "rejected" | "timeout" | "turn_cap" | null;
|
|
54
54
|
counterpartyHint?: unknown;
|
|
55
55
|
indexContext?: unknown;
|
|
56
56
|
keyTake?: unknown;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Negotiation state DTOs extracted from negotiation/negotiation.state.ts for
|
|
3
|
+
* consumption by shared interfaces. This shared module owns the DTO schemas;
|
|
4
|
+
* LangGraph Annotation.Root stays in the domain file.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export declare const NegotiationTurnSchema: z.ZodObject<{
|
|
8
|
+
action: z.ZodEnum<["propose", "accept", "reject", "counter", "question"]>;
|
|
9
|
+
assessment: z.ZodObject<{
|
|
10
|
+
reasoning: z.ZodString;
|
|
11
|
+
suggestedRoles: z.ZodObject<{
|
|
12
|
+
ownUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
13
|
+
otherUser: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
ownUser: "agent" | "patient" | "peer";
|
|
16
|
+
otherUser: "agent" | "patient" | "peer";
|
|
17
|
+
}, {
|
|
18
|
+
ownUser: "agent" | "patient" | "peer";
|
|
19
|
+
otherUser: "agent" | "patient" | "peer";
|
|
20
|
+
}>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
reasoning: string;
|
|
23
|
+
suggestedRoles: {
|
|
24
|
+
ownUser: "agent" | "patient" | "peer";
|
|
25
|
+
otherUser: "agent" | "patient" | "peer";
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
reasoning: string;
|
|
29
|
+
suggestedRoles: {
|
|
30
|
+
ownUser: "agent" | "patient" | "peer";
|
|
31
|
+
otherUser: "agent" | "patient" | "peer";
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
37
|
+
assessment: {
|
|
38
|
+
reasoning: string;
|
|
39
|
+
suggestedRoles: {
|
|
40
|
+
ownUser: "agent" | "patient" | "peer";
|
|
41
|
+
otherUser: "agent" | "patient" | "peer";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
message?: string | null | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
action: "propose" | "accept" | "reject" | "counter" | "question";
|
|
47
|
+
assessment: {
|
|
48
|
+
reasoning: string;
|
|
49
|
+
suggestedRoles: {
|
|
50
|
+
ownUser: "agent" | "patient" | "peer";
|
|
51
|
+
otherUser: "agent" | "patient" | "peer";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
message?: string | null | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;
|
|
57
|
+
export declare const NegotiationOutcomeSchema: z.ZodObject<{
|
|
58
|
+
hasOpportunity: z.ZodBoolean;
|
|
59
|
+
agreedRoles: z.ZodArray<z.ZodObject<{
|
|
60
|
+
userId: z.ZodString;
|
|
61
|
+
role: z.ZodEnum<["agent", "patient", "peer"]>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
userId: string;
|
|
64
|
+
role: "agent" | "patient" | "peer";
|
|
65
|
+
}, {
|
|
66
|
+
userId: string;
|
|
67
|
+
role: "agent" | "patient" | "peer";
|
|
68
|
+
}>, "many">;
|
|
69
|
+
reasoning: z.ZodString;
|
|
70
|
+
turnCount: z.ZodNumber;
|
|
71
|
+
reason: z.ZodOptional<z.ZodEnum<["turn_cap", "timeout"]>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
reasoning: string;
|
|
74
|
+
turnCount: number;
|
|
75
|
+
agreedRoles: {
|
|
76
|
+
userId: string;
|
|
77
|
+
role: "agent" | "patient" | "peer";
|
|
78
|
+
}[];
|
|
79
|
+
hasOpportunity: boolean;
|
|
80
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
reasoning: string;
|
|
83
|
+
turnCount: number;
|
|
84
|
+
agreedRoles: {
|
|
85
|
+
userId: string;
|
|
86
|
+
role: "agent" | "patient" | "peer";
|
|
87
|
+
}[];
|
|
88
|
+
hasOpportunity: boolean;
|
|
89
|
+
reason?: "timeout" | "turn_cap" | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
export type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;
|
|
92
|
+
/** Context each agent receives about its user. */
|
|
93
|
+
export interface UserNegotiationContext {
|
|
94
|
+
id: string;
|
|
95
|
+
intents: Array<{
|
|
96
|
+
id: string;
|
|
97
|
+
title: string;
|
|
98
|
+
description: string;
|
|
99
|
+
confidence: number;
|
|
100
|
+
}>;
|
|
101
|
+
profile: {
|
|
102
|
+
name?: string;
|
|
103
|
+
bio?: string;
|
|
104
|
+
location?: string;
|
|
105
|
+
interests?: string[];
|
|
106
|
+
skills?: string[];
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Seed assessment from the evaluator pre-filter. */
|
|
110
|
+
export interface SeedAssessment {
|
|
111
|
+
reasoning: string;
|
|
112
|
+
valencyRole: string;
|
|
113
|
+
actors?: Array<{
|
|
114
|
+
userId: string;
|
|
115
|
+
role: string;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=negotiation-state.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negotiation-state.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvF,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACtG;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Negotiation state DTOs extracted from negotiation/negotiation.state.ts for
|
|
3
|
+
* consumption by shared interfaces. This shared module owns the DTO schemas;
|
|
4
|
+
* LangGraph Annotation.Root stays in the domain file.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
// ─── Zod schemas (available for runtime validation) ───────────────────────────
|
|
8
|
+
export const NegotiationTurnSchema = z.object({
|
|
9
|
+
action: z.enum(["propose", "accept", "reject", "counter", "question"]),
|
|
10
|
+
assessment: z.object({
|
|
11
|
+
reasoning: z.string(),
|
|
12
|
+
suggestedRoles: z.object({
|
|
13
|
+
ownUser: z.enum(["agent", "patient", "peer"]),
|
|
14
|
+
otherUser: z.enum(["agent", "patient", "peer"]),
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
message: z.string().nullable().optional(),
|
|
18
|
+
});
|
|
19
|
+
export const NegotiationOutcomeSchema = z.object({
|
|
20
|
+
hasOpportunity: z.boolean(),
|
|
21
|
+
agreedRoles: z.array(z.object({
|
|
22
|
+
userId: z.string(),
|
|
23
|
+
role: z.enum(["agent", "patient", "peer"]),
|
|
24
|
+
})),
|
|
25
|
+
reasoning: z.string(),
|
|
26
|
+
turnCount: z.number(),
|
|
27
|
+
reason: z.enum(["turn_cap", "timeout"]).optional(),
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=negotiation-state.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"negotiation-state.schema.js","sourceRoot":"/","sources":["shared/schemas/negotiation-state.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACtE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD,CAAC;KACH,CAAC;IACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC,CAAC;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC","sourcesContent":["/**\n * Negotiation state DTOs extracted from negotiation/negotiation.state.ts for\n * consumption by shared interfaces. This shared module owns the DTO schemas;\n * LangGraph Annotation.Root stays in the domain file.\n */\nimport { z } from \"zod\";\n\n// ─── Zod schemas (available for runtime validation) ───────────────────────────\n\nexport const NegotiationTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\", \"question\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\"]).optional(),\n});\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n// ─── Pure interfaces ──────────────────────────────────────────────────────────\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}"]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProfileDocument DTO — pure Zod schema and inferred type.
|
|
3
|
+
* Shared contract for the database/interface layer.
|
|
4
|
+
* The LLM-facing Zod schema with .describe() annotations lives in
|
|
5
|
+
* profile/profile.generator.ts alongside the generator itself.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
export declare const ProfileIdentitySchema: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
bio: z.ZodString;
|
|
11
|
+
location: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
name: string;
|
|
14
|
+
bio: string;
|
|
15
|
+
location: string;
|
|
16
|
+
}, {
|
|
17
|
+
name: string;
|
|
18
|
+
bio: string;
|
|
19
|
+
location: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const ProfileNarrativeSchema: z.ZodObject<{
|
|
22
|
+
context: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
context: string;
|
|
25
|
+
}, {
|
|
26
|
+
context: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const ProfileAttributesSchema: z.ZodObject<{
|
|
29
|
+
interests: z.ZodArray<z.ZodString, "many">;
|
|
30
|
+
skills: z.ZodArray<z.ZodString, "many">;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
interests: string[];
|
|
33
|
+
skills: string[];
|
|
34
|
+
}, {
|
|
35
|
+
interests: string[];
|
|
36
|
+
skills: string[];
|
|
37
|
+
}>;
|
|
38
|
+
export declare const ProfileDocumentSchema: z.ZodObject<{
|
|
39
|
+
userId: z.ZodString;
|
|
40
|
+
identity: z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
bio: z.ZodString;
|
|
43
|
+
location: z.ZodString;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
name: string;
|
|
46
|
+
bio: string;
|
|
47
|
+
location: string;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
bio: string;
|
|
51
|
+
location: string;
|
|
52
|
+
}>;
|
|
53
|
+
narrative: z.ZodObject<{
|
|
54
|
+
context: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
context: string;
|
|
57
|
+
}, {
|
|
58
|
+
context: string;
|
|
59
|
+
}>;
|
|
60
|
+
attributes: z.ZodObject<{
|
|
61
|
+
interests: z.ZodArray<z.ZodString, "many">;
|
|
62
|
+
skills: z.ZodArray<z.ZodString, "many">;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
interests: string[];
|
|
65
|
+
skills: string[];
|
|
66
|
+
}, {
|
|
67
|
+
interests: string[];
|
|
68
|
+
skills: string[];
|
|
69
|
+
}>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
userId: string;
|
|
72
|
+
identity: {
|
|
73
|
+
name: string;
|
|
74
|
+
bio: string;
|
|
75
|
+
location: string;
|
|
76
|
+
};
|
|
77
|
+
narrative: {
|
|
78
|
+
context: string;
|
|
79
|
+
};
|
|
80
|
+
attributes: {
|
|
81
|
+
interests: string[];
|
|
82
|
+
skills: string[];
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
userId: string;
|
|
86
|
+
identity: {
|
|
87
|
+
name: string;
|
|
88
|
+
bio: string;
|
|
89
|
+
location: string;
|
|
90
|
+
};
|
|
91
|
+
narrative: {
|
|
92
|
+
context: string;
|
|
93
|
+
};
|
|
94
|
+
attributes: {
|
|
95
|
+
interests: string[];
|
|
96
|
+
skills: string[];
|
|
97
|
+
};
|
|
98
|
+
}>;
|
|
99
|
+
export type ProfileDocument = z.infer<typeof ProfileDocumentSchema>;
|
|
100
|
+
//# sourceMappingURL=profile.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/profile.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProfileDocument DTO — pure Zod schema and inferred type.
|
|
3
|
+
* Shared contract for the database/interface layer.
|
|
4
|
+
* The LLM-facing Zod schema with .describe() annotations lives in
|
|
5
|
+
* profile/profile.generator.ts alongside the generator itself.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
export const ProfileIdentitySchema = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
bio: z.string(),
|
|
11
|
+
location: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export const ProfileNarrativeSchema = z.object({
|
|
14
|
+
context: z.string(),
|
|
15
|
+
});
|
|
16
|
+
export const ProfileAttributesSchema = z.object({
|
|
17
|
+
interests: z.array(z.string()),
|
|
18
|
+
skills: z.array(z.string()),
|
|
19
|
+
});
|
|
20
|
+
export const ProfileDocumentSchema = z.object({
|
|
21
|
+
userId: z.string(),
|
|
22
|
+
identity: ProfileIdentitySchema,
|
|
23
|
+
narrative: ProfileNarrativeSchema,
|
|
24
|
+
attributes: ProfileAttributesSchema,
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=profile.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.schema.js","sourceRoot":"/","sources":["shared/schemas/profile.schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,qBAAqB;IAC/B,SAAS,EAAE,sBAAsB;IACjC,UAAU,EAAE,uBAAuB;CACpC,CAAC,CAAC","sourcesContent":["/**\n * ProfileDocument DTO — pure Zod schema and inferred type.\n * Shared contract for the database/interface layer.\n * The LLM-facing Zod schema with .describe() annotations lives in\n * profile/profile.generator.ts alongside the generator itself.\n */\nimport { z } from \"zod\";\n\nexport const ProfileIdentitySchema = z.object({\n name: z.string(),\n bio: z.string(),\n location: z.string(),\n});\n\nexport const ProfileNarrativeSchema = z.object({\n context: z.string(),\n});\n\nexport const ProfileAttributesSchema = z.object({\n interests: z.array(z.string()),\n skills: z.array(z.string()),\n});\n\nexport const ProfileDocumentSchema = z.object({\n userId: z.string(),\n identity: ProfileIdentitySchema,\n narrative: ProfileNarrativeSchema,\n attributes: ProfileAttributesSchema,\n});\n\nexport type ProfileDocument = z.infer<typeof ProfileDocumentSchema>;"]}
|