itsvertical 0.0.1 → 0.0.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/README.md CHANGED
@@ -32,6 +32,16 @@ Or run directly with npx:
32
32
  npx itsvertical new my-project.vertical "My Project"
33
33
  ```
34
34
 
35
+ ### Agent skill
36
+
37
+ Install the [Vertical skill](https://skills.sh/seasonedcc/vertical/vertical) to teach your AI agent how to use Vertical:
38
+
39
+ ```
40
+ npx skills add seasonedcc/vertical
41
+ ```
42
+
43
+ This gives agents like Claude Code, Cursor, and GitHub Copilot procedural knowledge of all Vertical commands and workflows.
44
+
35
45
  ## Commands
36
46
 
37
47
  All entities are addressed by ID. Use `itsvertical show` to see IDs. Every command accepts `--json` to output the full board state as JSON (useful for agents).
package/cli/dist/index.js CHANGED
@@ -1219,8 +1219,8 @@ var Promise2 = getNative_default(root_default, "Promise");
1219
1219
  var Promise_default = Promise2;
1220
1220
 
1221
1221
  // node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Set.js
1222
- var Set = getNative_default(root_default, "Set");
1223
- var Set_default = Set;
1222
+ var Set2 = getNative_default(root_default, "Set");
1223
+ var Set_default = Set2;
1224
1224
 
1225
1225
  // node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js
1226
1226
  var mapTag2 = "[object Map]";
@@ -1925,6 +1925,7 @@ function fail(message, json) {
1925
1925
  import fs2 from "fs";
1926
1926
  import http from "http";
1927
1927
  import path2 from "path";
1928
+ import readline from "readline";
1928
1929
  import { fileURLToPath } from "url";
1929
1930
  import getPort from "get-port";
1930
1931
  import open from "open";
@@ -1969,9 +1970,24 @@ function readRequestBody(req) {
1969
1970
  req.on("error", reject);
1970
1971
  });
1971
1972
  }
1973
+ function confirm(question) {
1974
+ const rl = readline.createInterface({
1975
+ input: process.stdin,
1976
+ output: process.stdout
1977
+ });
1978
+ rl.on("error", () => {
1979
+ });
1980
+ return new Promise((resolve) => {
1981
+ rl.question(question, (answer) => {
1982
+ rl.close();
1983
+ resolve(answer.toLowerCase() === "y");
1984
+ });
1985
+ });
1986
+ }
1972
1987
  async function startServer(filePath) {
1973
1988
  const absoluteFilePath = path2.resolve(filePath);
1974
1989
  const distPath = getDistPath();
1990
+ let browserDirty = false;
1975
1991
  if (!fs2.existsSync(distPath)) {
1976
1992
  console.error(
1977
1993
  "Error: dist/ directory not found. Run `pnpm run build` first."
@@ -1993,6 +2009,23 @@ async function startServer(filePath) {
1993
2009
  res.end('{"ok":true}');
1994
2010
  return;
1995
2011
  }
2012
+ if (url2 === "/api/events" && req.method === "GET") {
2013
+ res.writeHead(200, {
2014
+ "Content-Type": "text/event-stream",
2015
+ "Cache-Control": "no-cache",
2016
+ Connection: "keep-alive"
2017
+ });
2018
+ sseClients.add(res);
2019
+ req.on("close", () => sseClients.delete(res));
2020
+ return;
2021
+ }
2022
+ if (url2 === "/api/dirty" && req.method === "POST") {
2023
+ const body = await readRequestBody(req);
2024
+ browserDirty = JSON.parse(body).dirty;
2025
+ res.writeHead(200, { "Content-Type": "application/json" });
2026
+ res.end('{"ok":true}');
2027
+ return;
2028
+ }
1996
2029
  if (serveStaticFile(res, distPath, url2))
1997
2030
  return;
1998
2031
  const indexPath = path2.join(distPath, "index.html");
@@ -2006,6 +2039,12 @@ async function startServer(filePath) {
2006
2039
  });
2007
2040
  const port = await getPort();
2008
2041
  const url = `http://localhost:${port}`;
2042
+ const sseClients = /* @__PURE__ */ new Set();
2043
+ fs2.watch(absoluteFilePath, () => {
2044
+ for (const client of sseClients) {
2045
+ client.write("data: file-changed\n\n");
2046
+ }
2047
+ });
2009
2048
  server.listen(port, () => {
2010
2049
  console.log(`
2011
2050
  Vertical is running at ${url}`);
@@ -2013,6 +2052,22 @@ async function startServer(filePath) {
2013
2052
  console.log(" Press Ctrl+C to stop\n");
2014
2053
  open(url);
2015
2054
  });
2055
+ process.on("SIGINT", async () => {
2056
+ if (browserDirty) {
2057
+ try {
2058
+ const shouldQuit = await confirm(
2059
+ "\n There are unsaved changes in the browser. Quit anyway? (y/N) "
2060
+ );
2061
+ if (!shouldQuit) {
2062
+ console.log(" Resuming...\n");
2063
+ return;
2064
+ }
2065
+ } catch {
2066
+ }
2067
+ }
2068
+ server.close();
2069
+ process.exit(0);
2070
+ });
2016
2071
  }
2017
2072
 
2018
2073
  // cli/index.ts