@montytools/cli 0.1.4 → 0.1.5

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/bin/monty.mjs CHANGED
@@ -339,6 +339,27 @@ async function create() {
339
339
  console.log(`config: WARNING — could not reach ${host}/api/config; copy .env.example to .env.local manually`);
340
340
  }
341
341
 
342
+ // Build tracking: the /new screen minted an id; recording it here lets
343
+ // `monty deploy` resolve it and flips the UI into "agent is working" mode.
344
+ const buildId = flag("build");
345
+ if (buildId && /^[a-z0-9]{10,64}$/i.test(buildId)) {
346
+ mkdirSync(join(target, ".monty"), { recursive: true });
347
+ writeFileSync(join(target, ".monty", "build"), buildId + "\n");
348
+ const cfg = loadConfig();
349
+ if (cfg?.key) {
350
+ try {
351
+ await fetch(`${cfg.host ?? DEFAULT_HOST}/api/build`, {
352
+ method: "POST",
353
+ headers: { authorization: `Bearer ${cfg.key}`, "content-type": "application/json" },
354
+ body: JSON.stringify({ buildId, slug }),
355
+ });
356
+ console.log("build: workspace notified — the New app screen is following along");
357
+ } catch {
358
+ /* progress signal only — never block create */
359
+ }
360
+ }
361
+ }
362
+
342
363
  installSkills({ appDir: target });
343
364
  console.log(`created: ${target}`);
344
365
  console.log(`next: cd ${target} && pnpm install && monty dev`);
@@ -498,6 +519,10 @@ async function deploy() {
498
519
  // 3) Multipart POST to the host.
499
520
  const dist = join(appDir, "dist");
500
521
  const files = walk(dist);
522
+ const buildFile = join(appDir, ".monty", "build");
523
+ if (existsSync(buildFile)) {
524
+ meta.buildId = readFileSync(buildFile, "utf8").trim();
525
+ }
501
526
  const form = new FormData();
502
527
  form.set("monty", JSON.stringify(meta));
503
528
  let total = 0;
@@ -623,7 +648,7 @@ switch (command) {
623
648
  default:
624
649
  console.log("usage: monty <login|create|current|select|apps|dev|add|components|docs|deploy|skills>");
625
650
  console.log(" login [--host <url>] [--key <mk_...>] sign in (opens your browser to authorize)");
626
- console.log(" create <slug> [--name N] [--icon I] stamp a new app into ~/Monty/<slug>");
651
+ console.log(" create <slug> [--name N] [--icon I] [--build ID] stamp a new app into ~/Monty/<slug>");
627
652
  console.log(" dev [--port 5173] run the app locally (sandboxed data)");
628
653
  console.log(" add <name...> install curated UI components (see `monty components`)");
629
654
  console.log(" components [query] list the curated component catalog");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@montytools/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "monty": "./bin/monty.mjs"
@@ -17,6 +17,8 @@ the territory.
17
17
  tells you where you are; `cd "$(monty select <slug>)"` jumps to an app;
18
18
  `monty apps` lists local ones. Never mkdir app folders by hand.
19
19
  2. **The loop:** `monty create <slug> --name "Name" --icon <lucide-icon>` →
20
+ (if the prompt includes a `build id`, pass it: `--build <id>` — the
21
+ workspace's New app screen tracks your progress live) →
20
22
  edit `monty.config.ts` (zod tables) + `src/routes/` → verify with
21
23
  `monty dev` (localhost:5173, already authenticated, sandboxed data) →
22
24
  `monty deploy`. You are done when deploy prints the URL.