@markus-global/cli 0.8.4-rc.2 → 0.8.4-rc.7

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/markus.mjs CHANGED
@@ -10070,20 +10070,18 @@ echo ${sentinel}_$?_
10070
10070
  this.agentSessions.clear();
10071
10071
  }
10072
10072
  createSession(sessionId, agentId2, cwd) {
10073
- const shell = process.env["SHELL"] || "/bin/sh";
10074
- const isBashLike = /\b(bash|zsh)\b/.test(shell);
10075
- const args = isBashLike ? ["--norc", "--noprofile", "-i"] : [];
10073
+ const isWin = process.platform === "win32";
10074
+ const shell = isWin ? process.env["COMSPEC"] || "cmd.exe" : process.env["SHELL"] || "/bin/sh";
10075
+ const isBashLike = !isWin && /\b(bash|zsh)\b/.test(shell);
10076
+ const args = isWin ? ["/Q"] : isBashLike ? ["--norc", "--noprofile", "-i"] : [];
10076
10077
  const child = spawn(shell, args, {
10077
10078
  cwd: cwd ?? process.cwd(),
10078
10079
  stdio: ["pipe", "pipe", "pipe"],
10079
10080
  env: {
10080
10081
  ...process.env,
10081
- PS1: "",
10082
- PS2: "",
10083
- PROMPT_COMMAND: "",
10084
- TERM: "dumb",
10085
- ENV: ""
10086
- }
10082
+ ...isWin ? {} : { PS1: "", PS2: "", PROMPT_COMMAND: "", TERM: "dumb", ENV: "" }
10083
+ },
10084
+ windowsHide: true
10087
10085
  });
10088
10086
  const session = new ManagedSession(sessionId, agentId2, child);
10089
10087
  this.sessions.set(sessionId, session);
@@ -10109,6 +10107,7 @@ echo ${sentinel}_$?_
10109
10107
  // ../core/dist/tools/shell.js
10110
10108
  import { spawn as spawn2 } from "node:child_process";
10111
10109
  import { resolve as resolve4, normalize, sep } from "node:path";
10110
+ import { platform as platform2 } from "node:os";
10112
10111
  function injectGitCommitMeta(command, meta) {
10113
10112
  if (!meta)
10114
10113
  return command;
@@ -10277,13 +10276,16 @@ function createShellTool(security, workspacePath, agentMeta, policy, onCommandAp
10277
10276
  settled = true;
10278
10277
  resolve21(result);
10279
10278
  };
10280
- const child = spawn2("sh", ["-c", finalCommand], {
10279
+ const isWin = platform2() === "win32";
10280
+ const child = spawn2(isWin ? process.env["COMSPEC"] || "cmd.exe" : "sh", isWin ? ["/d", "/s", "/c", finalCommand] : ["-c", finalCommand], {
10281
10281
  cwd: effectiveCwd ?? void 0,
10282
10282
  stdio: ["ignore", "pipe", "pipe"],
10283
- detached: true,
10284
- env: { ...process.env }
10283
+ detached: !isWin,
10284
+ env: { ...process.env },
10285
+ windowsHide: true
10285
10286
  });
10286
- child.unref();
10287
+ if (!isWin)
10288
+ child.unref();
10287
10289
  let stdout = "";
10288
10290
  let stderr = "";
10289
10291
  let killed = false;
@@ -10291,12 +10293,20 @@ function createShellTool(security, workspacePath, agentMeta, policy, onCommandAp
10291
10293
  const timeout = setTimeout(() => {
10292
10294
  killed = true;
10293
10295
  try {
10294
- process.kill(-child.pid, "SIGTERM");
10296
+ if (isWin) {
10297
+ child.kill();
10298
+ } else {
10299
+ process.kill(-child.pid, "SIGTERM");
10300
+ }
10295
10301
  } catch {
10296
10302
  }
10297
10303
  setTimeout(() => {
10298
10304
  try {
10299
- process.kill(-child.pid, "SIGKILL");
10305
+ if (isWin) {
10306
+ child.kill("SIGKILL");
10307
+ } else {
10308
+ process.kill(-child.pid, "SIGKILL");
10309
+ }
10300
10310
  } catch {
10301
10311
  }
10302
10312
  child.stdout?.destroy();
@@ -42223,10 +42233,10 @@ var require_turndown_cjs = __commonJS({
42223
42233
  if (!content) return "";
42224
42234
  content = content.replace(/\r?\n|\r/g, " ");
42225
42235
  var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? " " : "";
42226
- var delimiter = "`";
42236
+ var delimiter2 = "`";
42227
42237
  var matches2 = content.match(/`+/gm) || [];
42228
- while (matches2.indexOf(delimiter) !== -1) delimiter = delimiter + "`";
42229
- return delimiter + extraSpace + content + extraSpace + delimiter;
42238
+ while (matches2.indexOf(delimiter2) !== -1) delimiter2 = delimiter2 + "`";
42239
+ return delimiter2 + extraSpace + content + extraSpace + delimiter2;
42230
42240
  }
42231
42241
  };
42232
42242
  rules.image = {
@@ -43782,6 +43792,7 @@ var init_patch = __esm({
43782
43792
  // ../core/dist/tools/process-manager.js
43783
43793
  import { spawn as spawn3 } from "node:child_process";
43784
43794
  import { resolve as resolve7 } from "node:path";
43795
+ import { platform as platform3 } from "node:os";
43785
43796
  function onBackgroundCompletion(cb) {
43786
43797
  completionListeners.push(cb);
43787
43798
  return () => {
@@ -43848,9 +43859,11 @@ function createBackgroundExecTool(workspacePath) {
43848
43859
  return JSON.stringify({ status: "denied", error: "Working directory must be within workspace" });
43849
43860
  }
43850
43861
  const id = `bg_${++sessionCounter}_${Date.now()}`;
43851
- const child = spawn3("sh", ["-c", command], {
43862
+ const isWin = platform3() === "win32";
43863
+ const child = spawn3(isWin ? process.env["COMSPEC"] || "cmd.exe" : "sh", isWin ? ["/d", "/s", "/c", command] : ["-c", command], {
43852
43864
  cwd: effectiveCwd,
43853
- stdio: ["ignore", "pipe", "pipe"]
43865
+ stdio: ["ignore", "pipe", "pipe"],
43866
+ windowsHide: true
43854
43867
  });
43855
43868
  const session = {
43856
43869
  id,
@@ -57963,12 +57976,12 @@ var init_semantic_search = __esm({
57963
57976
 
57964
57977
  // ../core/dist/tools/chrome-dialog-clicker.js
57965
57978
  import { execFile as execFile3, spawn as spawn5 } from "node:child_process";
57966
- import { platform as platform2 } from "node:os";
57979
+ import { platform as platform4 } from "node:os";
57967
57980
  import { resolve as resolve9, dirname as dirname5 } from "node:path";
57968
57981
  import { fileURLToPath as fileURLToPath3 } from "node:url";
57969
57982
  import { existsSync as existsSync17 } from "node:fs";
57970
57983
  async function checkAutoClickStatus() {
57971
- const os = platform2();
57984
+ const os = platform4();
57972
57985
  const base = {
57973
57986
  platform: os,
57974
57987
  supported: os === "darwin" || os === "win32",
@@ -58007,7 +58020,7 @@ async function checkAutoClickStatus() {
58007
58020
  return base;
58008
58021
  }
58009
58022
  async function openAccessibilitySettings() {
58010
- const os = platform2();
58023
+ const os = platform4();
58011
58024
  if (os === "darwin") {
58012
58025
  const bin = resolve9(SCRIPTS_DIR, "markus-chrome-allow");
58013
58026
  if (!existsSync17(bin))
@@ -58038,7 +58051,7 @@ async function testAutoClick() {
58038
58051
  result.error = "Helper binary not found";
58039
58052
  return result;
58040
58053
  }
58041
- if (platform2() === "darwin" && !checkResult.accessibilityPermission) {
58054
+ if (platform4() === "darwin" && !checkResult.accessibilityPermission) {
58042
58055
  result.openedAccessibilitySettings = await openAccessibilitySettings();
58043
58056
  result.clickResult = "no_permission";
58044
58057
  return result;
@@ -58064,13 +58077,13 @@ async function testAutoClick() {
58064
58077
  return result;
58065
58078
  }
58066
58079
  async function runMcpTest() {
58067
- const npxCmd = platform2() === "win32" ? "npx.cmd" : "npx";
58080
+ const npxCmd = platform4() === "win32" ? "npx.cmd" : "npx";
58068
58081
  return new Promise((resolveTest, rejectTest) => {
58069
58082
  const stderrChunks = [];
58070
58083
  const proc = spawn5(npxCmd, ["-y", "chrome-devtools-mcp@latest", "--autoConnect"], {
58071
58084
  stdio: ["pipe", "pipe", "pipe"],
58072
58085
  env: { ...process.env },
58073
- shell: platform2() === "win32"
58086
+ shell: platform4() === "win32"
58074
58087
  });
58075
58088
  let stdout = "";
58076
58089
  let requestId = 1;
@@ -58169,7 +58182,7 @@ async function runMcpTest() {
58169
58182
  });
58170
58183
  }
58171
58184
  async function clickChromeAllowDialog(timeoutSec = 5) {
58172
- const os = platform2();
58185
+ const os = platform4();
58173
58186
  if (os === "darwin") {
58174
58187
  const bin = resolve9(SCRIPTS_DIR, "markus-chrome-allow");
58175
58188
  return runHelper(bin, ["--timeout", String(timeoutSec)], timeoutSec);
@@ -63069,7 +63082,7 @@ var init_fireworks = __esm({
63069
63082
  import { readFileSync as readFileSync14, existsSync as existsSync19 } from "node:fs";
63070
63083
  import { execSync as execSync2 } from "node:child_process";
63071
63084
  import { join as join14 } from "node:path";
63072
- import { homedir as homedir7, platform as platform3 } from "node:os";
63085
+ import { homedir as homedir7, platform as platform5 } from "node:os";
63073
63086
  function readNetworkConfig() {
63074
63087
  try {
63075
63088
  const configPath = join14(homedir7(), ".markus", "markus.json");
@@ -63085,7 +63098,7 @@ function readNetworkConfig() {
63085
63098
  }
63086
63099
  }
63087
63100
  function readSystemProxy() {
63088
- const os = platform3();
63101
+ const os = platform5();
63089
63102
  try {
63090
63103
  if (os === "darwin") {
63091
63104
  return readMacOSProxy();
@@ -67281,7 +67294,7 @@ var init_external_gateway = __esm({
67281
67294
  return rows.length;
67282
67295
  }
67283
67296
  async register(request) {
67284
- const { externalAgentId, agentName, orgId: orgId2, capabilities = [], platform: platform7, platformConfig, agentCardUrl, openClawConfig } = request;
67297
+ const { externalAgentId, agentName, orgId: orgId2, capabilities = [], platform: platform9, platformConfig, agentCardUrl, openClawConfig } = request;
67285
67298
  if (!externalAgentId || !agentName || !orgId2) {
67286
67299
  throw new GatewayError("Missing required fields: externalAgentId, agentName, orgId", 400);
67287
67300
  }
@@ -67308,7 +67321,7 @@ var init_external_gateway = __esm({
67308
67321
  agentName,
67309
67322
  orgId: orgId2,
67310
67323
  capabilities,
67311
- platform: platform7 ?? (openClawConfig ? "openclaw" : void 0),
67324
+ platform: platform9 ?? (openClawConfig ? "openclaw" : void 0),
67312
67325
  platformConfig: platformConfig ?? openClawConfig,
67313
67326
  agentCardUrl,
67314
67327
  openClawConfig,
@@ -94814,8 +94827,8 @@ var require_common = __commonJS({
94814
94827
  }
94815
94828
  return debug;
94816
94829
  }
94817
- function extend(namespace, delimiter) {
94818
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
94830
+ function extend(namespace, delimiter2) {
94831
+ const newDebug = createDebug(this.namespace + (typeof delimiter2 === "undefined" ? ":" : delimiter2) + namespace);
94819
94832
  newDebug.log = this.log;
94820
94833
  return newDebug;
94821
94834
  }
@@ -96227,14 +96240,14 @@ var require_axios = __commonJS({
96227
96240
  }
96228
96241
  });
96229
96242
  };
96230
- var toObjectSet = (arrayOrString, delimiter) => {
96243
+ var toObjectSet = (arrayOrString, delimiter2) => {
96231
96244
  const obj = {};
96232
96245
  const define = (arr) => {
96233
96246
  arr.forEach((value) => {
96234
96247
  obj[value] = true;
96235
96248
  });
96236
96249
  };
96237
- isArray2(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
96250
+ isArray2(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter2));
96238
96251
  return obj;
96239
96252
  };
96240
96253
  var noop = () => {
@@ -96715,14 +96728,14 @@ var require_axios = __commonJS({
96715
96728
  navigator: _navigator,
96716
96729
  origin
96717
96730
  });
96718
- var platform7 = {
96731
+ var platform9 = {
96719
96732
  ...utils,
96720
96733
  ...platform$1
96721
96734
  };
96722
96735
  function toURLEncodedForm(data, options) {
96723
- return toFormData(data, new platform7.classes.URLSearchParams(), {
96736
+ return toFormData(data, new platform9.classes.URLSearchParams(), {
96724
96737
  visitor: function(value, key2, path, helpers) {
96725
- if (platform7.isNode && utils$1.isBuffer(value)) {
96738
+ if (platform9.isNode && utils$1.isBuffer(value)) {
96726
96739
  this.append(key2, value.toString("base64"));
96727
96740
  return false;
96728
96741
  }
@@ -96875,8 +96888,8 @@ var require_axios = __commonJS({
96875
96888
  maxContentLength: -1,
96876
96889
  maxBodyLength: -1,
96877
96890
  env: {
96878
- FormData: platform7.classes.FormData,
96879
- Blob: platform7.classes.Blob
96891
+ FormData: platform9.classes.FormData,
96892
+ Blob: platform9.classes.Blob
96880
96893
  },
96881
96894
  validateStatus: function validateStatus(status) {
96882
96895
  return status >= 200 && status < 300;
@@ -97239,7 +97252,7 @@ var require_axios = __commonJS({
97239
97252
  }
97240
97253
  var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
97241
97254
  function fromDataURI(uri, asBlob, options) {
97242
- const _Blob = options && options.Blob || platform7.classes.Blob;
97255
+ const _Blob = options && options.Blob || platform9.classes.Blob;
97243
97256
  const protocol = parseProtocol(uri);
97244
97257
  if (asBlob === void 0 && _Blob) {
97245
97258
  asBlob = true;
@@ -97397,7 +97410,7 @@ var require_axios = __commonJS({
97397
97410
  }
97398
97411
  };
97399
97412
  var readBlob$1 = readBlob;
97400
- var BOUNDARY_ALPHABET = platform7.ALPHABET.ALPHA_DIGIT + "-_";
97413
+ var BOUNDARY_ALPHABET = platform9.ALPHABET.ALPHA_DIGIT + "-_";
97401
97414
  var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder();
97402
97415
  var CRLF = "\r\n";
97403
97416
  var CRLF_BYTES = textEncoder.encode(CRLF);
@@ -97443,7 +97456,7 @@ var require_axios = __commonJS({
97443
97456
  const {
97444
97457
  tag = "form-data-boundary",
97445
97458
  size = 25,
97446
- boundary = tag + "-" + platform7.generateString(size, BOUNDARY_ALPHABET)
97459
+ boundary = tag + "-" + platform9.generateString(size, BOUNDARY_ALPHABET)
97447
97460
  } = options || {};
97448
97461
  if (!utils$1.isFormData(form)) {
97449
97462
  throw TypeError("FormData instance required");
@@ -97672,7 +97685,7 @@ var require_axios = __commonJS({
97672
97685
  var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
97673
97686
  var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"];
97674
97687
  var isHttps = /https:?/;
97675
- var supportedProtocols = platform7.protocols.map((protocol) => {
97688
+ var supportedProtocols = platform9.protocols.map((protocol) => {
97676
97689
  return protocol + ":";
97677
97690
  });
97678
97691
  var flushOnFinish = (stream2, [throttled, flush]) => {
@@ -97924,7 +97937,7 @@ var require_axios = __commonJS({
97924
97937
  }
97925
97938
  });
97926
97939
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
97927
- const parsed = new URL(fullPath, platform7.hasBrowserEnv ? platform7.origin : void 0);
97940
+ const parsed = new URL(fullPath, platform9.hasBrowserEnv ? platform9.origin : void 0);
97928
97941
  const protocol = parsed.protocol || supportedProtocols[0];
97929
97942
  if (protocol === "data:") {
97930
97943
  if (config.maxContentLength > -1) {
@@ -98332,14 +98345,14 @@ var require_axios = __commonJS({
98332
98345
  }
98333
98346
  });
98334
98347
  };
98335
- var isURLSameOrigin = platform7.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
98336
- url2 = new URL(url2, platform7.origin);
98348
+ var isURLSameOrigin = platform9.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
98349
+ url2 = new URL(url2, platform9.origin);
98337
98350
  return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
98338
98351
  })(
98339
- new URL(platform7.origin),
98340
- platform7.navigator && /(msie|trident)/i.test(platform7.navigator.userAgent)
98352
+ new URL(platform9.origin),
98353
+ platform9.navigator && /(msie|trident)/i.test(platform9.navigator.userAgent)
98341
98354
  ) : () => true;
98342
- var cookies = platform7.hasStandardBrowserEnv ? (
98355
+ var cookies = platform9.hasStandardBrowserEnv ? (
98343
98356
  // Standard browser envs support document.cookie
98344
98357
  {
98345
98358
  write(name, value, expires, path, domain, secure, sameSite) {
@@ -98480,7 +98493,7 @@ var require_axios = __commonJS({
98480
98493
  );
98481
98494
  }
98482
98495
  if (utils$1.isFormData(data)) {
98483
- if (platform7.hasStandardBrowserEnv || platform7.hasStandardBrowserWebWorkerEnv) {
98496
+ if (platform9.hasStandardBrowserEnv || platform9.hasStandardBrowserWebWorkerEnv) {
98484
98497
  headers.setContentType(void 0);
98485
98498
  } else if (utils$1.isFunction(data.getHeaders)) {
98486
98499
  const formHeaders = data.getHeaders();
@@ -98492,7 +98505,7 @@ var require_axios = __commonJS({
98492
98505
  });
98493
98506
  }
98494
98507
  }
98495
- if (platform7.hasStandardBrowserEnv) {
98508
+ if (platform9.hasStandardBrowserEnv) {
98496
98509
  withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
98497
98510
  if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
98498
98511
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -98630,7 +98643,7 @@ var require_axios = __commonJS({
98630
98643
  }
98631
98644
  }
98632
98645
  const protocol = parseProtocol(_config.url);
98633
- if (protocol && platform7.protocols.indexOf(protocol) === -1) {
98646
+ if (protocol && platform9.protocols.indexOf(protocol) === -1) {
98634
98647
  reject(
98635
98648
  new AxiosError$1(
98636
98649
  "Unsupported protocol " + protocol + ":",
@@ -98790,7 +98803,7 @@ var require_axios = __commonJS({
98790
98803
  const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
98791
98804
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
98792
98805
  let duplexAccessed = false;
98793
- const hasContentType = new Request(platform7.origin, {
98806
+ const hasContentType = new Request(platform9.origin, {
98794
98807
  body: new ReadableStream$1(),
98795
98808
  method: "POST",
98796
98809
  get duplex() {
@@ -98827,7 +98840,7 @@ var require_axios = __commonJS({
98827
98840
  return body.size;
98828
98841
  }
98829
98842
  if (utils$1.isSpecCompliantForm(body)) {
98830
- const _request = new Request(platform7.origin, {
98843
+ const _request = new Request(platform9.origin, {
98831
98844
  method: "POST",
98832
98845
  body
98833
98846
  });
@@ -201284,11 +201297,11 @@ EXPLANATION_END`;
201284
201297
  return;
201285
201298
  try {
201286
201299
  const { exec: execCb2 } = await import("node:child_process");
201287
- const platform7 = process.platform;
201288
- if (platform7 === "darwin") {
201300
+ const platform9 = process.platform;
201301
+ if (platform9 === "darwin") {
201289
201302
  execCb2('open -a "Google Chrome" "chrome://extensions"', () => {
201290
201303
  });
201291
- } else if (platform7 === "win32") {
201304
+ } else if (platform9 === "win32") {
201292
201305
  execCb2('start "" "chrome://extensions"', () => {
201293
201306
  });
201294
201307
  } else {
@@ -203337,10 +203350,10 @@ You can now:
203337
203350
  this.json(res, 400, { error: "Invalid or non-existent path" });
203338
203351
  return;
203339
203352
  }
203340
- const platform7 = process.platform;
203341
- if (platform7 === "darwin")
203353
+ const platform9 = process.platform;
203354
+ if (platform9 === "darwin")
203342
203355
  execSync4(`open ${JSON.stringify(dirPath)}`);
203343
- else if (platform7 === "win32")
203356
+ else if (platform9 === "win32")
203344
203357
  execSync4(`explorer ${JSON.stringify(dirPath)}`);
203345
203358
  else
203346
203359
  execSync4(`xdg-open ${JSON.stringify(dirPath)}`);
@@ -203688,11 +203701,11 @@ You can now:
203688
203701
  return;
203689
203702
  }
203690
203703
  const isDir = statSync8(resolved).isDirectory();
203691
- const platform7 = process.platform;
203704
+ const platform9 = process.platform;
203692
203705
  let cmd;
203693
- if (platform7 === "darwin") {
203706
+ if (platform9 === "darwin") {
203694
203707
  cmd = isDir ? `open "${resolved}"` : `open -R "${resolved}"`;
203695
- } else if (platform7 === "win32") {
203708
+ } else if (platform9 === "win32") {
203696
203709
  cmd = isDir ? `explorer "${resolved}"` : `explorer /select,"${resolved}"`;
203697
203710
  } else {
203698
203711
  cmd = `xdg-open "${isDir ? resolved : dirname16(resolved)}"`;
@@ -206362,7 +206375,7 @@ MCowBQYDK2VwAyEAPlaceholderPublicKeyForOfflineLicenseVerification00=
206362
206375
  // ../org-manager/dist/telemetry-service.js
206363
206376
  import { readFileSync as readFileSync26, writeFileSync as writeFileSync20, existsSync as existsSync32, mkdirSync as mkdirSync22 } from "node:fs";
206364
206377
  import { join as join28, dirname as dirname10 } from "node:path";
206365
- import { homedir as homedir18, platform as platform4, arch as arch2 } from "node:os";
206378
+ import { homedir as homedir18, platform as platform6, arch as arch2 } from "node:os";
206366
206379
  async function hubFetch2(url, init) {
206367
206380
  let currentUrl = url;
206368
206381
  for (let i = 0; i < 3; i++) {
@@ -206441,7 +206454,7 @@ var init_telemetry_service = __esm({
206441
206454
  const payload = {
206442
206455
  instanceId: this.instanceId,
206443
206456
  version: APP_VERSION,
206444
- os: `${platform4()}/${arch2()}`,
206457
+ os: `${platform6()}/${arch2()}`,
206445
206458
  ...stats
206446
206459
  };
206447
206460
  const hubToken = this.readHubToken();
@@ -212107,8 +212120,8 @@ CREATE INDEX IF NOT EXISTS idx_integrations_org ON integrations(org_id, platform
212107
212120
  const rows = this.db.prepare("SELECT * FROM integrations WHERE org_id = ? ORDER BY platform, display_name").all(orgId2);
212108
212121
  return rows.map((r) => this.mapRow(r));
212109
212122
  }
212110
- listByPlatform(orgId2, platform7) {
212111
- const rows = this.db.prepare("SELECT * FROM integrations WHERE org_id = ? AND platform = ? ORDER BY display_name").all(orgId2, platform7);
212123
+ listByPlatform(orgId2, platform9) {
212124
+ const rows = this.db.prepare("SELECT * FROM integrations WHERE org_id = ? AND platform = ? ORDER BY display_name").all(orgId2, platform9);
212112
212125
  return rows.map((r) => this.mapRow(r));
212113
212126
  }
212114
212127
  async update(id, data) {
@@ -221735,8 +221748,8 @@ var init_router2 = __esm({
221735
221748
  this.adapters.set(adapter2.platform, adapter2);
221736
221749
  log95.info(`Registered comm adapter: ${adapter2.platform}`);
221737
221750
  }
221738
- bindAgentToChannel(agentId2, platform7, channelId) {
221739
- const key2 = `${platform7}:${channelId}`;
221751
+ bindAgentToChannel(agentId2, platform9, channelId) {
221752
+ const key2 = `${platform9}:${channelId}`;
221740
221753
  this.agentChannelMap.set(key2, agentId2);
221741
221754
  log95.info(`Bound agent ${agentId2} to ${key2}`);
221742
221755
  }
@@ -221767,16 +221780,16 @@ var init_router2 = __esm({
221767
221780
  }
221768
221781
  }
221769
221782
  }
221770
- async sendToChannel(platform7, channelId, content) {
221771
- const adapter2 = this.adapters.get(platform7);
221783
+ async sendToChannel(platform9, channelId, content) {
221784
+ const adapter2 = this.adapters.get(platform9);
221772
221785
  if (!adapter2 || !adapter2.isConnected()) {
221773
- log95.warn(`Adapter not available for platform: ${platform7}`);
221786
+ log95.warn(`Adapter not available for platform: ${platform9}`);
221774
221787
  return void 0;
221775
221788
  }
221776
221789
  return adapter2.sendMessage(channelId, content);
221777
221790
  }
221778
- async sendAsAgent(agentId2, platform7, channelId, content) {
221779
- return this.sendToChannel(platform7, channelId, content);
221791
+ async sendAsAgent(agentId2, platform9, channelId, content) {
221792
+ return this.sendToChannel(platform9, channelId, content);
221780
221793
  }
221781
221794
  async routeIncomingMessage(message) {
221782
221795
  const key2 = `${message.platform}:${message.channelId}`;
@@ -221908,10 +221921,10 @@ var init_logger2 = __esm({
221908
221921
  // src/utils/browser.ts
221909
221922
  import { exec } from "node:child_process";
221910
221923
  import { get as httpGet } from "node:http";
221911
- import { platform as platform5 } from "node:os";
221924
+ import { platform as platform7 } from "node:os";
221912
221925
  function openBrowser(url) {
221913
221926
  if (process.env["NO_BROWSER"]) return;
221914
- const sys = platform5();
221927
+ const sys = platform7();
221915
221928
  const cmd = sys === "darwin" ? `open "${url}"` : sys === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
221916
221929
  exec(cmd, (err) => {
221917
221930
  if (err) {
@@ -222252,8 +222265,8 @@ function loadFromDir(dir, map) {
222252
222265
  }
222253
222266
  }
222254
222267
  }
222255
- function findConnector(platform7) {
222256
- return loadConnectors().find((c) => c.platform === platform7);
222268
+ function findConnector(platform9) {
222269
+ return loadConnectors().find((c) => c.platform === platform9);
222257
222270
  }
222258
222271
  function scanInstalledPlatforms() {
222259
222272
  const connectors = loadConnectors();
@@ -223518,7 +223531,7 @@ __export(start_exports, {
223518
223531
  registerStartCommand: () => registerStartCommand,
223519
223532
  startServerHeadless: () => startServerHeadless
223520
223533
  });
223521
- import { resolve as resolve18, join as join37, dirname as dirname13 } from "node:path";
223534
+ import { resolve as resolve18, join as join37, dirname as dirname13, delimiter } from "node:path";
223522
223535
  import { existsSync as existsSync41, readFileSync as readFileSync31 } from "node:fs";
223523
223536
  import { homedir as homedir26 } from "node:os";
223524
223537
  function registerStartCommand(program2) {
@@ -223856,7 +223869,7 @@ async function startServerCore(config, values, opts) {
223856
223869
  const cwdBin = join37(process.cwd(), "node_modules", ".bin");
223857
223870
  if (existsSync41(cwdBin) && !currentPath.includes(cwdBin)) extraPaths.push(cwdBin);
223858
223871
  if (extraPaths.length > 0) {
223859
- process.env["PATH"] = `${extraPaths.join(":")}:${currentPath}`;
223872
+ process.env["PATH"] = `${extraPaths.join(delimiter)}${delimiter}${currentPath}`;
223860
223873
  }
223861
223874
  if (config.security?.adminPassword && !process.env["ADMIN_PASSWORD"]) {
223862
223875
  process.env["ADMIN_PASSWORD"] = config.security.adminPassword;
@@ -224934,7 +224947,7 @@ ${reason}`;
224934
224947
  }
224935
224948
  startupBlank();
224936
224949
  const logFile = getStartupLogFile();
224937
- const logFileName = logFile.split("/").pop() ?? logFile;
224950
+ const logFileName = logFile.replace(/.*[/\\]/, "") || logFile;
224938
224951
  const uiUrl = `http://localhost:${apiPort}`;
224939
224952
  progress?.finish(uiUrl);
224940
224953
  onProgress?.("ready", `server ready at ${uiUrl}`);
@@ -226157,7 +226170,7 @@ __export(update_exports, {
226157
226170
  import { execSync as execSync6, spawnSync } from "node:child_process";
226158
226171
  import { existsSync as existsSync42, mkdirSync as mkdirSync31, renameSync, rmSync as rmSync4, createWriteStream as createWriteStream3 } from "node:fs";
226159
226172
  import { join as join38 } from "node:path";
226160
- import { homedir as homedir27, platform as platform6, arch as arch3 } from "node:os";
226173
+ import { homedir as homedir27, platform as platform8, arch as arch3 } from "node:os";
226161
226174
  import { pipeline } from "node:stream/promises";
226162
226175
  import { Readable } from "node:stream";
226163
226176
  function detectInstallMethod() {
@@ -226178,7 +226191,7 @@ function detectInstallMethod() {
226178
226191
  return "unknown";
226179
226192
  }
226180
226193
  function getDownloadUrl(version) {
226181
- const os = platform6();
226194
+ const os = platform8();
226182
226195
  const a = arch3();
226183
226196
  const platformStr = os === "win32" ? "win" : os;
226184
226197
  const archStr = a === "arm64" ? "arm64" : "x64";
@@ -226400,19 +226413,19 @@ __export(install_agent_exports, {
226400
226413
  import { execSync as execSync7 } from "node:child_process";
226401
226414
  import { randomBytes as randomBytes6 } from "node:crypto";
226402
226415
  function registerInstallAgentCommands(program2) {
226403
- program2.command("install <platform>").description("Install an external agent platform and connect it to Markus").option("--org-id <id>", "Organization ID", "default").option("--agent-name <name>", "Agent display name").option("--skip-install", "Skip npm install (platform already installed)").option("--skip-init", "Skip platform initialization").option("--skip-connect", "Only install, do not register with Markus").action(async (platform7, opts, cmd) => {
226416
+ program2.command("install <platform>").description("Install an external agent platform and connect it to Markus").option("--org-id <id>", "Organization ID", "default").option("--agent-name <name>", "Agent display name").option("--skip-install", "Skip npm install (platform already installed)").option("--skip-init", "Skip platform initialization").option("--skip-connect", "Only install, do not register with Markus").action(async (platform9, opts, cmd) => {
226404
226417
  const g = cmd.optsWithGlobals();
226405
- const connector = findConnector(platform7);
226418
+ const connector = findConnector(platform9);
226406
226419
  if (!connector) {
226407
226420
  const available = loadConnectors().map((c) => c.platform).join(", ");
226408
- fail(`Unknown platform "${platform7}". Available: ${available || "none"}`);
226421
+ fail(`Unknown platform "${platform9}". Available: ${available || "none"}`);
226409
226422
  return;
226410
226423
  }
226411
226424
  console.log(`
226412
226425
  Installing ${connector.displayName}...
226413
226426
  `);
226414
226427
  const scan = scanInstalledPlatforms();
226415
- const existing = scan.find((s2) => s2.platform === platform7);
226428
+ const existing = scan.find((s2) => s2.platform === platform9);
226416
226429
  const alreadyInstalled = existing?.installed;
226417
226430
  if (alreadyInstalled && !opts.skipInstall) {
226418
226431
  console.log(` [1/5] ${connector.displayName} is already installed.`);
@@ -226448,13 +226461,13 @@ function registerInstallAgentCommands(program2) {
226448
226461
  console.log(` [4/5] Token generation skipped.`);
226449
226462
  console.log(` [5/5] Config write skipped.`);
226450
226463
  console.log(`
226451
- ${connector.displayName} installed. Run \`markus install ${platform7}\` again without --skip-connect to connect later.
226464
+ ${connector.displayName} installed. Run \`markus install ${platform9}\` again without --skip-connect to connect later.
226452
226465
  `);
226453
226466
  return;
226454
226467
  }
226455
226468
  const client = createClient(g);
226456
226469
  const serverUrl = g.server || process.env["MARKUS_API_URL"] || "http://localhost:8056";
226457
- const agentId2 = `${platform7}-${randomBytes6(4).toString("hex")}`;
226470
+ const agentId2 = `${platform9}-${randomBytes6(4).toString("hex")}`;
226458
226471
  const agentName = opts.agentName || connector.defaultAgentName || `${connector.displayName} Agent`;
226459
226472
  const capabilities = connector.defaultCapabilities ?? [];
226460
226473
  try {
@@ -226517,7 +226530,7 @@ function registerInstallAgentCommands(program2) {
226517
226530
  Connection failed: ${e.message}`);
226518
226531
  console.log(` ${connector.displayName} was installed but could not connect to Markus.`);
226519
226532
  console.log(` Make sure the Markus server is running (\`markus start\`), then run:`);
226520
- console.log(` markus install ${platform7}
226533
+ console.log(` markus install ${platform9}
226521
226534
  `);
226522
226535
  return;
226523
226536
  }