@askexenow/exe-os 0.9.42 → 0.9.43

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.
@@ -24224,17 +24224,17 @@ async function fetchWithRetry(url, init) {
24224
24224
  }
24225
24225
  throw lastError;
24226
24226
  }
24227
- function assertSecureEndpoint(endpoint) {
24228
- if (endpoint.startsWith("https://")) return;
24229
- if (endpoint.startsWith("http://")) {
24227
+ function assertSecureEndpoint(endpoint2) {
24228
+ if (endpoint2.startsWith("https://")) return;
24229
+ if (endpoint2.startsWith("http://")) {
24230
24230
  try {
24231
- const parsed = new URL(endpoint);
24231
+ const parsed = new URL(endpoint2);
24232
24232
  if (LOCALHOST_PATTERNS.test(parsed.hostname)) return;
24233
24233
  } catch {
24234
24234
  return;
24235
24235
  }
24236
24236
  throw new Error(
24237
- `Insecure cloud endpoint rejected: "${endpoint}". Use https:// for remote hosts. Plain http:// is only allowed for localhost.`
24237
+ `Insecure cloud endpoint rejected: "${endpoint2}". Use https:// for remote hosts. Plain http:// is only allowed for localhost.`
24238
24238
  );
24239
24239
  }
24240
24240
  }
@@ -26848,14 +26848,14 @@ function buildMarkdown(input) {
26848
26848
  async function maybeSendUpstream(payload) {
26849
26849
  const config2 = await loadConfig();
26850
26850
  const routerUrl = process.env.API_ROUTER_URL?.replace(/\/+$/, "");
26851
- const endpoint = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT || (routerUrl ? `${routerUrl}/v1/support/bug-reports` : "https://askexe.com/v1/support/bug-reports");
26851
+ const endpoint2 = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT || (routerUrl ? `${routerUrl}/v1/support/bug-reports` : "https://askexe.com/v1/support/bug-reports");
26852
26852
  const token = config2.support?.bugReportToken || process.env.EXE_BUG_REPORT_TOKEN;
26853
26853
  const licenseKey = loadLicense() || process.env.EXE_LICENSE_KEY || config2.cloud?.apiKey;
26854
- if (!endpoint) {
26854
+ if (!endpoint2) {
26855
26855
  return "not_configured";
26856
26856
  }
26857
26857
  try {
26858
- const parsed = new URL(endpoint);
26858
+ const parsed = new URL(endpoint2);
26859
26859
  if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
26860
26860
  return "failed: insecure endpoint rejected";
26861
26861
  }
@@ -27023,6 +27023,108 @@ var init_create_bug_report = __esm({
27023
27023
  }
27024
27024
  });
27025
27025
 
27026
+ // src/mcp/tools/support-inbox.ts
27027
+ import { z as z83 } from "zod";
27028
+ function adminToken() {
27029
+ return process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN;
27030
+ }
27031
+ function endpoint() {
27032
+ return (process.env.ASKEXE_SUPPORT_ADMIN_ENDPOINT || DEFAULT_ENDPOINT).replace(/\/+$/, "");
27033
+ }
27034
+ function assertInternal() {
27035
+ const token = adminToken();
27036
+ if (!token) throw new Error("AskExe support admin token not configured");
27037
+ return token;
27038
+ }
27039
+ async function requestJson(url, init) {
27040
+ const token = assertInternal();
27041
+ const res = await fetch(url, {
27042
+ ...init,
27043
+ headers: {
27044
+ "content-type": "application/json",
27045
+ authorization: `Bearer ${token}`,
27046
+ ...init?.headers ?? {}
27047
+ },
27048
+ signal: AbortSignal.timeout(1e4)
27049
+ });
27050
+ const text3 = await res.text();
27051
+ let data = text3;
27052
+ try {
27053
+ data = text3 ? JSON.parse(text3) : {};
27054
+ } catch {
27055
+ }
27056
+ if (!res.ok) throw new Error(`HTTP ${res.status}: ${typeof data === "string" ? data : JSON.stringify(data)}`);
27057
+ return data;
27058
+ }
27059
+ function registerListBugReports(server) {
27060
+ server.registerTool(
27061
+ "list_bug_reports",
27062
+ {
27063
+ title: "List Bug Reports",
27064
+ description: "AskExe-internal only: list incoming customer bug reports from the support inbox.",
27065
+ inputSchema: {
27066
+ status: z83.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("open"),
27067
+ severity: z83.enum(["p0", "p1", "p2", "p3"]).optional(),
27068
+ limit: z83.number().int().min(1).max(100).default(25)
27069
+ }
27070
+ },
27071
+ async ({ status, severity, limit }) => {
27072
+ const url = new URL(endpoint());
27073
+ url.searchParams.set("status", status);
27074
+ url.searchParams.set("limit", String(limit));
27075
+ if (severity) url.searchParams.set("severity", severity);
27076
+ const data = await requestJson(url.toString());
27077
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
27078
+ }
27079
+ );
27080
+ }
27081
+ function registerGetBugReport(server) {
27082
+ server.registerTool(
27083
+ "get_bug_report",
27084
+ {
27085
+ title: "Get Bug Report",
27086
+ description: "AskExe-internal only: fetch one customer bug report with full markdown payload.",
27087
+ inputSchema: { id: z83.string().min(8) }
27088
+ },
27089
+ async ({ id }) => {
27090
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`);
27091
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
27092
+ }
27093
+ );
27094
+ }
27095
+ function registerTriageBugReport(server) {
27096
+ server.registerTool(
27097
+ "triage_bug_report",
27098
+ {
27099
+ title: "Triage Bug Report",
27100
+ description: "AskExe-internal only: update bug report status and link task/commit/release metadata.",
27101
+ inputSchema: {
27102
+ id: z83.string().min(8),
27103
+ status: STATUS.optional(),
27104
+ triage_notes: z83.string().optional(),
27105
+ linked_task_id: z83.string().optional(),
27106
+ linked_commit: z83.string().optional(),
27107
+ fixed_version: z83.string().optional()
27108
+ }
27109
+ },
27110
+ async ({ id, status, triage_notes, linked_task_id, linked_commit, fixed_version }) => {
27111
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`, {
27112
+ method: "PATCH",
27113
+ body: JSON.stringify({ status, triage_notes, linked_task_id, linked_commit, fixed_version })
27114
+ });
27115
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
27116
+ }
27117
+ );
27118
+ }
27119
+ var DEFAULT_ENDPOINT, STATUS;
27120
+ var init_support_inbox = __esm({
27121
+ "src/mcp/tools/support-inbox.ts"() {
27122
+ "use strict";
27123
+ DEFAULT_ENDPOINT = "https://askexe.com/admin/support/bug-reports";
27124
+ STATUS = z83.enum(["open", "triaged", "fixed", "closed", "wontfix"]);
27125
+ }
27126
+ });
27127
+
27026
27128
  // src/mcp/tool-gates.ts
27027
27129
  function isToolAllowed(registerFnName) {
27028
27130
  const role = process.env.AGENT_ROLE;
@@ -27085,6 +27187,9 @@ var init_tool_gates = __esm({
27085
27187
  registerStoreDecision: "core",
27086
27188
  registerGetDecision: "core",
27087
27189
  registerCreateBugReport: "core",
27190
+ registerListBugReports: "admin",
27191
+ registerGetBugReport: "admin",
27192
+ registerTriageBugReport: "admin",
27088
27193
  registerIdentity: "core",
27089
27194
  registerGetIdentity: "core",
27090
27195
  registerUpdateIdentity: "core",
@@ -27292,6 +27397,11 @@ function registerAllTools(server) {
27292
27397
  gate("registerStoreDecision", registerStoreDecision);
27293
27398
  gate("registerGetDecision", registerGetDecision);
27294
27399
  gate("registerCreateBugReport", registerCreateBugReport);
27400
+ if (process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN) {
27401
+ gate("registerListBugReports", registerListBugReports);
27402
+ gate("registerGetBugReport", registerGetBugReport);
27403
+ gate("registerTriageBugReport", registerTriageBugReport);
27404
+ }
27295
27405
  gate("registerGetAgentSpend", registerGetAgentSpend);
27296
27406
  gate("registerGetGraphStats", registerGetGraphStats);
27297
27407
  gate("registerGetEntityNeighbors", registerGetEntityNeighbors);
@@ -27414,6 +27524,7 @@ var init_register_tools = __esm({
27414
27524
  init_activate_license();
27415
27525
  init_query_company_brain();
27416
27526
  init_create_bug_report();
27527
+ init_support_inbox();
27417
27528
  init_tool_gates();
27418
27529
  }
27419
27530
  });
@@ -21709,17 +21709,17 @@ async function fetchWithRetry(url, init) {
21709
21709
  }
21710
21710
  throw lastError;
21711
21711
  }
21712
- function assertSecureEndpoint(endpoint) {
21713
- if (endpoint.startsWith("https://")) return;
21714
- if (endpoint.startsWith("http://")) {
21712
+ function assertSecureEndpoint(endpoint2) {
21713
+ if (endpoint2.startsWith("https://")) return;
21714
+ if (endpoint2.startsWith("http://")) {
21715
21715
  try {
21716
- const parsed = new URL(endpoint);
21716
+ const parsed = new URL(endpoint2);
21717
21717
  if (LOCALHOST_PATTERNS.test(parsed.hostname)) return;
21718
21718
  } catch {
21719
21719
  return;
21720
21720
  }
21721
21721
  throw new Error(
21722
- `Insecure cloud endpoint rejected: "${endpoint}". Use https:// for remote hosts. Plain http:// is only allowed for localhost.`
21722
+ `Insecure cloud endpoint rejected: "${endpoint2}". Use https:// for remote hosts. Plain http:// is only allowed for localhost.`
21723
21723
  );
21724
21724
  }
21725
21725
  }
@@ -24232,14 +24232,14 @@ function buildMarkdown(input) {
24232
24232
  async function maybeSendUpstream(payload) {
24233
24233
  const config2 = await loadConfig();
24234
24234
  const routerUrl = process.env.API_ROUTER_URL?.replace(/\/+$/, "");
24235
- const endpoint = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT || (routerUrl ? `${routerUrl}/v1/support/bug-reports` : "https://askexe.com/v1/support/bug-reports");
24235
+ const endpoint2 = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT || (routerUrl ? `${routerUrl}/v1/support/bug-reports` : "https://askexe.com/v1/support/bug-reports");
24236
24236
  const token = config2.support?.bugReportToken || process.env.EXE_BUG_REPORT_TOKEN;
24237
24237
  const licenseKey = loadLicense() || process.env.EXE_LICENSE_KEY || config2.cloud?.apiKey;
24238
- if (!endpoint) {
24238
+ if (!endpoint2) {
24239
24239
  return "not_configured";
24240
24240
  }
24241
24241
  try {
24242
- const parsed = new URL(endpoint);
24242
+ const parsed = new URL(endpoint2);
24243
24243
  if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
24244
24244
  return "failed: insecure endpoint rejected";
24245
24245
  }
@@ -24389,6 +24389,102 @@ Upstream status: ${upstreamStatus}`
24389
24389
  );
24390
24390
  }
24391
24391
 
24392
+ // src/mcp/tools/support-inbox.ts
24393
+ import { z as z83 } from "zod";
24394
+ var DEFAULT_ENDPOINT = "https://askexe.com/admin/support/bug-reports";
24395
+ var STATUS = z83.enum(["open", "triaged", "fixed", "closed", "wontfix"]);
24396
+ function adminToken() {
24397
+ return process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN;
24398
+ }
24399
+ function endpoint() {
24400
+ return (process.env.ASKEXE_SUPPORT_ADMIN_ENDPOINT || DEFAULT_ENDPOINT).replace(/\/+$/, "");
24401
+ }
24402
+ function assertInternal() {
24403
+ const token = adminToken();
24404
+ if (!token) throw new Error("AskExe support admin token not configured");
24405
+ return token;
24406
+ }
24407
+ async function requestJson(url, init) {
24408
+ const token = assertInternal();
24409
+ const res = await fetch(url, {
24410
+ ...init,
24411
+ headers: {
24412
+ "content-type": "application/json",
24413
+ authorization: `Bearer ${token}`,
24414
+ ...init?.headers ?? {}
24415
+ },
24416
+ signal: AbortSignal.timeout(1e4)
24417
+ });
24418
+ const text3 = await res.text();
24419
+ let data = text3;
24420
+ try {
24421
+ data = text3 ? JSON.parse(text3) : {};
24422
+ } catch {
24423
+ }
24424
+ if (!res.ok) throw new Error(`HTTP ${res.status}: ${typeof data === "string" ? data : JSON.stringify(data)}`);
24425
+ return data;
24426
+ }
24427
+ function registerListBugReports(server2) {
24428
+ server2.registerTool(
24429
+ "list_bug_reports",
24430
+ {
24431
+ title: "List Bug Reports",
24432
+ description: "AskExe-internal only: list incoming customer bug reports from the support inbox.",
24433
+ inputSchema: {
24434
+ status: z83.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("open"),
24435
+ severity: z83.enum(["p0", "p1", "p2", "p3"]).optional(),
24436
+ limit: z83.number().int().min(1).max(100).default(25)
24437
+ }
24438
+ },
24439
+ async ({ status, severity, limit }) => {
24440
+ const url = new URL(endpoint());
24441
+ url.searchParams.set("status", status);
24442
+ url.searchParams.set("limit", String(limit));
24443
+ if (severity) url.searchParams.set("severity", severity);
24444
+ const data = await requestJson(url.toString());
24445
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
24446
+ }
24447
+ );
24448
+ }
24449
+ function registerGetBugReport(server2) {
24450
+ server2.registerTool(
24451
+ "get_bug_report",
24452
+ {
24453
+ title: "Get Bug Report",
24454
+ description: "AskExe-internal only: fetch one customer bug report with full markdown payload.",
24455
+ inputSchema: { id: z83.string().min(8) }
24456
+ },
24457
+ async ({ id }) => {
24458
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`);
24459
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
24460
+ }
24461
+ );
24462
+ }
24463
+ function registerTriageBugReport(server2) {
24464
+ server2.registerTool(
24465
+ "triage_bug_report",
24466
+ {
24467
+ title: "Triage Bug Report",
24468
+ description: "AskExe-internal only: update bug report status and link task/commit/release metadata.",
24469
+ inputSchema: {
24470
+ id: z83.string().min(8),
24471
+ status: STATUS.optional(),
24472
+ triage_notes: z83.string().optional(),
24473
+ linked_task_id: z83.string().optional(),
24474
+ linked_commit: z83.string().optional(),
24475
+ fixed_version: z83.string().optional()
24476
+ }
24477
+ },
24478
+ async ({ id, status, triage_notes, linked_task_id, linked_commit, fixed_version }) => {
24479
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`, {
24480
+ method: "PATCH",
24481
+ body: JSON.stringify({ status, triage_notes, linked_task_id, linked_commit, fixed_version })
24482
+ });
24483
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
24484
+ }
24485
+ );
24486
+ }
24487
+
24392
24488
  // src/mcp/tool-gates.ts
24393
24489
  var TOOL_GATES = {
24394
24490
  core: [],
@@ -24438,6 +24534,9 @@ var TOOL_CATEGORIES = {
24438
24534
  registerStoreDecision: "core",
24439
24535
  registerGetDecision: "core",
24440
24536
  registerCreateBugReport: "core",
24537
+ registerListBugReports: "admin",
24538
+ registerGetBugReport: "admin",
24539
+ registerTriageBugReport: "admin",
24441
24540
  registerIdentity: "core",
24442
24541
  registerGetIdentity: "core",
24443
24542
  registerUpdateIdentity: "core",
@@ -24648,6 +24747,11 @@ function registerAllTools(server2) {
24648
24747
  gate("registerStoreDecision", registerStoreDecision);
24649
24748
  gate("registerGetDecision", registerGetDecision);
24650
24749
  gate("registerCreateBugReport", registerCreateBugReport);
24750
+ if (process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN) {
24751
+ gate("registerListBugReports", registerListBugReports);
24752
+ gate("registerGetBugReport", registerGetBugReport);
24753
+ gate("registerTriageBugReport", registerTriageBugReport);
24754
+ }
24651
24755
  gate("registerGetAgentSpend", registerGetAgentSpend);
24652
24756
  gate("registerGetGraphStats", registerGetGraphStats);
24653
24757
  gate("registerGetEntityNeighbors", registerGetEntityNeighbors);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.42",
3
+ "version": "0.9.43",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",