halfcycle 0.4.4 → 0.4.5

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.4",
3
+ "version": "0.4.5",
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
  {
@@ -18471,37 +18471,52 @@ function namesItsServer(body) {
18471
18471
  function discardBody(res) {
18472
18472
  res.body?.cancel().catch(() => void 0);
18473
18473
  }
18474
+ var CUT_OFF = /* @__PURE__ */ Symbol("cut-off");
18475
+ async function postInitialize(url2, bearer, fetchFn, signal) {
18476
+ let res;
18477
+ try {
18478
+ res = await fetchFn(url2, {
18479
+ method: "POST",
18480
+ headers: { "content-type": "application/json", authorization: `Bearer ${bearer}` },
18481
+ body: INITIALIZE_BODY,
18482
+ redirect: "manual",
18483
+ signal
18484
+ });
18485
+ } catch {
18486
+ return CANNOT_REACH_SENTENCE;
18487
+ }
18488
+ if (res.status === 401) {
18489
+ discardBody(res);
18490
+ return NO_CREDENTIAL_SENTENCE;
18491
+ }
18492
+ if (res.status < 200 || res.status > 299) {
18493
+ discardBody(res);
18494
+ return SERVICE_PROBLEM_SENTENCE;
18495
+ }
18496
+ let text;
18497
+ try {
18498
+ text = await res.text();
18499
+ } catch {
18500
+ return signal.aborted ? CANNOT_REACH_SENTENCE : CUT_OFF;
18501
+ }
18502
+ let body;
18503
+ try {
18504
+ body = JSON.parse(text);
18505
+ } catch {
18506
+ return SERVICE_PROBLEM_SENTENCE;
18507
+ }
18508
+ return namesItsServer(body) ? void 0 : SERVICE_PROBLEM_SENTENCE;
18509
+ }
18474
18510
  async function probeDelivery(url2, bearer, fetchFn, deadlineMs) {
18475
18511
  const controller = new AbortController();
18476
18512
  const timer = setTimeout(() => controller.abort(), deadlineMs);
18477
18513
  try {
18478
- let res;
18479
- try {
18480
- res = await fetchFn(url2, {
18481
- method: "POST",
18482
- headers: { "content-type": "application/json", authorization: `Bearer ${bearer}` },
18483
- body: INITIALIZE_BODY,
18484
- redirect: "manual",
18485
- signal: controller.signal
18486
- });
18487
- } catch {
18488
- return CANNOT_REACH_SENTENCE;
18489
- }
18490
- if (res.status === 401) {
18491
- discardBody(res);
18492
- return NO_CREDENTIAL_SENTENCE;
18493
- }
18494
- if (res.status < 200 || res.status > 299) {
18495
- discardBody(res);
18496
- return SERVICE_PROBLEM_SENTENCE;
18497
- }
18498
- let body;
18499
- try {
18500
- body = await res.json();
18501
- } catch {
18502
- return controller.signal.aborted ? CANNOT_REACH_SENTENCE : SERVICE_PROBLEM_SENTENCE;
18514
+ for (let attempt2 = 0; attempt2 < 2; attempt2++) {
18515
+ const outcome = await postInitialize(url2, bearer, fetchFn, controller.signal);
18516
+ if (outcome !== CUT_OFF)
18517
+ return outcome;
18503
18518
  }
18504
- return namesItsServer(body) ? void 0 : SERVICE_PROBLEM_SENTENCE;
18519
+ return CANNOT_REACH_SENTENCE;
18505
18520
  } finally {
18506
18521
  clearTimeout(timer);
18507
18522
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halfcycle",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Your coding agents are the engineers. Halfcycle is the rest of the team: product owner, architect, planner and independent reviewer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",