@titan-design/active-work 0.2.0 → 0.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titan-design/active-work",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Durable workspace state for engineering work — CLI, MCP, and Claude skill for tracking initiatives across sessions",
6
6
  "license": "MIT",
@@ -21,7 +21,8 @@
21
21
  "dist",
22
22
  "skill",
23
23
  "claude-commands",
24
- "scripts"
24
+ "scripts",
25
+ "docs/cli-reference.md"
25
26
  ],
26
27
  "engines": {
27
28
  "node": ">=22"
@@ -34,10 +35,14 @@
34
35
  "build:dashboard": "vite build --config src/dashboard/vite.config.ts",
35
36
  "gen:cli-reference": "pnpm build:cli && node scripts/gen-cli-reference.mjs",
36
37
  "mine:session": "node tools/mine-session-signals.mjs",
38
+ "index:session": "node tools/build-session-index.mjs",
37
39
  "mine:files": "node tools/mine-file-history.mjs",
40
+ "mine:drain": "node tools/mine-drain.mjs",
41
+ "mine:drain-eval": "node tools/eval-drain.mjs",
38
42
  "export:aw-data": "node tools/export-aw-data.mjs",
39
43
  "cost:rollup": "node tools/cost-rollup.mjs",
40
44
  "eval:miner": "node tools/eval-miner.mjs",
45
+ "index:eval": "node tools/eval-session-index.mjs",
41
46
  "check:tools": "for f in tools/*.mjs; do node --check \"$f\" || exit 1; done && node -e \"JSON.parse(require('fs').readFileSync('tools/pricing/models.json','utf8'))\"",
42
47
  "postinstall": "node scripts/postinstall.js",
43
48
  "preuninstall": "node scripts/preuninstall.js",
@@ -53,6 +58,7 @@
53
58
  },
54
59
  "devDependencies": {
55
60
  "@eslint/js": "^9.39.4",
61
+ "@types/better-sqlite3": "^7.6.13",
56
62
  "@types/node": "^22.10.5",
57
63
  "@types/proper-lockfile": "^4.1.4",
58
64
  "@types/react": "^19.2.14",
@@ -79,6 +85,13 @@
79
85
  "@clack/prompts": "^1.4.0",
80
86
  "@hono/node-server": "^2.0.2",
81
87
  "@modelcontextprotocol/sdk": "^1.29.0",
88
+ "@titan-design/cluster": "^0.1.0",
89
+ "@titan-design/daemon": "^0.1.2",
90
+ "@titan-design/locator": "^0.1.0",
91
+ "@titan-design/registry": "^0.1.0",
92
+ "@titan-design/session-graph": "^0.3.1",
93
+ "@titan-design/session-read": "^0.2.0",
94
+ "better-sqlite3": "^13.0.2",
82
95
  "commander": "^14.0.3",
83
96
  "env-paths": "^4.0.0",
84
97
  "gray-matter": "^4.0.3",
@@ -89,5 +102,10 @@
89
102
  "proper-lockfile": "^4.1.2",
90
103
  "yaml": "^2.9.0",
91
104
  "zod": "^4.4.3"
105
+ },
106
+ "pnpm": {
107
+ "onlyBuiltDependencies": [
108
+ "better-sqlite3"
109
+ ]
92
110
  }
93
111
  }
@@ -10,20 +10,41 @@
10
10
  * Requires `pnpm build` to have run so `dist/cli.js` exists.
11
11
  */
12
12
  import { spawnSync } from 'node:child_process';
13
- import { writeFileSync, existsSync } from 'node:fs';
13
+ import { writeFileSync, existsSync, statSync, readdirSync } from 'node:fs';
14
14
  import { fileURLToPath } from 'node:url';
15
- import { dirname, resolve } from 'node:path';
15
+ import { dirname, resolve, join } from 'node:path';
16
16
 
17
17
  const __dirname = dirname(fileURLToPath(import.meta.url));
18
18
  const REPO_ROOT = resolve(__dirname, '..');
19
19
  const CLI = resolve(REPO_ROOT, 'dist/cli.js');
20
20
  const OUT = resolve(REPO_ROOT, 'docs/cli-reference.md');
21
+ const SRC = resolve(REPO_ROOT, 'src');
21
22
 
22
23
  if (!existsSync(CLI)) {
23
24
  console.error(`error: ${CLI} not found. Run \`pnpm build\` first.`);
24
25
  process.exit(1);
25
26
  }
26
27
 
28
+ /** Recursively find the most recent mtime among files under `dir`. */
29
+ function newestMtime(dir) {
30
+ let newest = 0;
31
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
32
+ const path = join(dir, entry.name);
33
+ const mtime = entry.isDirectory() ? newestMtime(path) : statSync(path).mtimeMs;
34
+ if (mtime > newest) newest = mtime;
35
+ }
36
+ return newest;
37
+ }
38
+
39
+ const distMtime = statSync(CLI).mtimeMs;
40
+ const srcMtime = newestMtime(SRC);
41
+ if (srcMtime > distMtime) {
42
+ console.error(
43
+ `error: ${CLI} is older than src/ (dist stale). Run \`pnpm build:cli\` before regenerating docs.`,
44
+ );
45
+ process.exit(1);
46
+ }
47
+
27
48
  /** Run the built CLI and return its stdout (help is written to stdout by commander). */
28
49
  function runHelp(args) {
29
50
  const result = spawnSync(process.execPath, [CLI, ...args, '--help'], {