@indexnetwork/protocol 0.31.0-rc.119.1 → 0.33.0-rc.121.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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcp.server.d.ts.map +1 -1
- package/dist/mcp/mcp.server.js +5 -2
- package/dist/mcp/mcp.server.js.map +1 -1
- package/dist/opportunity/opportunity.tools.d.ts +1 -0
- package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
- package/dist/opportunity/opportunity.tools.js +4 -0
- package/dist/opportunity/opportunity.tools.js.map +1 -1
- package/dist/opportunity/question.generator.d.ts +14 -0
- package/dist/opportunity/question.generator.d.ts.map +1 -0
- package/dist/opportunity/question.generator.js +113 -0
- package/dist/opportunity/question.generator.js.map +1 -0
- package/dist/opportunity/question.prompt.d.ts +84 -0
- package/dist/opportunity/question.prompt.d.ts.map +1 -0
- package/dist/opportunity/question.prompt.js +170 -0
- package/dist/opportunity/question.prompt.js.map +1 -0
- package/dist/shared/agent/model.config.d.ts +5 -0
- package/dist/shared/agent/model.config.d.ts.map +1 -1
- package/dist/shared/agent/model.config.js +1 -0
- package/dist/shared/agent/model.config.js.map +1 -1
- package/dist/shared/agent/tool.helpers.d.ts +8 -0
- 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/auth.interface.d.ts +17 -6
- package/dist/shared/interfaces/auth.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/connect-link.interface.d.ts +8 -1
- package/dist/shared/interfaces/connect-link.interface.d.ts.map +1 -1
- package/dist/shared/schemas/question.schema.d.ts +182 -0
- package/dist/shared/schemas/question.schema.d.ts.map +1 -0
- package/dist/shared/schemas/question.schema.js +41 -0
- package/dist/shared/schemas/question.schema.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Question — public structured shape consumed by frontend renderers and MCP
|
|
3
|
+
* elicitation dispatch. Mirrors the brainstorming AskUserQuestion skill so a
|
|
4
|
+
* Question can be rendered identically across surfaces.
|
|
5
|
+
*
|
|
6
|
+
* `QuestionWithStrategy` extends the public shape with an internal `strategy`
|
|
7
|
+
* tag used by the generator's guardrails (dedup/diversity) and recorded in
|
|
8
|
+
* `debugMeta`. The tag is stripped before the public payload leaves the
|
|
9
|
+
* generator — users never see it.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
export declare const QuestionOptionSchema: z.ZodObject<{
|
|
13
|
+
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
14
|
+
label: z.ZodString;
|
|
15
|
+
/** Explains the consequence of choosing this option, not just its definition. */
|
|
16
|
+
description: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
description: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}, {
|
|
21
|
+
description: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const QuestionSchema: z.ZodObject<{
|
|
25
|
+
/** ≤12 chars. Noun of the decision domain — e.g. "Stage", "Timing", "Role". */
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
/** ≤2 sentences, ≤400 chars. Ends in a question mark. */
|
|
28
|
+
prompt: z.ZodString;
|
|
29
|
+
/** 2–4 options. No explicit "Other" — clients provide that automatically. */
|
|
30
|
+
options: z.ZodArray<z.ZodObject<{
|
|
31
|
+
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
32
|
+
label: z.ZodString;
|
|
33
|
+
/** Explains the consequence of choosing this option, not just its definition. */
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
description: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}, {
|
|
39
|
+
description: string;
|
|
40
|
+
label: string;
|
|
41
|
+
}>, "many">;
|
|
42
|
+
/** True when options are not mutually exclusive (priorities, bundles). */
|
|
43
|
+
multiSelect: z.ZodBoolean;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
prompt: string;
|
|
46
|
+
options: {
|
|
47
|
+
description: string;
|
|
48
|
+
label: string;
|
|
49
|
+
}[];
|
|
50
|
+
title: string;
|
|
51
|
+
multiSelect: boolean;
|
|
52
|
+
}, {
|
|
53
|
+
prompt: string;
|
|
54
|
+
options: {
|
|
55
|
+
description: string;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
title: string;
|
|
59
|
+
multiSelect: boolean;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const QuestionStrategySchema: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
|
|
62
|
+
export declare const QuestionWithStrategySchema: z.ZodObject<{
|
|
63
|
+
/** ≤12 chars. Noun of the decision domain — e.g. "Stage", "Timing", "Role". */
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
/** ≤2 sentences, ≤400 chars. Ends in a question mark. */
|
|
66
|
+
prompt: z.ZodString;
|
|
67
|
+
/** 2–4 options. No explicit "Other" — clients provide that automatically. */
|
|
68
|
+
options: z.ZodArray<z.ZodObject<{
|
|
69
|
+
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
70
|
+
label: z.ZodString;
|
|
71
|
+
/** Explains the consequence of choosing this option, not just its definition. */
|
|
72
|
+
description: z.ZodString;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
description: string;
|
|
75
|
+
label: string;
|
|
76
|
+
}, {
|
|
77
|
+
description: string;
|
|
78
|
+
label: string;
|
|
79
|
+
}>, "many">;
|
|
80
|
+
/** True when options are not mutually exclusive (priorities, bundles). */
|
|
81
|
+
multiSelect: z.ZodBoolean;
|
|
82
|
+
} & {
|
|
83
|
+
strategy: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
prompt: string;
|
|
86
|
+
options: {
|
|
87
|
+
description: string;
|
|
88
|
+
label: string;
|
|
89
|
+
}[];
|
|
90
|
+
title: string;
|
|
91
|
+
multiSelect: boolean;
|
|
92
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
93
|
+
}, {
|
|
94
|
+
prompt: string;
|
|
95
|
+
options: {
|
|
96
|
+
description: string;
|
|
97
|
+
label: string;
|
|
98
|
+
}[];
|
|
99
|
+
title: string;
|
|
100
|
+
multiSelect: boolean;
|
|
101
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
102
|
+
}>;
|
|
103
|
+
export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
|
|
104
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
105
|
+
/** ≤12 chars. Noun of the decision domain — e.g. "Stage", "Timing", "Role". */
|
|
106
|
+
title: z.ZodString;
|
|
107
|
+
/** ≤2 sentences, ≤400 chars. Ends in a question mark. */
|
|
108
|
+
prompt: z.ZodString;
|
|
109
|
+
/** 2–4 options. No explicit "Other" — clients provide that automatically. */
|
|
110
|
+
options: z.ZodArray<z.ZodObject<{
|
|
111
|
+
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
112
|
+
label: z.ZodString;
|
|
113
|
+
/** Explains the consequence of choosing this option, not just its definition. */
|
|
114
|
+
description: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
description: string;
|
|
117
|
+
label: string;
|
|
118
|
+
}, {
|
|
119
|
+
description: string;
|
|
120
|
+
label: string;
|
|
121
|
+
}>, "many">;
|
|
122
|
+
/** True when options are not mutually exclusive (priorities, bundles). */
|
|
123
|
+
multiSelect: z.ZodBoolean;
|
|
124
|
+
} & {
|
|
125
|
+
strategy: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
prompt: string;
|
|
128
|
+
options: {
|
|
129
|
+
description: string;
|
|
130
|
+
label: string;
|
|
131
|
+
}[];
|
|
132
|
+
title: string;
|
|
133
|
+
multiSelect: boolean;
|
|
134
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
135
|
+
}, {
|
|
136
|
+
prompt: string;
|
|
137
|
+
options: {
|
|
138
|
+
description: string;
|
|
139
|
+
label: string;
|
|
140
|
+
}[];
|
|
141
|
+
title: string;
|
|
142
|
+
multiSelect: boolean;
|
|
143
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
144
|
+
}>, "many">;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
questions: {
|
|
147
|
+
prompt: string;
|
|
148
|
+
options: {
|
|
149
|
+
description: string;
|
|
150
|
+
label: string;
|
|
151
|
+
}[];
|
|
152
|
+
title: string;
|
|
153
|
+
multiSelect: boolean;
|
|
154
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
155
|
+
}[];
|
|
156
|
+
}, {
|
|
157
|
+
questions: {
|
|
158
|
+
prompt: string;
|
|
159
|
+
options: {
|
|
160
|
+
description: string;
|
|
161
|
+
label: string;
|
|
162
|
+
}[];
|
|
163
|
+
title: string;
|
|
164
|
+
multiSelect: boolean;
|
|
165
|
+
strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
|
|
166
|
+
}[];
|
|
167
|
+
}>;
|
|
168
|
+
export type QuestionOption = z.infer<typeof QuestionOptionSchema>;
|
|
169
|
+
export type Question = z.infer<typeof QuestionSchema>;
|
|
170
|
+
export type QuestionStrategy = z.infer<typeof QuestionStrategySchema>;
|
|
171
|
+
export type QuestionWithStrategy = z.infer<typeof QuestionWithStrategySchema>;
|
|
172
|
+
export type QuestionGeneratorResponse = z.infer<typeof QuestionGeneratorResponseSchema>;
|
|
173
|
+
/**
|
|
174
|
+
* Internal generator output: public questions plus a parallel strategies
|
|
175
|
+
* array for debug-only consumption. The generator emits this; callers
|
|
176
|
+
* forward `questions` to renderers and `strategies` to `debugMeta` only.
|
|
177
|
+
*/
|
|
178
|
+
export interface QuestionGenerationResult {
|
|
179
|
+
questions: Question[];
|
|
180
|
+
strategies: QuestionStrategy[];
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=question.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.schema.d.ts","sourceRoot":"","sources":["../../../src/shared/schemas/question.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;IAC/B,+EAA+E;;IAE/E,iFAAiF;;;;;;;;EAEjF,CAAC;AAEH,eAAO,MAAM,cAAc;IACzB,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;;;;;;;;;;;;;;;;;EAE1E,CAAC;AAEH,eAAO,MAAM,sBAAsB,oIAMjC,CAAC;AAEH,eAAO,MAAM,0BAA0B;IAlBrC,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;;;;;;;;;;;;;;;;;;;;;EAc1E,CAAC;AAEH,eAAO,MAAM,+BAA+B;;QAtB1C,+EAA+E;;QAE/E,yDAAyD;;QAEzD,6EAA6E;;YAX7E,+EAA+E;;YAE/E,iFAAiF;;;;;;;;;QAWjF,0EAA0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB1E,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Question — public structured shape consumed by frontend renderers and MCP
|
|
3
|
+
* elicitation dispatch. Mirrors the brainstorming AskUserQuestion skill so a
|
|
4
|
+
* Question can be rendered identically across surfaces.
|
|
5
|
+
*
|
|
6
|
+
* `QuestionWithStrategy` extends the public shape with an internal `strategy`
|
|
7
|
+
* tag used by the generator's guardrails (dedup/diversity) and recorded in
|
|
8
|
+
* `debugMeta`. The tag is stripped before the public payload leaves the
|
|
9
|
+
* generator — users never see it.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
export const QuestionOptionSchema = z.object({
|
|
13
|
+
/** Display text. Suffix " (Recommended)" on the safest path; list it first. */
|
|
14
|
+
label: z.string().min(1).max(120),
|
|
15
|
+
/** Explains the consequence of choosing this option, not just its definition. */
|
|
16
|
+
description: z.string().min(1).max(280),
|
|
17
|
+
});
|
|
18
|
+
export const QuestionSchema = z.object({
|
|
19
|
+
/** ≤12 chars. Noun of the decision domain — e.g. "Stage", "Timing", "Role". */
|
|
20
|
+
title: z.string().min(1).max(12),
|
|
21
|
+
/** ≤2 sentences, ≤400 chars. Ends in a question mark. */
|
|
22
|
+
prompt: z.string().min(1).max(400),
|
|
23
|
+
/** 2–4 options. No explicit "Other" — clients provide that automatically. */
|
|
24
|
+
options: z.array(QuestionOptionSchema).min(2).max(4),
|
|
25
|
+
/** True when options are not mutually exclusive (priorities, bundles). */
|
|
26
|
+
multiSelect: z.boolean(),
|
|
27
|
+
});
|
|
28
|
+
export const QuestionStrategySchema = z.enum([
|
|
29
|
+
"refine_intent",
|
|
30
|
+
"surface_missing_detail",
|
|
31
|
+
"open_adjacent_thread",
|
|
32
|
+
"reflective_summary",
|
|
33
|
+
"surface_emergent_knowledge",
|
|
34
|
+
]);
|
|
35
|
+
export const QuestionWithStrategySchema = QuestionSchema.extend({
|
|
36
|
+
strategy: QuestionStrategySchema,
|
|
37
|
+
});
|
|
38
|
+
export const QuestionGeneratorResponseSchema = z.object({
|
|
39
|
+
questions: z.array(QuestionWithStrategySchema).max(3),
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=question.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.schema.js","sourceRoot":"","sources":["../../../src/shared/schemas/question.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,+EAA+E;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,iFAAiF;IACjF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,+EAA+E;IAC/E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChC,yDAAyD;IACzD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAClC,6EAA6E;IAC7E,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,0EAA0E;IAC1E,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,eAAe;IACf,wBAAwB;IACxB,sBAAsB;IACtB,oBAAoB;IACpB,4BAA4B;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC,MAAM,CAAC;IAC9D,QAAQ,EAAE,sBAAsB;CACjC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACtD,CAAC,CAAC"}
|