@mtreeai/msapling-cli 2.3.6-beta.14 → 2.3.6-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +16 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -581,15 +581,22 @@ var init_src = __esm({
581
581
  const controller = new AbortController();
582
582
  const timeout = setTimeout(() => controller.abort(), 3e4);
583
583
  try {
584
+ const headers = {
585
+ "Authorization": `Bearer ${this.token}`,
586
+ "Content-Type": "application/json"
587
+ };
588
+ if (this.cookies.size > 0) {
589
+ headers["Cookie"] = this.serializeCookies();
590
+ }
591
+ const csrf = this.cookies.get("msapling_csrftoken");
592
+ if (csrf) headers["X-CSRF-Token"] = csrf;
584
593
  const response = await fetch(`${this.apiUrl}/api/chat/message`, {
585
594
  method: "POST",
586
- headers: {
587
- "Authorization": `Bearer ${this.token}`,
588
- "Content-Type": "application/json"
589
- },
595
+ headers,
590
596
  body: JSON.stringify(params),
591
597
  signal: controller.signal
592
598
  });
599
+ this.updateCookiesFromResponse(response);
593
600
  clearTimeout(timeout);
594
601
  if (response.status === 423) {
595
602
  await new Promise((r) => setTimeout(r, 1e3));
@@ -9176,7 +9183,7 @@ var init_skill = __esm({
9176
9183
  context.addMessage("system", `No skills/ dir found. Looked at: ${SKILLS_DIRS.join(", ")}`);
9177
9184
  return;
9178
9185
  }
9179
- if (args2.length === 0) {
9186
+ if (args2.length === 0 || args2.length === 1 && (args2[0] === "list" || args2[0] === "ls")) {
9180
9187
  const all = listAllSkills(root);
9181
9188
  if (all.length === 0) {
9182
9189
  context.addMessage("system", `${root}/ has no skills (.md files).`);
@@ -9684,7 +9691,7 @@ var init_version = __esm({
9684
9691
  description: "Show version information for CLI and core packages",
9685
9692
  category: "debug",
9686
9693
  handler: async (_args, context) => {
9687
- const cliVersion = true ? "2.3.6-beta.14" : "(dev)";
9694
+ const cliVersion = true ? "2.3.6-beta.16" : "(dev)";
9688
9695
  const coreVersion = true ? "2.3.2" : "(dev)";
9689
9696
  const runtime = process.version;
9690
9697
  context.addMessage("system", "MSapling Version Info");
@@ -9693,7 +9700,7 @@ var init_version = __esm({
9693
9700
  context.addMessage("system", row2("Core (@msapling/core)", coreVersion));
9694
9701
  context.addMessage("system", row2("Runtime (Node/Bun)", runtime));
9695
9702
  try {
9696
- const ts = "2026-05-28T13:59:33.347Z";
9703
+ const ts = "2026-05-28T15:34:41.643Z";
9697
9704
  if (ts && ts !== "__BUILD_TIMESTAMP__") {
9698
9705
  context.addMessage("system", row2("Build Timestamp", ts));
9699
9706
  }
@@ -13277,7 +13284,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
13277
13284
  var Header = () => /* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
13278
13285
  /* @__PURE__ */ jsxs(Text, { bold: true, color: "cyan", children: [
13279
13286
  "\u25CF MSapling CLI v",
13280
- "2.3.6-beta.14"
13287
+ "2.3.6-beta.16"
13281
13288
  ] }),
13282
13289
  /* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "Platinum Tier Architecture" }) })
13283
13290
  ] });
@@ -13888,7 +13895,7 @@ function parseApprovalMode(raw, now) {
13888
13895
  if (typeof mode !== "string" || !VALID_MODES.includes(mode)) {
13889
13896
  return { kind: "invalid", error: `approvalMode.mode invalid: ${JSON.stringify(mode)}` };
13890
13897
  }
13891
- if (obj.ttlMs === void 0 && obj.timestamp === void 0) {
13898
+ if (mode !== "bypassPermissions") {
13892
13899
  return { kind: "ok", mode };
13893
13900
  }
13894
13901
  if (typeof obj.ttlMs !== "number" || !Number.isFinite(obj.ttlMs) || obj.ttlMs <= 0) {
@@ -13903,9 +13910,6 @@ function parseApprovalMode(raw, now) {
13903
13910
  error: `approvalMode.timestamp must be a positive number, got ${JSON.stringify(obj.timestamp)}`
13904
13911
  };
13905
13912
  }
13906
- if (mode !== "bypassPermissions") {
13907
- return { kind: "ok", mode };
13908
- }
13909
13913
  const age = now - obj.timestamp;
13910
13914
  if (age > obj.ttlMs) {
13911
13915
  return { kind: "expired", mode: "default", agedMs: age };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtreeai/msapling-cli",
3
- "version": "2.3.6-beta.14",
3
+ "version": "2.3.6-beta.16",
4
4
  "description": "MSapling CLI — React/Ink terminal client for the MSapling backend (chat, projects, MDrive, agent tools). Proprietary; redistribution prohibited.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "MSapling Team",