flyspace-cli 0.1.55 → 0.1.56

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.
@@ -24661,7 +24661,7 @@ async function withMcpConfig(profile, connectionIds, fn, extraServers = {}) {
24661
24661
 
24662
24662
  // ../api/src/version.ts
24663
24663
  import { readFileSync as readFileSync7 } from "fs";
24664
- var CLI_VERSION = true ? "0.1.55" : devVersion();
24664
+ var CLI_VERSION = true ? "0.1.56" : devVersion();
24665
24665
  function isOlderVersion(a, b) {
24666
24666
  const parse2 = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
24667
24667
  const [pa, pb] = [parse2(a), parse2(b)];
@@ -24919,105 +24919,42 @@ function createHostDbClient(via = "socket") {
24919
24919
  }
24920
24920
 
24921
24921
  // src/claude/agents.ts
24922
- import { existsSync as existsSync11, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
24923
- import { homedir as homedir3 } from "os";
24924
- import { basename as basename2, join as join11 } from "path";
24925
- import yaml from "js-yaml";
24926
- function defaultConfigDir() {
24927
- return join11(homedir3(), ".claude");
24928
- }
24929
- function expandHome(p) {
24930
- if (p === "~") return homedir3();
24931
- if (p.startsWith("~/")) return join11(homedir3(), p.slice(2));
24932
- return p;
24933
- }
24934
- function parseFrontmatter(file) {
24935
- let content;
24936
- try {
24937
- content = readFileSync9(file, "utf-8");
24938
- } catch {
24939
- return {};
24940
- }
24941
- const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
24942
- if (!match) return {};
24943
- try {
24944
- const fm = yaml.load(match[1]);
24945
- const name = typeof fm?.["name"] === "string" ? fm["name"] : void 0;
24946
- const description = typeof fm?.["description"] === "string" ? fm["description"] : void 0;
24947
- return { name, description };
24948
- } catch {
24949
- return {};
24950
- }
24951
- }
24952
- function collectFrom(root, source) {
24953
- if (!existsSync11(root)) return [];
24954
- let entries2;
24955
- try {
24956
- entries2 = readdirSync2(root).filter((f) => f.endsWith(".md"));
24957
- } catch {
24958
- return [];
24959
- }
24960
- return entries2.map((file) => {
24961
- const path = join11(root, file);
24962
- const fm = parseFrontmatter(path);
24963
- const name = fm.name?.trim() || basename2(file, ".md");
24964
- return { name, description: (fm.description ?? "").trim(), source, path };
24965
- });
24966
- }
24967
- function listAgents(configDir, cwd) {
24968
- const base = configDir ? expandHome(configDir) : defaultConfigDir();
24969
- const collected = [
24970
- ...collectFrom(join11(cwd, ".claude", "agents"), "project"),
24971
- ...collectFrom(join11(base, "agents"), "user")
24972
- ];
24973
- const byName = /* @__PURE__ */ new Map();
24974
- for (const agent of collected) {
24975
- if (agent.name && !byName.has(agent.name)) byName.set(agent.name, agent);
24976
- }
24977
- return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
24978
- }
24979
- function readAgentPersona(configDir, cwd, name) {
24980
- const agent = listAgents(configDir, cwd).find((a) => a.name === name);
24981
- if (!agent) return void 0;
24982
- try {
24983
- const content = readFileSync9(agent.path, "utf-8");
24984
- return content.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "").trim();
24985
- } catch {
24986
- return void 0;
24987
- }
24988
- }
24989
-
24990
- // ../api/src/claude/skills.ts
24991
- import { existsSync as existsSync13, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync5 } from "fs";
24922
+ import { existsSync as existsSync13, readdirSync as readdirSync4, readFileSync as readFileSync11 } from "fs";
24992
24923
  import { homedir as homedir5 } from "os";
24993
- import { basename as basename3, dirname as dirname2, join as join13 } from "path";
24924
+ import { basename as basename3, join as join13 } from "path";
24994
24925
  import yaml3 from "js-yaml";
24995
24926
 
24927
+ // ../api/src/claude/skills.ts
24928
+ import { existsSync as existsSync12, readdirSync as readdirSync3, readFileSync as readFileSync10, statSync as statSync5 } from "fs";
24929
+ import { homedir as homedir4 } from "os";
24930
+ import { basename as basename2, dirname as dirname2, join as join12 } from "path";
24931
+ import yaml2 from "js-yaml";
24932
+
24996
24933
  // ../api/src/claude/skill-files.ts
24997
24934
  import {
24998
- existsSync as existsSync12,
24935
+ existsSync as existsSync11,
24999
24936
  mkdirSync as mkdirSync8,
25000
- readFileSync as readFileSync10,
25001
- readdirSync as readdirSync3,
24937
+ readFileSync as readFileSync9,
24938
+ readdirSync as readdirSync2,
25002
24939
  rmSync as rmSync7,
25003
24940
  statSync as statSync4,
25004
24941
  writeFileSync as writeFileSync6
25005
24942
  } from "fs";
25006
- import { homedir as homedir4 } from "os";
25007
- import { join as join12, resolve as resolve5, sep as sep2 } from "path";
25008
- import yaml2 from "js-yaml";
24943
+ import { homedir as homedir3 } from "os";
24944
+ import { join as join11, resolve as resolve5, sep as sep2 } from "path";
24945
+ import yaml from "js-yaml";
25009
24946
  var MAX_SKILL_BYTES = 2 * 1024 * 1024;
25010
24947
  var SKILL_NAME = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
25011
- function expandHome2(p) {
25012
- if (p === "~") return homedir4();
25013
- if (p.startsWith("~/")) return join12(homedir4(), p.slice(2));
24948
+ function expandHome(p) {
24949
+ if (p === "~") return homedir3();
24950
+ if (p.startsWith("~/")) return join11(homedir3(), p.slice(2));
25014
24951
  return p;
25015
24952
  }
25016
24953
  function workspaceSkillsDir(configDir) {
25017
- return join12(configDir ? expandHome2(configDir) : join12(homedir4(), ".claude"), "skills");
24954
+ return join11(configDir ? expandHome(configDir) : join11(homedir3(), ".claude"), "skills");
25018
24955
  }
25019
24956
  function channelSkillsDir(cwd) {
25020
- return join12(cwd, ".claude", "skills");
24957
+ return join11(cwd, ".claude", "skills");
25021
24958
  }
25022
24959
  function isValidSkillName(name) {
25023
24960
  return SKILL_NAME.test(name);
@@ -25033,7 +24970,7 @@ function splitFrontmatter(raw) {
25033
24970
  if (!match) return { fm: {}, body: raw };
25034
24971
  let fm = {};
25035
24972
  try {
25036
- fm = yaml2.load(match[1]) ?? {};
24973
+ fm = yaml.load(match[1]) ?? {};
25037
24974
  } catch {
25038
24975
  fm = {};
25039
24976
  }
@@ -25042,7 +24979,7 @@ function splitFrontmatter(raw) {
25042
24979
  function buildSkillFile(fm, body) {
25043
24980
  const { name, description, ...rest } = fm;
25044
24981
  const ordered = { name, description, ...rest };
25045
- const front = yaml2.dump(ordered, { lineWidth: -1 }).trimEnd();
24982
+ const front = yaml.dump(ordered, { lineWidth: -1 }).trimEnd();
25046
24983
  return `---
25047
24984
  ${front}
25048
24985
  ---
@@ -25052,7 +24989,7 @@ ${body.replace(/^\n+/, "").trimEnd()}
25052
24989
  }
25053
24990
  function readMeta(abs) {
25054
24991
  try {
25055
- const { fm } = splitFrontmatter(readFileSync10(abs, "utf-8"));
24992
+ const { fm } = splitFrontmatter(readFileSync9(abs, "utf-8"));
25056
24993
  return {
25057
24994
  name: typeof fm["name"] === "string" ? fm["name"] : void 0,
25058
24995
  description: typeof fm["description"] === "string" ? fm["description"] : void 0
@@ -25062,17 +24999,17 @@ function readMeta(abs) {
25062
24999
  }
25063
25000
  }
25064
25001
  function listSkillFiles(dir) {
25065
- if (!existsSync12(dir)) return [];
25002
+ if (!existsSync11(dir)) return [];
25066
25003
  let entries2;
25067
25004
  try {
25068
- entries2 = readdirSync3(dir);
25005
+ entries2 = readdirSync2(dir);
25069
25006
  } catch {
25070
25007
  return [];
25071
25008
  }
25072
25009
  const rows2 = [];
25073
25010
  for (const entry of entries2) {
25074
25011
  if (!isValidSkillName(entry)) continue;
25075
- const abs = join12(dir, entry, "SKILL.md");
25012
+ const abs = join11(dir, entry, "SKILL.md");
25076
25013
  let stat;
25077
25014
  try {
25078
25015
  stat = statSync4(abs);
@@ -25101,7 +25038,7 @@ function readSkillFile(dir, name) {
25101
25038
  return null;
25102
25039
  }
25103
25040
  if (!stat.isFile() || stat.size > MAX_SKILL_BYTES) return null;
25104
- const { fm, body } = splitFrontmatter(readFileSync10(abs, "utf-8"));
25041
+ const { fm, body } = splitFrontmatter(readFileSync9(abs, "utf-8"));
25105
25042
  return {
25106
25043
  name,
25107
25044
  description: typeof fm["description"] === "string" ? fm["description"].trim() : "",
@@ -25123,7 +25060,7 @@ function writeSkillFile(dir, name, patch, baseMtime) {
25123
25060
  if (baseMtime && stat.mtime.toISOString() !== baseMtime) {
25124
25061
  return { status: "conflict", mtime: stat.mtime.toISOString() };
25125
25062
  }
25126
- const { fm } = splitFrontmatter(readFileSync10(abs, "utf-8"));
25063
+ const { fm } = splitFrontmatter(readFileSync9(abs, "utf-8"));
25127
25064
  const content = buildSkillFile({ ...fm, name, description: patch.description }, patch.body);
25128
25065
  if (Buffer.byteLength(content, "utf8") > MAX_SKILL_BYTES) return { status: "too-large" };
25129
25066
  writeFileSync6(abs, content, "utf8");
@@ -25132,8 +25069,8 @@ function writeSkillFile(dir, name, patch, baseMtime) {
25132
25069
  function createSkillFile(dir, name, description) {
25133
25070
  const abs = resolveSkillPath(dir, name);
25134
25071
  if (!abs) return { status: "bad-name" };
25135
- if (existsSync12(abs)) return { status: "exists" };
25136
- mkdirSync8(join12(dir, name), { recursive: true });
25072
+ if (existsSync11(abs)) return { status: "exists" };
25073
+ mkdirSync8(join11(dir, name), { recursive: true });
25137
25074
  writeFileSync6(
25138
25075
  abs,
25139
25076
  buildSkillFile(
@@ -25150,31 +25087,31 @@ Describe what this skill does and when to use it.
25150
25087
  }
25151
25088
  function deleteSkillFile(dir, name) {
25152
25089
  const abs = resolveSkillPath(dir, name);
25153
- if (!abs || !existsSync12(abs)) return { status: "not-found" };
25154
- rmSync7(join12(dir, name), { recursive: true, force: true });
25090
+ if (!abs || !existsSync11(abs)) return { status: "not-found" };
25091
+ rmSync7(join11(dir, name), { recursive: true, force: true });
25155
25092
  return { status: "ok" };
25156
25093
  }
25157
25094
 
25158
25095
  // ../api/src/claude/skills.ts
25159
- function defaultConfigDir2() {
25160
- return join13(homedir5(), ".claude");
25096
+ function defaultConfigDir() {
25097
+ return join12(homedir4(), ".claude");
25161
25098
  }
25162
- function expandHome3(p) {
25163
- if (p === "~") return homedir5();
25164
- if (p.startsWith("~/")) return join13(homedir5(), p.slice(2));
25099
+ function expandHome2(p) {
25100
+ if (p === "~") return homedir4();
25101
+ if (p.startsWith("~/")) return join12(homedir4(), p.slice(2));
25165
25102
  return p;
25166
25103
  }
25167
- function parseFrontmatter2(file) {
25104
+ function parseFrontmatter(file) {
25168
25105
  let content;
25169
25106
  try {
25170
- content = readFileSync11(file, "utf-8");
25107
+ content = readFileSync10(file, "utf-8");
25171
25108
  } catch {
25172
25109
  return {};
25173
25110
  }
25174
25111
  const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
25175
25112
  if (!match) return {};
25176
25113
  try {
25177
- const fm = yaml3.load(match[1]);
25114
+ const fm = yaml2.load(match[1]);
25178
25115
  const name = typeof fm?.["name"] === "string" ? fm["name"] : void 0;
25179
25116
  const description = typeof fm?.["description"] === "string" ? fm["description"] : void 0;
25180
25117
  return { name, description };
@@ -25185,25 +25122,25 @@ function parseFrontmatter2(file) {
25185
25122
  function isSymlinkedDir(root, entry) {
25186
25123
  if (!entry.isSymbolicLink()) return false;
25187
25124
  try {
25188
- return statSync5(join13(root, entry.name)).isDirectory();
25125
+ return statSync5(join12(root, entry.name)).isDirectory();
25189
25126
  } catch {
25190
25127
  return false;
25191
25128
  }
25192
25129
  }
25193
25130
  function findSkillFiles(root, maxDepth, out) {
25194
- if (maxDepth < 0 || !existsSync13(root)) return;
25131
+ if (maxDepth < 0 || !existsSync12(root)) return;
25195
25132
  let entries2;
25196
25133
  try {
25197
- entries2 = readdirSync4(root, { withFileTypes: true });
25134
+ entries2 = readdirSync3(root, { withFileTypes: true });
25198
25135
  } catch {
25199
25136
  return;
25200
25137
  }
25201
25138
  for (const entry of entries2) {
25202
25139
  if (entry.isFile()) {
25203
- if (entry.name === "SKILL.md") out.push(join13(root, entry.name));
25140
+ if (entry.name === "SKILL.md") out.push(join12(root, entry.name));
25204
25141
  } else if (entry.isDirectory() || isSymlinkedDir(root, entry)) {
25205
25142
  if (entry.name === "node_modules" || entry.name.startsWith(".")) continue;
25206
- findSkillFiles(join13(root, entry.name), maxDepth - 1, out);
25143
+ findSkillFiles(join12(root, entry.name), maxDepth - 1, out);
25207
25144
  }
25208
25145
  }
25209
25146
  }
@@ -25212,7 +25149,7 @@ function pluginNameFor(file, root) {
25212
25149
  while (dir.startsWith(root) && dir !== dirname2(dir)) {
25213
25150
  try {
25214
25151
  const manifest = JSON.parse(
25215
- readFileSync11(join13(dir, ".claude-plugin", "plugin.json"), "utf-8")
25152
+ readFileSync10(join12(dir, ".claude-plugin", "plugin.json"), "utf-8")
25216
25153
  );
25217
25154
  if (typeof manifest.name === "string" && manifest.name.trim()) return manifest.name.trim();
25218
25155
  } catch {
@@ -25221,12 +25158,73 @@ function pluginNameFor(file, root) {
25221
25158
  }
25222
25159
  return void 0;
25223
25160
  }
25224
- function collectFrom2(root, source, maxDepth, namePrefix) {
25161
+ function findPluginMarkdown(pluginsRoot, dirName, maxDepth = 8) {
25162
+ const out = [];
25163
+ const walk = (dir, depth) => {
25164
+ if (depth < 0) return;
25165
+ let entries2;
25166
+ try {
25167
+ entries2 = readdirSync3(dir, { withFileTypes: true });
25168
+ } catch {
25169
+ return;
25170
+ }
25171
+ for (const entry of entries2) {
25172
+ if (entry.name === "node_modules" || entry.name.startsWith(".")) continue;
25173
+ if (!entry.isDirectory() && !isSymlinkedDir(dir, entry)) continue;
25174
+ const child = join12(dir, entry.name);
25175
+ if (entry.name === dirName) {
25176
+ for (const f of readdirSafe(child)) {
25177
+ if (f.endsWith(".md")) out.push({ file: join12(child, f), plugin: pluginNameFor(join12(child, f), pluginsRoot) });
25178
+ }
25179
+ } else {
25180
+ walk(child, depth - 1);
25181
+ }
25182
+ }
25183
+ };
25184
+ if (existsSync12(pluginsRoot)) walk(pluginsRoot, maxDepth);
25185
+ return out;
25186
+ }
25187
+ function readdirSafe(dir) {
25188
+ try {
25189
+ return readdirSync3(dir);
25190
+ } catch {
25191
+ return [];
25192
+ }
25193
+ }
25194
+ function listCommands(configDir, cwd) {
25195
+ const base = configDir ? expandHome2(configDir) : defaultConfigDir();
25196
+ const local = (dir, source) => readdirSafe(dir).filter((f) => f.endsWith(".md")).map((f) => ({
25197
+ name: basename2(f, ".md"),
25198
+ description: (parseFrontmatter(join12(dir, f)).description ?? "").trim(),
25199
+ source,
25200
+ kind: "command"
25201
+ }));
25202
+ const collected = [
25203
+ ...local(join12(cwd, ".claude", "commands"), "project"),
25204
+ ...local(join12(base, "commands"), "user"),
25205
+ ...findPluginMarkdown(join12(base, "plugins"), "commands").map(({ file, plugin }) => ({
25206
+ name: plugin ? `${plugin}:${basename2(file, ".md")}` : basename2(file, ".md"),
25207
+ description: (parseFrontmatter(file).description ?? "").trim(),
25208
+ source: "plugin",
25209
+ ...plugin && { plugin },
25210
+ kind: "command"
25211
+ }))
25212
+ ];
25213
+ const byName = /* @__PURE__ */ new Map();
25214
+ for (const c of collected) if (!byName.has(c.name)) byName.set(c.name, c);
25215
+ return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
25216
+ }
25217
+ function listSlashItems(configDir, cwd) {
25218
+ const skills = listSkills(configDir, cwd);
25219
+ const taken = new Set(skills.map((s) => s.name));
25220
+ return [...skills, ...listCommands(configDir, cwd).filter((c) => !taken.has(c.name))];
25221
+ }
25222
+ function collectFrom(root, source, maxDepth, namePrefix) {
25225
25223
  const files = [];
25226
25224
  findSkillFiles(root, maxDepth, files);
25227
25225
  return files.map((file) => {
25228
- const fm = parseFrontmatter2(file);
25229
- const name = fm.name?.trim() || basename3(dirname2(file));
25226
+ const fm = parseFrontmatter(file);
25227
+ const name = fm.name?.trim() || basename2(dirname2(file));
25230
25228
  const plugin = source === "plugin" ? pluginNameFor(file, root) : void 0;
25231
25229
  const prefix = namePrefix ?? plugin;
25232
25230
  return {
@@ -25240,12 +25238,12 @@ function collectFrom2(root, source, maxDepth, namePrefix) {
25240
25238
  });
25241
25239
  }
25242
25240
  function collectAll(configDir, cwd) {
25243
- const base = configDir ? expandHome3(configDir) : defaultConfigDir2();
25241
+ const base = configDir ? expandHome2(configDir) : defaultConfigDir();
25244
25242
  const collected = [
25245
- ...collectFrom2(join13(cwd, ".claude", "skills"), "project", 2),
25246
- ...nestedProjectRoots(cwd).flatMap(({ dir, prefix }) => collectFrom2(dir, "project", 2, prefix)),
25247
- ...collectFrom2(join13(base, "skills"), "user", 2),
25248
- ...collectFrom2(join13(base, "plugins"), "plugin", 8)
25243
+ ...collectFrom(join12(cwd, ".claude", "skills"), "project", 2),
25244
+ ...nestedProjectRoots(cwd).flatMap(({ dir, prefix }) => collectFrom(dir, "project", 2, prefix)),
25245
+ ...collectFrom(join12(base, "skills"), "user", 2),
25246
+ ...collectFrom(join12(base, "plugins"), "plugin", 8)
25249
25247
  ];
25250
25248
  const byName = /* @__PURE__ */ new Map();
25251
25249
  for (const skill of collected) {
@@ -25256,7 +25254,7 @@ function collectAll(configDir, cwd) {
25256
25254
  function nestedProjectRoots(cwd) {
25257
25255
  let entries2;
25258
25256
  try {
25259
- entries2 = readdirSync4(cwd, { withFileTypes: true });
25257
+ entries2 = readdirSync3(cwd, { withFileTypes: true });
25260
25258
  } catch {
25261
25259
  return [];
25262
25260
  }
@@ -25264,8 +25262,8 @@ function nestedProjectRoots(cwd) {
25264
25262
  for (const entry of entries2) {
25265
25263
  if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
25266
25264
  if (!entry.isDirectory() && !isSymlinkedDir(cwd, entry)) continue;
25267
- const skillsDir = join13(cwd, entry.name, ".claude", "skills");
25268
- if (existsSync13(skillsDir)) roots.push({ dir: skillsDir, prefix: entry.name });
25265
+ const skillsDir = join12(cwd, entry.name, ".claude", "skills");
25266
+ if (existsSync12(skillsDir)) roots.push({ dir: skillsDir, prefix: entry.name });
25269
25267
  }
25270
25268
  return roots;
25271
25269
  }
@@ -25277,7 +25275,7 @@ function listPluginSkillDetails(configDir, cwd) {
25277
25275
  for (const { file, ...skill } of collectAll(configDir, cwd)) {
25278
25276
  if (skill.source !== "plugin") continue;
25279
25277
  try {
25280
- const { body } = splitFrontmatter(readFileSync11(file, "utf-8"));
25278
+ const { body } = splitFrontmatter(readFileSync10(file, "utf-8"));
25281
25279
  details.push({ ...skill, body, path: file, mtime: statSync5(file).mtime.toISOString() });
25282
25280
  } catch {
25283
25281
  }
@@ -25285,25 +25283,25 @@ function listPluginSkillDetails(configDir, cwd) {
25285
25283
  return details;
25286
25284
  }
25287
25285
  function findSkillDetail(configDir, cwd, name, sources) {
25288
- const base = configDir ? expandHome3(configDir) : defaultConfigDir2();
25286
+ const base = configDir ? expandHome2(configDir) : defaultConfigDir();
25289
25287
  const roots = [
25290
- [join13(cwd, ".claude", "skills"), "project", 2],
25288
+ [join12(cwd, ".claude", "skills"), "project", 2],
25291
25289
  ...nestedProjectRoots(cwd).map(({ dir, prefix }) => [
25292
25290
  dir,
25293
25291
  "project",
25294
25292
  2,
25295
25293
  prefix
25296
25294
  ]),
25297
- [join13(base, "skills"), "user", 2],
25298
- [join13(base, "plugins"), "plugin", 8]
25295
+ [join12(base, "skills"), "user", 2],
25296
+ [join12(base, "plugins"), "plugin", 8]
25299
25297
  ];
25300
25298
  for (const [root, source, maxDepth, namePrefix] of roots) {
25301
25299
  if (!sources.includes(source)) continue;
25302
25300
  const files = [];
25303
25301
  findSkillFiles(root, maxDepth, files);
25304
25302
  for (const file of files) {
25305
- const fm = parseFrontmatter2(file);
25306
- const rawName = fm.name?.trim() || basename3(dirname2(file));
25303
+ const fm = parseFrontmatter(file);
25304
+ const rawName = fm.name?.trim() || basename2(dirname2(file));
25307
25305
  const plugin = source === "plugin" ? pluginNameFor(file, root) : void 0;
25308
25306
  const prefix = namePrefix ?? plugin;
25309
25307
  const skillName = prefix ? `${prefix}:${rawName}` : rawName;
@@ -25311,7 +25309,7 @@ function findSkillDetail(configDir, cwd, name, sources) {
25311
25309
  let raw;
25312
25310
  let mtime;
25313
25311
  try {
25314
- raw = readFileSync11(file, "utf-8");
25312
+ raw = readFileSync10(file, "utf-8");
25315
25313
  mtime = statSync5(file).mtime.toISOString();
25316
25314
  } catch {
25317
25315
  continue;
@@ -25344,6 +25342,82 @@ ARGUMENTS: ${args}` : "");
25344
25342
  ${body.trim()}`;
25345
25343
  }
25346
25344
 
25345
+ // src/claude/agents.ts
25346
+ function defaultConfigDir2() {
25347
+ return join13(homedir5(), ".claude");
25348
+ }
25349
+ function expandHome3(p) {
25350
+ if (p === "~") return homedir5();
25351
+ if (p.startsWith("~/")) return join13(homedir5(), p.slice(2));
25352
+ return p;
25353
+ }
25354
+ function parseFrontmatter2(file) {
25355
+ let content;
25356
+ try {
25357
+ content = readFileSync11(file, "utf-8");
25358
+ } catch {
25359
+ return {};
25360
+ }
25361
+ const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
25362
+ if (!match) return {};
25363
+ try {
25364
+ const fm = yaml3.load(match[1]);
25365
+ const name = typeof fm?.["name"] === "string" ? fm["name"] : void 0;
25366
+ const description = typeof fm?.["description"] === "string" ? fm["description"] : void 0;
25367
+ return { name, description };
25368
+ } catch {
25369
+ return {};
25370
+ }
25371
+ }
25372
+ function collectFrom2(root, source) {
25373
+ if (!existsSync13(root)) return [];
25374
+ let entries2;
25375
+ try {
25376
+ entries2 = readdirSync4(root).filter((f) => f.endsWith(".md"));
25377
+ } catch {
25378
+ return [];
25379
+ }
25380
+ return entries2.map((file) => {
25381
+ const path = join13(root, file);
25382
+ const fm = parseFrontmatter2(path);
25383
+ const name = fm.name?.trim() || basename3(file, ".md");
25384
+ return { name, description: (fm.description ?? "").trim(), source, path };
25385
+ });
25386
+ }
25387
+ function listAgents(configDir, cwd) {
25388
+ const base = configDir ? expandHome3(configDir) : defaultConfigDir2();
25389
+ const collected = [
25390
+ ...collectFrom2(join13(cwd, ".claude", "agents"), "project"),
25391
+ ...collectFrom2(join13(base, "agents"), "user"),
25392
+ // Plugin agents, namespaced `plugin:agent` the way the CLI lists them.
25393
+ ...findPluginMarkdown(join13(base, "plugins"), "agents").map(({ file, plugin }) => {
25394
+ const fm = parseFrontmatter2(file);
25395
+ const name = fm.name?.trim() || basename3(file, ".md");
25396
+ return {
25397
+ name: plugin ? `${plugin}:${name}` : name,
25398
+ description: (fm.description ?? "").trim(),
25399
+ source: "plugin",
25400
+ path: file
25401
+ };
25402
+ })
25403
+ ];
25404
+ const byName = /* @__PURE__ */ new Map();
25405
+ for (const agent of collected) {
25406
+ if (agent.name && !byName.has(agent.name)) byName.set(agent.name, agent);
25407
+ }
25408
+ return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
25409
+ }
25410
+ function readAgentPersona(configDir, cwd, name) {
25411
+ const agent = listAgents(configDir, cwd).find((a) => a.name === name);
25412
+ if (!agent) return void 0;
25413
+ try {
25414
+ const content = readFileSync11(agent.path, "utf-8");
25415
+ return content.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "").trim();
25416
+ } catch {
25417
+ return void 0;
25418
+ }
25419
+ }
25420
+
25347
25421
  // src/dashboard/memory-extraction-runner.ts
25348
25422
  import { spawn as spawn4 } from "child_process";
25349
25423
  import { existsSync as existsSync14, mkdtempSync as mkdtempSync4, readFileSync as readFileSync12, rmSync as rmSync8 } from "fs";
@@ -34344,7 +34418,6 @@ export {
34344
34418
  handleShouldRespondResult,
34345
34419
  LOCAL_DB_PATH,
34346
34420
  createHostDbClient,
34347
- listAgents,
34348
34421
  workspaceSkillsDir,
34349
34422
  channelSkillsDir,
34350
34423
  isValidSkillName,
@@ -34353,9 +34426,11 @@ export {
34353
34426
  writeSkillFile,
34354
34427
  createSkillFile,
34355
34428
  deleteSkillFile,
34429
+ listSlashItems,
34356
34430
  listSkills,
34357
34431
  listPluginSkillDetails,
34358
34432
  findSkillDetail,
34433
+ listAgents,
34359
34434
  setProfileConfigCache,
34360
34435
  cachedProfileConfig,
34361
34436
  profileEnv,
package/dist/cli.js CHANGED
@@ -148,6 +148,7 @@ import {
148
148
  listPluginSkillDetails,
149
149
  listSkillFiles,
150
150
  listSkills,
151
+ listSlashItems,
151
152
  listThreadMemoryEvents,
152
153
  listWorkspaceSummaries,
153
154
  listWorkspaces,
@@ -261,7 +262,7 @@ import {
261
262
  workspaceHostname,
262
263
  workspaceSkillsDir,
263
264
  writeSkillFile
264
- } from "./chunk-CN6YV335.js";
265
+ } from "./chunk-ZUYZL7Y3.js";
265
266
  import {
266
267
  canReadThread,
267
268
  firstReplyBody,
@@ -2359,7 +2360,7 @@ function npmEnv(target) {
2359
2360
  return nodeBin ? { ...process.env, PATH: `${nodeBin}:${process.env.PATH ?? ""}` } : process.env;
2360
2361
  }
2361
2362
  async function runUpgrade() {
2362
- const current = "0.1.55";
2363
+ const current = "0.1.56";
2363
2364
  console.log(`Current version: ${current}`);
2364
2365
  console.log("Checking for updates...\n");
2365
2366
  try {
@@ -14101,7 +14102,7 @@ async function handleProviderLoginRequest(req) {
14101
14102
  function registerHostRoutes(api) {
14102
14103
  api.get("/channels/:id/skills", (c) => {
14103
14104
  const { cwd, claudeConfigDir } = resolveChannelConfig(c.req.param("id"));
14104
- return c.json({ skills: listSkills(claudeConfigDir, cwd) });
14105
+ return c.json({ skills: listSlashItems(claudeConfigDir, cwd) });
14105
14106
  });
14106
14107
  api.get("/channels/:id/agents", (c) => {
14107
14108
  const { cwd, claudeConfigDir } = resolveChannelConfig(c.req.param("id"));
@@ -14869,7 +14870,7 @@ function localAgentCallbacks(chatAgent) {
14869
14870
  readDocShareBundle: (req) => readDocShareBundle(req.channelId ? { ...req, cwd: resolveChannelConfig(req.channelId).cwd } : req),
14870
14871
  listChannelSkills: (args) => {
14871
14872
  const { cwd, claudeConfigDir } = args.channelId ? resolveChannelConfig(args.channelId) : args;
14872
- return listSkills(claudeConfigDir, cwd);
14873
+ return listSlashItems(claudeConfigDir, cwd);
14873
14874
  },
14874
14875
  listFlatDocs: (args) => flatDocs(args.channelId ? resolveChannelConfig(args.channelId).cwd : args.cwd, { query: args.query, sort: args.sort, showHidden: args.showHidden }),
14875
14876
  getLocalDashboardSettings: () => loadDashboardSettings(),
@@ -15768,7 +15769,7 @@ async function main() {
15768
15769
  break;
15769
15770
  case "-v":
15770
15771
  case "--version":
15771
- printRaw("0.1.55");
15772
+ printRaw("0.1.56");
15772
15773
  break;
15773
15774
  case "-h":
15774
15775
  case "--help":
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire as __flyspaceCreateRequire } from 'node:module';
3
3
  const require = __flyspaceCreateRequire(import.meta.url);
4
4
  import {
5
5
  startServer
6
- } from "./chunk-CN6YV335.js";
6
+ } from "./chunk-ZUYZL7Y3.js";
7
7
  import "./chunk-XACRG7BO.js";
8
8
  export {
9
9
  startServer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flyspace-cli",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "description": "AI-native headless community OS",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,