@askexenow/exe-os 0.9.41 → 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
  }
@@ -26847,13 +26847,15 @@ function buildMarkdown(input) {
26847
26847
  }
26848
26848
  async function maybeSendUpstream(payload) {
26849
26849
  const config2 = await loadConfig();
26850
- const endpoint = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT;
26850
+ const routerUrl = process.env.API_ROUTER_URL?.replace(/\/+$/, "");
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");
26851
26852
  const token = config2.support?.bugReportToken || process.env.EXE_BUG_REPORT_TOKEN;
26852
- if (!endpoint) {
26853
+ const licenseKey = loadLicense() || process.env.EXE_LICENSE_KEY || config2.cloud?.apiKey;
26854
+ if (!endpoint2) {
26853
26855
  return "not_configured";
26854
26856
  }
26855
26857
  try {
26856
- const parsed = new URL(endpoint);
26858
+ const parsed = new URL(endpoint2);
26857
26859
  if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
26858
26860
  return "failed: insecure endpoint rejected";
26859
26861
  }
@@ -26861,7 +26863,8 @@ async function maybeSendUpstream(payload) {
26861
26863
  method: "POST",
26862
26864
  headers: {
26863
26865
  "content-type": "application/json",
26864
- ...token ? { authorization: `Bearer ${token}` } : {}
26866
+ ...token ? { authorization: `Bearer ${token}` } : {},
26867
+ ...licenseKey ? { "x-exe-license-key": licenseKey } : {}
26865
26868
  },
26866
26869
  body: JSON.stringify(payload),
26867
26870
  signal: AbortSignal.timeout(1e4)
@@ -27008,6 +27011,7 @@ var init_create_bug_report = __esm({
27008
27011
  init_embedder();
27009
27012
  init_active_agent();
27010
27013
  init_config();
27014
+ init_license();
27011
27015
  init_store();
27012
27016
  CLASSIFICATION = z82.enum([
27013
27017
  "upstream_bug",
@@ -27019,6 +27023,108 @@ var init_create_bug_report = __esm({
27019
27023
  }
27020
27024
  });
27021
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
+
27022
27128
  // src/mcp/tool-gates.ts
27023
27129
  function isToolAllowed(registerFnName) {
27024
27130
  const role = process.env.AGENT_ROLE;
@@ -27081,6 +27187,9 @@ var init_tool_gates = __esm({
27081
27187
  registerStoreDecision: "core",
27082
27188
  registerGetDecision: "core",
27083
27189
  registerCreateBugReport: "core",
27190
+ registerListBugReports: "admin",
27191
+ registerGetBugReport: "admin",
27192
+ registerTriageBugReport: "admin",
27084
27193
  registerIdentity: "core",
27085
27194
  registerGetIdentity: "core",
27086
27195
  registerUpdateIdentity: "core",
@@ -27288,6 +27397,11 @@ function registerAllTools(server) {
27288
27397
  gate("registerStoreDecision", registerStoreDecision);
27289
27398
  gate("registerGetDecision", registerGetDecision);
27290
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
+ }
27291
27405
  gate("registerGetAgentSpend", registerGetAgentSpend);
27292
27406
  gate("registerGetGraphStats", registerGetGraphStats);
27293
27407
  gate("registerGetEntityNeighbors", registerGetEntityNeighbors);
@@ -27410,6 +27524,7 @@ var init_register_tools = __esm({
27410
27524
  init_activate_license();
27411
27525
  init_query_company_brain();
27412
27526
  init_create_bug_report();
27527
+ init_support_inbox();
27413
27528
  init_tool_gates();
27414
27529
  }
27415
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
  }
@@ -24176,6 +24176,7 @@ Key saved to ~/.exe-os/license.key. Device ID: ${deviceId}`);
24176
24176
  init_embedder();
24177
24177
  init_active_agent();
24178
24178
  init_config();
24179
+ init_license();
24179
24180
  init_store();
24180
24181
  import { z as z82 } from "zod";
24181
24182
  import crypto18 from "crypto";
@@ -24230,13 +24231,15 @@ function buildMarkdown(input) {
24230
24231
  }
24231
24232
  async function maybeSendUpstream(payload) {
24232
24233
  const config2 = await loadConfig();
24233
- const endpoint = config2.support?.bugReportEndpoint || process.env.EXE_BUG_REPORT_ENDPOINT;
24234
+ const routerUrl = process.env.API_ROUTER_URL?.replace(/\/+$/, "");
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");
24234
24236
  const token = config2.support?.bugReportToken || process.env.EXE_BUG_REPORT_TOKEN;
24235
- if (!endpoint) {
24237
+ const licenseKey = loadLicense() || process.env.EXE_LICENSE_KEY || config2.cloud?.apiKey;
24238
+ if (!endpoint2) {
24236
24239
  return "not_configured";
24237
24240
  }
24238
24241
  try {
24239
- const parsed = new URL(endpoint);
24242
+ const parsed = new URL(endpoint2);
24240
24243
  if (parsed.protocol !== "https:" && !["localhost", "127.0.0.1", "::1"].includes(parsed.hostname)) {
24241
24244
  return "failed: insecure endpoint rejected";
24242
24245
  }
@@ -24244,7 +24247,8 @@ async function maybeSendUpstream(payload) {
24244
24247
  method: "POST",
24245
24248
  headers: {
24246
24249
  "content-type": "application/json",
24247
- ...token ? { authorization: `Bearer ${token}` } : {}
24250
+ ...token ? { authorization: `Bearer ${token}` } : {},
24251
+ ...licenseKey ? { "x-exe-license-key": licenseKey } : {}
24248
24252
  },
24249
24253
  body: JSON.stringify(payload),
24250
24254
  signal: AbortSignal.timeout(1e4)
@@ -24385,6 +24389,102 @@ Upstream status: ${upstreamStatus}`
24385
24389
  );
24386
24390
  }
24387
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
+
24388
24488
  // src/mcp/tool-gates.ts
24389
24489
  var TOOL_GATES = {
24390
24490
  core: [],
@@ -24434,6 +24534,9 @@ var TOOL_CATEGORIES = {
24434
24534
  registerStoreDecision: "core",
24435
24535
  registerGetDecision: "core",
24436
24536
  registerCreateBugReport: "core",
24537
+ registerListBugReports: "admin",
24538
+ registerGetBugReport: "admin",
24539
+ registerTriageBugReport: "admin",
24437
24540
  registerIdentity: "core",
24438
24541
  registerGetIdentity: "core",
24439
24542
  registerUpdateIdentity: "core",
@@ -24644,6 +24747,11 @@ function registerAllTools(server2) {
24644
24747
  gate("registerStoreDecision", registerStoreDecision);
24645
24748
  gate("registerGetDecision", registerGetDecision);
24646
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
+ }
24647
24755
  gate("registerGetAgentSpend", registerGetAgentSpend);
24648
24756
  gate("registerGetGraphStats", registerGetGraphStats);
24649
24757
  gate("registerGetEntityNeighbors", registerGetEntityNeighbors);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.41",
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",