@clubnet/seedclub 0.2.47 → 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,7 +96,33 @@ 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) {
106
+ let sourceFlowPending = false;
107
+
108
+ pi.on("before_agent_start", async (event) => {
109
+ const shouldStartSourceFlow = sourceFlowPending || isLikelyDealSourcingPrompt(event.prompt);
110
+ if (!shouldStartSourceFlow) return;
111
+ sourceFlowPending = false;
112
+ return {
113
+ systemPrompt: `${event.systemPrompt}
114
+
115
+ ## Active /source Deal Sourcing Flow
116
+
117
+ The user started the source-a-deal flow. Treat their current message as the first sourcing submission.
118
+
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.
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.
121
+ - After showing extracted details, ask the user to correct or add the missing mandatory sourcing context needed to make the intro: company name, founder name(s), founder or company contact path, how the user knows the founder, why the user is excited or willing to vouch, the round ask or explicit ask unknown, and any timing or intro constraints.
122
+ - Keep this workflow concise. Do not present it as source-backed research or a diligence report.`,
123
+ };
124
+ });
125
+
100
126
  pi.registerCommand("connect", {
101
127
  description: "Connect your Seed Club account",
102
128
  handler: async (args, ctx) => {
@@ -190,9 +216,12 @@ export function registerSeedclubCommand(pi: ExtensionAPI, deps: SeedclubDeps) {
190
216
  description: "Source a deal to the network",
191
217
  handler: async (_args, ctx) => {
192
218
  await ctx.waitForIdle();
193
- pi.sendUserMessage(
194
- "I want to source a deal to Seed Club. Ask me for the deck or memo and why I am excited about it. Do not ask the rest of the sourcing questions yet. After I provide the deck or memo, read it, extract the sourcing details you can find, and display those details back for confirmation. Then ask me to correct or add the missing mandatory sourcing context needed to make the intro: company name, founder name(s), founder or company contact path, how I know the founder, why I am excited or willing to vouch, the round ask or explicit ask unknown, and any timing or intro constraints.",
195
- );
219
+ sourceFlowPending = true;
220
+ pi.sendMessage({
221
+ customType: "seedclub_source",
222
+ content: "Send me the deck or memo, and tell me why you are excited about it.",
223
+ display: true,
224
+ });
196
225
  },
197
226
  });
198
227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clubnet/seedclub",
3
- "version": "0.2.47",
3
+ "version": "0.2.50",
4
4
  "description": "A branded command-line agent wrapper around pi, with integrated Seed Club commands, tools, and app actions",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -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");