@ascenda-one/agent-mcp 0.1.25 → 0.1.27

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 +78 -29
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -544,6 +544,10 @@ var require_metricKeys = __commonJS({
544
544
  orphanedBubbles: { readBy: ["diagnostic"] },
545
545
  orphanedSubagentBubbles: { readBy: ["diagnostic"] },
546
546
  sessionsWithoutTimeline: { readBy: ["diagnostic"] },
547
+ sessionsWithOnlyInheritedLines: {
548
+ readBy: ["diagnostic"],
549
+ note: "Claude Code transcripts holding nothing but a copy of an ancestor's history, so no line's instant is theirs and no session is emitted for them. Excluded by rule, not a read failure: the work is in the transcript that owns it."
550
+ },
547
551
  emptyComposers: { readBy: ["diagnostic"] },
548
552
  apiErrorCount: { readBy: ["diagnostic"] },
549
553
  assistantTurns: { readBy: ["diagnostic"] },
@@ -739,6 +743,16 @@ var require_out = __commonJS({
739
743
  // `ai_prompt_submitted` closes. Neutral so a marker sent once per turn
740
744
  // doesn't weigh on any workload leg.
741
745
  ai_turn_completed: "neutral",
746
+ // The agent stopped and is waiting on the person: Claude Code's
747
+ // `Notification`, Codex's `PermissionRequest`. Supervision, beside the other
748
+ // oversight overhead, because that is what it is — time the person spends
749
+ // attending to the agent rather than to the work.
750
+ //
751
+ // Deliberately NOT risk. Risk is the leg that reads as something going
752
+ // wrong, and being asked is not a failure; classifying it there is the first
753
+ // step toward an interruption count becoming a score, a streak, or something
754
+ // that fires on a miss. It must never become any of those.
755
+ supervision_interruption: "supervision",
742
756
  // Semantic (agent-observed) — see SEMANTIC_WORK_SIGNAL_EVENT_TYPES.
743
757
  approach_churn_detected: "risk",
744
758
  goal_drift_detected: "risk",
@@ -3353,16 +3367,20 @@ var require_liveBus = __commonJS({
3353
3367
  path.join(home, "Library", "Containers", SAVER_HOST_BUNDLE_ID, "Data", "l.sock")
3354
3368
  ];
3355
3369
  }
3356
- function liveBusSocketPath() {
3370
+ function existingSocketCandidates() {
3357
3371
  const candidates = liveBusSocketCandidates();
3358
- for (const candidate of candidates) {
3372
+ if (process.env.ASCENDA_LIVE_BUS_SOCKET)
3373
+ return candidates;
3374
+ return candidates.filter((candidate) => {
3359
3375
  try {
3360
- if (fs.statSync(candidate).isSocket())
3361
- return candidate;
3376
+ return fs.statSync(candidate).isSocket();
3362
3377
  } catch {
3378
+ return false;
3363
3379
  }
3364
- }
3365
- return candidates[0];
3380
+ });
3381
+ }
3382
+ function liveBusSocketPath() {
3383
+ return existingSocketCandidates()[0] ?? liveBusSocketCandidates()[0];
3366
3384
  }
3367
3385
  function bucketPromptSize(text) {
3368
3386
  const length = typeof text === "string" ? text.length : 0;
@@ -3374,44 +3392,75 @@ var require_liveBus = __commonJS({
3374
3392
  return "l";
3375
3393
  return "xl";
3376
3394
  }
3395
+ var NOBODY_LISTENING = /* @__PURE__ */ new Set(["ECONNREFUSED", "ENOENT"]);
3377
3396
  function emitLiveSignal(signal) {
3378
3397
  return new Promise((resolve) => {
3398
+ const candidates = existingSocketCandidates();
3399
+ if (candidates.length === 0) {
3400
+ resolve();
3401
+ return;
3402
+ }
3379
3403
  let settled = false;
3404
+ let socket;
3405
+ const drop = () => {
3406
+ try {
3407
+ socket?.destroy();
3408
+ } catch {
3409
+ }
3410
+ socket = void 0;
3411
+ };
3380
3412
  const done = () => {
3381
3413
  if (settled)
3382
3414
  return;
3383
3415
  settled = true;
3384
- try {
3385
- socket.destroy();
3386
- } catch {
3387
- }
3416
+ clearTimeout(timer);
3417
+ drop();
3388
3418
  resolve();
3389
3419
  };
3390
- let socket;
3391
- try {
3392
- socket = net.createConnection(liveBusSocketPath());
3393
- } catch {
3394
- resolve();
3395
- return;
3396
- }
3397
3420
  const timer = setTimeout(done, WRITE_TIMEOUT_MS);
3398
3421
  if (typeof timer.unref === "function")
3399
3422
  timer.unref();
3400
- if (typeof socket.unref === "function")
3401
- socket.unref();
3402
- socket.on("error", done);
3403
- socket.on("connect", () => {
3423
+ const tryFrom = (index) => {
3424
+ if (settled)
3425
+ return;
3426
+ if (index >= candidates.length) {
3427
+ done();
3428
+ return;
3429
+ }
3430
+ let attempt;
3404
3431
  try {
3405
- socket.write(`${JSON.stringify(signal)}
3406
- `, () => {
3407
- clearTimeout(timer);
3408
- done();
3409
- });
3432
+ attempt = net.createConnection(candidates[index]);
3410
3433
  } catch {
3411
- clearTimeout(timer);
3412
- done();
3434
+ tryFrom(index + 1);
3435
+ return;
3413
3436
  }
3414
- });
3437
+ socket = attempt;
3438
+ if (typeof attempt.unref === "function")
3439
+ attempt.unref();
3440
+ let connected = false;
3441
+ attempt.on("error", (error2) => {
3442
+ if (settled || socket !== attempt)
3443
+ return;
3444
+ if (!connected && error2.code && NOBODY_LISTENING.has(error2.code)) {
3445
+ drop();
3446
+ tryFrom(index + 1);
3447
+ return;
3448
+ }
3449
+ done();
3450
+ });
3451
+ attempt.on("connect", () => {
3452
+ if (settled || socket !== attempt)
3453
+ return;
3454
+ connected = true;
3455
+ try {
3456
+ attempt.write(`${JSON.stringify(signal)}
3457
+ `, done);
3458
+ } catch {
3459
+ done();
3460
+ }
3461
+ });
3462
+ };
3463
+ tryFrom(0);
3415
3464
  });
3416
3465
  }
3417
3466
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "publishConfig": { "access": "public" },
3
3
  "name": "@ascenda-one/agent-mcp",
4
- "version": "0.1.25",
4
+ "version": "0.1.27",
5
5
  "description": "MCP server exposing ascenda_emit_work_signal — the one submission interface for agent-observed (semantic) work-friction signals.",
6
6
  "repository": {
7
7
  "type": "git",