halfcycle 0.4.2 → 0.4.4

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.4.2",
3
+ "version": "0.4.4",
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
  {
@@ -17517,11 +17517,17 @@ function deleteMarker(repoRoot, sessionId) {
17517
17517
  }
17518
17518
  }
17519
17519
  }
17520
- var NO_REPO_NOTICE_SUFFIX = ".norepo";
17521
- function firstNoRepoNoticeThisSession(folder, sessionId) {
17520
+ var SESSION_NOTICE_SUFFIX = {
17521
+ "no-repository": ".norepo",
17522
+ "credential-rejected": ".credential",
17523
+ "credential-renewed-for-this-run": ".renewed",
17524
+ "credential-missing": ".nocredential"
17525
+ };
17526
+ function firstNoticeThisSession(notice, folder, sessionId) {
17522
17527
  if (!sessionId)
17523
17528
  return true;
17524
- const path = join6(markerDir(), `${MARKER_PREFIX}${repoHash(folder)}-${sessionId}${NO_REPO_NOTICE_SUFFIX}`);
17529
+ const suffix = SESSION_NOTICE_SUFFIX[notice];
17530
+ const path = join6(markerDir(), `${MARKER_PREFIX}${repoHash(folder)}-${sessionId}${suffix}`);
17525
17531
  try {
17526
17532
  writeFileSync3(path, "", { encoding: "utf-8", flag: "wx" });
17527
17533
  return true;
@@ -17529,6 +17535,15 @@ function firstNoRepoNoticeThisSession(folder, sessionId) {
17529
17535
  return err.code !== "EEXIST";
17530
17536
  }
17531
17537
  }
17538
+ function warnOnceThisSession(notice, folder, sessionId) {
17539
+ return (message) => {
17540
+ if (firstNoticeThisSession(notice, folder, sessionId))
17541
+ process.stderr.write(message);
17542
+ };
17543
+ }
17544
+ function firstNoRepoNoticeThisSession(folder, sessionId) {
17545
+ return firstNoticeThisSession("no-repository", folder, sessionId);
17546
+ }
17532
17547
  function readDedupe(repoRoot, sessionId) {
17533
17548
  const path = dedupePath(repoRoot, sessionId);
17534
17549
  if (!existsSync4(path))
@@ -17796,6 +17811,8 @@ async function evaluateEdit(reply, readSeat) {
17796
17811
  const configResult = readConfig();
17797
17812
  if (!configResult.config) {
17798
17813
  await emitRunRecord({ runType: "hook", outcome: "unconfigured", changeSet });
17814
+ if (!firstNoticeThisSession("credential-missing", repoRoot, input.session_id))
17815
+ return;
17799
17816
  emitNeverConfigured(UNCONFIGURED_EXIT_TOOL_USE, readNeverConfiguredReason());
17800
17817
  return;
17801
17818
  }
@@ -17805,7 +17822,8 @@ async function evaluateEdit(reply, readSeat) {
17805
17822
  guardServiceUrl,
17806
17823
  token: guardServiceToken,
17807
17824
  engagementId: guardEngagementId,
17808
- request: buildEvaluationRequest(guardEngagementId, changeSet, context, seatConfiguration)
17825
+ request: buildEvaluationRequest(guardEngagementId, changeSet, context, seatConfiguration),
17826
+ warn: warnOnceThisSession("credential-renewed-for-this-run", repoRoot, input.session_id)
17809
17827
  });
17810
17828
  const clientResult = evaluation.result;
17811
17829
  if (!clientResult.ok) {
@@ -17820,6 +17838,8 @@ async function evaluateEdit(reply, readSeat) {
17820
17838
  credentialRefused: failure.kind === "credential"
17821
17839
  });
17822
17840
  if (failure.kind === "credential") {
17841
+ if (!firstNoticeThisSession("credential-rejected", repoRoot, input.session_id))
17842
+ return;
17823
17843
  emitCredentialRejected(
17824
17844
  failure.statusCode,
17825
17845
  failure.message,
@@ -17972,6 +17992,8 @@ async function evaluateSession(input, kind, reply, readSeat) {
17972
17992
  const configResult = readConfig();
17973
17993
  if (!configResult.config) {
17974
17994
  await emitRunRecord({ runType: "hook", outcome: "unconfigured", changeSet, diffBase });
17995
+ if (!firstNoticeThisSession("credential-missing", repoRoot, sessionId))
17996
+ return;
17975
17997
  emitNeverConfigured(UNCONFIGURED_EXIT_STOP_FAMILY, readNeverConfiguredReason());
17976
17998
  return;
17977
17999
  }
@@ -17981,7 +18003,8 @@ async function evaluateSession(input, kind, reply, readSeat) {
17981
18003
  guardServiceUrl,
17982
18004
  token: guardServiceToken,
17983
18005
  engagementId: guardEngagementId,
17984
- request: buildEvaluationRequest(guardEngagementId, changeSet, context, seatConfiguration)
18006
+ request: buildEvaluationRequest(guardEngagementId, changeSet, context, seatConfiguration),
18007
+ warn: warnOnceThisSession("credential-renewed-for-this-run", repoRoot, sessionId)
17985
18008
  });
17986
18009
  const clientResult = evaluation.result;
17987
18010
  if (!clientResult.ok) {
@@ -17997,6 +18020,8 @@ async function evaluateSession(input, kind, reply, readSeat) {
17997
18020
  credentialRefused: failure.kind === "credential"
17998
18021
  });
17999
18022
  if (failure.kind === "credential") {
18023
+ if (!firstNoticeThisSession("credential-rejected", repoRoot, sessionId))
18024
+ return;
18000
18025
  emitCredentialRejected(
18001
18026
  failure.statusCode,
18002
18027
  failure.message,
@@ -18411,7 +18436,7 @@ async function refreshCredentialToken(opts) {
18411
18436
  return { token: refreshed.token };
18412
18437
  }
18413
18438
  var CHECKED_SOURCES = /* @__PURE__ */ new Set(["startup", "resume"]);
18414
- var CONNECTED_SENTENCE = `Halfcycle's sign-in works and its service answered. If Halfcycle's tools are missing, turn on ${MCP_SERVER_KEY} in /mcp; if /mcp does not list it, run "claude mcp reset-project-choices" in this folder and restart Claude Code.`;
18439
+ var CONNECTED_SENTENCE = `Halfcycle's sign-in works and its service answered. If its tools are missing, turn on ${MCP_SERVER_KEY} in /mcp; if it is not listed, run "claude mcp reset-project-choices" here and restart Claude Code.`;
18415
18440
  var INITIALIZE_BODY = JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: {} });
18416
18441
  function registeredMcpUrl(projectRoot) {
18417
18442
  let parsed;
@@ -1 +1 @@
1
- {"version":3,"file":"claude-version-probe.d.ts","sourceRoot":"","sources":["../src/claude-version-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;G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