@motion-studio/cli 0.1.1 → 0.1.2

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/main.js CHANGED
@@ -3879,10 +3879,10 @@ Variables: MOTION_STUDIO_CONFIG_DIR, MOTION_STUDIO_CLAUDE_COMMAND (JSON array)`,
3879
3879
  workspaceSub: "Where projects are saved",
3880
3880
  workspaceIntro: "Motion Studio keeps one folder per project inside it, with versioned history. You can change it later by replaying the setup from the account menu.",
3881
3881
  folder: "Folder",
3882
- pathPlaceholder: "/Users/yourname/MotionStudio",
3883
3882
  pickFolderTitle: "Choose the working folder",
3884
3883
  statusCurrent: (p2) => p2.count === 0 ? "Current workspace \xB7 no projects yet" : `Current workspace \xB7 ${p2.count} ${p2.count === 1 ? "project" : "projects"}`,
3885
3884
  statusChecking: "Reading the workspace\u2026",
3885
+ statusSuggested: "The suggested folder is fine: Motion Studio creates it if it doesn't exist. You can pick another one.",
3886
3886
  statusNew: "Motion Studio creates the folder if it doesn't exist and checks it when you continue.",
3887
3887
  workspaceNotFound: (p2) => `Folder not found: ${p2.path}. Choose another.`,
3888
3888
  workspaceInvalid: (p2) => `Invalid content in ${p2.path}: ${p2.detail}`,
@@ -8239,10 +8239,10 @@ Variabili: MOTION_STUDIO_CONFIG_DIR, MOTION_STUDIO_CLAUDE_COMMAND (array JSON)`,
8239
8239
  workspaceSub: "Dove si salvano i progetti",
8240
8240
  workspaceIntro: "Motion Studio tiene al suo interno una cartella per progetto, con la cronologia delle versioni. Puoi cambiarlo in seguito rifacendo la configurazione dal menu dell'account.",
8241
8241
  folder: "Cartella",
8242
- pathPlaceholder: "/Users/tuonome/MotionStudio",
8243
8242
  pickFolderTitle: "Scegli la cartella di lavoro",
8244
8243
  statusCurrent: (p2) => p2.count === 0 ? "Workspace attuale \xB7 ancora nessun progetto" : `Workspace attuale \xB7 ${p2.count} ${p2.count === 1 ? "progetto" : "progetti"}`,
8245
8244
  statusChecking: "Lettura del workspace\u2026",
8245
+ statusSuggested: "Va bene quella proposta: se non esiste Motion Studio la crea. Puoi sceglierne un'altra.",
8246
8246
  statusNew: "Se la cartella non esiste Motion Studio la crea, e la verifica quando prosegui.",
8247
8247
  workspaceNotFound: (p2) => `Cartella non trovata: ${p2.path}, scegline un'altra`,
8248
8248
  workspaceInvalid: (p2) => `Contenuto non valido in ${p2.path}: ${p2.detail}`,
@@ -11086,8 +11086,8 @@ function brandKitIssues(error, locale) {
11086
11086
  var EMPTY_BRAND_KIT = { schemaVersion: 1, colors: [], fonts: [], logos: [], tone: null, dos: [], donts: [], photoStyle: null };
11087
11087
  function isAbsoluteCodebasePath(p2) {
11088
11088
  if (p2.includes("\0") || p2.split(/[\\/]/).includes("..")) return false;
11089
- const posix3 = p2.startsWith("/") ? p2.replace(/\/+$/, "") : null;
11090
- if (posix3 !== null) return posix3 !== "";
11089
+ const posix4 = p2.startsWith("/") ? p2.replace(/\/+$/, "") : null;
11090
+ if (posix4 !== null) return posix4 !== "";
11091
11091
  const win = /^[A-Za-z]:[\\/]/.test(p2) ? p2.slice(3).replace(/[\\/]+$/, "") : null;
11092
11092
  return win !== null && win !== "";
11093
11093
  }
@@ -19820,6 +19820,7 @@ var SettingsHoldStore = class {
19820
19820
  // ../../packages/core/src/workspace-store.ts
19821
19821
  import { homedir as homedir2 } from "os";
19822
19822
  import * as platformPath from "path";
19823
+ import { posix, win32 } from "path";
19823
19824
  import { basename as basename2, dirname as dirname3, isAbsolute, join as join6, normalize, resolve as resolve6, sep as sep3 } from "path";
19824
19825
 
19825
19826
  // ../../packages/core/src/project-template.ts
@@ -20409,6 +20410,9 @@ var WorkspaceStore = class _WorkspaceStore {
20409
20410
  });
20410
20411
  }
20411
20412
  };
20413
+ function defaultWorkspacePath(home = homedir2(), platform = process.platform) {
20414
+ return (platform === "win32" ? win32 : posix).join(home, "MotionStudio");
20415
+ }
20412
20416
 
20413
20417
  // ../../packages/core/src/doctor.ts
20414
20418
  import { readdir as readdir6 } from "fs/promises";
@@ -22564,13 +22568,13 @@ var ClaudeCodeRunner = class {
22564
22568
  }
22565
22569
  };
22566
22570
  }
22567
- const posix3 = process.platform !== "win32";
22571
+ const posix4 = process.platform !== "win32";
22568
22572
  const env = { ...process.env, ...req.env };
22569
22573
  for (const k of req.unsetEnv ?? []) delete env[k];
22570
- const child = this.spawnFn(bin, [...prefix, ...buildClaudeArgs(req)], { cwd: req.cwd, stdio: ["pipe", "pipe", "pipe"], detached: posix3, env });
22574
+ const child = this.spawnFn(bin, [...prefix, ...buildClaudeArgs(req)], { cwd: req.cwd, stdio: ["pipe", "pipe", "pipe"], detached: posix4, env });
22571
22575
  const signal = (sig) => {
22572
22576
  try {
22573
- if (posix3 && child.pid) process.kill(-child.pid, sig);
22577
+ if (posix4 && child.pid) process.kill(-child.pid, sig);
22574
22578
  else child.kill(sig);
22575
22579
  } catch {
22576
22580
  }
@@ -22779,7 +22783,7 @@ var ClaudeCodeRunner = class {
22779
22783
  // POSIX: the whole group, also after the leader exited. Windows has no groups: a tree kill reaches the descendants
22780
22784
  // only while the leader is alive (after it exits they are orphaned and out of reach; documented limit).
22781
22785
  killGroup: () => {
22782
- if (posix3) return signal("SIGKILL");
22786
+ if (posix4) return signal("SIGKILL");
22783
22787
  if (!child.pid || exited) return;
22784
22788
  const [cmd, args] = treeKillCommand(child.pid);
22785
22789
  try {
@@ -23552,7 +23556,7 @@ async function readConfinedBytes(projectDir, rel, maxBytes = MAX_AGENT_BYTES) {
23552
23556
  import { createHash as createHash7 } from "crypto";
23553
23557
  import { createServer } from "http";
23554
23558
  import { lstat as lstat11, realpath as realpath6 } from "fs/promises";
23555
- import { basename as basename3, dirname as dirname7, join as join16, posix } from "path";
23559
+ import { basename as basename3, dirname as dirname7, join as join16, posix as posix2 } from "path";
23556
23560
  import { pipeline as pipeline2 } from "stream/promises";
23557
23561
 
23558
23562
  // ../../packages/composition-runtime/src/page.ts
@@ -24071,7 +24075,7 @@ async function startCompositionServer(opts2) {
24071
24075
  const rel = rest.slice(prefix.length).join("/");
24072
24076
  if (rest.length === prefix.length + 2 && rest[prefix.length] === "media") return serveMedia(req, res, session, rest[prefix.length + 1], headers2);
24073
24077
  if (!isCompositionPath(rel)) return notFound();
24074
- const ext2 = posix.extname(rel).toLowerCase();
24078
+ const ext2 = posix2.extname(rel).toLowerCase();
24075
24079
  const fileHeaders = {
24076
24080
  ...headers2,
24077
24081
  "content-security-policy": [COMPOSITION_CSP, SANDBOX_CSP],
@@ -53699,7 +53703,7 @@ function registerBrandRoutes(app, ctx) {
53699
53703
 
53700
53704
  // ../../packages/core/src/server/library-routes.ts
53701
53705
  import { rm as rm49 } from "fs/promises";
53702
- import { join as join95, posix as posix2 } from "path";
53706
+ import { join as join95, posix as posix3 } from "path";
53703
53707
  import { z as z44 } from "zod";
53704
53708
  var assetPatch = z44.object({
53705
53709
  name: z44.string().min(1).max(200).optional(),
@@ -53881,7 +53885,7 @@ function registerLibraryRoutes(app, ctx) {
53881
53885
  });
53882
53886
  app.get("/api/projects/:slug/files/*", async (req, reply) => {
53883
53887
  const { projectDir } = await project(req.params.slug);
53884
- const rel = posix2.normalize(req.params["*"] ?? ".");
53888
+ const rel = posix3.normalize(req.params["*"] ?? ".");
53885
53889
  const lower = rel.toLowerCase();
53886
53890
  if (lower === "assets/assets.json" || lower === "references/references.json") return reply.status(404).send({ error: t().errors.fileNotFoundShort });
53887
53891
  return sendConfinedFile(reply, projectDir, req.params["*"] ?? "", ["assets/", "references/"]);
@@ -56831,11 +56835,12 @@ async function buildServer(deps) {
56831
56835
  });
56832
56836
  app.get("/api/agent/capabilities", async () => capabilitiesFor(await claudeVersion(), await agentOptIn()));
56833
56837
  app.get("/api/workspace", async () => {
56834
- if (!workspace) return { path: workspaceProblem?.path ?? null, settings: null, error: workspaceProblem?.error ?? null };
56838
+ const suggestedPath = defaultWorkspacePath();
56839
+ if (!workspace) return { path: workspaceProblem?.path ?? null, settings: null, error: workspaceProblem?.error ?? null, suggestedPath };
56835
56840
  try {
56836
- return { path: workspace.root, settings: await workspace.readSettings(), error: null };
56841
+ return { path: workspace.root, settings: await workspace.readSettings(), error: null, suggestedPath };
56837
56842
  } catch (err2) {
56838
- return { path: workspace.root, settings: null, error: describeWorkspaceProblem(err2) };
56843
+ return { path: workspace.root, settings: null, error: describeWorkspaceProblem(err2), suggestedPath };
56839
56844
  }
56840
56845
  });
56841
56846
  app.put("/api/workspace", async (req) => {