@mrciphersmith/keryx 0.4.2 → 0.4.3

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/cli.js +37 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -23456,7 +23456,7 @@ var package_default;
23456
23456
  var init_package = __esm(() => {
23457
23457
  package_default = {
23458
23458
  name: "@mrciphersmith/keryx",
23459
- version: "0.4.2",
23459
+ version: "0.4.3",
23460
23460
  description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
23461
23461
  private: false,
23462
23462
  publishConfig: {
@@ -278412,9 +278412,12 @@ function resolveRun(state, repo, authority, machine, body) {
278412
278412
  fail6(409, "recovery-required", "Owned supervisor required");
278413
278413
  run.nativeIdentity = report.nativeIdentity;
278414
278414
  run.state = "running";
278415
- } else
278415
+ } else {
278416
278416
  run.state = "lost";
278417
+ run.terminalAt ??= new Date().toISOString();
278418
+ }
278417
278419
  run.version++;
278420
+ run.notificationVersion = (run.notificationVersion ?? 0) + 1;
278418
278421
  run.reconciliationId = receipt.reconciliationId;
278419
278422
  run.observedAt = report.observedAt;
278420
278423
  repo.put("remote_run", run.runId, run, { projectId: run.projectId, machineId: machine.machineId, sessionId: run.sessionId, runId: run.runId });
@@ -279151,6 +279154,7 @@ function resultUpload(state, repo, machine, projectId, runId, body, key) {
279151
279154
  if (drift.length > 0)
279152
279155
  run.pinDrift = drift;
279153
279156
  run.version++;
279157
+ run.notificationVersion = (run.notificationVersion ?? 0) + 1;
279154
279158
  repo.put("remote_run", runId, run, { projectId, machineId: machine.machineId, sessionId: run.sessionId, runId });
279155
279159
  state.events.push({ sequence: (state.events.at(-1)?.sequence ?? 0) + 1, projectId, type: "revision-created", actorId: `machine:${machine.machineId}`, entityId: revision.id, createdAt: iso() });
279156
279160
  return receipt;
@@ -279484,6 +279488,23 @@ function failRejectedDelivery(repo, command, p) {
279484
279488
  operation.deliveryFailure = { error: { code: p.errorCode, message: "The machine refused this operation before starting it; nothing was applied" } };
279485
279489
  repo.put("remote_operation", operation.id, operation);
279486
279490
  }
279491
+ function endRefusedRun(repo, command, p) {
279492
+ if (p.status !== "rejected")
279493
+ return;
279494
+ const envelope = command.envelope;
279495
+ const runId = "target" in envelope ? envelope.target.scope === "run" ? envelope.target.runId : undefined : envelope.runId;
279496
+ const run = runId ? repo.get("remote_run", runId) : undefined;
279497
+ if (!run || run.commandId !== envelope.commandId || run.state !== "dispatching")
279498
+ return;
279499
+ run.state = "rejected";
279500
+ run.version++;
279501
+ run.notificationVersion = (run.notificationVersion ?? 0) + 1;
279502
+ run.terminalAt ??= new Date().toISOString();
279503
+ repo.put("remote_run", run.runId, run);
279504
+ repo.releaseRunCapacity(run.runId);
279505
+ command.capacityReleased = true;
279506
+ failRejectedDelivery(repo, command, p);
279507
+ }
279487
279508
  function commandReceipt(repo, machine, frame, authorityValid) {
279488
279509
  const p = frame.payload;
279489
279510
  const command = repo.get("remote_command", p.commandId);
@@ -279541,6 +279562,7 @@ function commandReceipt(repo, machine, frame, authorityValid) {
279541
279562
  saveSession(repo, row);
279542
279563
  }
279543
279564
  }
279565
+ endRefusedRun(repo, command, p);
279544
279566
  command.receipt = p;
279545
279567
  command.status = p.status;
279546
279568
  repo.put("remote_command", p.commandId, command, { machineId: machine.machineId, projectId: command.projectId, sessionId: targetSession, ..."runId" in command.envelope ? { runId: command.envelope.runId } : {}, seq: p.hubSequence });
@@ -280393,6 +280415,12 @@ function createRemoteControl(ports) {
280393
280415
  if (changed)
280394
280416
  invalidateMachine(changed);
280395
280417
  }
280418
+ if (p[0] === "machines" && p[1] && p[2] === "resolve-run") {
280419
+ const runId = input?.runId;
280420
+ const changed = typeof runId === "string" ? store.remote.get("remote_run", runId) : undefined;
280421
+ if (changed && changed.machineId === p[1])
280422
+ invalidate(changed.projectId, "run", changed.runId, changed.notificationVersion ?? 0);
280423
+ }
280396
280424
  if (p[0] === "projects" && p[1]) {
280397
280425
  if (p[2] === "sessions" && p[3]) {
280398
280426
  const currentSession = store.remote.get("remote_session", p[3]);
@@ -280580,7 +280608,13 @@ function createRemoteControl(ports) {
280580
280608
  if (p[0] === "projects" && p[1] && p[2] === "runs" && p[3] && p[4] === "result" && request.method === "POST") {
280581
280609
  const b = control("ResultUpload", input);
280582
280610
  const key = mutationKey(request);
280583
- return ports.serialized(async () => store.writeTransaction((state, repo) => json2(resultUpload(state, repo, machine(repo, m.machineId), p[1], p[3], b, key))));
280611
+ return ports.serialized(async () => {
280612
+ const response = store.writeTransaction((state, repo) => json2(resultUpload(state, repo, machine(repo, m.machineId), p[1], p[3], b, key)));
280613
+ const changed = store.remote.get("remote_run", p[3]);
280614
+ if (changed)
280615
+ invalidate(changed.projectId, "run", changed.runId, changed.notificationVersion ?? 0);
280616
+ return response;
280617
+ });
280584
280618
  }
280585
280619
  if (p[0] !== "machines" || p[1] !== m.machineId)
280586
280620
  fail6(403, "forbidden", "Machine cannot perform human control actions");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {