@grovehq/cli 0.40.0 → 0.40.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/cli.cjs +19 -83
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -3729,10 +3729,6 @@ var COMMANDS = [
3729
3729
  description: 'Usage: grove help [command]. For subcommands, quote them: `grove help "project assign"`.'
3730
3730
  }
3731
3731
  ];
3732
- var logCommandsEnabled = true;
3733
- function setLogCommandsEnabled(enabled) {
3734
- logCommandsEnabled = enabled;
3735
- }
3736
3732
  var finderMissEnabled = true;
3737
3733
  function setFinderMissEnabled(enabled) {
3738
3734
  finderMissEnabled = enabled;
@@ -3741,8 +3737,7 @@ function withoutFinderMiss(commands) {
3741
3737
  return commands.filter((c) => c.name !== "thread mark-finder-miss" && c.name !== "thread unmark-finder-miss").map((c) => c.flags?.includes(FINDER_MISS_FLAG) ? { ...c, flags: c.flags.filter((f) => f !== FINDER_MISS_FLAG) } : c);
3742
3738
  }
3743
3739
  function visibleCommands() {
3744
- const commands = logCommandsEnabled ? COMMANDS : COMMANDS.filter((c) => c.name !== "log" && !c.name.startsWith("log "));
3745
- return finderMissEnabled ? commands : withoutFinderMiss(commands);
3740
+ return finderMissEnabled ? COMMANDS : withoutFinderMiss(COMMANDS);
3746
3741
  }
3747
3742
  function byName(name) {
3748
3743
  return visibleCommands().find((c) => c.name === name);
@@ -4260,7 +4255,7 @@ async function fetchNpmLatest(signal) {
4260
4255
  }
4261
4256
 
4262
4257
  // src/lib/version.ts
4263
- var CLI_VERSION = true ? "0.40.0" : "0.0.0-dev";
4258
+ var CLI_VERSION = true ? "0.40.1" : "0.0.0-dev";
4264
4259
  function compareSemver(a, b) {
4265
4260
  const parse = (v) => (v.split("-")[0] ?? v).split(".").map((n) => Number.parseInt(n, 10) || 0);
4266
4261
  const pa = parse(a);
@@ -4355,7 +4350,6 @@ function isPreflightFailure(err) {
4355
4350
  return err instanceof SessionExpiredError || err instanceof AuthUnavailableError || err instanceof UpgradeRequiredError;
4356
4351
  }
4357
4352
  var REQUEST_TIMEOUT_MS = 9e4;
4358
- var AGENT_ACTIVITY_LOG_CHECK_TIMEOUT_MS = 5e3;
4359
4353
  var FINDER_FEEDBACK_CHECK_TIMEOUT_MS = 5e3;
4360
4354
  var DOWNLOAD_TIMEOUT_MS = 15 * 6e4;
4361
4355
  function send(path, init, accessToken, timeoutMs = REQUEST_TIMEOUT_MS) {
@@ -5048,13 +5042,6 @@ var api = {
5048
5042
  { method: "PATCH", body: JSON.stringify(body) }
5049
5043
  );
5050
5044
  },
5051
- /** Whether the signed-in org's agent activity log flag is on — checked
5052
- * live since the CLI has no offline signal for it. */
5053
- getAgentActivityLogEnabled() {
5054
- return request("/api/grove/agent-activity-log/enabled", {
5055
- signal: AbortSignal.timeout(AGENT_ACTIVITY_LOG_CHECK_TIMEOUT_MS)
5056
- });
5057
- },
5058
5045
  /**
5059
5046
  * Read a project's activity log back — the channel a waiting coding agent
5060
5047
  * reads to learn whether a handoff has arrived, through the same channel it
@@ -5069,10 +5056,11 @@ var api = {
5069
5056
  * entry on this log is refused server-side rather than read as the start of
5070
5057
  * it — see `unknown_point` in `isSettledRejection`'s callers.
5071
5058
  */
5072
- async readActivityLog(stableId, after) {
5059
+ async readActivityLog(stableId, after, init = {}) {
5073
5060
  const qs = after === void 0 ? "" : `?after=${encodeURIComponent(after)}`;
5074
5061
  const res = await request(
5075
- `/api/grove/projects/${encodeURIComponent(stableId)}/activity-log${qs}`
5062
+ `/api/grove/projects/${encodeURIComponent(stableId)}/activity-log${qs}`,
5063
+ init
5076
5064
  );
5077
5065
  return {
5078
5066
  ...res,
@@ -5893,29 +5881,11 @@ async function listActivityLogCommand(stableId, opts = {}) {
5893
5881
  }
5894
5882
  }
5895
5883
 
5896
- // src/lib/agent-activity-log-capability.ts
5897
- async function agentActivityLogEnabled() {
5898
- try {
5899
- const { data } = await api.getAgentActivityLogEnabled();
5900
- return data.enabled;
5901
- } catch (err) {
5902
- if (isPreflightFailure(err)) throw err;
5903
- return false;
5904
- }
5905
- }
5906
-
5907
5884
  // src/lib/log-nudge.ts
5908
- async function logNudgesEnabled() {
5909
- try {
5910
- return await agentActivityLogEnabled();
5911
- } catch {
5912
- return false;
5913
- }
5914
- }
5885
+ var LOG_READ_TIMEOUT_MS = 5e3;
5915
5886
  async function assignLogLines(stableId) {
5916
- if (!await logNudgesEnabled()) return [];
5917
5887
  try {
5918
- const { entries } = (await api.readActivityLog(stableId)).data;
5888
+ const { entries } = (await api.readActivityLog(stableId, void 0, { signal: AbortSignal.timeout(LOG_READ_TIMEOUT_MS) })).data;
5919
5889
  const arrival = `Changes to this spec and answers to your threads arrive on it, so read \`grove log list ${stableId}\` again before you open the PR.`;
5920
5890
  if (entries.length === 0) return [`Nothing on ${stableId}'s agent activity log yet. ${arrival}`];
5921
5891
  const total = entries.length;
@@ -6066,7 +6036,7 @@ async function writeProjectDocCommand(doc, stableId, opts) {
6066
6036
  refreshMirror(stableId, data);
6067
6037
  if (hint) info(`
6068
6038
  ${hint}`);
6069
- if (data.changed && await logNudgesEnabled()) info(`
6039
+ if (data.changed) info(`
6070
6040
  ${specWriteNudge(stableId)}`);
6071
6041
  } catch (err) {
6072
6042
  if (!handleCommandError(err)) throw err;
@@ -6379,17 +6349,12 @@ function pickupReviewLines(stableId) {
6379
6349
  threadCheckLine(stableId)
6380
6350
  ];
6381
6351
  }
6382
- function buildReminderLines(stableId, logEnabled) {
6383
- const lines = [
6352
+ function buildReminderLines(stableId) {
6353
+ return [
6384
6354
  `As you work on ${stableId}, if you find a functional gap in its spec \u2014 something the build needs that it doesn't decide, or that the code contradicts \u2014 offer the person directing you to raise it as a thread.`,
6385
- threadCheckLine(stableId)
6355
+ threadCheckLine(stableId),
6356
+ `Answers arrive on ${stableId}'s agent activity log: read it from your last point with \`grove log list ${stableId} --after <last entry id you read>\`. If an answer changes something you already built, say so in its thread.`
6386
6357
  ];
6387
- if (logEnabled) {
6388
- lines.push(
6389
- `Answers arrive on ${stableId}'s agent activity log: read it from your last point with \`grove log list ${stableId} --after <last entry id you read>\`. If an answer changes something you already built, say so in its thread.`
6390
- );
6391
- }
6392
- return lines;
6393
6358
  }
6394
6359
 
6395
6360
  // src/commands/dashboard.ts
@@ -6401,9 +6366,8 @@ async function dashboardCommand() {
6401
6366
  }
6402
6367
  const auth = authState.auth;
6403
6368
  const binding = worktreeBinding();
6404
- const [listing, logEnabled, outcomes2] = await Promise.all([
6369
+ const [listing, outcomes2] = await Promise.all([
6405
6370
  fetchListing(),
6406
- binding.kind === "assigned" ? logNudgesEnabled() : false,
6407
6371
  binding.kind === "assigned" ? fetchOutcomes(binding.stableId) : null
6408
6372
  ]);
6409
6373
  if (listing.ok) {
@@ -6428,7 +6392,7 @@ async function dashboardCommand() {
6428
6392
  }
6429
6393
  process.exitCode = 1;
6430
6394
  }
6431
- showBindingState(binding, logEnabled, outcomes2);
6395
+ showBindingState(binding, outcomes2);
6432
6396
  await showBehindLatestNotices();
6433
6397
  await refreshStandards(binding);
6434
6398
  }
@@ -6458,7 +6422,7 @@ async function fetchListing() {
6458
6422
  return { ok: false };
6459
6423
  }
6460
6424
  }
6461
- function showBindingState(binding, logEnabled, outcomes2) {
6425
+ function showBindingState(binding, outcomes2) {
6462
6426
  if (binding.kind === "unasked") return;
6463
6427
  info("");
6464
6428
  if (binding.kind === "none") {
@@ -6468,7 +6432,7 @@ function showBindingState(binding, logEnabled, outcomes2) {
6468
6432
  info(assignedHereLead(binding.stableId));
6469
6433
  for (const line of prContractBlock(binding.stableId, outcomes2)) info(line);
6470
6434
  info("");
6471
- for (const line of buildReminderLines(binding.stableId, logEnabled)) info(line);
6435
+ for (const line of buildReminderLines(binding.stableId)) info(line);
6472
6436
  }
6473
6437
  async function showBehindLatestNotices() {
6474
6438
  const entries = Object.entries(readSyncMarker());
@@ -8407,7 +8371,7 @@ async function raiseThreadCommand(stableId, opts) {
8407
8371
  data.url === null ? "Link: none \u2014 this workspace has no web address. Tell the developer the thread id and report the missing address." : `Link: ${data.url}`
8408
8372
  );
8409
8373
  info("Give the link to the person you work for; a thread is answered by a person, not by Grove.");
8410
- if (await logNudgesEnabled()) for (const line of raiseNudge(input.stableId)) info(line);
8374
+ for (const line of raiseNudge(input.stableId)) info(line);
8411
8375
  } catch (err) {
8412
8376
  if (isPreflightFailure(err)) {
8413
8377
  handleCommandError(err);
@@ -8641,7 +8605,7 @@ async function resolveThreadCommand(thread2, opts) {
8641
8605
  });
8642
8606
  info(message === void 0 ? `Resolved. Thread ${data.threadId} is resolved, with no post appended \u2014 it ends on the posts it already holds.` : `Resolved. Thread ${data.threadId} is resolved, and what was decided is recorded on it.`);
8643
8607
  if (data.settledAt !== void 0) info(`Resolved at: ${new Date(data.settledAt).toISOString()}`);
8644
- if (await logNudgesEnabled()) info(resolveNudge());
8608
+ info(resolveNudge());
8645
8609
  return;
8646
8610
  } catch (err) {
8647
8611
  const remarkFact = message !== void 0 ? `The remark WAS recorded on thread ${threadId}.` : `Nothing was appended to thread ${threadId} \u2014 no post was asked for.`;
@@ -9268,39 +9232,11 @@ async function gateFinderMiss(argv) {
9268
9232
  return true;
9269
9233
  }
9270
9234
 
9271
- // src/lib/log-gate.ts
9272
- function touchesLog(argv) {
9273
- if (argv[0] === "log") return true;
9274
- if (argv[0] === "--help" || argv[0] === "-h") return true;
9275
- return argv[0] === "help" && (argv.length <= 1 || argv[1] === "log" || argv[1]?.startsWith("log ") === true);
9276
- }
9277
- async function gateLogCommands(argv) {
9278
- if (!touchesLog(argv)) return true;
9279
- let enabled;
9280
- try {
9281
- enabled = await agentActivityLogEnabled();
9282
- } catch (err) {
9283
- if (argv[0] === "log" && isPreflightFailure(err)) {
9284
- handleCommandError(err);
9285
- return false;
9286
- }
9287
- setLogCommandsEnabled(false);
9288
- return true;
9289
- }
9290
- setLogCommandsEnabled(enabled);
9291
- if (!enabled && argv[0] === "log") {
9292
- unknownCommand("log");
9293
- return false;
9294
- }
9295
- return true;
9296
- }
9297
-
9298
9235
  // src/cli.ts
9299
9236
  async function main() {
9300
9237
  warnIfShadowingNpmCopy();
9301
9238
  const argv = process.argv.slice(2);
9302
- const [logOk, finderMissOk] = await Promise.all([gateLogCommands(argv), gateFinderMiss(argv)]);
9303
- if (logOk && finderMissOk) {
9239
+ if (await gateFinderMiss(argv)) {
9304
9240
  await program2.parseAsync();
9305
9241
  }
9306
9242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grovehq/cli",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "Grove's command line, for coding agents building Grove projects.",
5
5
  "homepage": "https://grovehq.com",
6
6
  "license": "UNLICENSED",