flyspace-cli 0.1.56 → 0.1.57

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.
@@ -18595,6 +18595,7 @@ var BRANDING_DEFAULTS = {
18595
18595
  gaMeasurementId: null,
18596
18596
  botName: null,
18597
18597
  botAvatar: null,
18598
+ botExpressionAvatars: null,
18598
18599
  autoTitleEnabled: true,
18599
18600
  autoTitlePrompt: null
18600
18601
  };
@@ -18609,6 +18610,7 @@ function rowToBranding(row) {
18609
18610
  gaMeasurementId: row["ga_measurement_id"] ?? null,
18610
18611
  botName: row["bot_name"] ?? null,
18611
18612
  botAvatar: row["bot_avatar"] ?? null,
18613
+ botExpressionAvatars: row["bot_expression_avatars"] ?? null,
18612
18614
  autoTitleEnabled: row["auto_title_enabled"] !== false,
18613
18615
  autoTitlePrompt: row["auto_title_prompt"] ?? null
18614
18616
  };
@@ -18618,7 +18620,7 @@ var cache2 = /* @__PURE__ */ new Map();
18618
18620
  async function getWorkspaceBranding(profile) {
18619
18621
  const hit = cache2.get(profile);
18620
18622
  if (hit && Date.now() - hit.readAt < CACHE_TTL_MS3) return hit.value;
18621
- const { data, error } = await getSupabaseClient().from("workspace_settings").select("theme, font, logo, display_name, ga_measurement_id, bot_name, bot_avatar, auto_title_enabled, auto_title_prompt").eq("profile", profile).maybeSingle();
18623
+ const { data, error } = await getSupabaseClient().from("workspace_settings").select("theme, font, logo, display_name, ga_measurement_id, bot_name, bot_avatar, bot_expression_avatars, auto_title_enabled, auto_title_prompt").eq("profile", profile).maybeSingle();
18622
18624
  if (error) throw new Error(`failed to read workspace settings: ${error.message}`);
18623
18625
  const value = data ? rowToBranding(data) : null;
18624
18626
  cache2.set(profile, { value, readAt: Date.now() });
@@ -18634,6 +18636,7 @@ async function upsertWorkspaceBranding(profile, patch) {
18634
18636
  gaMeasurementId: patch.gaMeasurementId === void 0 ? current.gaMeasurementId : patch.gaMeasurementId,
18635
18637
  botName: patch.botName === void 0 ? current.botName : patch.botName,
18636
18638
  botAvatar: patch.botAvatar === void 0 ? current.botAvatar : patch.botAvatar,
18639
+ botExpressionAvatars: patch.botExpressionAvatars === void 0 ? current.botExpressionAvatars : patch.botExpressionAvatars,
18637
18640
  autoTitleEnabled: patch.autoTitleEnabled ?? current.autoTitleEnabled,
18638
18641
  autoTitlePrompt: patch.autoTitlePrompt === void 0 ? current.autoTitlePrompt : patch.autoTitlePrompt
18639
18642
  };
@@ -18647,6 +18650,7 @@ async function upsertWorkspaceBranding(profile, patch) {
18647
18650
  ga_measurement_id: next.gaMeasurementId,
18648
18651
  bot_name: next.botName,
18649
18652
  bot_avatar: next.botAvatar,
18653
+ bot_expression_avatars: next.botExpressionAvatars,
18650
18654
  auto_title_enabled: next.autoTitleEnabled,
18651
18655
  auto_title_prompt: next.autoTitlePrompt,
18652
18656
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -18762,7 +18766,8 @@ async function loadBotIdentity(profile = getProfile()) {
18762
18766
  const branding = await getWorkspaceBranding(profile);
18763
18767
  return {
18764
18768
  displayName: branding?.botName ?? void 0,
18765
- avatar: branding?.botAvatar ?? void 0
18769
+ avatar: branding?.botAvatar ?? void 0,
18770
+ expressionAvatars: branding?.botExpressionAvatars ?? void 0
18766
18771
  };
18767
18772
  }
18768
18773
  async function saveBotIdentity(patch, profile = getProfile()) {
@@ -24661,7 +24666,7 @@ async function withMcpConfig(profile, connectionIds, fn, extraServers = {}) {
24661
24666
 
24662
24667
  // ../api/src/version.ts
24663
24668
  import { readFileSync as readFileSync7 } from "fs";
24664
- var CLI_VERSION = true ? "0.1.56" : devVersion();
24669
+ var CLI_VERSION = true ? "0.1.57" : devVersion();
24665
24670
  function isOlderVersion(a, b) {
24666
24671
  const parse2 = (v) => v.replace(/^v/, "").split("-")[0].split(".").map(Number);
24667
24672
  const [pa, pb] = [parse2(a), parse2(b)];
package/dist/cli.js CHANGED
@@ -262,7 +262,7 @@ import {
262
262
  workspaceHostname,
263
263
  workspaceSkillsDir,
264
264
  writeSkillFile
265
- } from "./chunk-ZUYZL7Y3.js";
265
+ } from "./chunk-3KXMQCGD.js";
266
266
  import {
267
267
  canReadThread,
268
268
  firstReplyBody,
@@ -2360,7 +2360,7 @@ function npmEnv(target) {
2360
2360
  return nodeBin ? { ...process.env, PATH: `${nodeBin}:${process.env.PATH ?? ""}` } : process.env;
2361
2361
  }
2362
2362
  async function runUpgrade() {
2363
- const current = "0.1.56";
2363
+ const current = "0.1.57";
2364
2364
  console.log(`Current version: ${current}`);
2365
2365
  console.log("Checking for updates...\n");
2366
2366
  try {
@@ -15623,16 +15623,79 @@ async function runDesktopCmd(args) {
15623
15623
  if (result.status !== 0) process.exit(result.status ?? 1);
15624
15624
  }
15625
15625
 
15626
+ // src/commands/persona.ts
15627
+ import { existsSync as existsSync30, readdirSync as readdirSync5, readFileSync as readFileSync22 } from "fs";
15628
+ import { homedir as homedir9 } from "os";
15629
+ import { basename as basename7, join as join21 } from "path";
15630
+ import sharp6 from "sharp";
15631
+ var USAGE10 = `
15632
+ Usage: flyspace persona avatars [--character <id>] [--clear]
15633
+
15634
+ Use a claudecafe persona-panel character's faces (claudecafe.dev) as the
15635
+ workspace bot's avatars: a reply ending in her mood marker shows the matching
15636
+ face, and "neutral" becomes the bot's default avatar.
15637
+
15638
+ --character <id> Character folder under ~/.config/claudecafe/characters
15639
+ (default: "character" in its config.json, else kotone)
15640
+ --clear Remove the per-expression avatars
15641
+ `;
15642
+ var AVATAR_SIZE2 = 96;
15643
+ function cafeRoot() {
15644
+ return join21(process.env["XDG_CONFIG_HOME"] || join21(homedir9(), ".config"), "claudecafe");
15645
+ }
15646
+ function configuredCharacter(root) {
15647
+ try {
15648
+ const config = JSON.parse(readFileSync22(join21(root, "config.json"), "utf8"));
15649
+ if (config.character && config.character !== "none") return config.character;
15650
+ } catch {
15651
+ }
15652
+ return "kotone";
15653
+ }
15654
+ async function runPersonaCmd(args) {
15655
+ if (args[0] !== "avatars") {
15656
+ console.log(USAGE10);
15657
+ return;
15658
+ }
15659
+ loadEnvFiles();
15660
+ useHostDbWithoutCredentials();
15661
+ const profile = getProfile();
15662
+ if (args.includes("--clear")) {
15663
+ await upsertWorkspaceBranding(profile, { botExpressionAvatars: null });
15664
+ console.log("Cleared the per-expression bot avatars.");
15665
+ return;
15666
+ }
15667
+ const root = cafeRoot();
15668
+ const idx = args.indexOf("--character");
15669
+ const character = idx !== -1 && args[idx + 1] || configuredCharacter(root);
15670
+ const dir = join21(root, "characters", character, "avatars");
15671
+ if (!existsSync30(dir)) {
15672
+ throw new Error(
15673
+ `No avatars at ${dir}. Open a Claude Code desktop session with persona-panel once so it installs the pack, or pass --character.`
15674
+ );
15675
+ }
15676
+ const avatars = {};
15677
+ for (const file of readdirSync5(dir).filter((f) => f.endsWith(".webp"))) {
15678
+ const image = await sharp6(join21(dir, file)).resize({ width: AVATAR_SIZE2, height: AVATAR_SIZE2, fit: "cover", position: "top" }).webp({ quality: 80 }).toBuffer();
15679
+ avatars[basename7(file, ".webp")] = `data:image/webp;base64,${image.toString("base64")}`;
15680
+ }
15681
+ if (!Object.keys(avatars).length) throw new Error(`No .webp avatars in ${dir}.`);
15682
+ await upsertWorkspaceBranding(profile, {
15683
+ botExpressionAvatars: avatars,
15684
+ ...avatars["neutral"] ? { botAvatar: avatars["neutral"] } : {}
15685
+ });
15686
+ console.log(`Saved ${Object.keys(avatars).length} ${character} avatars: ${Object.keys(avatars).sort().join(", ")}`);
15687
+ }
15688
+
15626
15689
  // src/cli.ts
15627
- import { join as join21 } from "path";
15690
+ import { join as join22 } from "path";
15628
15691
  var home = flyspaceHome();
15629
15692
  if (home) {
15630
- const bin = join21(home, "bin");
15693
+ const bin = join22(home, "bin");
15631
15694
  const path = process.env.PATH ?? "";
15632
15695
  if (!path.split(":").includes(bin)) process.env.PATH = path ? `${bin}:${path}` : bin;
15633
15696
  }
15634
15697
  var XERO_USAGE = false ? " xero Connect to Xero and expose it as an MCP server\n" : "";
15635
- var USAGE10 = `
15698
+ var USAGE11 = `
15636
15699
  Usage: flyspace <command> [options]
15637
15700
 
15638
15701
  Commands:
@@ -15652,6 +15715,7 @@ var USAGE10 = `
15652
15715
  usage Show agent token usage and cost for this workspace
15653
15716
  chat Inspect dashboard chat channels and move threads between them
15654
15717
  memory Read and write a channel's persistent agent memory
15718
+ persona Use a claudecafe character's faces as the bot's avatars
15655
15719
  profiles List local profiles (bound here? scheduler?) or remove one
15656
15720
  workspace Provision a workspace (Supabase rows + local profile dirs)
15657
15721
  reconcile Repair a workspace's local files against Supabase
@@ -15754,6 +15818,9 @@ async function main() {
15754
15818
  case "memory":
15755
15819
  await runMemoryCmd(args.slice(1));
15756
15820
  break;
15821
+ case "persona":
15822
+ await runPersonaCmd(args.slice(1));
15823
+ break;
15757
15824
  case "profile":
15758
15825
  case "profiles":
15759
15826
  await runProfiles(args.slice(1));
@@ -15769,12 +15836,12 @@ async function main() {
15769
15836
  break;
15770
15837
  case "-v":
15771
15838
  case "--version":
15772
- printRaw("0.1.56");
15839
+ printRaw("0.1.57");
15773
15840
  break;
15774
15841
  case "-h":
15775
15842
  case "--help":
15776
15843
  case void 0:
15777
- printRaw(USAGE10);
15844
+ printRaw(USAGE11);
15778
15845
  break;
15779
15846
  case "xero":
15780
15847
  if (false) {
@@ -15785,7 +15852,7 @@ async function main() {
15785
15852
  // falls through
15786
15853
  default:
15787
15854
  printRaw(`Unknown command: ${command}`);
15788
- printRaw(USAGE10);
15855
+ printRaw(USAGE11);
15789
15856
  process.exit(1);
15790
15857
  }
15791
15858
  }
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-ZUYZL7Y3.js";
6
+ } from "./chunk-3KXMQCGD.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.56",
3
+ "version": "0.1.57",
4
4
  "description": "AI-native headless community OS",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,