@ascenda-one/agent-mcp 0.1.40 → 0.1.41

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 +76 -10
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -608,7 +608,7 @@ var require_metricKeys = __commonJS({
608
608
  family: "context",
609
609
  readBy: ["handoff"],
610
610
  unit: "tokens",
611
- note: "Codex only: the model_context_window the rollout itself recorded \u2014 the real denominator its contextWindowPeakPct was computed against. Claude Code records no window and its ratio assumes 200k; absent here means the store never said."
611
+ note: "Codex: the model_context_window the rollout itself recorded \u2014 the real denominator its contextWindowPeakPct was computed against. VS Code: the largest modelConfiguration.contextSize a Copilot request recorded. Claude Code records no window and its ratio assumes 200k; absent here means the store never said."
612
612
  },
613
613
  date: { family: "clock", readBy: ["handoff"] },
614
614
  errorCount: { family: "outcome", readBy: ["handoff"] },
@@ -724,6 +724,17 @@ var require_metricKeys = __commonJS({
724
724
  unit: "lines",
725
725
  note: "Claude Code only: user lines written by the Agent SDK or a headless run (entrypoint sdk-*). Nobody typed them, so promptCount leaves them out. Counted once per line across the store."
726
726
  },
727
+ copilotCredits: {
728
+ family: "context",
729
+ readBy: ["diagnostic"],
730
+ unit: "Copilot credits",
731
+ note: "VS Code only: the sum of each Copilot request's copilotCredits, rounded to five decimal places. Absent where no request recorded the figure, which Copilot builds before Jun 2026 don't."
732
+ },
733
+ reasoningEffort: {
734
+ family: "model",
735
+ readBy: ["diagnostic"],
736
+ note: "VS Code only: the modelConfiguration.reasoningEffort most of a Copilot session's requests ran with. Absent where no request recorded a model configuration."
737
+ },
727
738
  tokensNotCollected: {
728
739
  family: "context",
729
740
  readBy: ["diagnostic"],
@@ -737,7 +748,28 @@ var require_metricKeys = __commonJS({
737
748
  duplicateChatSessions: {
738
749
  family: "reading",
739
750
  readBy: ["diagnostic"],
740
- note: "VS Code only: chat sessions seen in more than one place (a transferred session also in a workspace). Counted once."
751
+ note: "VS Code only: chat sessions seen in more than one place (a transferred session also in a workspace). Counted once. Copilot CLI uses it for a session written both as a directory and as an older flat file."
752
+ },
753
+ clientName: {
754
+ family: "session",
755
+ readBy: ["diagnostic"],
756
+ note: "Copilot CLI only: workspace.yaml's client_name, one constant word naming what started the CLI (vscode, vscode-agent-host). Absent on sessions written before the field existed, which were the standalone CLI."
757
+ },
758
+ totalApiDurationMs: {
759
+ family: "session",
760
+ readBy: ["diagnostic"],
761
+ unit: "milliseconds",
762
+ note: "Copilot CLI only: session.shutdown.totalApiDurationMs, the time the session spent waiting on model calls. Absent where the session has no shutdown event."
763
+ },
764
+ selectedModel: {
765
+ family: "model",
766
+ readBy: ["diagnostic"],
767
+ note: "Copilot CLI only: the model the person chose at session start (session.start.selectedModel), which is auto when they let the router pick. primaryModel is the model that served the session, so the two differ exactly when the router chose."
768
+ },
769
+ selectedModelClass: {
770
+ family: "model",
771
+ readBy: ["diagnostic"],
772
+ note: "Copilot CLI only: classifyModelClass of selectedModel, so a session whose person picked auto reads router:auto beside the served model's class."
741
773
  },
742
774
  sessionsStartedFromBubble: {
743
775
  family: "reading",
@@ -1259,7 +1291,7 @@ var require_collectorVersion = __commonJS({
1259
1291
  exports.COLLECTOR_VERSION = exports.UNRELEASED_COLLECTOR_VERSION = void 0;
1260
1292
  exports.describeCollectorVersion = describeCollectorVersion;
1261
1293
  exports.UNRELEASED_COLLECTOR_VERSION = "unreleased";
1262
- exports.COLLECTOR_VERSION = "0.1.40" ? "0.1.40" : exports.UNRELEASED_COLLECTOR_VERSION;
1294
+ exports.COLLECTOR_VERSION = "0.1.41" ? "0.1.41" : exports.UNRELEASED_COLLECTOR_VERSION;
1263
1295
  function describeCollectorVersion(version2 = exports.COLLECTOR_VERSION) {
1264
1296
  return version2 === exports.UNRELEASED_COLLECTOR_VERSION ? `${version2} (built from a checkout, not a release)` : version2;
1265
1297
  }
@@ -3924,6 +3956,8 @@ var require_hookAdapter = __commonJS({
3924
3956
  if (!logFile)
3925
3957
  throw error2;
3926
3958
  logUnsent(logFile, events, options);
3959
+ if (!(error2 instanceof MissingInstallationIdError))
3960
+ throw error2;
3927
3961
  return;
3928
3962
  }
3929
3963
  const sender = new eventSender_1.AscendaEventSender({
@@ -4092,6 +4126,7 @@ var require_studyJoin = __commonJS({
4092
4126
  };
4093
4127
  }();
4094
4128
  Object.defineProperty(exports, "__esModule", { value: true });
4129
+ exports.gitOfferLine = gitOfferLine;
4095
4130
  exports.runStudyJoin = runStudyJoin;
4096
4131
  exports.formatWindow = formatWindow;
4097
4132
  exports.describeStudyGrant = describeStudyGrant;
@@ -4100,6 +4135,11 @@ var require_studyJoin = __commonJS({
4100
4135
  var readline = __importStar(__require("node:readline"));
4101
4136
  var confirmLinks_1 = require_confirmLinks();
4102
4137
  var http_1 = require_http();
4138
+ function gitOfferLine(optionalImportStores) {
4139
+ if (!optionalImportStores?.includes("git"))
4140
+ return void 0;
4141
+ return "The page also has an unticked box for git history: commit times, size buckets, files changed and whether each is a merge. No messages, paths, names or emails.";
4142
+ }
4103
4143
  var STUDY_JOIN_MODE = "report";
4104
4144
  var POLL_INTERVAL_MS = 3e3;
4105
4145
  var POLL_TIMEOUT_MS = 11 * 60 * 1e3;
@@ -4136,6 +4176,9 @@ var require_studyJoin = __commonJS({
4136
4176
  print("Report (30 days) grants:");
4137
4177
  for (const grant of start.grants)
4138
4178
  print(` ${describeStudyGrant(grant)}`);
4179
+ const gitOffer = gitOfferLine(start.optionalImportStores);
4180
+ if (gitOffer)
4181
+ print(gitOffer);
4139
4182
  print("");
4140
4183
  print("Study mode needs the Ascenda app. Open the app to join that way instead.");
4141
4184
  print("");
@@ -4190,7 +4233,7 @@ var require_studyJoin = __commonJS({
4190
4233
  print("");
4191
4234
  print("Each of these can be turned off separately, in the app's consent settings.");
4192
4235
  print("The organisation sees group counts, never who joined.");
4193
- report({ status: "joined", start, granted });
4236
+ report({ status: "joined", start, granted, importStores: poll.importStores ?? null });
4194
4237
  return 0;
4195
4238
  }
4196
4239
  if (poll.status === "expired") {
@@ -4212,7 +4255,7 @@ var require_studyJoin = __commonJS({
4212
4255
  print("Each of these can be turned off separately, in the app's consent settings.");
4213
4256
  }
4214
4257
  print("Run join again, or check with your organisation.");
4215
- report({ status: "refused", start, granted, refusedReason: poll.refusedReason, message: describeRefusal(poll.refusedReason) });
4258
+ report({ status: "refused", start, granted, refusedReason: poll.refusedReason, message: describeRefusal(poll.refusedReason), importStores: poll.importStores ?? null });
4216
4259
  return 1;
4217
4260
  }
4218
4261
  print("");
@@ -4393,8 +4436,10 @@ var require_pairingStudyJoin = __commonJS({
4393
4436
  const join = attempt.carriesJoin ? session.studyJoin : void 0;
4394
4437
  if (!join)
4395
4438
  return (0, confirmLinks_1.pairingConfirmLines)(session.qrUrl, session.code);
4439
+ const gitOffer = (0, studyJoin_1.gitOfferLine)(join.optionalImportStores);
4396
4440
  return [
4397
4441
  `This also joins ${join.organisationName} (${(0, studyJoin_1.formatWindow)(join.windowStartUtc, join.windowEndUtc)}). The page shows what you'd share before you confirm.`,
4442
+ ...gitOffer ? [gitOffer] : [],
4398
4443
  `Open this link to confirm: ${session.qrUrl}`
4399
4444
  ];
4400
4445
  }
@@ -5964,7 +6009,7 @@ ${(0, setupDisclosure_1.renderSetupDisclosure)({ sends: spec.sends, displayName:
5964
6009
  if (options.dryRun) {
5965
6010
  row("info", "moved", `would remove the copy in ${(0, hookRunner_1.tidyHomePath)(otherFile, os.homedir())}, so each event runs once`);
5966
6011
  } else if (removeOurHookEntries(otherFile, spec)) {
5967
- row("ok", "moved", `removed the copy in ${(0, hookRunner_1.tidyHomePath)(otherFile, os.homedir())}, so each event runs once ${ui.dim("(backup beside it)")}`);
6012
+ row("ok", "moved", `removed the copy in ${(0, hookRunner_1.tidyHomePath)(otherFile, os.homedir())}, so each event runs once${spec.settings.owned ? "" : ` ${ui.dim("(backup beside it)")}`}`);
5968
6013
  } else {
5969
6014
  row("warn", "note", `${(0, hookRunner_1.tidyHomePath)(otherFile, os.homedir())} registers these hooks too, so each event runs twice.`);
5970
6015
  detail("", `Remove the ${spec.binaryName} entries from one of the two files.`);
@@ -6236,7 +6281,7 @@ Pairing ${status.status}. Run setup again.`);
6236
6281
  function writeHookSettings(settingsFile, binary, spec, dryRun) {
6237
6282
  let settings = { ...spec.settings.scaffold ?? {} };
6238
6283
  const exists = fs.existsSync(settingsFile);
6239
- if (exists) {
6284
+ if (exists && !spec.settings.owned) {
6240
6285
  const raw = fs.readFileSync(settingsFile, "utf8").trim();
6241
6286
  if (raw) {
6242
6287
  try {
@@ -6249,7 +6294,7 @@ ${settingsFile} is not valid JSON. Fix or move it, then run setup again.`);
6249
6294
  }
6250
6295
  }
6251
6296
  const command = hookCommand(binary, spec);
6252
- const hooks = { ...settings.hooks ?? {} };
6297
+ const hooks = spec.settings.owned ? {} : { ...settings.hooks ?? {} };
6253
6298
  for (const event of spec.hookEvents) {
6254
6299
  hooks[event] = placeOurEntry(hooks[event] ?? [], spec.settings.entry(command, event), spec);
6255
6300
  }
@@ -6264,6 +6309,11 @@ ${settingsFile} is not valid JSON. Fix or move it, then run setup again.`);
6264
6309
  ${serialised}`);
6265
6310
  return true;
6266
6311
  }
6312
+ if (spec.settings.owned) {
6313
+ fs.mkdirSync(path.dirname(settingsFile), { recursive: true });
6314
+ (0, hookRunner_1.writeAtomically)(settingsFile, serialised, 420);
6315
+ return true;
6316
+ }
6267
6317
  (0, settingsFile_1.replaceSettingsFile)(settingsFile, serialised);
6268
6318
  return true;
6269
6319
  }
@@ -6518,6 +6568,15 @@ ${serialised}`);
6518
6568
  if (found.length)
6519
6569
  lines.push("", ...found);
6520
6570
  }
6571
+ if (spec.doctorExtras) {
6572
+ try {
6573
+ const extra = spec.doctorExtras(ui);
6574
+ if (extra.length)
6575
+ lines.push("", ...extra);
6576
+ } catch (error2) {
6577
+ lines.push("", ` ${spec.displayName} checks could not run: ${error2 instanceof Error ? error2.message : String(error2)}`);
6578
+ }
6579
+ }
6521
6580
  lines.push("", ...accountLines(ui, spec));
6522
6581
  const localOnly = (0, credentials_1.isLocalOnlyHostInstall)(spec.host, (id) => (0, tokenStore_1.readTokenFile)((0, tokenStore_1.defaultTokenFilePath)(id)) !== void 0);
6523
6582
  lines.push("", ` ${ui.bold("Local events")} ${(0, eventLog_1.describeEventLog)((0, eventLog_1.resolveEventLog)({ localOnly }), `npx ${spec.packageName} setup`)}`);
@@ -6573,6 +6632,10 @@ ${serialised}`);
6573
6632
  function removeOurHookEntries(settingsFile, spec) {
6574
6633
  if (!fs.existsSync(settingsFile))
6575
6634
  return true;
6635
+ if (spec.settings.owned) {
6636
+ fs.rmSync(settingsFile, { force: true });
6637
+ return true;
6638
+ }
6576
6639
  try {
6577
6640
  const settings = JSON.parse(fs.readFileSync(settingsFile, "utf8"));
6578
6641
  const hooks = { ...settings.hooks ?? {} };
@@ -6600,7 +6663,7 @@ ${serialised}`);
6600
6663
  console.error(`could not parse ${settingsFile} \u2014 remove the ascenda hook entries by hand`);
6601
6664
  return 1;
6602
6665
  }
6603
- console.log(`hooks removed from ${settingsFile}`);
6666
+ console.log(spec.settings.owned ? `removed ${settingsFile}` : `hooks removed from ${settingsFile}`);
6604
6667
  }
6605
6668
  for (const file of (0, hookRunner_1.removeHookRunner)(spec.binaryName)) {
6606
6669
  if (!file.endsWith(".node") && !file.endsWith(".no-node"))
@@ -6953,7 +7016,7 @@ var require_out3 = __commonJS({
6953
7016
  exports.shouldAnnounceFailure = exports.recordSendOutcome = exports.readCollectorState = exports.defaultStateFilePath = exports.tokenExpiryFilePath = exports.readTokenFile = exports.readTokenExpiry = exports.persistEventWriteToken = exports.listPersistedToolInstallationIds = exports.defaultTokenFilePath = exports.ascendaHome = exports.EVENT_TOKEN_TTL_MS = exports.recordTurnStart = exports.readTurnPromptId = exports.consumeTurnDurationMs = exports.writeTopLevelCredentials = exports.writeMachineCredentials = exports.writeRepoKeysSetting = exports.writeEventLogSetting = exports.writeHostCredentials = exports.removeHostCredentials = exports.readMachineCredentials = exports.readHostCredentials = exports.isLocalOnlyHostInstall = exports.credentialsFilePath = exports.renderSetupDisclosure = exports.REFUSALS = exports.FREE_TEXT_KEYS = exports.FAMILY_SENTENCES = exports.ALWAYS_SENT = exports.writeHookSettings = exports.trustProblemLines = exports.runCliAgentSetup = exports.registeredHookSets = exports.ourHookPositions = exports.isCliAgentManagementCommand = exports.findStaleHookCommands = exports.cliAgentHookBinPath = exports.resolveContextHashes = exports.resolveCliAgentInstallationId = exports.withPromptId = exports.withForgeKeys = exports.loadCliAgentConfig = exports.flushHookOutbox = exports.deliverHookEvents = exports.MissingInstallationIdError = exports.DEFAULT_API_BASE_URL = exports.resolveEventLogPath = exports.resolveEventLog = exports.parseEventLogFlag = void 0;
6954
7017
  exports.saverReplayPath = exports.saverContainerDir = exports.readSaverStatuses = exports.probeSocket = exports.heldForSaver = exports.holdForSaver = exports.LIVE_BUS_BACKGROUND_TRUST_MS = exports.liveBusSocketCandidates = exports.liveBusSocketPath = exports.bucketPromptSize = exports.deliverLine = exports.emitLiveSignal = exports.repoKeysEnabled = exports.deriveForgeKeysForCwd = exports.REPO_KEYS_ENV_VAR = exports.recordForgeProjectAlias = exports.forgeFullNameFromConfig = exports.readForgeFullName = exports.parseForgeFullName = exports.forgeBranchKey = exports.forgeRepoKey = exports.forgeProjectHash = exports.workContextRegistryFilePath = exports.readWorkContextRegistry = exports.recordWorkContextAlias = exports.recordWorkContext = exports.readBranchName = exports.normalizeBranchName = exports.deriveBranchHashForCwd = exports.deriveBranchHash = exports.deriveWorkContext = exports.hashWithMachineSalt = exports.readOrCreateMachineSalt = exports.machineSaltFilePath = exports.fixedTimeProvider = exports.systemTimeProvider = exports.enforceOutboxBounds = exports.claimOutbox = exports.readOutboxSummary = exports.appendToOutbox = exports.defaultOutboxFilePath = exports.outboxDrainEnabled = exports.DEFAULT_OUTBOX_DRAIN_BATCH_SIZE = exports.DEFAULT_OUTBOX_MAX_AGE_MS = exports.DEFAULT_OUTBOX_MAX_ENTRIES = exports.OUTBOX_DRAIN_ENV_VAR = exports.recordOutboxDiscard = exports.unresolvedToolInstallationId = exports.unresolvedStateFilePath = exports.markFailureNotified = void 0;
6955
7018
  exports.isRetryableStatus = exports.parseIngestResponse = exports.postToolEventsBatch = exports.postToolEvent = exports.renewToolToken = exports.getStudyJoinStatus = exports.getPairingStatus = exports.createPairingSession = exports.AscendaApiError = exports.scriptMarkerIn = exports.psLookup = exports.psArgsLookup = exports.livePidFields = exports.findAgentProcess = exports.findAgentPid = exports.AGENT_PROCESS = exports.readViaPlugin = exports.readHookSet = exports.isHookSet = exports.hookSetOfCommand = exports.hookSetChanges = exports.hookSetArgument = exports.describeHookSetChanges = exports.UNVERSIONED_HOOK_SET = exports.HOOK_SET_FLAG = exports.liveSignalDoctorLines = exports.doctorRow = exports.DOCTOR_VALUE_COLUMN = exports.pluginBundlePaths = exports.installPluginBundle = exports.describePluginBundleOutcome = exports.replaceSettingsFile = exports.writeAtomically = exports.tidyHomePath = exports.stampLastHook = exports.resolveHookNode = exports.removeHookRunner = exports.readLastHook = exports.lastHookPath = exports.isDowngrade = exports.installHookRunner = exports.hookRunnerPaths = exports.hookRunnerCommand = exports.hookLauncherScript = exports.describeAge = exports.terminalStyle = exports.colourEnabled = exports.SAVER_REPLAY_WINDOW_MS = exports.saverSupportDir = exports.saverStatusDir = void 0;
6956
- exports.writePairingJoinOutcome = exports.settleStudyJoin = exports.pairingJoinOutcome = exports.pairingAttemptLines = exports.createPairingAttempt = exports.PAIR_ORG_JOIN_CODE_ENV = exports.PAIR_JOIN_OUTCOME_FILE_ENV = exports.studyJoinConfirmUrl = exports.pairingConfirmUrl = exports.pairingConfirmLines = exports.runStudyJoin = exports.formatWindow = exports.describeStudyGrant = exports.describeStudyKind = exports.describeStudyJoinRefusal = exports.studyNoticeStatus = exports.runStudyObjection = exports.renderStudyNotices = exports.NOTICED_PURPOSES = exports.renderInitiatives = exports.initiativesStatusLines = exports.INITIATIVE_COPY = exports.startStudyJoin = exports.setStudyObjection = exports.markStudyNoticeShown = exports.readStudyNotices = exports.readInitiatives = void 0;
7019
+ exports.writePairingJoinOutcome = exports.settleStudyJoin = exports.pairingJoinOutcome = exports.pairingAttemptLines = exports.createPairingAttempt = exports.PAIR_ORG_JOIN_CODE_ENV = exports.PAIR_JOIN_OUTCOME_FILE_ENV = exports.studyJoinConfirmUrl = exports.pairingConfirmUrl = exports.pairingConfirmLines = exports.runStudyJoin = exports.gitOfferLine = exports.formatWindow = exports.describeStudyGrant = exports.describeStudyKind = exports.describeStudyJoinRefusal = exports.studyNoticeStatus = exports.runStudyObjection = exports.renderStudyNotices = exports.NOTICED_PURPOSES = exports.renderInitiatives = exports.initiativesStatusLines = exports.INITIATIVE_COPY = exports.startStudyJoin = exports.setStudyObjection = exports.markStudyNoticeShown = exports.readStudyNotices = exports.readInitiatives = void 0;
6957
7020
  var commandClassifier_1 = require_commandClassifier();
6958
7021
  Object.defineProperty(exports, "classifyCommand", { enumerable: true, get: function() {
6959
7022
  return commandClassifier_1.classifyCommand;
@@ -7644,6 +7707,9 @@ var require_out3 = __commonJS({
7644
7707
  Object.defineProperty(exports, "formatWindow", { enumerable: true, get: function() {
7645
7708
  return studyJoin_1.formatWindow;
7646
7709
  } });
7710
+ Object.defineProperty(exports, "gitOfferLine", { enumerable: true, get: function() {
7711
+ return studyJoin_1.gitOfferLine;
7712
+ } });
7647
7713
  Object.defineProperty(exports, "runStudyJoin", { enumerable: true, get: function() {
7648
7714
  return studyJoin_1.runStudyJoin;
7649
7715
  } });
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.40",
4
+ "version": "0.1.41",
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",