halfcycle 0.8.0 → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halfcycle",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Halfcycle Method bundle — resolution-stub slash commands, remote method-delivery registration, and governance-hook wiring for a Halfcycle engagement repo. It ships NO worker role files: a project's roles are authored from that project's own recorded decisions at orchestration kickoff (FX-2, W3-F-27).",
5
5
  "commands": [
6
6
  {
@@ -19507,6 +19507,17 @@ var phaseModelsFileSchema = external_exports.object({
19507
19507
  tasks: external_exports.record(external_exports.string().min(1).max(200), external_exports.record(external_exports.string().min(1).max(PHASE_MODEL_NAME_MAX), external_exports.number().int().min(0)))
19508
19508
  }).strict();
19509
19509
 
19510
+ // ../events/dist/checks-report-words.js
19511
+ var CHECKS_NO_REPORT_YET_STATE = "Set up, no report yet";
19512
+ var CHECKS_GONE_QUIET = "Halfcycle's checks have not reported from this machine lately.";
19513
+ function checksReportOfInstructions(text) {
19514
+ if (text.startsWith(CHECKS_NO_REPORT_YET_STATE))
19515
+ return "no-report-yet";
19516
+ if (text.startsWith(CHECKS_GONE_QUIET))
19517
+ return "gone-quiet";
19518
+ return "none";
19519
+ }
19520
+
19510
19521
  // dist/hook-protocol.js
19511
19522
  import { writeSync } from "node:fs";
19512
19523
 
@@ -35113,6 +35124,10 @@ function discardBody(res) {
35113
35124
  res.body?.cancel().catch(() => void 0);
35114
35125
  }
35115
35126
  var CUT_OFF = /* @__PURE__ */ Symbol("cut-off");
35127
+ function reportOf(body) {
35128
+ const instructions = body["result"]["instructions"];
35129
+ return typeof instructions === "string" ? checksReportOfInstructions(instructions) : "none";
35130
+ }
35116
35131
  async function postInitialize(url2, bearer, fetchFn, signal) {
35117
35132
  let res;
35118
35133
  try {
@@ -35146,7 +35161,7 @@ async function postInitialize(url2, bearer, fetchFn, signal) {
35146
35161
  } catch {
35147
35162
  return SERVICE_PROBLEM_SENTENCE;
35148
35163
  }
35149
- return namesItsServer(body) ? void 0 : SERVICE_PROBLEM_SENTENCE;
35164
+ return namesItsServer(body) ? { report: reportOf(body) } : SERVICE_PROBLEM_SENTENCE;
35150
35165
  }
35151
35166
  async function probeDelivery(url2, bearer, fetchFn, deadlineMs, maxAttempts) {
35152
35167
  const controller = new AbortController();
@@ -35180,7 +35195,9 @@ async function checkConnection(renewedToken, opts) {
35180
35195
  return { sentence: PLACEHOLDER_SENTENCES[bearer], url: url2, bearer, connected: false };
35181
35196
  }
35182
35197
  const outcome = await probeDelivery(url2, bearer, opts.fetchFn ?? globalThis.fetch, opts.checkDeadlineMs ?? CONNECTION_CHECK_DEADLINE_MS, opts.maxAttempts ?? SESSION_START_PROBE_ATTEMPTS);
35183
- return { sentence: outcome ?? connectedSentenceFor(profile), url: url2, bearer, connected: outcome === void 0 };
35198
+ if (typeof outcome === "string")
35199
+ return { sentence: outcome, url: url2, bearer, connected: false };
35200
+ return { sentence: connectedSentenceFor(profile), url: url2, bearer, connected: true, report: outcome.report };
35184
35201
  }
35185
35202
  function positionRequestBody(engagementId) {
35186
35203
  return JSON.stringify({
@@ -36099,7 +36116,8 @@ async function checkConnectionLine(opts) {
36099
36116
  });
36100
36117
  if (result === void 0)
36101
36118
  return { kind: "not-registered", sentence: null };
36102
- return { kind: connectionKind(result.bearer, result.sentence), sentence: result.sentence };
36119
+ const line2 = { kind: connectionKind(result.bearer, result.sentence), sentence: result.sentence };
36120
+ return result.report === void 0 || result.report === "none" ? line2 : { ...line2, report: result.report };
36103
36121
  }
36104
36122
  async function runCheckConnection(opts) {
36105
36123
  const line2 = await checkConnectionLine(opts);
package/dist/cli.js CHANGED
@@ -7124,6 +7124,12 @@ function seenModelsLineOf(task, models) {
7124
7124
  return `Seen in your coding agent's own records: ${task} ran on ${joinedOf(models)}.`;
7125
7125
  }
7126
7126
 
7127
+ // ../events/dist/checks-report-words.js
7128
+ var CHECKS_NO_REPORT_YET_STATE = "Set up, no report yet";
7129
+ var CHECKS_NO_REPORT_YET_WHEN = "Halfcycle's checks report after the first file edit they can see. A new shell file counts once added to git.";
7130
+ var CHECKS_IF_STILL_UNREPORTED = "If edits go unreported: Codex, approve /hooks; Claude Code, trust this folder.";
7131
+ var CHECKS_GONE_QUIET = "Halfcycle's checks have not reported from this machine lately.";
7132
+
7127
7133
  // dist/engagement-credential.js
7128
7134
  import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
7129
7135
  import { platform as platform2 } from "node:os";
@@ -12653,9 +12659,10 @@ function runDoctor(root, options) {
12653
12659
  const version = offline ? notChecked("Up to date", "Connected") : upToDate ? { ok: true, text: `Up to date: yes (${current}).` } : { ok: false, text: versionNoLine(installed, current) };
12654
12660
  const lines = [setUp.line, connection.signedIn, connection.connected, checksRunning, version];
12655
12661
  const failing = lines.filter((line) => !line.ok && !line.cascading).length;
12656
- const closing = failing === 0 ? "Everything is working." : `${failing} of these ${failing === 1 ? "needs" : "need"} fixing; each line above says what to do.`;
12657
- const codex = codexLine(root, options);
12658
- const printed = codex === void 0 ? lines : [...lines.slice(0, 4), codex, ...lines.slice(4)];
12662
+ const report = running.state === "answered" ? running.report : "none";
12663
+ const closing = failing === 0 ? closingWithNothingFailing(report) : `${failing} of these ${failing === 1 ? "needs" : "need"} fixing; each line above says what to do.`;
12664
+ const extras = [codexLine(root, options), reportsLine(report)].filter((line) => line !== void 0);
12665
+ const printed = [...lines.slice(0, 4), ...extras, ...lines.slice(4)];
12659
12666
  return {
12660
12667
  text: [...printed.map((line) => line.text), closing].join("\n"),
12661
12668
  exitCode: failing === 0 ? 0 : 1
@@ -12793,7 +12800,9 @@ function parseAnswer(stdout) {
12793
12800
  return void 0;
12794
12801
  if (parsed["kind"] !== "not-registered" && typeof sentence !== "string")
12795
12802
  return void 0;
12796
- return { kind: parsed["kind"], sentence };
12803
+ const said = parsed["report"];
12804
+ const report = parsed["kind"] === "connected" && (said === "no-report-yet" || said === "gone-quiet") ? said : "none";
12805
+ return { kind: parsed["kind"], sentence, report };
12797
12806
  }
12798
12807
  function checksRunningLine(running, hooksMissing) {
12799
12808
  if (running.state === "not-run")
@@ -12834,6 +12843,17 @@ function connectionLines(running) {
12834
12843
  connected: { ok: false, text: `Connected: no. ${sentence ?? ""}`.trimEnd() }
12835
12844
  };
12836
12845
  }
12846
+ function reportsLine(report) {
12847
+ if (report === "no-report-yet") {
12848
+ return { ok: true, text: `Reports: ${CHECKS_NO_REPORT_YET_STATE}. ${CHECKS_NO_REPORT_YET_WHEN} ${CHECKS_IF_STILL_UNREPORTED}` };
12849
+ }
12850
+ return report === "gone-quiet" ? { ok: true, text: `Reports: ${CHECKS_GONE_QUIET}` } : void 0;
12851
+ }
12852
+ function closingWithNothingFailing(report) {
12853
+ if (report === "no-report-yet")
12854
+ return `${CHECKS_NO_REPORT_YET_STATE}.`;
12855
+ return report === "gone-quiet" ? CHECKS_GONE_QUIET : "Everything is working.";
12856
+ }
12837
12857
  function installedVersion(root) {
12838
12858
  try {
12839
12859
  return checkDrift(root).installed;