@indexnetwork/protocol 66.0.0-rc.645.1 → 66.0.0-rc.646.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
CHANGED
|
@@ -33,7 +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 type { IntentSuggestion, IntentSuggestionInput } from "./internal/intents/intent.suggester.js";
|
|
36
|
+
export type { IntentSuggestion, IntentSuggestionInput, IntentSuggestions } from "./internal/intents/intent.suggester.js";
|
|
37
37
|
export { normalizeTelegramHandle } from './internal/shared/utils/telegram-handle.js';
|
|
38
38
|
/**
|
|
39
39
|
* opportunity — the capability's sole cross-capability surface.
|
|
@@ -2,12 +2,15 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const IntentSuggestionOutputSchema: z.ZodObject<{
|
|
3
3
|
lookingFor: z.ZodArray<z.ZodString, "many">;
|
|
4
4
|
offering: z.ZodString;
|
|
5
|
+
examples: z.ZodArray<z.ZodString, "many">;
|
|
5
6
|
}, "strip", z.ZodTypeAny, {
|
|
6
7
|
lookingFor: string[];
|
|
7
8
|
offering: string;
|
|
9
|
+
examples: string[];
|
|
8
10
|
}, {
|
|
9
11
|
lookingFor: string[];
|
|
10
12
|
offering: string;
|
|
13
|
+
examples: string[];
|
|
11
14
|
}>;
|
|
12
15
|
export interface IntentSuggestionInput {
|
|
13
16
|
name: string | null;
|
|
@@ -21,6 +24,11 @@ export interface IntentSuggestion {
|
|
|
21
24
|
kind: "looking_for" | "offering";
|
|
22
25
|
text: string;
|
|
23
26
|
}
|
|
27
|
+
/** The picks, plus the example starters rewritten for this person. */
|
|
28
|
+
export interface IntentSuggestions {
|
|
29
|
+
suggestions: IntentSuggestion[];
|
|
30
|
+
examples: string[];
|
|
31
|
+
}
|
|
24
32
|
/**
|
|
25
33
|
* Suggests a new member's first intents from their profile: two they might be
|
|
26
34
|
* looking for and one they could offer. Follows the shared agent pattern:
|
|
@@ -31,7 +39,7 @@ export declare class IntentSuggester {
|
|
|
31
39
|
constructor();
|
|
32
40
|
/**
|
|
33
41
|
* @param input - The person's profile and their active intents.
|
|
34
|
-
* @returns Two "looking_for" suggestions then one "offering",
|
|
42
|
+
* @returns Two "looking_for" suggestions then one "offering", with the rewritten examples; null when the call fails.
|
|
35
43
|
*/
|
|
36
|
-
invoke(input: IntentSuggestionInput): Promise<
|
|
44
|
+
invoke(input: IntentSuggestionInput): Promise<IntentSuggestions | null>;
|
|
37
45
|
}
|
|
@@ -22,6 +22,9 @@ export const IntentSuggestionOutputSchema = z.object({
|
|
|
22
22
|
.array(SuggestionText)
|
|
23
23
|
.describe("Exactly two things they might want: someone to learn from, hire, fund, build with, or meet."),
|
|
24
24
|
offering: SuggestionText.describe("One thing they could offer others: their skills, capital, time, or help."),
|
|
25
|
+
examples: z
|
|
26
|
+
.array(z.string().describe("One line, at most 110 characters, lowercase, no trailing period."))
|
|
27
|
+
.describe("Five to seven of the example starters, rewritten for this person in the same casual shape."),
|
|
25
28
|
});
|
|
26
29
|
// ─── Logger ───────────────────────────────────────────────────────────────────
|
|
27
30
|
const logger = log.lib.from("IntentSuggester");
|
|
@@ -39,11 +42,32 @@ RULES:
|
|
|
39
42
|
- Write each in their voice, first person implied, like they would type it:
|
|
40
43
|
"looking for a technical cofounder who has shipped ml in production",
|
|
41
44
|
"happy to give early founders feedback on their go-to-market".
|
|
42
|
-
- Ground every suggestion in the profile: their
|
|
43
|
-
|
|
45
|
+
- Ground every suggestion in the profile: their role and field. What we found may be old, so
|
|
46
|
+
stay at that level: never name a company, product, fund, school, or city, and leave out
|
|
47
|
+
details that go stale (stage, round, team size, dates). Do not invent facts.
|
|
44
48
|
- One line each, at most 90 characters, lowercase, no trailing period, no emoji, no em dashes.
|
|
45
49
|
- Skip anything that repeats one of their existing intents.
|
|
46
50
|
- If the profile says little, still give three plausible, specific starting points.
|
|
51
|
+
|
|
52
|
+
EXAMPLES:
|
|
53
|
+
Also rewrite these generic starters for this person, keeping their short, casual
|
|
54
|
+
"situation, want ..." shape:
|
|
55
|
+
- traveling soon, want to meet cool people in ai
|
|
56
|
+
- building something, want honest feedback on it
|
|
57
|
+
- just launched, want cool people to try it
|
|
58
|
+
- new in town, want to find my people
|
|
59
|
+
- raising soon, want to meet investors who get it
|
|
60
|
+
- hiring soon, want to meet great people early
|
|
61
|
+
- have an idea, want someone to build it with
|
|
62
|
+
Give each a light touch so it feels like theirs: swap the generic part for their broad field or
|
|
63
|
+
role, nothing more. A founder in agent infrastructure might get "traveling soon, want to meet people
|
|
64
|
+
building or investing in agents". Same limits as above: no company, product, fund, school, or city
|
|
65
|
+
names, and nothing that would go stale. Keep them short and loose; one field word is usually enough.
|
|
66
|
+
Swap any that do not fit their role for one that does: an investor does not raise, so "raising soon"
|
|
67
|
+
becomes something like "deploying capital, want to meet founders in <their broad focus>"; someone who
|
|
68
|
+
is not building does not launch. Drop any you cannot make fit, but always keep the traveling one.
|
|
69
|
+
Return five to seven, each at most 90 characters, lowercase, no trailing period, no emoji, no em
|
|
70
|
+
dashes, and none that repeat the three suggestions above.
|
|
47
71
|
`;
|
|
48
72
|
// ─── Agent class ──────────────────────────────────────────────────────────────
|
|
49
73
|
/**
|
|
@@ -59,7 +83,7 @@ export class IntentSuggester {
|
|
|
59
83
|
}
|
|
60
84
|
/**
|
|
61
85
|
* @param input - The person's profile and their active intents.
|
|
62
|
-
* @returns Two "looking_for" suggestions then one "offering",
|
|
86
|
+
* @returns Two "looking_for" suggestions then one "offering", with the rewritten examples; null when the call fails.
|
|
63
87
|
*/
|
|
64
88
|
async invoke(input) {
|
|
65
89
|
const clean = (text, max) => (text ?? "").replace(/\s+/g, " ").trim().slice(0, max);
|
|
@@ -81,10 +105,13 @@ export class IntentSuggester {
|
|
|
81
105
|
const offering = tidy(parsed.data.offering);
|
|
82
106
|
if (lookingFor.length < 2 || !offering)
|
|
83
107
|
return null;
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
108
|
+
return {
|
|
109
|
+
suggestions: [
|
|
110
|
+
...lookingFor.map((text) => ({ kind: "looking_for", text })),
|
|
111
|
+
{ kind: "offering", text: offering },
|
|
112
|
+
],
|
|
113
|
+
examples: parsed.data.examples.map(tidy).filter((text) => text && text.length <= 140).slice(0, 7),
|
|
114
|
+
};
|
|
88
115
|
}
|
|
89
116
|
catch (error) {
|
|
90
117
|
logger.error("Error during execution", { error });
|