yapout 0.4.2 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +115 -84
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12,8 +12,11 @@ import { Command as Command16 } from "commander";
12
12
  // src/commands/login.ts
13
13
  import { Command } from "commander";
14
14
  import http from "http";
15
+ import { createHash } from "crypto";
16
+ import { hostname, userInfo } from "os";
15
17
  import chalk from "chalk";
16
18
  import open from "open";
19
+ import { anyApi as anyApi2 } from "convex/server";
17
20
 
18
21
  // src/lib/config.ts
19
22
  import { homedir } from "os";
@@ -165,6 +168,16 @@ function getAppUrl() {
165
168
  return process.env.YAPOUT_APP_URL || "https://yapout.vercel.app";
166
169
  }
167
170
 
171
+ // src/lib/convex.ts
172
+ import { ConvexHttpClient } from "convex/browser";
173
+ import { anyApi } from "convex/server";
174
+ function createConvexClient(token) {
175
+ const url = getConvexUrl();
176
+ const client = new ConvexHttpClient(url);
177
+ client.setAuth(token);
178
+ return client;
179
+ }
180
+
168
181
  // src/lib/protocol.ts
169
182
  import { execSync, spawnSync } from "child_process";
170
183
  import { platform, homedir as homedir2 } from "os";
@@ -413,6 +426,17 @@ function registerProtocolHandler() {
413
426
  }
414
427
 
415
428
  // src/commands/login.ts
429
+ var CLI_VERSION = "0.5.1";
430
+ function safeReturnTo(raw) {
431
+ if (!raw) return null;
432
+ try {
433
+ const parsed = new URL(raw);
434
+ if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
435
+ return parsed.toString();
436
+ } catch {
437
+ return null;
438
+ }
439
+ }
416
440
  function startCallbackServer() {
417
441
  return new Promise((resolve11) => {
418
442
  let resolveData;
@@ -429,6 +453,7 @@ function startCallbackServer() {
429
453
  const expiresAt = url.searchParams.get("expiresAt");
430
454
  const convexUrl = url.searchParams.get("convexUrl");
431
455
  const error = url.searchParams.get("error");
456
+ const returnTo = safeReturnTo(url.searchParams.get("returnTo"));
432
457
  if (error || !token) {
433
458
  res.writeHead(200, { "Content-Type": "text/html" });
434
459
  res.end(
@@ -438,10 +463,15 @@ function startCallbackServer() {
438
463
  rejectData(new Error(error || "No token received"));
439
464
  return;
440
465
  }
441
- res.writeHead(200, { "Content-Type": "text/html" });
442
- res.end(
443
- `<html><body style="font-family:sans-serif;text-align:center;padding:2rem"><h2>Authenticated!</h2><p>You can close this tab and return to the terminal.</p></body></html>`
444
- );
466
+ if (returnTo) {
467
+ res.writeHead(302, { Location: returnTo });
468
+ res.end();
469
+ } else {
470
+ res.writeHead(200, { "Content-Type": "text/html" });
471
+ res.end(
472
+ `<html><body style="font-family:sans-serif;text-align:center;padding:2rem"><h2>Authenticated!</h2><p>You can close this tab and return to the terminal.</p></body></html>`
473
+ );
474
+ }
445
475
  server.close();
446
476
  resolveData({
447
477
  token,
@@ -493,6 +523,17 @@ var loginCommand = new Command("login").description("Authenticate with yapout").
493
523
  ` (expires in ${daysLeft} day${daysLeft === 1 ? "" : "s"})`
494
524
  )
495
525
  );
526
+ try {
527
+ const client = createConvexClient(creds.token);
528
+ const deviceId = createHash("sha256").update(hostname() + userInfo().username).digest("hex").slice(0, 16);
529
+ await client.mutation(anyApi2.functions.devices.registerDevice, {
530
+ deviceId,
531
+ name: hostname(),
532
+ cliVersion: CLI_VERSION
533
+ });
534
+ } catch {
535
+ console.warn(chalk.dim("Note: Could not register device. This is non-fatal."));
536
+ }
496
537
  try {
497
538
  registerProtocolHandler();
498
539
  console.log(
@@ -546,16 +587,6 @@ function requireAuth() {
546
587
  return creds;
547
588
  }
548
589
 
549
- // src/lib/convex.ts
550
- import { ConvexHttpClient } from "convex/browser";
551
- import { anyApi } from "convex/server";
552
- function createConvexClient(token) {
553
- const url = getConvexUrl();
554
- const client = new ConvexHttpClient(url);
555
- client.setAuth(token);
556
- return client;
557
- }
558
-
559
590
  // src/lib/prompts.ts
560
591
  import { select } from "@inquirer/prompts";
561
592
  async function pickProject(projects) {
@@ -916,7 +947,7 @@ import { Command as Command7 } from "commander";
916
947
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
917
948
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
918
949
  import { ConvexHttpClient as ConvexHttpClient2 } from "convex/browser";
919
- import { anyApi as anyApi2 } from "convex/server";
950
+ import { anyApi as anyApi3 } from "convex/server";
920
951
 
921
952
  // src/mcp/tools/init.ts
922
953
  import { z } from "zod";
@@ -936,7 +967,7 @@ function registerInitTool(server, ctx) {
936
967
  const defaultBranch = getDefaultBranch(ctx.cwd);
937
968
  const projectName = args.name || repoFullName.split("/")[1] || "unnamed";
938
969
  const result = await ctx.client.mutation(
939
- anyApi2.functions.projects.createProjectFromCli,
970
+ anyApi3.functions.projects.createProjectFromCli,
940
971
  {
941
972
  name: projectName,
942
973
  githubRepoFullName: repoFullName,
@@ -1024,7 +1055,7 @@ function registerCompactTool(server, ctx) {
1024
1055
  let lastUpdated;
1025
1056
  try {
1026
1057
  const project = await ctx.client.query(
1027
- anyApi2.functions.projects.getProject,
1058
+ anyApi3.functions.projects.getProject,
1028
1059
  { projectId: ctx.projectId }
1029
1060
  );
1030
1061
  currentContext = project?.contextSummary ?? void 0;
@@ -1067,7 +1098,7 @@ function registerUpdateContextTool(server, ctx) {
1067
1098
  };
1068
1099
  }
1069
1100
  await ctx.client.mutation(
1070
- anyApi2.functions.projects.updateProjectContext,
1101
+ anyApi3.functions.projects.updateProjectContext,
1071
1102
  {
1072
1103
  projectId: ctx.projectId,
1073
1104
  summary: args.summary
@@ -1137,7 +1168,7 @@ function registerQueueTool(server, ctx) {
1137
1168
  };
1138
1169
  }
1139
1170
  const data = await ctx.client.query(
1140
- anyApi2.functions.workQueue.getWorkQueue,
1171
+ anyApi3.functions.workQueue.getWorkQueue,
1141
1172
  { projectId: ctx.projectId }
1142
1173
  );
1143
1174
  if (!data) {
@@ -1246,7 +1277,7 @@ function registerGetBriefTool(server, ctx) {
1246
1277
  }
1247
1278
  try {
1248
1279
  const data = await ctx.client.query(
1249
- anyApi2.functions.findings.getFindingBrief,
1280
+ anyApi3.functions.findings.getFindingBrief,
1250
1281
  { findingId: itemId }
1251
1282
  );
1252
1283
  if (data) {
@@ -1260,7 +1291,7 @@ function registerGetBriefTool(server, ctx) {
1260
1291
  }
1261
1292
  try {
1262
1293
  const bundle = await ctx.client.query(
1263
- anyApi2.functions.bundles.getBundle,
1294
+ anyApi3.functions.bundles.getBundle,
1264
1295
  { bundleId: itemId }
1265
1296
  );
1266
1297
  if (bundle) {
@@ -1431,7 +1462,7 @@ function formatBundleBrief(bundle, projectContext) {
1431
1462
  async function detectWorkItemKind(client, workItemId) {
1432
1463
  try {
1433
1464
  const bundle = await client.query(
1434
- anyApi2.functions.bundles.getBundle,
1465
+ anyApi3.functions.bundles.getBundle,
1435
1466
  { bundleId: workItemId }
1436
1467
  );
1437
1468
  if (bundle) {
@@ -1485,7 +1516,7 @@ function registerClaimTool(server, ctx) {
1485
1516
  }
1486
1517
  async function claimStandalone(ctx, args, findingId) {
1487
1518
  const briefData = await ctx.client.query(
1488
- anyApi2.functions.findings.getFindingBrief,
1519
+ anyApi3.functions.findings.getFindingBrief,
1489
1520
  { findingId }
1490
1521
  );
1491
1522
  if (!briefData) {
@@ -1506,11 +1537,11 @@ async function claimStandalone(ctx, args, findingId) {
1506
1537
  const slug = slugify(finding.title);
1507
1538
  const branchName = linearIssueId ? `${prefix}/${linearIssueId.toLowerCase()}-${slug}` : `${prefix}/${slug}`;
1508
1539
  const localClaim = await ctx.client.mutation(
1509
- anyApi2.functions.findings.claimFindingLocal,
1540
+ anyApi3.functions.findings.claimFindingLocal,
1510
1541
  { findingId, branchName }
1511
1542
  );
1512
1543
  const claim = await ctx.client.mutation(
1513
- anyApi2.functions.workQueue.claimForImplementation,
1544
+ anyApi3.functions.workQueue.claimForImplementation,
1514
1545
  {
1515
1546
  projectId: ctx.projectId,
1516
1547
  workItemId: findingId,
@@ -1520,7 +1551,7 @@ async function claimStandalone(ctx, args, findingId) {
1520
1551
  if (linearIssueId && ctx.projectId) {
1521
1552
  try {
1522
1553
  await ctx.client.action(
1523
- anyApi2.functions.linearStatusMutations.moveIssueStatus,
1554
+ anyApi3.functions.linearStatusMutations.moveIssueStatus,
1524
1555
  {
1525
1556
  projectId: ctx.projectId,
1526
1557
  linearIssueId,
@@ -1577,11 +1608,11 @@ async function claimBundle(ctx, args, bundleId, bundleData) {
1577
1608
  };
1578
1609
  }
1579
1610
  const localClaim = await ctx.client.mutation(
1580
- anyApi2.functions.findings.claimFindingLocal,
1611
+ anyApi3.functions.findings.claimFindingLocal,
1581
1612
  { findingId: primaryFinding._id, branchName }
1582
1613
  );
1583
1614
  const claim = await ctx.client.mutation(
1584
- anyApi2.functions.workQueue.claimForImplementation,
1615
+ anyApi3.functions.workQueue.claimForImplementation,
1585
1616
  {
1586
1617
  projectId: ctx.projectId,
1587
1618
  workItemId: bundleId,
@@ -1592,7 +1623,7 @@ async function claimBundle(ctx, args, bundleId, bundleData) {
1592
1623
  if (f.linearIssueId && ctx.projectId) {
1593
1624
  try {
1594
1625
  await ctx.client.action(
1595
- anyApi2.functions.linearStatusMutations.moveIssueStatus,
1626
+ anyApi3.functions.linearStatusMutations.moveIssueStatus,
1596
1627
  {
1597
1628
  projectId: ctx.projectId,
1598
1629
  linearIssueId: f.linearIssueId,
@@ -1606,7 +1637,7 @@ async function claimBundle(ctx, args, bundleId, bundleData) {
1606
1637
  let projectContext;
1607
1638
  try {
1608
1639
  const briefData = await ctx.client.query(
1609
- anyApi2.functions.findings.getFindingBrief,
1640
+ anyApi3.functions.findings.getFindingBrief,
1610
1641
  { findingId: primaryFinding._id }
1611
1642
  );
1612
1643
  projectContext = briefData?.projectContext;
@@ -1646,7 +1677,7 @@ async function claimBundle(ctx, args, bundleId, bundleData) {
1646
1677
  async function getDefaultBranchForProject(ctx) {
1647
1678
  try {
1648
1679
  const data = await ctx.client.query(
1649
- anyApi2.functions.projects.getProject,
1680
+ anyApi3.functions.projects.getProject,
1650
1681
  { projectId: ctx.projectId }
1651
1682
  );
1652
1683
  return data?.githubDefaultBranch || "main";
@@ -1665,7 +1696,7 @@ async function setupWorktree(ctx, itemId, branchName, defaultBranch, brief, pipe
1665
1696
  writeBrief(worktreePath, brief);
1666
1697
  try {
1667
1698
  await ctx.client.mutation(
1668
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
1699
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
1669
1700
  {
1670
1701
  pipelineRunId,
1671
1702
  event: "worktree_created",
@@ -1701,7 +1732,7 @@ function writeBrief(dir, brief) {
1701
1732
  async function reportClaimEvents(ctx, pipelineRunId, title, branchName) {
1702
1733
  try {
1703
1734
  await ctx.client.mutation(
1704
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
1735
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
1705
1736
  {
1706
1737
  pipelineRunId,
1707
1738
  event: "daemon_claimed",
@@ -1709,7 +1740,7 @@ async function reportClaimEvents(ctx, pipelineRunId, title, branchName) {
1709
1740
  }
1710
1741
  );
1711
1742
  await ctx.client.mutation(
1712
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
1743
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
1713
1744
  {
1714
1745
  pipelineRunId,
1715
1746
  event: "branch_created",
@@ -1736,7 +1767,7 @@ function registerEventTool(server, ctx) {
1736
1767
  async (args) => {
1737
1768
  try {
1738
1769
  await ctx.client.mutation(
1739
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
1770
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
1740
1771
  {
1741
1772
  pipelineRunId: args.pipelineRunId,
1742
1773
  event: args.event,
@@ -1993,7 +2024,7 @@ function registerShipTool(server, ctx) {
1993
2024
  }
1994
2025
  try {
1995
2026
  await ctx.client.mutation(
1996
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
2027
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
1997
2028
  {
1998
2029
  pipelineRunId: args.pipelineRunId,
1999
2030
  event: "push_completed",
@@ -2002,7 +2033,7 @@ function registerShipTool(server, ctx) {
2002
2033
  );
2003
2034
  if (prUrl) {
2004
2035
  await ctx.client.mutation(
2005
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
2036
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
2006
2037
  {
2007
2038
  pipelineRunId: args.pipelineRunId,
2008
2039
  event: "pr_opened",
@@ -2014,7 +2045,7 @@ function registerShipTool(server, ctx) {
2014
2045
  }
2015
2046
  try {
2016
2047
  await ctx.client.mutation(
2017
- anyApi2.functions.pipelineRuns.completePipelineLocal,
2048
+ anyApi3.functions.pipelineRuns.completePipelineLocal,
2018
2049
  {
2019
2050
  pipelineRunId: args.pipelineRunId,
2020
2051
  githubPrNumber: prNumber,
@@ -2030,7 +2061,7 @@ function registerShipTool(server, ctx) {
2030
2061
  if (ctx.projectId) {
2031
2062
  try {
2032
2063
  await ctx.client.action(
2033
- anyApi2.functions.linearStatusMutations.moveIssueStatus,
2064
+ anyApi3.functions.linearStatusMutations.moveIssueStatus,
2034
2065
  {
2035
2066
  projectId: ctx.projectId,
2036
2067
  linearIssueId: linearId,
@@ -2042,7 +2073,7 @@ function registerShipTool(server, ctx) {
2042
2073
  if (prUrl) {
2043
2074
  try {
2044
2075
  await ctx.client.action(
2045
- anyApi2.functions.linearStatusMutations.addLinearComment,
2076
+ anyApi3.functions.linearStatusMutations.addLinearComment,
2046
2077
  {
2047
2078
  projectId: ctx.projectId,
2048
2079
  linearIssueId: linearId,
@@ -2060,7 +2091,7 @@ function registerShipTool(server, ctx) {
2060
2091
  result.worktreeCleaned = true;
2061
2092
  try {
2062
2093
  await ctx.client.mutation(
2063
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
2094
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
2064
2095
  {
2065
2096
  pipelineRunId: args.pipelineRunId,
2066
2097
  event: "worktree_cleaned",
@@ -2151,7 +2182,7 @@ function registerCheckTool(server, ctx) {
2151
2182
  if (args.pipelineRunId) {
2152
2183
  try {
2153
2184
  await ctx.client.mutation(
2154
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
2185
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
2155
2186
  {
2156
2187
  pipelineRunId: args.pipelineRunId,
2157
2188
  event: "running_check",
@@ -2171,7 +2202,7 @@ function registerCheckTool(server, ctx) {
2171
2202
  if (args.pipelineRunId) {
2172
2203
  try {
2173
2204
  await ctx.client.mutation(
2174
- anyApi2.functions.pipelineRuns.reportDaemonEvent,
2205
+ anyApi3.functions.pipelineRuns.reportDaemonEvent,
2175
2206
  {
2176
2207
  pipelineRunId: args.pipelineRunId,
2177
2208
  event: passed ? "check_passed" : "check_failed",
@@ -2215,11 +2246,11 @@ function registerBundleTool(server, ctx) {
2215
2246
  },
2216
2247
  async (args) => {
2217
2248
  const result = await ctx.client.mutation(
2218
- anyApi2.functions.bundles.createBundle,
2249
+ anyApi3.functions.bundles.createBundle,
2219
2250
  { leadFindingId: args.withFinding, joiningFindingId: args.findingId }
2220
2251
  );
2221
2252
  const bundledBrief = await ctx.client.query(
2222
- anyApi2.functions.bundles.getBundledBrief,
2253
+ anyApi3.functions.bundles.getBundledBrief,
2223
2254
  { bundleId: result.bundleId }
2224
2255
  );
2225
2256
  if (!bundledBrief) {
@@ -2316,7 +2347,7 @@ After calling this tool, you should:
2316
2347
  }
2317
2348
  try {
2318
2349
  const result = await ctx.client.mutation(
2319
- anyApi2.functions.localPipeline.claimForEnrichment,
2350
+ anyApi3.functions.localPipeline.claimForEnrichment,
2320
2351
  {
2321
2352
  projectId,
2322
2353
  ...args.findingId ? { findingId: args.findingId } : {}
@@ -2376,7 +2407,7 @@ function registerGetExistingFindingsTool(server, ctx) {
2376
2407
  }
2377
2408
  try {
2378
2409
  const findings = await ctx.client.query(
2379
- anyApi2.functions.localPipeline.getExistingFindingTitles,
2410
+ anyApi3.functions.localPipeline.getExistingFindingTitles,
2380
2411
  { projectId }
2381
2412
  );
2382
2413
  if (!findings || findings.length === 0) {
@@ -2477,7 +2508,7 @@ The finding transitions: enriching \u2192 enriched \u2192 ready.`,
2477
2508
  async (args) => {
2478
2509
  try {
2479
2510
  await ctx.client.mutation(
2480
- anyApi2.functions.localPipeline.saveLocalEnrichment,
2511
+ anyApi3.functions.localPipeline.saveLocalEnrichment,
2481
2512
  {
2482
2513
  findingId: args.findingId,
2483
2514
  title: args.title,
@@ -2491,11 +2522,11 @@ The finding transitions: enriching \u2192 enriched \u2192 ready.`,
2491
2522
  }
2492
2523
  );
2493
2524
  await ctx.client.action(
2494
- anyApi2.functions.localPipeline.syncFindingToLinearLocal,
2525
+ anyApi3.functions.localPipeline.syncFindingToLinearLocal,
2495
2526
  { findingId: args.findingId }
2496
2527
  );
2497
2528
  const finding = await ctx.client.query(
2498
- anyApi2.functions.findings.getFinding,
2529
+ anyApi3.functions.findings.getFinding,
2499
2530
  { findingId: args.findingId }
2500
2531
  );
2501
2532
  if (args.sessionId) {
@@ -2554,7 +2585,7 @@ function registerSyncToLinearTool(server, ctx) {
2554
2585
  async (args) => {
2555
2586
  try {
2556
2587
  await ctx.client.action(
2557
- anyApi2.functions.localPipeline.syncFindingToLinearLocal,
2588
+ anyApi3.functions.localPipeline.syncFindingToLinearLocal,
2558
2589
  { findingId: args.findingId }
2559
2590
  );
2560
2591
  return {
@@ -2612,7 +2643,7 @@ function registerSubmitYapSessionTool(server, ctx) {
2612
2643
  }
2613
2644
  try {
2614
2645
  const captureId = await ctx.client.mutation(
2615
- anyApi2.functions.captures.createFromYapSession,
2646
+ anyApi3.functions.captures.createFromYapSession,
2616
2647
  {
2617
2648
  projectId: ctx.projectId,
2618
2649
  title: args.title,
@@ -2888,7 +2919,7 @@ function registerExtractFromYapTool(server, ctx) {
2888
2919
  }
2889
2920
  try {
2890
2921
  const result = await ctx.client.mutation(
2891
- anyApi2.functions.captures.extractFromYapSession,
2922
+ anyApi3.functions.captures.extractFromYapSession,
2892
2923
  {
2893
2924
  projectId: ctx.projectId,
2894
2925
  title: args.sessionTitle,
@@ -3000,7 +3031,7 @@ full spec \u2014 schema changes, files to modify, edge cases, and acceptance cri
3000
3031
  }
3001
3032
  try {
3002
3033
  const result = await ctx.client.mutation(
3003
- anyApi2.functions.localPipeline.decomposeIntoBundle,
3034
+ anyApi3.functions.localPipeline.decomposeIntoBundle,
3004
3035
  {
3005
3036
  findingId: args.findingId,
3006
3037
  bundleDescription: args.bundleDescription,
@@ -3073,7 +3104,7 @@ The finding must be in "enriching" or "enriched" status. It will be transitioned
3073
3104
  }
3074
3105
  try {
3075
3106
  const result = await ctx.client.mutation(
3076
- anyApi2.functions.findings.markDuplicate,
3107
+ anyApi3.functions.findings.markDuplicate,
3077
3108
  {
3078
3109
  findingId: args.findingId,
3079
3110
  duplicateOfLinearId: args.duplicateOfLinearId,
@@ -3136,7 +3167,7 @@ and issue counts so you can ask the user for confirmation before creating a new
3136
3167
  }
3137
3168
  try {
3138
3169
  const project = await ctx.client.query(
3139
- anyApi2.functions.projects.getProject,
3170
+ anyApi3.functions.projects.getProject,
3140
3171
  { projectId: ctx.projectId }
3141
3172
  );
3142
3173
  if (!project?.linearTeamId) {
@@ -3151,7 +3182,7 @@ and issue counts so you can ask the user for confirmation before creating a new
3151
3182
  };
3152
3183
  }
3153
3184
  const projects = await ctx.client.action(
3154
- anyApi2.functions.linearProjectsMutations.fetchProjectsDetailed,
3185
+ anyApi3.functions.linearProjectsMutations.fetchProjectsDetailed,
3155
3186
  { teamId: project.linearTeamId }
3156
3187
  );
3157
3188
  return {
@@ -3213,7 +3244,7 @@ Optionally filter by tags, capture, or explicit finding IDs.`,
3213
3244
  }
3214
3245
  try {
3215
3246
  const allFindings = await ctx.client.query(
3216
- anyApi2.functions.findings.getProjectFindings,
3247
+ anyApi3.functions.findings.getProjectFindings,
3217
3248
  { projectId }
3218
3249
  );
3219
3250
  let drafts = (allFindings ?? []).filter((f) => f.status === "draft");
@@ -3283,7 +3314,7 @@ When done=true, all findings have been processed.`,
3283
3314
  if (args.skip && args.skipFindingId) {
3284
3315
  try {
3285
3316
  await ctx.client.mutation(
3286
- anyApi2.functions.localPipeline.releaseEnrichmentClaim,
3317
+ anyApi3.functions.localPipeline.releaseEnrichmentClaim,
3287
3318
  { findingId: args.skipFindingId }
3288
3319
  );
3289
3320
  updateSessionStats(args.sessionId, {
@@ -3293,7 +3324,7 @@ When done=true, all findings have been processed.`,
3293
3324
  }
3294
3325
  }
3295
3326
  const allFindings = await ctx.client.query(
3296
- anyApi2.functions.findings.getProjectFindings,
3327
+ anyApi3.functions.findings.getProjectFindings,
3297
3328
  { projectId: session.projectId }
3298
3329
  );
3299
3330
  let drafts = (allFindings ?? []).filter(
@@ -3335,7 +3366,7 @@ When done=true, all findings have been processed.`,
3335
3366
  }
3336
3367
  const next = drafts[0];
3337
3368
  const claimResult = await ctx.client.mutation(
3338
- anyApi2.functions.localPipeline.claimForEnrichment,
3369
+ anyApi3.functions.localPipeline.claimForEnrichment,
3339
3370
  { projectId: session.projectId, findingId: next._id }
3340
3371
  );
3341
3372
  if (!claimResult) {
@@ -3416,7 +3447,7 @@ The bundle and all its findings transition to "enriching" status.`,
3416
3447
  async (args) => {
3417
3448
  try {
3418
3449
  const result = await ctx.client.mutation(
3419
- anyApi2.functions.bundles.claimBundleForEnrichment,
3450
+ anyApi3.functions.bundles.claimBundleForEnrichment,
3420
3451
  { bundleId: args.bundleId }
3421
3452
  );
3422
3453
  if (!result) {
@@ -3474,7 +3505,7 @@ Call yapout_sync_bundle_to_linear afterwards to create the Linear project.`,
3474
3505
  async (args) => {
3475
3506
  try {
3476
3507
  await ctx.client.mutation(
3477
- anyApi2.functions.bundles.saveBundleEnrichment,
3508
+ anyApi3.functions.bundles.saveBundleEnrichment,
3478
3509
  {
3479
3510
  bundleId: args.bundleId,
3480
3511
  title: args.title,
@@ -3542,7 +3573,7 @@ async function startMcpServer() {
3542
3573
  };
3543
3574
  const server = new McpServer({
3544
3575
  name: "yapout",
3545
- version: "0.1.0"
3576
+ version: "0.5.1"
3546
3577
  });
3547
3578
  registerInitTool(server, ctx);
3548
3579
  registerCompactTool(server, ctx);
@@ -3655,14 +3686,14 @@ import chalk11 from "chalk";
3655
3686
  import { ConvexHttpClient as ConvexHttpClient3 } from "convex/browser";
3656
3687
 
3657
3688
  // src/daemon/watcher.ts
3658
- import { anyApi as anyApi4 } from "convex/server";
3689
+ import { anyApi as anyApi5 } from "convex/server";
3659
3690
  import { execSync as execSync4 } from "child_process";
3660
3691
  import { existsSync as existsSync9, mkdirSync as mkdirSync8 } from "fs";
3661
3692
  import { join as join10 } from "path";
3662
3693
  import { hostname as osHostname } from "os";
3663
3694
 
3664
3695
  // src/daemon/heartbeat.ts
3665
- import { anyApi as anyApi3 } from "convex/server";
3696
+ import { anyApi as anyApi4 } from "convex/server";
3666
3697
  var HEARTBEAT_INTERVAL = 3e4;
3667
3698
  var Heartbeat = class {
3668
3699
  client;
@@ -3690,7 +3721,7 @@ var Heartbeat = class {
3690
3721
  if (currentTicketId) args.currentTicketId = currentTicketId;
3691
3722
  if (currentBranch) args.currentBranch = currentBranch;
3692
3723
  if (worktreePath) args.worktreePath = worktreePath;
3693
- await this.client.mutation(anyApi3.functions.agents.agentHeartbeat, args);
3724
+ await this.client.mutation(anyApi4.functions.agents.agentHeartbeat, args);
3694
3725
  } catch {
3695
3726
  }
3696
3727
  }
@@ -3997,7 +4028,7 @@ var Watcher = class {
3997
4028
  );
3998
4029
  process.exit(1);
3999
4030
  }
4000
- await this.client.mutation(anyApi4.functions.agents.registerAgent, {
4031
+ await this.client.mutation(anyApi5.functions.agents.registerAgent, {
4001
4032
  projectId: this.options.projectId,
4002
4033
  sessionId: this.sessionId,
4003
4034
  machineHostname: this.getHostname()
@@ -4033,7 +4064,7 @@ Waiting for ${this.spawner.activeCount} agent(s) to finish...`
4033
4064
  await this.spawner.gracefulShutdown();
4034
4065
  }
4035
4066
  try {
4036
- await this.client.mutation(anyApi4.functions.agents.unregisterAgent, {
4067
+ await this.client.mutation(anyApi5.functions.agents.unregisterAgent, {
4037
4068
  sessionId: this.sessionId
4038
4069
  });
4039
4070
  } catch {
@@ -4047,7 +4078,7 @@ Waiting for ${this.spawner.activeCount} agent(s) to finish...`
4047
4078
  }
4048
4079
  this.heartbeat.stop();
4049
4080
  this.spawner.forceKill();
4050
- this.client.mutation(anyApi4.functions.agents.unregisterAgent, {
4081
+ this.client.mutation(anyApi5.functions.agents.unregisterAgent, {
4051
4082
  sessionId: this.sessionId
4052
4083
  }).catch(() => {
4053
4084
  });
@@ -4089,7 +4120,7 @@ Waiting for ${this.spawner.activeCount} agent(s) to finish...`
4089
4120
  }
4090
4121
  async checkForEnrichmentWork(maxSlots) {
4091
4122
  const tickets = await this.client.query(
4092
- anyApi4.functions.localPipeline.getUnenrichedTickets,
4123
+ anyApi5.functions.localPipeline.getUnenrichedTickets,
4093
4124
  { projectId: this.options.projectId }
4094
4125
  );
4095
4126
  if (!tickets || tickets.length === 0) return;
@@ -4118,7 +4149,7 @@ Waiting for ${this.spawner.activeCount} agent(s) to finish...`
4118
4149
  }
4119
4150
  async checkForImplementationWork(maxSlots) {
4120
4151
  const data = await this.client.query(
4121
- anyApi4.functions.tickets.getLocalQueuedTickets,
4152
+ anyApi5.functions.tickets.getLocalQueuedTickets,
4122
4153
  { projectId: this.options.projectId }
4123
4154
  );
4124
4155
  if (!data || data.ready.length === 0) return;
@@ -4191,7 +4222,7 @@ Waiting for ${this.spawner.activeCount} agent(s) to finish...`
4191
4222
  if (wt.ticketId) {
4192
4223
  try {
4193
4224
  const ticket = await this.client.query(
4194
- anyApi4.functions.tickets.getTicket,
4225
+ anyApi5.functions.tickets.getTicket,
4195
4226
  { ticketId: wt.ticketId }
4196
4227
  );
4197
4228
  if (ticket && (ticket.status === "failed" || ticket.status === "workflow2_done")) {
@@ -4308,7 +4339,7 @@ var watchCommand = new Command10("watch").description("Watch for work and spawn
4308
4339
  chalk11.green("Watcher started in background") + chalk11.dim(` (PID ${process.pid}, log: ${LOG_FILE})`)
4309
4340
  );
4310
4341
  }
4311
- console.log(chalk11.bold(`yapout watch v0.1.0`));
4342
+ console.log(chalk11.bold(`yapout watch v${"0.5.1"}`));
4312
4343
  console.log(
4313
4344
  `Project: ${chalk11.green(mapping.projectName)} (${mapping.projectId})`
4314
4345
  );
@@ -4376,15 +4407,15 @@ var queueCommand = new Command11("queue").description("Show pipeline state \u201
4376
4407
  process.exit(1);
4377
4408
  }
4378
4409
  const client = createConvexClient(creds.token);
4379
- const { anyApi: anyApi5 } = await import("convex/server");
4410
+ const { anyApi: anyApi6 } = await import("convex/server");
4380
4411
  const [queueData, unenriched, pending] = await Promise.all([
4381
- client.query(anyApi5.functions.tickets.getLocalQueuedTickets, {
4412
+ client.query(anyApi6.functions.tickets.getLocalQueuedTickets, {
4382
4413
  projectId: mapping.projectId
4383
4414
  }),
4384
- client.query(anyApi5.functions.localPipeline.getUnenrichedTickets, {
4415
+ client.query(anyApi6.functions.localPipeline.getUnenrichedTickets, {
4385
4416
  projectId: mapping.projectId
4386
4417
  }),
4387
- client.query(anyApi5.functions.localPipeline.getPendingSources, {
4418
+ client.query(anyApi6.functions.localPipeline.getPendingSources, {
4388
4419
  projectId: mapping.projectId
4389
4420
  })
4390
4421
  ]);
@@ -4475,9 +4506,9 @@ var nextCommand = new Command12("next").description("Claim the highest priority
4475
4506
  process.exit(1);
4476
4507
  }
4477
4508
  const client = createConvexClient(creds.token);
4478
- const { anyApi: anyApi5 } = await import("convex/server");
4509
+ const { anyApi: anyApi6 } = await import("convex/server");
4479
4510
  const data = await client.query(
4480
- anyApi5.functions.tickets.getLocalQueuedTickets,
4511
+ anyApi6.functions.tickets.getLocalQueuedTickets,
4481
4512
  { projectId: mapping.projectId }
4482
4513
  );
4483
4514
  if (!data?.ready || data.ready.length === 0) {
@@ -4502,7 +4533,7 @@ Claimed: ${ref} "${ticket.title}"`));
4502
4533
  }
4503
4534
  console.log(`Branch: ${chalk13.cyan(branchName)}`);
4504
4535
  const brief = await client.query(
4505
- anyApi5.functions.tickets.getTicketBrief,
4536
+ anyApi6.functions.tickets.getTicketBrief,
4506
4537
  { ticketId: ticket.ticketId }
4507
4538
  );
4508
4539
  if (brief) {
@@ -4578,7 +4609,7 @@ var recapCommand = new Command13("recap").description("Show a summary of recent
4578
4609
  process.exit(1);
4579
4610
  }
4580
4611
  const client = createConvexClient(creds.token);
4581
- const { anyApi: anyApi5 } = await import("convex/server");
4612
+ const { anyApi: anyApi6 } = await import("convex/server");
4582
4613
  const now = /* @__PURE__ */ new Date();
4583
4614
  const todayStart = new Date(
4584
4615
  now.getFullYear(),
@@ -4588,7 +4619,7 @@ var recapCommand = new Command13("recap").description("Show a summary of recent
4588
4619
  const weekStart = todayStart - 6 * 24 * 60 * 60 * 1e3;
4589
4620
  const since = opts.week ? weekStart : todayStart;
4590
4621
  const data = await client.query(
4591
- anyApi5.functions.localPipeline.getRecentActivity,
4622
+ anyApi6.functions.localPipeline.getRecentActivity,
4592
4623
  { projectId: mapping.projectId, since }
4593
4624
  );
4594
4625
  if (!data) {
@@ -4861,7 +4892,7 @@ var handleUriCommand = new Command15("handle-uri").description("Handle a yapout:
4861
4892
 
4862
4893
  // src/index.ts
4863
4894
  var program = new Command16();
4864
- program.name("yapout").description("yapout \u2014 from meeting transcript to merged PR").version("0.1.0");
4895
+ program.name("yapout").description("yapout \u2014 from meeting transcript to merged PR").version("0.5.1");
4865
4896
  program.addCommand(loginCommand);
4866
4897
  program.addCommand(logoutCommand);
4867
4898
  program.addCommand(initCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yapout",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "yapout CLI — link local repos, authenticate, and manage projects",
5
5
  "type": "module",
6
6
  "bin": {