@tryarcanist/cli 0.1.288 → 0.1.289

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 +36 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8524,6 +8524,19 @@ async function egressValidateCommand(path = EGRESS_ALLOWLIST_SOURCE_PATH, option
8524
8524
  });
8525
8525
  }
8526
8526
 
8527
+ // src/commands/hades.ts
8528
+ async function hadesCommand(options = {}, command) {
8529
+ assertArcanistSessionMutationAllowed("hades");
8530
+ const { config } = resolveBusinessContext(command, options);
8531
+ const result = await apiFetch(config, "/api/hades-runs", {
8532
+ method: "POST",
8533
+ body: "{}"
8534
+ });
8535
+ emit(command, options, result, (payload) => {
8536
+ console.log(`Started Hades run ${payload.runId} (${payload.jobId}).`);
8537
+ });
8538
+ }
8539
+
8527
8540
  // src/commands/login.ts
8528
8541
  async function loginCommand(options, command) {
8529
8542
  const runtime = getRuntimeOptions(command, options);
@@ -10352,7 +10365,7 @@ function getRawSessionEventPromptId(event) {
10352
10365
  if (isCanonicalRawSessionEvent(event)) {
10353
10366
  return canonicalPromptId(event);
10354
10367
  }
10355
- return typeof event.data?.promptId === "string" && event.data.promptId.length > 0 ? event.data.promptId : void 0;
10368
+ return isRecord(event.data) && typeof event.data.promptId === "string" && event.data.promptId.length > 0 ? event.data.promptId : void 0;
10356
10369
  }
10357
10370
  function getRawSessionEventKind(event) {
10358
10371
  if (!isCanonicalRawSessionEvent(event)) return event.type;
@@ -10398,7 +10411,7 @@ function getRawSessionEventTimestamp(event) {
10398
10411
  if (isCanonicalRawSessionEvent(event)) {
10399
10412
  return Number.isFinite(event.timestampMs) && Number.isFinite(new Date(event.timestampMs).getTime()) ? new Date(event.timestampMs).toISOString() : void 0;
10400
10413
  }
10401
- const dataTimestamp = event.data?.timestamp;
10414
+ const dataTimestamp = isRecord(event.data) ? event.data.timestamp : void 0;
10402
10415
  if (typeof dataTimestamp === "string" && dataTimestamp.length > 0 || typeof dataTimestamp === "number") {
10403
10416
  const parsed = new Date(dataTimestamp);
10404
10417
  if (Number.isFinite(parsed.getTime())) return parsed.toISOString();
@@ -10477,6 +10490,7 @@ function getRawSessionEventData(event) {
10477
10490
  ...base,
10478
10491
  error: payload.message,
10479
10492
  ...typeof payload.code === "string" ? { code: payload.code } : {},
10493
+ ...typeof payload.command === "string" ? { command: payload.command } : {},
10480
10494
  ...payload.details !== void 0 ? { errorDetails: payload.details } : {}
10481
10495
  });
10482
10496
  case "bridge.event":
@@ -10761,21 +10775,20 @@ function mergeMemoryRefs(ids, rawRefs) {
10761
10775
  const byId = /* @__PURE__ */ new Map();
10762
10776
  if (Array.isArray(rawRefs)) {
10763
10777
  for (const entry of rawRefs) {
10764
- if (!entry || typeof entry !== "object") continue;
10765
- const record = entry;
10766
- const id = typeof record.id === "string" ? record.id.trim() : "";
10778
+ if (!isRecord(entry)) continue;
10779
+ const id = typeof entry.id === "string" ? entry.id.trim() : "";
10767
10780
  if (!id) continue;
10768
10781
  const ref = { id };
10769
- if (typeof record.path === "string" && record.path.trim()) ref.path = record.path.trim();
10770
- if (typeof record.title === "string" && record.title.trim()) ref.title = record.title.trim();
10771
- if (typeof record.selectionRank === "number") ref.selectionRank = record.selectionRank;
10772
- if (typeof record.selectionScore === "number") ref.selectionScore = record.selectionScore;
10773
- if (typeof record.reason === "string" && record.reason.trim()) ref.reason = record.reason.trim();
10774
- if (typeof record.expectedEffect === "string" && record.expectedEffect.trim()) {
10775
- ref.expectedEffect = record.expectedEffect.trim();
10782
+ if (typeof entry.path === "string" && entry.path.trim()) ref.path = entry.path.trim();
10783
+ if (typeof entry.title === "string" && entry.title.trim()) ref.title = entry.title.trim();
10784
+ if (typeof entry.selectionRank === "number") ref.selectionRank = entry.selectionRank;
10785
+ if (typeof entry.selectionScore === "number") ref.selectionScore = entry.selectionScore;
10786
+ if (typeof entry.reason === "string" && entry.reason.trim()) ref.reason = entry.reason.trim();
10787
+ if (typeof entry.expectedEffect === "string" && entry.expectedEffect.trim()) {
10788
+ ref.expectedEffect = entry.expectedEffect.trim();
10776
10789
  }
10777
- if (typeof record.observedEffect === "string" && record.observedEffect.trim()) {
10778
- ref.observedEffect = record.observedEffect.trim();
10790
+ if (typeof entry.observedEffect === "string" && entry.observedEffect.trim()) {
10791
+ ref.observedEffect = entry.observedEffect.trim();
10779
10792
  }
10780
10793
  byId.set(id, ref);
10781
10794
  }
@@ -10824,7 +10837,8 @@ function projectSessionError(data, index) {
10824
10837
  id: resolveEventId(data, "err", index),
10825
10838
  error: typeof data?.error === "string" ? data.error : "Unknown error",
10826
10839
  ...resolvePromptId(data) ? { promptId: resolvePromptId(data) } : {},
10827
- ...typeof data?.code === "string" ? { code: data.code } : {}
10840
+ ...typeof data?.code === "string" ? { code: data.code } : {},
10841
+ ...typeof data?.command === "string" ? { command: data.command } : {}
10828
10842
  };
10829
10843
  }
10830
10844
  function recordMalformedSearchBlock(data, state) {
@@ -12397,6 +12411,13 @@ The result is posted as a PR comment marked arcanist-anubis:v1.
12397
12411
  Anubis requires a write-scoped CLI token and repository write access.
12398
12412
  `
12399
12413
  ).action((prUrl, options, command) => anubisCommand(prUrl, options, command));
12414
+ program.command("hades").description("Start an internal Hades adversarial Zeus probe").addHelpText(
12415
+ "after",
12416
+ `
12417
+ Hades is internal-only. It creates one proved adversarial patch in tryarcanist/arcanist;
12418
+ the control plane opens the draft pull request and triggers Zeus.
12419
+ `
12420
+ ).action((options, command) => hadesCommand(options, command));
12400
12421
  sessions.command("stop").description("Stop the active run for a session").argument("<session-id>", "Session ID").addHelpText(
12401
12422
  "after",
12402
12423
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.288",
3
+ "version": "0.1.289",
4
4
  "description": "CLI for Arcanist - create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {