vibebusiness 1.2.65 → 1.2.68
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +19 -19
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/api/investor-updates/generate/route.js +1 -1
- package/.next/standalone/.next/server/app/api/investor-updates/generate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js +1 -1
- package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/goals/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ideas/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +1 -1
- package/.next/standalone/.next/server/app/social/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/social.html +1 -1
- package/.next/standalone/.next/server/app/social.rsc +1 -1
- package/.next/standalone/.next/server/app/updates/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/updates/new/page.js +1 -1
- package/.next/standalone/.next/server/app/updates/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/updates/new.html +1 -1
- package/.next/standalone/.next/server/app/updates/new.rsc +2 -2
- package/.next/standalone/.next/server/app/updates/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +13 -13
- package/.next/standalone/.next/server/chunks/{7599.js → 3794.js} +33 -25
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/data/business-context.json +1 -1
- package/.next/standalone/data/goals.json +93 -12
- package/.next/standalone/data/ideas.json +58 -17
- package/.next/standalone/data/implementations.json +53 -0
- package/.next/standalone/data/social.json +49 -1
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/investor-update.ts +249 -12
- package/.next/standalone/scripts/skills/social-media.ts +239 -34
- package/.next/static/chunks/app/updates/new/page-dcc67ffca587dcc2.js +1 -0
- package/dist/scripts/heartbeat.js +205 -30
- package/dist/scripts/social-routine.js +205 -30
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/1685.js +0 -6
- package/.next/standalone/.next/server/chunks/7564.js +0 -81
- package/.next/standalone/scripts/skills/investor-update.ts +0 -476
- package/.next/static/chunks/app/updates/new/page-c518fba0d9ffae98.js +0 -1
- /package/.next/static/{yXi8K8u58qskYid0oHU5f → Gsf15cMKd-7htpbN5eZHd}/_buildManifest.js +0 -0
- /package/.next/static/{yXi8K8u58qskYid0oHU5f → Gsf15cMKd-7htpbN5eZHd}/_ssgManifest.js +0 -0
|
@@ -7945,16 +7945,16 @@ async function executeSocialTask(taskId, description, _businessContext) {
|
|
|
7945
7945
|
return executeDraftShipVisual();
|
|
7946
7946
|
}
|
|
7947
7947
|
if (taskId === "social-draft-ship") {
|
|
7948
|
-
return executeDraftShip();
|
|
7948
|
+
return await executeDraftShip();
|
|
7949
7949
|
}
|
|
7950
7950
|
if (taskId === "social-draft-update") {
|
|
7951
|
-
return executeDraftUpdate();
|
|
7951
|
+
return await executeDraftUpdate();
|
|
7952
7952
|
}
|
|
7953
7953
|
if (taskId === "social-draft-milestone") {
|
|
7954
|
-
return executeDraftMilestone();
|
|
7954
|
+
return await executeDraftMilestone();
|
|
7955
7955
|
}
|
|
7956
7956
|
if (taskId === "social-draft-digest") {
|
|
7957
|
-
return executeDraftDigest();
|
|
7957
|
+
return await executeDraftDigest();
|
|
7958
7958
|
}
|
|
7959
7959
|
if (taskId.startsWith("social-draft-viral-")) {
|
|
7960
7960
|
const topic = taskId.replace("social-draft-viral-", "");
|
|
@@ -8279,23 +8279,52 @@ async function executeSetupX() {
|
|
|
8279
8279
|
output: `Connected to X as ${userInfo.username} (${userInfo.followersCount ?? 0} followers)`
|
|
8280
8280
|
};
|
|
8281
8281
|
}
|
|
8282
|
-
function executeDraftShip() {
|
|
8282
|
+
async function executeDraftShip() {
|
|
8283
8283
|
const state = loadState();
|
|
8284
|
-
|
|
8285
|
-
|
|
8284
|
+
let allIdeas = [];
|
|
8285
|
+
try {
|
|
8286
|
+
const { ideas } = JSON.parse(fs8.readFileSync(IDEAS_FILE, "utf-8"));
|
|
8287
|
+
allIdeas = ideas;
|
|
8288
|
+
} catch {
|
|
8289
|
+
return { success: false, output: "Could not read ideas.json." };
|
|
8290
|
+
}
|
|
8291
|
+
const latestShipped = allIdeas.filter((i) => i.stage === "shipped").sort((a, b) => b.updated_at.localeCompare(a.updated_at))[0];
|
|
8292
|
+
if (!latestShipped) {
|
|
8286
8293
|
return { success: false, output: "No shipped ideas found to generate a tweet from." };
|
|
8287
8294
|
}
|
|
8288
|
-
|
|
8289
|
-
path4.join(path4.dirname(SOCIAL_FILE), "ideas.json"),
|
|
8290
|
-
"utf-8"
|
|
8291
|
-
));
|
|
8292
|
-
const latestShipped = ideas.filter((i) => i.stage === "shipped").sort((a, b) => b.updated_at.localeCompare(a.updated_at))[0];
|
|
8293
|
-
if (latestShipped && hasDraftOrPublished(state, latestShipped.id)) {
|
|
8295
|
+
if (hasDraftOrPublished(state, latestShipped.id)) {
|
|
8294
8296
|
return { success: false, output: `Draft already exists for shipped idea ${latestShipped.id}` };
|
|
8295
8297
|
}
|
|
8296
|
-
|
|
8298
|
+
let text;
|
|
8299
|
+
let hookType;
|
|
8300
|
+
let estimatedEngagement;
|
|
8301
|
+
try {
|
|
8302
|
+
const context = buildShipContext(latestShipped);
|
|
8303
|
+
let positioning = null;
|
|
8304
|
+
try {
|
|
8305
|
+
if (fs8.existsSync(POSITIONING_FILE)) {
|
|
8306
|
+
positioning = JSON.parse(fs8.readFileSync(POSITIONING_FILE, "utf-8"));
|
|
8307
|
+
}
|
|
8308
|
+
} catch {
|
|
8309
|
+
}
|
|
8310
|
+
const pastPerformance = collectEngagementHistory(state);
|
|
8311
|
+
const result = await generateViralTweet({ topic: "ship", context, positioning, pastPerformance });
|
|
8312
|
+
text = result.text;
|
|
8313
|
+
hookType = result.hook_type;
|
|
8314
|
+
estimatedEngagement = result.estimated_engagement;
|
|
8315
|
+
} catch {
|
|
8316
|
+
const fallback = generateShipTweet();
|
|
8317
|
+
if (!fallback) {
|
|
8318
|
+
return { success: false, output: "No shipped ideas found to generate a tweet from." };
|
|
8319
|
+
}
|
|
8320
|
+
text = fallback;
|
|
8321
|
+
}
|
|
8322
|
+
const draft = createDraft(state, text, "ship", latestShipped.id);
|
|
8297
8323
|
saveState(state);
|
|
8298
|
-
|
|
8324
|
+
const outputParts = [`Created ship draft: "${draft.text}" (${draft.id})`];
|
|
8325
|
+
if (hookType) outputParts.push(`Hook type: ${hookType}`);
|
|
8326
|
+
if (estimatedEngagement) outputParts.push(`Estimated engagement: ${estimatedEngagement}`);
|
|
8327
|
+
return { success: true, output: outputParts.join("\n") };
|
|
8299
8328
|
}
|
|
8300
8329
|
function executeDraftShipVisual() {
|
|
8301
8330
|
const state = loadState();
|
|
@@ -8336,35 +8365,166 @@ function executeDraftShipVisual() {
|
|
|
8336
8365
|
output: `Created ship draft with media: "${draft.text}" (${draft.id}) \u2014 ${mediaPaths.length} file(s) attached`
|
|
8337
8366
|
};
|
|
8338
8367
|
}
|
|
8339
|
-
function executeDraftUpdate() {
|
|
8368
|
+
async function executeDraftUpdate() {
|
|
8340
8369
|
const state = loadState();
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8370
|
+
let text;
|
|
8371
|
+
let hookType;
|
|
8372
|
+
let estimatedEngagement;
|
|
8373
|
+
try {
|
|
8374
|
+
let positioning = null;
|
|
8375
|
+
try {
|
|
8376
|
+
if (fs8.existsSync(POSITIONING_FILE)) {
|
|
8377
|
+
positioning = JSON.parse(fs8.readFileSync(POSITIONING_FILE, "utf-8"));
|
|
8378
|
+
}
|
|
8379
|
+
} catch {
|
|
8380
|
+
}
|
|
8381
|
+
const contextParts = [];
|
|
8382
|
+
if (positioning?.current?.tagline) contextParts.push(`Tagline: ${positioning.current.tagline}`);
|
|
8383
|
+
if (positioning?.current?.value_proposition) {
|
|
8384
|
+
const s = positioning.current.value_proposition.split(/[.!]/)[0]?.trim();
|
|
8385
|
+
if (s) contextParts.push(`Value prop: ${s}`);
|
|
8386
|
+
}
|
|
8387
|
+
if (positioning?.copy_bank?.pain_points?.length) {
|
|
8388
|
+
const pains = positioning.copy_bank.pain_points.slice(0, 2).map((p) => p.pain);
|
|
8389
|
+
contextParts.push(`Pain points: ${pains.join(", ")}`);
|
|
8390
|
+
}
|
|
8391
|
+
if (positioning?.current?.differentiators?.length) {
|
|
8392
|
+
contextParts.push(`Differentiator: ${positioning.current.differentiators[0]}`);
|
|
8393
|
+
}
|
|
8394
|
+
if (contextParts.length === 0) {
|
|
8395
|
+
throw new Error("No positioning context available");
|
|
8396
|
+
}
|
|
8397
|
+
const context = contextParts.join("\n");
|
|
8398
|
+
const pastPerformance = collectEngagementHistory(state);
|
|
8399
|
+
const result = await generateViralTweet({ topic: "update", context, positioning, pastPerformance });
|
|
8400
|
+
text = result.text;
|
|
8401
|
+
hookType = result.hook_type;
|
|
8402
|
+
estimatedEngagement = result.estimated_engagement;
|
|
8403
|
+
} catch {
|
|
8404
|
+
const fallback = generateProductUpdateTweet();
|
|
8405
|
+
if (!fallback) {
|
|
8406
|
+
return { success: false, output: "No positioning data found to generate update tweet." };
|
|
8407
|
+
}
|
|
8408
|
+
text = fallback;
|
|
8344
8409
|
}
|
|
8345
8410
|
const draft = createDraft(state, text, "update", null);
|
|
8346
8411
|
saveState(state);
|
|
8347
|
-
|
|
8412
|
+
const outputParts = [`Created update draft: "${draft.text}" (${draft.id})`];
|
|
8413
|
+
if (hookType) outputParts.push(`Hook type: ${hookType}`);
|
|
8414
|
+
if (estimatedEngagement) outputParts.push(`Estimated engagement: ${estimatedEngagement}`);
|
|
8415
|
+
return { success: true, output: outputParts.join("\n") };
|
|
8348
8416
|
}
|
|
8349
|
-
function executeDraftMilestone() {
|
|
8417
|
+
async function executeDraftMilestone() {
|
|
8350
8418
|
const state = loadState();
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8419
|
+
let text;
|
|
8420
|
+
let hookType;
|
|
8421
|
+
let estimatedEngagement;
|
|
8422
|
+
try {
|
|
8423
|
+
let kpiContext = "";
|
|
8424
|
+
try {
|
|
8425
|
+
if (fs8.existsSync(GOALS_FILE)) {
|
|
8426
|
+
const { goals } = JSON.parse(fs8.readFileSync(GOALS_FILE, "utf-8"));
|
|
8427
|
+
for (const goal of goals) {
|
|
8428
|
+
for (const kpi of goal.kpis) {
|
|
8429
|
+
if (kpi.current_value != null && kpi.target_value != null) {
|
|
8430
|
+
const pct = kpi.current_value / kpi.target_value;
|
|
8431
|
+
if (pct >= 0.8) {
|
|
8432
|
+
kpiContext = [
|
|
8433
|
+
`KPI: ${kpi.name}`,
|
|
8434
|
+
`Current: ${kpi.current_value} ${kpi.unit}`,
|
|
8435
|
+
`Target: ${kpi.target_value} ${kpi.unit}`,
|
|
8436
|
+
`Goal: ${goal.title}`
|
|
8437
|
+
].join("\n");
|
|
8438
|
+
break;
|
|
8439
|
+
}
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
if (kpiContext) break;
|
|
8443
|
+
}
|
|
8444
|
+
}
|
|
8445
|
+
} catch {
|
|
8446
|
+
}
|
|
8447
|
+
if (!kpiContext) {
|
|
8448
|
+
throw new Error("No milestone KPI context available");
|
|
8449
|
+
}
|
|
8450
|
+
const pastPerformance = collectEngagementHistory(state);
|
|
8451
|
+
const result = await generateViralTweet({ topic: "milestone", context: kpiContext, pastPerformance });
|
|
8452
|
+
text = result.text;
|
|
8453
|
+
hookType = result.hook_type;
|
|
8454
|
+
estimatedEngagement = result.estimated_engagement;
|
|
8455
|
+
} catch {
|
|
8456
|
+
const fallback = generateMilestoneTweet();
|
|
8457
|
+
if (!fallback) {
|
|
8458
|
+
return { success: false, output: "No KPI milestones found to celebrate." };
|
|
8459
|
+
}
|
|
8460
|
+
text = fallback;
|
|
8354
8461
|
}
|
|
8355
8462
|
const draft = createDraft(state, text, "milestone", null);
|
|
8356
8463
|
saveState(state);
|
|
8357
|
-
|
|
8464
|
+
const outputParts = [`Created milestone draft: "${draft.text}" (${draft.id})`];
|
|
8465
|
+
if (hookType) outputParts.push(`Hook type: ${hookType}`);
|
|
8466
|
+
if (estimatedEngagement) outputParts.push(`Estimated engagement: ${estimatedEngagement}`);
|
|
8467
|
+
return { success: true, output: outputParts.join("\n") };
|
|
8358
8468
|
}
|
|
8359
|
-
function executeDraftDigest() {
|
|
8469
|
+
async function executeDraftDigest() {
|
|
8360
8470
|
const state = loadState();
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8471
|
+
let text;
|
|
8472
|
+
let hookType;
|
|
8473
|
+
let estimatedEngagement;
|
|
8474
|
+
try {
|
|
8475
|
+
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1e3).toISOString();
|
|
8476
|
+
let recentShips = [];
|
|
8477
|
+
let kpiMovement = "";
|
|
8478
|
+
try {
|
|
8479
|
+
if (fs8.existsSync(IDEAS_FILE)) {
|
|
8480
|
+
const { ideas } = JSON.parse(fs8.readFileSync(IDEAS_FILE, "utf-8"));
|
|
8481
|
+
recentShips = ideas.filter((i) => i.stage === "shipped" && i.updated_at > sevenDaysAgo).sort((a, b) => b.updated_at.localeCompare(a.updated_at)).slice(0, 5).map((i) => ({ title: i.title, category: i.category }));
|
|
8482
|
+
}
|
|
8483
|
+
} catch {
|
|
8484
|
+
}
|
|
8485
|
+
try {
|
|
8486
|
+
if (fs8.existsSync(GOALS_FILE)) {
|
|
8487
|
+
const { goals } = JSON.parse(fs8.readFileSync(GOALS_FILE, "utf-8"));
|
|
8488
|
+
const highlights = [];
|
|
8489
|
+
for (const goal of goals) {
|
|
8490
|
+
for (const kpi of goal.kpis) {
|
|
8491
|
+
if (kpi.current_value != null && kpi.target_value != null) {
|
|
8492
|
+
const pct = Math.round(kpi.current_value / kpi.target_value * 100);
|
|
8493
|
+
highlights.push(`${kpi.name}: ${kpi.current_value}/${kpi.target_value} ${kpi.unit} (${pct}%)`);
|
|
8494
|
+
}
|
|
8495
|
+
}
|
|
8496
|
+
}
|
|
8497
|
+
if (highlights.length > 0) kpiMovement = highlights.slice(0, 3).join(", ");
|
|
8498
|
+
}
|
|
8499
|
+
} catch {
|
|
8500
|
+
}
|
|
8501
|
+
if (recentShips.length === 0) {
|
|
8502
|
+
throw new Error("No recent ships for digest context");
|
|
8503
|
+
}
|
|
8504
|
+
const contextParts = [
|
|
8505
|
+
`Shipped this week (${recentShips.length} items): ${recentShips.map((s) => s.title).join(", ")}`,
|
|
8506
|
+
`Categories: ${Array.from(new Set(recentShips.map((s) => s.category))).join(", ")}`
|
|
8507
|
+
];
|
|
8508
|
+
if (kpiMovement) contextParts.push(`KPI movement: ${kpiMovement}`);
|
|
8509
|
+
const context = contextParts.join("\n");
|
|
8510
|
+
const pastPerformance = collectEngagementHistory(state);
|
|
8511
|
+
const result = await generateViralTweet({ topic: "update", context, pastPerformance });
|
|
8512
|
+
text = result.text;
|
|
8513
|
+
hookType = result.hook_type;
|
|
8514
|
+
estimatedEngagement = result.estimated_engagement;
|
|
8515
|
+
} catch {
|
|
8516
|
+
const fallback = generateDigestTweet();
|
|
8517
|
+
if (!fallback) {
|
|
8518
|
+
return { success: false, output: "No recent activity to summarize in a digest." };
|
|
8519
|
+
}
|
|
8520
|
+
text = fallback;
|
|
8364
8521
|
}
|
|
8365
8522
|
const draft = createDraft(state, text, "digest", null);
|
|
8366
8523
|
saveState(state);
|
|
8367
|
-
|
|
8524
|
+
const outputParts = [`Created digest draft: "${draft.text}" (${draft.id})`];
|
|
8525
|
+
if (hookType) outputParts.push(`Hook type: ${hookType}`);
|
|
8526
|
+
if (estimatedEngagement) outputParts.push(`Estimated engagement: ${estimatedEngagement}`);
|
|
8527
|
+
return { success: true, output: outputParts.join("\n") };
|
|
8368
8528
|
}
|
|
8369
8529
|
async function executePublish(draftId) {
|
|
8370
8530
|
const state = loadState();
|
|
@@ -8909,6 +9069,21 @@ async function executeEngagementReport() {
|
|
|
8909
9069
|
}
|
|
8910
9070
|
return { success: true, output: lines.join("\n") };
|
|
8911
9071
|
}
|
|
9072
|
+
function buildShipContext(idea) {
|
|
9073
|
+
const parts = [`Title: ${idea.title}`];
|
|
9074
|
+
if (idea.context) {
|
|
9075
|
+
const s = idea.context.split(/[.!]/)[0]?.trim();
|
|
9076
|
+
if (s) parts.push(`Background: ${s}`);
|
|
9077
|
+
}
|
|
9078
|
+
if (idea.rationale) {
|
|
9079
|
+
const s = idea.rationale.split(/[.!]/)[0]?.trim();
|
|
9080
|
+
if (s) parts.push(`Why it matters: ${s}`);
|
|
9081
|
+
}
|
|
9082
|
+
if (idea.summary) parts.push(`What was shipped: ${idea.summary}`);
|
|
9083
|
+
if (idea.success_metrics?.[0]) parts.push(`Success target: ${idea.success_metrics[0]}`);
|
|
9084
|
+
if (idea.category) parts.push(`Category: ${idea.category}`);
|
|
9085
|
+
return parts.join("\n");
|
|
9086
|
+
}
|
|
8912
9087
|
function collectEngagementHistory(state) {
|
|
8913
9088
|
const result = [];
|
|
8914
9089
|
for (const draft of state.drafts) {
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=1685,exports.ids=[1685],exports.modules={7084:(e,o,n)=>{n.d(o,{i0:()=>d});var t=n(1282),r=n(2048),i=n(5315);let s=i.join(process.env.HOME||"",".vibebusiness"),a=i.join(s,"credentials.json"),c=i.join(process.env.HOME||"",".ai-analyst"),p=i.join(c,"provider.json");async function u(e){let o=Date.now(),n=process.env.ANTHROPIC_API_KEY;if(!n)return{output:"",provider:"anthropic-api",durationMs:0,error:"ANTHROPIC_API_KEY not set"};try{let t=e.model||"claude-sonnet-4-6",r=e.prompt;e.jsonSchema?r+=`
|
|
2
|
-
|
|
3
|
-
IMPORTANT: Respond with valid JSON matching this schema:
|
|
4
|
-
${JSON.stringify(e.jsonSchema,null,2)}
|
|
5
|
-
|
|
6
|
-
Output ONLY the JSON object, no markdown code blocks or other text.`:e.expectJson&&(r+="\n\nIMPORTANT: Respond with valid JSON only. No markdown code blocks or other text.");let i=await fetch("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n,"anthropic-version":"2023-06-01"},body:JSON.stringify({model:t,max_tokens:16384,messages:[{role:"user",content:r}]}),signal:AbortSignal.timeout(e.timeoutMs||3e5)});if(!i.ok){let e=await i.text();return{output:"",provider:"anthropic-api",durationMs:Date.now()-o,error:`Anthropic API error ${i.status}: ${e}`}}return{output:(await i.json()).content.filter(e=>"text"===e.type).map(e=>e.text).join("\n"),provider:"anthropic-api",durationMs:Date.now()-o}}catch(e){return{output:"",provider:"anthropic-api",durationMs:Date.now()-o,error:`Anthropic API call failed: ${e.message}`}}}async function d(e){let o=function(){try{if(r.existsSync(p))return JSON.parse(r.readFileSync(p,"utf-8"))}catch{}return null}(),n=function(e){let o=function(e){let o=e||"claude";try{let e=(0,t.execSync)(`${o} --version 2>/dev/null`,{timeout:1e4,encoding:"utf-8"}).trim();return{found:!0,path:o,version:e}}catch{for(let e of["/usr/local/bin/claude",i.join(process.env.HOME||"",".claude","bin","claude"),i.join(process.env.HOME||"",".local","bin","claude")])try{if(r.existsSync(e)){let o=(0,t.execSync)(`${e} --version 2>/dev/null`,{timeout:1e4,encoding:"utf-8"}).trim();return{found:!0,path:e,version:o}}}catch{continue}return{found:!1,path:o}}}(e?.claudePath);if(o.found)return{provider:"claude-cli",version:o.version,message:`Found Claude Code CLI${o.version?` (${o.version})`:""}. Using your Claude subscription for AI reasoning.`};let n=function(){if(process.env.ANTHROPIC_API_KEY)return{provider:"anthropic-api",key:process.env.ANTHROPIC_API_KEY,source:"env"};if(process.env.OPENAI_API_KEY)return{provider:"openai-api",key:process.env.OPENAI_API_KEY,source:"env"};if(process.env.GOOGLE_API_KEY||process.env.GEMINI_API_KEY)return{provider:"google-api",key:process.env.GOOGLE_API_KEY||process.env.GEMINI_API_KEY,source:"env"};let e=function(){try{if(r.existsSync(a))return JSON.parse(r.readFileSync(a,"utf-8"))}catch{}return{}}();if(e.ANTHROPIC_API_KEY)return process.env.ANTHROPIC_API_KEY=e.ANTHROPIC_API_KEY,{provider:"anthropic-api",key:e.ANTHROPIC_API_KEY,source:"credentials"};if(e.OPENAI_API_KEY)return process.env.OPENAI_API_KEY=e.OPENAI_API_KEY,{provider:"openai-api",key:e.OPENAI_API_KEY,source:"credentials"};if(e.GOOGLE_API_KEY||e.GEMINI_API_KEY){let o=e.GOOGLE_API_KEY||e.GEMINI_API_KEY;return process.env.GOOGLE_API_KEY=o,{provider:"google-api",key:o,source:"credentials"}}return null}();return n?{provider:n.provider,message:`Using ${({"claude-cli":"Claude CLI","anthropic-api":"Anthropic API","openai-api":"OpenAI API","google-api":"Google AI API"})[n.provider]} key for AI reasoning.`}:{provider:"claude-cli",message:"No AI provider found. Install Claude Code CLI or set an API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY)."}}(o||void 0);switch(n.provider){case"claude-cli":return function(e,o){let n=o||"claude",r=["--print"];e.model&&r.push("--model",e.model),e.jsonSchema&&r.push("--output-format","json","--json-schema",JSON.stringify(e.jsonSchema)),e.claudeFlags&&r.push(...e.claudeFlags);let i=!1!==e.useStdin&&e.prompt.length>1e4;i||r.push("-p",e.prompt);let s=Date.now(),a=e.timeoutMs||3e5;return new Promise(o=>{let c=(0,t.spawn)(n,r,{cwd:e.cwd||process.cwd(),env:process.env,stdio:i?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]}),p="",u="";c.stdout?.on("data",e=>{p+=e.toString()}),c.stderr?.on("data",e=>{u+=e.toString()}),i&&c.stdin&&(c.stdin.write(e.prompt),c.stdin.end());let d=setTimeout(()=>{c.kill("SIGTERM"),o({output:p,provider:"claude-cli",durationMs:Date.now()-s,error:`Timeout after ${a}ms`})},a);c.on("close",e=>{clearTimeout(d),o({output:p.trim(),provider:"claude-cli",durationMs:Date.now()-s,error:0!==e?`Claude CLI exited with code ${e}: ${u}`:void 0})}),c.on("error",e=>{clearTimeout(d),o({output:"",provider:"claude-cli",durationMs:Date.now()-s,error:`Failed to spawn Claude CLI: ${e.message}`})})})}(e,o?.claudePath);case"anthropic-api":return u(e);case"openai-api":case"google-api":return{output:"",provider:n.provider,durationMs:0,error:`${n.provider} provider not yet implemented. Use Claude CLI or set ANTHROPIC_API_KEY.`};default:return{output:"",provider:"claude-cli",durationMs:0,error:n.message}}}},7786:(e,o,n)=>{n.d(o,{ET:()=>u,QN:()=>s,Ug:()=>p,b0:()=>i,pF:()=>a,wE:()=>c});var t=n(5315),r=n(2048);let i=function(){let e=process.cwd();if(r.existsSync(t.join(e,"data","config.json")))return e;try{for(let o of r.readdirSync(e,{withFileTypes:!0}))if(o.isDirectory()){let n=t.join(e,o.name,"data","config.json");if(r.existsSync(n))return t.join(e,o.name)}}catch{}let o=e;for(let e=0;e<5;e++){let e=t.dirname(o);if(e===o)break;if(r.existsSync(t.join(e,"data","config.json")))return e;o=e}return e}(),s=t.join(i,"data");t.join(i,"STATUS.md"),t.join(i,"TODO.md"),t.join(i,"MEMORY.md");let a=t.join(s,"ideas.json"),c=t.join(s,"goals.json");t.join(s,"sessions.json"),t.join(s,"config.json"),t.join(s,"business-context.json"),t.join(s,"hypotheses.json"),t.join(s,"implementations.json"),t.join(s,"roadmap.json"),t.join(s,"competitors.json");let p=t.join(s,"positioning.json");t.join(s,"pages.json"),t.join(s,"payments.json"),t.join(s,"posthog.json");let u=t.join(s,"social.json"),d=t.join(__dirname,"..","..","templates");t.join(d,"commands")}};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=7564,exports.ids=[7564],exports.modules={7564:(e,t,a)=>{a.d(t,{executeInvestorUpdateTask:()=>h});var s=a(2048),n=a(5315),r=a(1282),o=a(7084),i=a(7786);let u=n.join(i.b0,"data/investor-updates.json"),l=n.join(i.b0,"scripts/investor-update.ts");function c(e,t){try{if(!s.existsSync(e))return t;return JSON.parse(s.readFileSync(e,"utf-8"))}catch{return t}}function d(e){return e.toISOString().split("T")[0]}async function p(e,t){let a=`You are a seasoned investor relations advisor. Transform this data-driven investor update into a compelling narrative.
|
|
2
|
-
|
|
3
|
-
# Raw Update Data
|
|
4
|
-
|
|
5
|
-
${e}
|
|
6
|
-
|
|
7
|
-
${t?`# Previous Period Context (for comparison)
|
|
8
|
-
|
|
9
|
-
Last update period: ${t.period_start} to ${t.period_end}
|
|
10
|
-
Last update summary: ${t.narrative.executive_summary}
|
|
11
|
-
|
|
12
|
-
`:""}
|
|
13
|
-
|
|
14
|
-
# Your Task
|
|
15
|
-
|
|
16
|
-
Generate the following sections in a confident, achievement-focused tone:
|
|
17
|
-
|
|
18
|
-
1. **Executive Summary** (2-3 sentences)
|
|
19
|
-
- Open with the most impressive metric or milestone
|
|
20
|
-
- Frame momentum: "up and to the right" or "pivoting based on data"
|
|
21
|
-
${t?"- Compare to previous period if there's meaningful change":""}
|
|
22
|
-
|
|
23
|
-
2. **Accomplishments Story** (3-4 paragraphs)
|
|
24
|
-
- Turn bullet points into a narrative arc
|
|
25
|
-
- Highlight strategic wins, not just feature lists
|
|
26
|
-
- Quantify impact where possible (users, revenue, time saved)
|
|
27
|
-
- Connect accomplishments to business goals
|
|
28
|
-
|
|
29
|
-
3. **Challenges and Plans** (2-3 paragraphs)
|
|
30
|
-
- Frame challenges as "what we're learning" not "what's broken"
|
|
31
|
-
- Show you have a plan to address each challenge
|
|
32
|
-
- Demonstrate strategic thinking about resource allocation
|
|
33
|
-
|
|
34
|
-
4. **Asks Rationale** (1-2 paragraphs)
|
|
35
|
-
- Explain what you need and WHY it will accelerate growth
|
|
36
|
-
- Make it easy for investors to help (specific intros, feedback requests)
|
|
37
|
-
- Show you've thought through how their help connects to outcomes
|
|
38
|
-
|
|
39
|
-
# Output Format
|
|
40
|
-
|
|
41
|
-
Return ONLY valid JSON with this structure:
|
|
42
|
-
{
|
|
43
|
-
"executive_summary": "...",
|
|
44
|
-
"accomplishments_story": "...",
|
|
45
|
-
"challenges_and_plans": "...",
|
|
46
|
-
"asks_rationale": "..."
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
No markdown fencing, no extra commentary. Just the JSON object.`,s=await (0,o.i0)({prompt:a,timeoutMs:12e4,expectJson:!0});if(s.error)throw Error(`AI narrative generation failed: ${s.error}`);try{return JSON.parse(s.output)}catch(e){throw Error(`Failed to parse AI narrative JSON: ${s.output.slice(0,200)}`)}}async function h(e,t){try{var a;let t;let o=new Date;"investor-update-monthly"===e?(t=new Date(o)).setDate(o.getDate()-30):"investor-update-quarterly"===e?(t=new Date(o)).setDate(o.getDate()-90):(t=new Date(o)).setDate(o.getDate()-30);let h=i.b0;console.log(`
|
|
50
|
-
🚀 Generating investor update for ${d(t)} to ${d(o)}
|
|
51
|
-
`),console.log("\uD83D\uDCCA Gathering data...");let m=function(e){let{since:t,until:a,repo:s}=e,n=d(t),o=d(a),u=(0,r.execSync)(`npx tsx "${l}" --since="${n}" --until="${o}" --repo="${s}"`,{cwd:i.b0,encoding:"utf-8",maxBuffer:10485760}),c=u.split("\n"),p=c.findIndex(e=>e.includes("────────"));if(-1===p)return u;let h=c.slice(p+1),m=h.findIndex(e=>e.includes("────────"));return -1===m?h.join("\n"):h.slice(0,m).join("\n").trim()}({since:t,until:o,repo:h,includeAI:!0}),g=(a=d(t),c(u,{updates:[]}).updates.filter(e=>e.period_end<a&&"published"===e.status).sort((e,t)=>t.period_end.localeCompare(e.period_end))[0]);g&&console.log(`📈 Found previous update from ${g.period_start} to ${g.period_end}`),console.log("\uD83E\uDD16 Generating AI narrative...");let f=await p(m,g),{epics_completed:D,goals:v,roadmap_epics:y,insights:$}=function(e){let t=[],a=e.split("\n"),s=!1;for(let e of a)e.includes("## \uD83D\uDE80 Key Accomplishments")?s=!1:e.includes("### Business Growth")||(e.includes("## \uD83D\uDDFA️ Next 30 Days Roadmap")?s=!1:e.includes("## \uD83D\uDCA1 Strategic Insights")?s=!0:e.includes("## \uD83D\uDCCA Momentum Indicators")&&(s=!1)),s&&e.startsWith("- ")&&t.push(e.slice(2).trim());return{epics_completed:[],goals:[],roadmap_epics:[],insights:t}}(m),w=function(e,t){let a=e.split("\n## "),s=`${a[0]}
|
|
52
|
-
|
|
53
|
-
## 📝 Executive Summary
|
|
54
|
-
|
|
55
|
-
${t.executive_summary}
|
|
56
|
-
|
|
57
|
-
## `;for(let e=1;e<a.length;e++){let n=a[e];n.startsWith("\uD83D\uDE80 Key Accomplishments")?s+=`${n}
|
|
58
|
-
|
|
59
|
-
### Strategic Context
|
|
60
|
-
|
|
61
|
-
${t.accomplishments_story}
|
|
62
|
-
|
|
63
|
-
## `:n.startsWith("\uD83D\uDDFA️ Next 30 Days Roadmap")?s+=`${n}
|
|
64
|
-
|
|
65
|
-
### Strategic Approach
|
|
66
|
-
|
|
67
|
-
${t.challenges_and_plans}
|
|
68
|
-
|
|
69
|
-
## `:s+=`${n}
|
|
70
|
-
|
|
71
|
-
## `}return(s=s.replace(/\*\*What We Need:\*\*\n- \[Your ask here[\s\S]*?\]\n- \[Your ask here[\s\S]*?\]/g,`**What We Need:**
|
|
72
|
-
|
|
73
|
-
${t.asks_rationale}`)).trim()}(m,f),S={id:`update-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,created_at:new Date().toISOString(),period_start:d(t),period_end:d(o),project:h.split("/").pop()||h,epics_completed:D,goals:v,roadmap_epics:y,insights:$,asks:[],narrative:f,markdown:w,status:"draft"};(function(e){let t=c(u,{updates:[]});t.updates=t.updates.filter(t=>t.id!==e.id),t.updates.push(e),t.updates.sort((e,t)=>t.period_end.localeCompare(e.period_end)),function(e,t){let a=n.dirname(e);s.existsSync(a)||s.mkdirSync(a,{recursive:!0}),s.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}(u,t)})(S),console.log(`
|
|
74
|
-
✅ Update saved to ${u}`),console.log(`📝 Update ID: ${S.id}
|
|
75
|
-
`);let _=n.join(i.b0,`investor-update-${d(o)}.md`);return s.writeFileSync(_,w,"utf-8"),console.log(`📄 Markdown saved to: ${_}
|
|
76
|
-
`),{success:!0,output:`Investor update generated successfully!
|
|
77
|
-
|
|
78
|
-
Update ID: ${S.id}
|
|
79
|
-
Markdown: ${_}
|
|
80
|
-
|
|
81
|
-
To publish: Update status to 'published' in ${u}`}}catch(e){return{success:!1,output:`Failed to generate investor update: ${e.message}`}}}}};
|