@ascenda-one/agent-mcp 0.1.41 → 0.1.42

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.
package/dist/cli.js CHANGED
@@ -928,6 +928,9 @@ var require_out = __commonJS({
928
928
  outcome: "outcome",
929
929
  trigger: "outcome",
930
930
  promptClass: "counts",
931
+ // One letter for how long the prompt was, worked out on this machine.
932
+ // Never the text or its length.
933
+ promptSizeBucket: "counts",
931
934
  reason: "outcome",
932
935
  afterHours: "clock",
933
936
  activity: "counts",
@@ -987,6 +990,7 @@ var require_out = __commonJS({
987
990
  "outcome",
988
991
  "trigger",
989
992
  "promptClass",
993
+ "promptSizeBucket",
990
994
  "reason",
991
995
  "afterHours",
992
996
  "activity",
@@ -1291,7 +1295,7 @@ var require_collectorVersion = __commonJS({
1291
1295
  exports.COLLECTOR_VERSION = exports.UNRELEASED_COLLECTOR_VERSION = void 0;
1292
1296
  exports.describeCollectorVersion = describeCollectorVersion;
1293
1297
  exports.UNRELEASED_COLLECTOR_VERSION = "unreleased";
1294
- exports.COLLECTOR_VERSION = "0.1.41" ? "0.1.41" : exports.UNRELEASED_COLLECTOR_VERSION;
1298
+ exports.COLLECTOR_VERSION = "0.1.42" ? "0.1.42" : exports.UNRELEASED_COLLECTOR_VERSION;
1295
1299
  function describeCollectorVersion(version2 = exports.COLLECTOR_VERSION) {
1296
1300
  return version2 === exports.UNRELEASED_COLLECTOR_VERSION ? `${version2} (built from a checkout, not a release)` : version2;
1297
1301
  }
@@ -2397,6 +2401,8 @@ var require_http = __commonJS({
2397
2401
  exports.createPairingSession = createPairingSession;
2398
2402
  exports.getPairingStatus = getPairingStatus;
2399
2403
  exports.startStudyJoin = startStudyJoin;
2404
+ exports.previewJoinCode = previewJoinCode;
2405
+ exports.startSquadronJoin = startSquadronJoin;
2400
2406
  exports.getStudyJoinStatus = getStudyJoinStatus;
2401
2407
  exports.readInitiatives = readInitiatives;
2402
2408
  exports.readStudyNotices = readStudyNotices;
@@ -2448,6 +2454,31 @@ var require_http = __commonJS({
2448
2454
  throw await apiError(response);
2449
2455
  return await response.json();
2450
2456
  }
2457
+ async function previewJoinCode(apiBaseUrl, joinCode) {
2458
+ const response = await fetch(`${apiBaseUrl}/api/share/join/${encodeURIComponent(joinCode)}`, {
2459
+ method: "GET",
2460
+ headers: { Accept: "application/json" }
2461
+ });
2462
+ if (!response.ok)
2463
+ throw await apiError(response);
2464
+ return await response.json();
2465
+ }
2466
+ async function startSquadronJoin(apiBaseUrl, eventWriteToken, seat) {
2467
+ const response = await fetch(`${apiBaseUrl}/v1/org-study-join-sessions`, {
2468
+ method: "POST",
2469
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${eventWriteToken}` },
2470
+ body: JSON.stringify({
2471
+ joinCode: seat.joinCode,
2472
+ mode: "jam",
2473
+ handle: seat.handle,
2474
+ ...seat.aircraft ? { aircraft: seat.aircraft } : {},
2475
+ ...seat.colour ? { colour: seat.colour } : {}
2476
+ })
2477
+ });
2478
+ if (!response.ok)
2479
+ throw await apiError(response);
2480
+ return await response.json();
2481
+ }
2451
2482
  async function getStudyJoinStatus(apiBaseUrl, eventWriteToken, joinSessionId) {
2452
2483
  const response = await fetch(`${apiBaseUrl}/v1/org-study-join-sessions/${encodeURIComponent(joinSessionId)}/status`, {
2453
2484
  method: "GET",
@@ -4055,17 +4086,20 @@ var require_confirmLinks = __commonJS({
4055
4086
  "../packages/tool-kit/out/confirmLinks.js"(exports) {
4056
4087
  "use strict";
4057
4088
  Object.defineProperty(exports, "__esModule", { value: true });
4089
+ exports.WEEKLY_POSTER_CONNECT_URL = void 0;
4058
4090
  exports.pairingConfirmUrl = pairingConfirmUrl;
4059
4091
  exports.pairingConfirmLines = pairingConfirmLines;
4060
4092
  exports.studyJoinConfirmUrl = studyJoinConfirmUrl;
4093
+ exports.WEEKLY_POSTER_CONNECT_URL = "https://me.ascendaflow.com/connect";
4061
4094
  function pairingConfirmUrl(qrUrl) {
4062
4095
  return isHttps(qrUrl) ? qrUrl : void 0;
4063
4096
  }
4064
4097
  function pairingConfirmLines(qrUrl, code) {
4065
4098
  const url = pairingConfirmUrl(qrUrl);
4099
+ const where = [" Ascenda Flow, under Connections \u2192 Ingest telemetry", ` ${exports.WEEKLY_POSTER_CONNECT_URL}, for the weekly poster`];
4066
4100
  if (!url)
4067
- return [`Confirm in the Ascenda app \u2014 code ${code}`];
4068
- return [`Open this link to confirm: ${url}`, `Or paste code ${code} in the Ascenda app.`];
4101
+ return [`Confirm code ${code} in either place:`, ...where];
4102
+ return [`Open this link to confirm: ${url}`, `Or enter code ${code} in either place:`, ...where];
4069
4103
  }
4070
4104
  function studyJoinConfirmUrl(apiBaseUrl, deviceCode) {
4071
4105
  if (!isHttps(apiBaseUrl))
@@ -5070,7 +5104,7 @@ var require_setupDisclosure = __commonJS({
5070
5104
  exports.renderSetupDisclosure = renderSetupDisclosure;
5071
5105
  exports.FAMILY_SENTENCES = {
5072
5106
  session: "when a session starts and ends, the one-word reason for the end if your agent gives one, how long each turn took, and whether it ran on this machine or in a hosted cloud session",
5073
- counts: "how many prompts you sent, how many replies came back, and what class of command ran in a terminal \u2014 test, lint, build, git and so on",
5107
+ counts: "how many prompts you sent and roughly how long each was, as one of four sizes, how many replies came back, and what class of command ran in a terminal \u2014 test, lint, build, git and so on",
5074
5108
  tools: "the name of each tool your agent calls",
5075
5109
  outcome: "whether a call succeeded, failed, or was interrupted",
5076
5110
  clock: "your machine's offset from UTC, so an evening is read as an evening",
@@ -5323,6 +5357,7 @@ var require_liveBus = __commonJS({
5323
5357
  exports.existingSocketCandidates = existingSocketCandidates;
5324
5358
  exports.liveBusSocketPath = liveBusSocketPath;
5325
5359
  exports.bucketPromptSize = bucketPromptSize;
5360
+ exports.promptSizeMetadata = promptSizeMetadata;
5326
5361
  exports.emitLiveSignal = emitLiveSignal;
5327
5362
  exports.deliverLine = deliverLine;
5328
5363
  var fs = __importStar(__require("fs"));
@@ -5371,6 +5406,9 @@ var require_liveBus = __commonJS({
5371
5406
  return "l";
5372
5407
  return "xl";
5373
5408
  }
5409
+ function promptSizeMetadata(text) {
5410
+ return text === void 0 ? {} : { promptSizeBucket: bucketPromptSize(text) };
5411
+ }
5374
5412
  var NOBODY_LISTENING = /* @__PURE__ */ new Set(["ECONNREFUSED", "ENOENT"]);
5375
5413
  function onTheWire(signal) {
5376
5414
  const out = { ...signal };
@@ -6036,7 +6074,7 @@ ${(0, setupDisclosure_1.renderSetupDisclosure)({ sends: spec.sends, displayName:
6036
6074
  const next = (label, value) => console.log(` ${ui.bold(label.padEnd(6))} ${value}`);
6037
6075
  console.log("");
6038
6076
  if (chosenLocal) {
6039
- console.log(`${ui.mark("ok")} ${ui.bold("Ready.")} The screen saver and the Ascenda app's live view work now.`);
6077
+ console.log(`${ui.mark("ok")} ${ui.bold("Ready.")} The screen saver and Ascenda Flow's live view work now.`);
6040
6078
  console.log(" They run on this machine and need no account or pairing.");
6041
6079
  if (eventLog.path)
6042
6080
  console.log(` Every event is also written to ${(0, hookRunner_1.tidyHomePath)(eventLog.path, os.homedir())}, for you or any tool to read.`);
@@ -6053,9 +6091,9 @@ ${(0, setupDisclosure_1.renderSetupDisclosure)({ sends: spec.sends, displayName:
6053
6091
  next(chosenLocal ? "Pair" : "Retry", `${ui.cyan(`${self} setup`)}${chosenLocal ? ui.dim(" (optional)") : ""}`);
6054
6092
  if (chosenLocal) {
6055
6093
  console.log("");
6056
- console.log(ui.dim(" Pairing sends the details below to Ascenda's servers, under the account the"));
6057
- console.log(ui.dim(" Ascenda app is signed in to when you confirm the code, so your sessions appear"));
6058
- console.log(ui.dim(" in the app. Until you pair, nothing leaves this machine."));
6094
+ console.log(ui.dim(" Pairing sends the details below to Ascenda's servers, under the account you"));
6095
+ console.log(ui.dim(" confirm the code with, in Ascenda Flow or at me.ascendaflow.com."));
6096
+ console.log(ui.dim(" Until you pair, nothing leaves this machine."));
6059
6097
  console.log("");
6060
6098
  console.log(ui.dim((0, setupDisclosure_1.renderSetupDisclosure)({ sends: spec.sends, displayName: spec.displayName }).split("\n").map((line) => ` ${line}`).join("\n")));
6061
6099
  }
@@ -6774,6 +6812,395 @@ var require_turnState = __commonJS({
6774
6812
  }
6775
6813
  });
6776
6814
 
6815
+ // ../packages/tool-kit/out/squadronJoin.js
6816
+ var require_squadronJoin = __commonJS({
6817
+ "../packages/tool-kit/out/squadronJoin.js"(exports) {
6818
+ "use strict";
6819
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6820
+ if (k2 === void 0) k2 = k;
6821
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6822
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6823
+ desc = { enumerable: true, get: function() {
6824
+ return m[k];
6825
+ } };
6826
+ }
6827
+ Object.defineProperty(o, k2, desc);
6828
+ } : function(o, m, k, k2) {
6829
+ if (k2 === void 0) k2 = k;
6830
+ o[k2] = m[k];
6831
+ });
6832
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
6833
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6834
+ } : function(o, v) {
6835
+ o["default"] = v;
6836
+ });
6837
+ var __importStar = exports && exports.__importStar || /* @__PURE__ */ function() {
6838
+ var ownKeys = function(o) {
6839
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
6840
+ var ar = [];
6841
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
6842
+ return ar;
6843
+ };
6844
+ return ownKeys(o);
6845
+ };
6846
+ return function(mod) {
6847
+ if (mod && mod.__esModule) return mod;
6848
+ var result = {};
6849
+ if (mod != null) {
6850
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
6851
+ }
6852
+ __setModuleDefault(result, mod);
6853
+ return result;
6854
+ };
6855
+ }();
6856
+ Object.defineProperty(exports, "__esModule", { value: true });
6857
+ exports.SQUADRON_COLOURS = exports.SQUADRON_AIRCRAFT = void 0;
6858
+ exports.generateCallsign = generateCallsign;
6859
+ exports.normaliseBookingReference = normaliseBookingReference;
6860
+ exports.callsignProblem = callsignProblem;
6861
+ exports.runSquadronJoin = runSquadronJoin;
6862
+ exports.leaseEnd = leaseEnd;
6863
+ exports.describeGate = describeGate;
6864
+ exports.describeSquadronRefusal = describeSquadronRefusal;
6865
+ var readline = __importStar(__require("node:readline"));
6866
+ var node_crypto_1 = __require("node:crypto");
6867
+ var confirmLinks_1 = require_confirmLinks();
6868
+ var http_1 = require_http();
6869
+ exports.SQUADRON_AIRCRAFT = ["trainer", "airliner", "glider", "fighter", "stealth", "floatplane"];
6870
+ exports.SQUADRON_COLOURS = ["orange", "yellow", "ivory", "charcoal", "grey", "red"];
6871
+ var CALLSIGN_WORDS = ["Kestrel", "Falcon", "Heron", "Swift", "Osprey", "Raven", "Merlin", "Puffin", "Condor", "Harrier", "Kite", "Tern"];
6872
+ function generateCallsign() {
6873
+ return `${CALLSIGN_WORDS[(0, node_crypto_1.randomInt)(CALLSIGN_WORDS.length)]} ${String((0, node_crypto_1.randomInt)(10, 100))}`;
6874
+ }
6875
+ function normaliseBookingReference(raw) {
6876
+ const cleaned = (raw ?? "").replace(/[\s-]/g, "").toUpperCase();
6877
+ return /^[A-Z0-9]{6}$/.test(cleaned) ? cleaned : void 0;
6878
+ }
6879
+ function callsignProblem(callsign) {
6880
+ const trimmed = callsign.trim();
6881
+ if (trimmed.length === 0)
6882
+ return "A callsign can't be empty.";
6883
+ if (trimmed.length > 40)
6884
+ return "A callsign is 40 characters at most.";
6885
+ if (/[\u0000-\u001f\u007f]/.test(trimmed))
6886
+ return "A callsign can't contain control characters.";
6887
+ return void 0;
6888
+ }
6889
+ var POLL_INTERVAL_MS = 3e3;
6890
+ var POLL_TIMEOUT_MS = 11 * 60 * 1e3;
6891
+ async function runSquadronJoin(ctx) {
6892
+ const stdin = ctx.stdin ?? process.stdin;
6893
+ const stdout = ctx.stdout ?? process.stdout;
6894
+ const stderr = ctx.stderr ?? process.stderr;
6895
+ const print = (line = "") => stdout.write(`${line}
6896
+ `);
6897
+ if (!stdin.isTTY || !stdout.isTTY) {
6898
+ stderr.write("squadron needs an interactive terminal (stdin and stdout). Run it directly, not from a script or a pipe.\n");
6899
+ return 0;
6900
+ }
6901
+ const reference = normaliseBookingReference(ctx.bookingReference);
6902
+ if (!reference) {
6903
+ stderr.write("A booking reference is six letters or digits, like FEFBDH.\n");
6904
+ return 1;
6905
+ }
6906
+ let preview;
6907
+ try {
6908
+ preview = await (0, http_1.previewJoinCode)(ctx.apiBaseUrl, reference);
6909
+ } catch (error2) {
6910
+ stderr.write(`${describeSquadronError(error2)}
6911
+ `);
6912
+ return 1;
6913
+ }
6914
+ const jam = preview.jam;
6915
+ if (preview.labRole !== "Jam" || !jam) {
6916
+ stderr.write(`${reference} isn't a Squadron booking reference. If it's a study code, run join instead.
6917
+ `);
6918
+ return 1;
6919
+ }
6920
+ if (jam.acceptsJoins === false) {
6921
+ stderr.write(jam.isLocked ? "This sortie's gate is closed. Ask the host to open it.\n" : "This sortie isn't taking new pilots.\n");
6922
+ return 1;
6923
+ }
6924
+ const aircraftList = jam.aircraft?.length ? jam.aircraft : [...exports.SQUADRON_AIRCRAFT];
6925
+ const colourList = jam.colours?.length ? jam.colours : [...exports.SQUADRON_COLOURS];
6926
+ for (const [flag, value, list] of [["--aircraft", ctx.aircraft, aircraftList], ["--colour", ctx.colour, colourList]]) {
6927
+ if (value !== void 0 && !list.includes(value.trim().toLowerCase())) {
6928
+ stderr.write(`${flag} must be one of: ${list.join(", ")}.
6929
+ `);
6930
+ return 1;
6931
+ }
6932
+ }
6933
+ if (ctx.callsign !== void 0) {
6934
+ const problem = callsignProblem(ctx.callsign);
6935
+ if (problem) {
6936
+ stderr.write(`${problem}
6937
+ `);
6938
+ return 1;
6939
+ }
6940
+ }
6941
+ print();
6942
+ print(`Squadron: ${jam.name ?? preview.labName ?? reference}`);
6943
+ if (jam.mission)
6944
+ print(`Mission: ${jam.mission}`);
6945
+ print(describeGate(jam));
6946
+ print();
6947
+ const prompt = createPrompter(stdin, stdout);
6948
+ try {
6949
+ let callsign = ctx.callsign?.trim();
6950
+ if (callsign === void 0) {
6951
+ const suggested = (ctx.generateCallsign ?? generateCallsign)();
6952
+ for (; ; ) {
6953
+ const answer = await prompt.ask(`Callsign [${suggested}]: `);
6954
+ if (answer === void 0)
6955
+ return notNow(print);
6956
+ const chosen = answer === "" ? suggested : answer;
6957
+ const problem = callsignProblem(chosen);
6958
+ if (!problem) {
6959
+ callsign = chosen.trim();
6960
+ break;
6961
+ }
6962
+ print(problem);
6963
+ }
6964
+ }
6965
+ let aircraft = ctx.aircraft?.trim().toLowerCase();
6966
+ if (aircraft === void 0) {
6967
+ const suggested = aircraftList[(0, node_crypto_1.randomInt)(aircraftList.length)];
6968
+ aircraft = await askFromList(prompt, print, "Aircraft", aircraftList, suggested);
6969
+ if (aircraft === void 0)
6970
+ return notNow(print);
6971
+ }
6972
+ let colour = ctx.colour?.trim().toLowerCase();
6973
+ if (colour === void 0) {
6974
+ const picked = await askFromList(prompt, print, "Colour", colourList, "", "dealt for you");
6975
+ if (picked === void 0)
6976
+ return notNow(print);
6977
+ colour = picked === "" ? void 0 : picked;
6978
+ }
6979
+ print();
6980
+ print(`You'll confirm as ${callsign}, ${aircraft}${colour ? `, ${colour}` : ""}. The confirm page lets you change any of them.`);
6981
+ print();
6982
+ print("Joining shares, with this squadron only:");
6983
+ print(` your activity counts from ${ctx.displayName}: prompts, tool calls, turns and edits, as numbers`);
6984
+ print(" your callsign and aircraft, which the other pilots see");
6985
+ print("Never your prompts, code, file names or project names.");
6986
+ print("Sharing stops on the date the server gives when you join. It's printed then.");
6987
+ print();
6988
+ print(" 1) Join");
6989
+ print(" 2) Not now");
6990
+ print();
6991
+ const choice = await prompt.ask("Choice [Not now]: ");
6992
+ if (choice === void 0 || !/^(1|join|y|yes)$/i.test(choice))
6993
+ return notNow(print);
6994
+ prompt.close();
6995
+ let start;
6996
+ try {
6997
+ start = await (0, http_1.startSquadronJoin)(ctx.apiBaseUrl, ctx.eventWriteToken, { joinCode: reference, handle: callsign, aircraft, colour });
6998
+ } catch (error2) {
6999
+ const doorClosed = error2 instanceof http_1.AscendaApiError && error2.status === 404 && !error2.errorCode?.startsWith("jam_");
7000
+ stderr.write(doorClosed ? "This server can't seat you in a sortie from the command line yet. Join from the Ascenda app instead.\n" : `${describeSquadronError(error2)}
7001
+ `);
7002
+ return 1;
7003
+ }
7004
+ if (start.kind !== void 0 && start.kind !== "jam") {
7005
+ stderr.write(`${reference} opened a study join, not a sortie. Run join instead.
7006
+ `);
7007
+ return 1;
7008
+ }
7009
+ print();
7010
+ const confirmUrl = (0, confirmLinks_1.studyJoinConfirmUrl)(ctx.apiBaseUrl, start.deviceCode);
7011
+ if (confirmUrl) {
7012
+ print(`Open this link to confirm: ${confirmUrl}`);
7013
+ print(`Or confirm in the Ascenda app with code ${start.deviceCode}.`);
7014
+ } else {
7015
+ print(`Confirm in the Ascenda app with code ${start.deviceCode}`);
7016
+ }
7017
+ print(`Waiting for confirmation (expires ${formatLocalTime(start.expiresAt)})...`);
7018
+ const pollIntervalMs = ctx.pollIntervalMs ?? POLL_INTERVAL_MS;
7019
+ const deadline = Math.min(Date.parse(start.expiresAt) || Date.now() + POLL_TIMEOUT_MS, Date.now() + POLL_TIMEOUT_MS);
7020
+ while (Date.now() < deadline) {
7021
+ await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
7022
+ let poll;
7023
+ try {
7024
+ poll = await (0, http_1.getStudyJoinStatus)(ctx.apiBaseUrl, ctx.eventWriteToken, start.joinSessionId);
7025
+ } catch (error2) {
7026
+ if (!(error2 instanceof http_1.AscendaApiError) || error2.status >= 500 && error2.status <= 599)
7027
+ continue;
7028
+ stderr.write(`${describeSquadronError(error2)}
7029
+ `);
7030
+ return 1;
7031
+ }
7032
+ if (poll.status === "pending")
7033
+ continue;
7034
+ if (poll.status === "confirmed") {
7035
+ const until = poll.endUtc ?? poll.jam?.endUtc ?? leaseEnd(poll.jam ?? {});
7036
+ const seat = poll.jam?.handle ? ` as ${poll.jam.handle}` : "";
7037
+ print();
7038
+ print(poll.jam?.alreadyJoined ? `You already have a seat${seat}.` : `Joined${seat}.`);
7039
+ print(until ? `Your activity counts are shared with this squadron until ${formatLocalDate(until)}.` : "Your activity counts are shared with this squadron until the sortie's sharing ends. The server didn't give a date.");
7040
+ print(describeStatusAfterJoin(poll.jam));
7041
+ return 0;
7042
+ }
7043
+ if (poll.status === "expired") {
7044
+ print();
7045
+ print("This code expired before it was confirmed. Run squadron again for a fresh code.");
7046
+ return 1;
7047
+ }
7048
+ print();
7049
+ print(describeSquadronRefusal(poll.refusedReason ?? void 0));
7050
+ return 1;
7051
+ }
7052
+ print();
7053
+ print("Timed out waiting for confirmation. Run squadron again for a fresh code.");
7054
+ return 1;
7055
+ } finally {
7056
+ prompt.close();
7057
+ }
7058
+ }
7059
+ function leaseEnd(jam) {
7060
+ const from = Date.parse(jam.startedAt ?? jam.quorumDeadline ?? "");
7061
+ if (Number.isNaN(from) || typeof jam.durationMinutes !== "number")
7062
+ return void 0;
7063
+ return new Date(from + (jam.durationMinutes + 7 * 24 * 60) * 6e4).toISOString();
7064
+ }
7065
+ function notNow(print) {
7066
+ print("Not now.");
7067
+ return 0;
7068
+ }
7069
+ async function askFromList(prompt, print, label, list, suggested, emptyMeans) {
7070
+ print(`${label === "Aircraft" ? "Aircraft" : `${label}s`}: ${list.join(", ")}`);
7071
+ for (; ; ) {
7072
+ const answer = await prompt.ask(`${label} [${emptyMeans ?? suggested}]: `);
7073
+ if (answer === void 0)
7074
+ return void 0;
7075
+ if (answer === "")
7076
+ return suggested;
7077
+ const value = answer.toLowerCase();
7078
+ const byNumber = /^\d+$/.test(value) ? list[Number(value) - 1] : void 0;
7079
+ if (byNumber)
7080
+ return byNumber;
7081
+ if (list.includes(value))
7082
+ return value;
7083
+ print(`Pick one of: ${list.join(", ")}.`);
7084
+ }
7085
+ }
7086
+ function describeGate(jam) {
7087
+ const length = jam.durationMinutes ? `${jam.durationMinutes}-minute flight plan` : "flight plan";
7088
+ if (jam.status === "live")
7089
+ return `In the air now, ${length}.`;
7090
+ const have = jam.activeParticipants ?? 0;
7091
+ const need = jam.minParticipants ?? 0;
7092
+ const deadline = jam.quorumDeadline ? `, gate closes ${formatLocalTime(jam.quorumDeadline)}` : "";
7093
+ return need > have ? `On the ground: ${have} of ${need} pilots in${deadline}. The ${length} starts when the squadron fills.` : `On the ground${deadline}. ${length[0].toUpperCase()}${length.slice(1)}.`;
7094
+ }
7095
+ function describeStatusAfterJoin(jam) {
7096
+ if (!jam)
7097
+ return "Open the Ascenda app to watch the squadron.";
7098
+ if (jam.status === "live" && jam.expiresAt)
7099
+ return `The squadron is in the air until ${formatLocalTime(jam.expiresAt)}. Open the Ascenda app to watch.`;
7100
+ const have = jam.activeParticipants;
7101
+ const need = jam.minParticipants;
7102
+ if (have !== void 0 && need !== void 0 && need > have)
7103
+ return `${have} of ${need} pilots in. The clock starts when the squadron fills.`;
7104
+ return "Open the Ascenda app to watch the squadron.";
7105
+ }
7106
+ function describeSquadronRefusal(code) {
7107
+ switch (code) {
7108
+ case "join_code_not_found":
7109
+ return "No sortie has that booking reference, or it has ended.";
7110
+ case "jam_closed":
7111
+ return "That sortie has ended.";
7112
+ case "jam_locked":
7113
+ return "This sortie's gate is closed. Ask the host to open it.";
7114
+ case "jam_already_left":
7115
+ return "You left this sortie, and leaving is final. Ask the host for a new one.";
7116
+ case "jam_handle_taken":
7117
+ return "Another pilot has that callsign. Run squadron again and pick another.";
7118
+ case "jam_requires_account":
7119
+ return "A sortie needs a signed-in Ascenda account, not a guest one.";
7120
+ case "jam_handle_required":
7121
+ case "jam_handle_too_long":
7122
+ case "jam_handle_invalid":
7123
+ return "The server didn't accept that callsign. Run squadron again and pick another.";
7124
+ case "jam_aircraft_unknown":
7125
+ return "The server didn't recognise that aircraft.";
7126
+ case "jam_colour_unknown":
7127
+ return "The server didn't recognise that colour.";
7128
+ case "unknown_mode":
7129
+ return "This server's join door didn't accept a sortie. It may be older than this command.";
7130
+ case "too_many_open_sessions":
7131
+ return "Too many joins are waiting to be confirmed. Confirm or let one expire, then try again.";
7132
+ case "jam_not_enabled":
7133
+ return "Squadron isn't switched on for this server yet.";
7134
+ default:
7135
+ return code ? `The server refused the join (${code}).` : "The server refused the join.";
7136
+ }
7137
+ }
7138
+ function describeSquadronError(error2) {
7139
+ if (error2 instanceof http_1.AscendaApiError) {
7140
+ if (error2.status === 401)
7141
+ return "This collector's pairing isn't accepted any more. Run pair, then try again.";
7142
+ if (error2.status === 404 && !error2.errorCode?.startsWith("jam_"))
7143
+ return describeSquadronRefusal("join_code_not_found");
7144
+ return describeSquadronRefusal(error2.errorCode);
7145
+ }
7146
+ return `Couldn't reach Ascenda: ${error2 instanceof Error ? error2.message : String(error2)}`;
7147
+ }
7148
+ function createPrompter(stdin, stdout) {
7149
+ const rl = readline.createInterface({ input: stdin, output: stdout });
7150
+ let closed = false;
7151
+ const lines = [];
7152
+ let waiting;
7153
+ rl.on("line", (line) => {
7154
+ if (waiting) {
7155
+ const resolve = waiting;
7156
+ waiting = void 0;
7157
+ resolve(line.trim());
7158
+ } else {
7159
+ lines.push(line.trim());
7160
+ }
7161
+ });
7162
+ rl.on("close", () => {
7163
+ closed = true;
7164
+ if (waiting) {
7165
+ const resolve = waiting;
7166
+ waiting = void 0;
7167
+ resolve(void 0);
7168
+ }
7169
+ });
7170
+ return {
7171
+ ask(question) {
7172
+ if (lines.length > 0) {
7173
+ stdout.write(question);
7174
+ return Promise.resolve(lines.shift());
7175
+ }
7176
+ if (closed)
7177
+ return Promise.resolve(void 0);
7178
+ stdout.write(question);
7179
+ return new Promise((resolve) => {
7180
+ waiting = resolve;
7181
+ });
7182
+ },
7183
+ close() {
7184
+ if (!closed)
7185
+ rl.close();
7186
+ }
7187
+ };
7188
+ }
7189
+ function formatLocalTime(iso) {
7190
+ const date3 = new Date(iso);
7191
+ if (Number.isNaN(date3.getTime()))
7192
+ return iso;
7193
+ return new Intl.DateTimeFormat(void 0, { day: "numeric", month: "short", hour: "numeric", minute: "2-digit" }).format(date3);
7194
+ }
7195
+ function formatLocalDate(iso) {
7196
+ const date3 = new Date(iso);
7197
+ if (Number.isNaN(date3.getTime()))
7198
+ return iso;
7199
+ return new Intl.DateTimeFormat(void 0, { day: "numeric", month: "short", year: "numeric" }).format(date3);
7200
+ }
7201
+ }
7202
+ });
7203
+
6777
7204
  // ../packages/tool-kit/out/pluginBundle.js
6778
7205
  var require_pluginBundle = __commonJS({
6779
7206
  "../packages/tool-kit/out/pluginBundle.js"(exports) {
@@ -7014,9 +7441,9 @@ var require_out3 = __commonJS({
7014
7441
  Object.defineProperty(exports, "__esModule", { value: true });
7015
7442
  exports.expandUserPath = exports.describeEventLog = exports.defaultEventLogPath = exports.appendEventLog = exports.EVENT_LOG_OFF = exports.EVENT_LOG_ENV_VAR = exports.toAgentEvent = exports.buildEventPayload = exports.buildEventBody = exports.TOKEN_RENEW_LEAD_MS = exports.AscendaSemanticEventError = exports.AscendaEventSender = exports.startBackgroundFlush = exports.runOutboxFlush = exports.hookDeliveryInline = exports.flushLockPath = exports.OUTBOX_FLUSH_COMMAND = exports.HOOK_DELIVERY_ENV_VAR = exports.FLUSH_LOCK_FRESH_MS = exports.describeCollectorVersion = exports.UNRELEASED_COLLECTOR_VERSION = exports.COLLECTOR_VERSION = exports.detectCollectorPlatform = exports.COLLECTOR_PLATFORM = exports.mintIdempotencyKey = exports.looksLikeCorrection = exports.outcomeForHook = exports.inferOutcome = exports.getNestedNumber = exports.getNestedString = exports.getNested = exports.getNumber = exports.getString = exports.localHourAt = exports.utcOffsetMinutesAt = exports.BUSINESS_DAY = exports.isOutsideBusinessHours = exports.isAfterHours = exports.bucketDurationMs = exports.bucketLinesChanged = exports.classifyModelClass = exports.autonomyBand = exports.shellCommandFacts = exports.invitesDebrief = exports.classifyMcpWorkMilestone = exports.classifyWorkMilestone = exports.isReworkGitAction = exports.classifyGitAction = exports.isVerificationCommand = exports.classifyCommand = void 0;
7016
7443
  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;
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;
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;
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;
7444
+ exports.emitLiveSignal = exports.startSquadronJoin = exports.previewJoinCode = exports.SQUADRON_COLOURS = exports.SQUADRON_AIRCRAFT = exports.describeSquadronRefusal = exports.describeGate = exports.callsignProblem = exports.normaliseBookingReference = exports.generateCallsign = exports.leaseEnd = exports.runSquadronJoin = 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;
7445
+ 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 = exports.saverReplayPath = exports.saverContainerDir = exports.readSaverStatuses = exports.probeSocket = exports.heldForSaver = exports.holdForSaver = exports.LIVE_BUS_BACKGROUND_TRUST_MS = exports.liveBusSocketCandidates = exports.liveBusSocketPath = exports.promptSizeMetadata = exports.bucketPromptSize = exports.deliverLine = void 0;
7446
+ 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.WEEKLY_POSTER_CONNECT_URL = 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 = exports.isRetryableStatus = exports.parseIngestResponse = exports.postToolEventsBatch = exports.postToolEvent = exports.renewToolToken = exports.getStudyJoinStatus = exports.getPairingStatus = exports.createPairingSession = exports.AscendaApiError = exports.scriptMarkerIn = exports.psLookup = exports.psArgsLookup = void 0;
7020
7447
  var commandClassifier_1 = require_commandClassifier();
7021
7448
  Object.defineProperty(exports, "classifyCommand", { enumerable: true, get: function() {
7022
7449
  return commandClassifier_1.classifyCommand;
@@ -7460,6 +7887,41 @@ var require_out3 = __commonJS({
7460
7887
  Object.defineProperty(exports, "repoKeysEnabled", { enumerable: true, get: function() {
7461
7888
  return forgeKeys_1.repoKeysEnabled;
7462
7889
  } });
7890
+ var squadronJoin_1 = require_squadronJoin();
7891
+ Object.defineProperty(exports, "runSquadronJoin", { enumerable: true, get: function() {
7892
+ return squadronJoin_1.runSquadronJoin;
7893
+ } });
7894
+ Object.defineProperty(exports, "leaseEnd", { enumerable: true, get: function() {
7895
+ return squadronJoin_1.leaseEnd;
7896
+ } });
7897
+ Object.defineProperty(exports, "generateCallsign", { enumerable: true, get: function() {
7898
+ return squadronJoin_1.generateCallsign;
7899
+ } });
7900
+ Object.defineProperty(exports, "normaliseBookingReference", { enumerable: true, get: function() {
7901
+ return squadronJoin_1.normaliseBookingReference;
7902
+ } });
7903
+ Object.defineProperty(exports, "callsignProblem", { enumerable: true, get: function() {
7904
+ return squadronJoin_1.callsignProblem;
7905
+ } });
7906
+ Object.defineProperty(exports, "describeGate", { enumerable: true, get: function() {
7907
+ return squadronJoin_1.describeGate;
7908
+ } });
7909
+ Object.defineProperty(exports, "describeSquadronRefusal", { enumerable: true, get: function() {
7910
+ return squadronJoin_1.describeSquadronRefusal;
7911
+ } });
7912
+ Object.defineProperty(exports, "SQUADRON_AIRCRAFT", { enumerable: true, get: function() {
7913
+ return squadronJoin_1.SQUADRON_AIRCRAFT;
7914
+ } });
7915
+ Object.defineProperty(exports, "SQUADRON_COLOURS", { enumerable: true, get: function() {
7916
+ return squadronJoin_1.SQUADRON_COLOURS;
7917
+ } });
7918
+ var http_1 = require_http();
7919
+ Object.defineProperty(exports, "previewJoinCode", { enumerable: true, get: function() {
7920
+ return http_1.previewJoinCode;
7921
+ } });
7922
+ Object.defineProperty(exports, "startSquadronJoin", { enumerable: true, get: function() {
7923
+ return http_1.startSquadronJoin;
7924
+ } });
7463
7925
  var liveBus_1 = require_liveBus();
7464
7926
  Object.defineProperty(exports, "emitLiveSignal", { enumerable: true, get: function() {
7465
7927
  return liveBus_1.emitLiveSignal;
@@ -7470,6 +7932,9 @@ var require_out3 = __commonJS({
7470
7932
  Object.defineProperty(exports, "bucketPromptSize", { enumerable: true, get: function() {
7471
7933
  return liveBus_1.bucketPromptSize;
7472
7934
  } });
7935
+ Object.defineProperty(exports, "promptSizeMetadata", { enumerable: true, get: function() {
7936
+ return liveBus_1.promptSizeMetadata;
7937
+ } });
7473
7938
  Object.defineProperty(exports, "liveBusSocketPath", { enumerable: true, get: function() {
7474
7939
  return liveBus_1.liveBusSocketPath;
7475
7940
  } });
@@ -7628,48 +8093,48 @@ var require_out3 = __commonJS({
7628
8093
  Object.defineProperty(exports, "scriptMarkerIn", { enumerable: true, get: function() {
7629
8094
  return agentProcess_1.scriptMarkerIn;
7630
8095
  } });
7631
- var http_1 = require_http();
8096
+ var http_2 = require_http();
7632
8097
  Object.defineProperty(exports, "AscendaApiError", { enumerable: true, get: function() {
7633
- return http_1.AscendaApiError;
8098
+ return http_2.AscendaApiError;
7634
8099
  } });
7635
8100
  Object.defineProperty(exports, "createPairingSession", { enumerable: true, get: function() {
7636
- return http_1.createPairingSession;
8101
+ return http_2.createPairingSession;
7637
8102
  } });
7638
8103
  Object.defineProperty(exports, "getPairingStatus", { enumerable: true, get: function() {
7639
- return http_1.getPairingStatus;
8104
+ return http_2.getPairingStatus;
7640
8105
  } });
7641
8106
  Object.defineProperty(exports, "getStudyJoinStatus", { enumerable: true, get: function() {
7642
- return http_1.getStudyJoinStatus;
8107
+ return http_2.getStudyJoinStatus;
7643
8108
  } });
7644
8109
  Object.defineProperty(exports, "renewToolToken", { enumerable: true, get: function() {
7645
- return http_1.renewToolToken;
8110
+ return http_2.renewToolToken;
7646
8111
  } });
7647
8112
  Object.defineProperty(exports, "postToolEvent", { enumerable: true, get: function() {
7648
- return http_1.postToolEvent;
8113
+ return http_2.postToolEvent;
7649
8114
  } });
7650
8115
  Object.defineProperty(exports, "postToolEventsBatch", { enumerable: true, get: function() {
7651
- return http_1.postToolEventsBatch;
8116
+ return http_2.postToolEventsBatch;
7652
8117
  } });
7653
8118
  Object.defineProperty(exports, "parseIngestResponse", { enumerable: true, get: function() {
7654
- return http_1.parseIngestResponse;
8119
+ return http_2.parseIngestResponse;
7655
8120
  } });
7656
8121
  Object.defineProperty(exports, "isRetryableStatus", { enumerable: true, get: function() {
7657
- return http_1.isRetryableStatus;
8122
+ return http_2.isRetryableStatus;
7658
8123
  } });
7659
8124
  Object.defineProperty(exports, "readInitiatives", { enumerable: true, get: function() {
7660
- return http_1.readInitiatives;
8125
+ return http_2.readInitiatives;
7661
8126
  } });
7662
8127
  Object.defineProperty(exports, "readStudyNotices", { enumerable: true, get: function() {
7663
- return http_1.readStudyNotices;
8128
+ return http_2.readStudyNotices;
7664
8129
  } });
7665
8130
  Object.defineProperty(exports, "markStudyNoticeShown", { enumerable: true, get: function() {
7666
- return http_1.markStudyNoticeShown;
8131
+ return http_2.markStudyNoticeShown;
7667
8132
  } });
7668
8133
  Object.defineProperty(exports, "setStudyObjection", { enumerable: true, get: function() {
7669
- return http_1.setStudyObjection;
8134
+ return http_2.setStudyObjection;
7670
8135
  } });
7671
8136
  Object.defineProperty(exports, "startStudyJoin", { enumerable: true, get: function() {
7672
- return http_1.startStudyJoin;
8137
+ return http_2.startStudyJoin;
7673
8138
  } });
7674
8139
  var initiatives_1 = require_initiatives();
7675
8140
  Object.defineProperty(exports, "INITIATIVE_COPY", { enumerable: true, get: function() {
@@ -7714,6 +8179,9 @@ var require_out3 = __commonJS({
7714
8179
  return studyJoin_1.runStudyJoin;
7715
8180
  } });
7716
8181
  var confirmLinks_1 = require_confirmLinks();
8182
+ Object.defineProperty(exports, "WEEKLY_POSTER_CONNECT_URL", { enumerable: true, get: function() {
8183
+ return confirmLinks_1.WEEKLY_POSTER_CONNECT_URL;
8184
+ } });
7717
8185
  Object.defineProperty(exports, "pairingConfirmLines", { enumerable: true, get: function() {
7718
8186
  return confirmLinks_1.pairingConfirmLines;
7719
8187
  } });
@@ -28894,6 +29362,7 @@ var RESERVED_METADATA_KEYS = /* @__PURE__ */ new Set([
28894
29362
  "outcome",
28895
29363
  "trigger",
28896
29364
  "promptClass",
29365
+ "promptSizeBucket",
28897
29366
  "reason",
28898
29367
  "afterHours",
28899
29368
  "activity",
package/dist/server.js CHANGED
@@ -19,6 +19,7 @@ const RESERVED_METADATA_KEYS = new Set([
19
19
  "outcome",
20
20
  "trigger",
21
21
  "promptClass",
22
+ "promptSizeBucket",
22
23
  "reason",
23
24
  "afterHours",
24
25
  "activity",
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAmD,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC/H,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,cAAc;IACd,iBAAiB;IACjB,UAAU;IACV,UAAU;IACV,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,cAAc;IACd,SAAS;IACT,SAAS;IACT,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AAU,EAAE,CAAC;gBAC1B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;YAC3D,CAAC;YACD,IAAI,MAAM,KAAK,iBAAiB,EAAE,CAAC;gBACjC,OAAO,WAAW,CAChB,wEAAwE;oBACtE,mEAAmE,CACtE,CAAC;YACJ,CAAC;YACD,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;gBAC7B,OAAO,WAAW,CAAC,wFAAwF,CAAC,CAAC;YAC/G,CAAC;YACD,OAAO,WAAW,CAAC,0BAA0B,MAAM,GAAG,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACvE,CAAC"}
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.41",
4
+ "version": "0.1.42",
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",