@clubnet/seedclub 0.2.48 → 0.2.50
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.
|
@@ -96,18 +96,25 @@ async function showCalendarMenu(ctx: any, deps: SeedclubDeps) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
function isLikelyDealSourcingPrompt(prompt: string) {
|
|
100
|
+
const text = prompt.trim().toLowerCase();
|
|
101
|
+
if (!text) return false;
|
|
102
|
+
return /\b(?:i\s+want\s+to|i'?d\s+like\s+to|let'?s|help\s+me|can\s+we|ready\s+to)?\s*source\s+(?:this|the|a)\s+deal\s+(?:to|for)\s+(?:the\s+)?network\b/.test(text);
|
|
103
|
+
}
|
|
104
|
+
|
|
99
105
|
export function registerSeedclubCommand(pi: ExtensionAPI, deps: SeedclubDeps) {
|
|
100
106
|
let sourceFlowPending = false;
|
|
101
107
|
|
|
102
108
|
pi.on("before_agent_start", async (event) => {
|
|
103
|
-
|
|
109
|
+
const shouldStartSourceFlow = sourceFlowPending || isLikelyDealSourcingPrompt(event.prompt);
|
|
110
|
+
if (!shouldStartSourceFlow) return;
|
|
104
111
|
sourceFlowPending = false;
|
|
105
112
|
return {
|
|
106
113
|
systemPrompt: `${event.systemPrompt}
|
|
107
114
|
|
|
108
115
|
## Active /source Deal Sourcing Flow
|
|
109
116
|
|
|
110
|
-
The user started
|
|
117
|
+
The user started the source-a-deal flow. Treat their current message as the first sourcing submission.
|
|
111
118
|
|
|
112
119
|
- If they have not provided a deck or memo, ask for the deck or memo and why they are excited. Do not ask the rest of the sourcing questions yet.
|
|
113
120
|
- If they provided a deck or memo, read it with the Seed Club document reader, extract the sourcing details you can find, and display those extracted details back for confirmation.
|
package/package.json
CHANGED
|
@@ -1040,6 +1040,13 @@ function isSeedclubCommand(command) {
|
|
|
1040
1040
|
return typeof sourcePath === "string" && sourcePath.includes("/extensions/seedclub/");
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
+
function getSlashCommandName(text) {
|
|
1044
|
+
if (!text.startsWith("/")) return null;
|
|
1045
|
+
const spaceIndex = text.indexOf(" ");
|
|
1046
|
+
const name = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
|
|
1047
|
+
return name || null;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1043
1050
|
function formatCommandList(commands) {
|
|
1044
1051
|
return commands
|
|
1045
1052
|
.filter((command) => shouldShowCommandInList(command.name))
|
|
@@ -2350,6 +2357,13 @@ export class SeedclubInteractiveModeApp {
|
|
|
2350
2357
|
}
|
|
2351
2358
|
|
|
2352
2359
|
try {
|
|
2360
|
+
if (this.isExtensionSlashCommand(value)) {
|
|
2361
|
+
this.chat.addChild(new UserMessageComponent(value));
|
|
2362
|
+
this.ui.requestRender();
|
|
2363
|
+
await this.session.prompt(text);
|
|
2364
|
+
this.clearTransientStatus();
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2353
2367
|
this.setStatus("Submitting prompt...", "accent", { animate: true });
|
|
2354
2368
|
await this.session.prompt(text);
|
|
2355
2369
|
} catch (error) {
|
|
@@ -2360,6 +2374,12 @@ export class SeedclubInteractiveModeApp {
|
|
|
2360
2374
|
}
|
|
2361
2375
|
}
|
|
2362
2376
|
|
|
2377
|
+
isExtensionSlashCommand(value) {
|
|
2378
|
+
const commandName = getSlashCommandName(value);
|
|
2379
|
+
if (!commandName) return false;
|
|
2380
|
+
return Boolean(this.session.extensionRunner?.getCommand?.(commandName));
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2363
2383
|
async runLocalShell(command) {
|
|
2364
2384
|
if (!command) {
|
|
2365
2385
|
this.setStatus("Shell command is empty.", "warning");
|