agent-lyceum 0.4.14 → 0.6.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.
Files changed (47) hide show
  1. package/README.md +21 -21
  2. package/README.zh-TW.md +21 -21
  3. package/dist/adapters/claude.js +2 -0
  4. package/dist/ask-answer.d.ts +10 -0
  5. package/dist/ask-answer.js +21 -0
  6. package/dist/ask-reply.d.ts +65 -0
  7. package/dist/ask-reply.js +165 -0
  8. package/dist/assert.d.ts +2 -0
  9. package/dist/assert.js +6 -0
  10. package/dist/cli.js +202 -16
  11. package/dist/config.d.ts +21 -16
  12. package/dist/config.js +19 -7
  13. package/dist/dispatcher.d.ts +3 -34
  14. package/dist/dispatcher.js +4 -464
  15. package/dist/doctor.js +3 -0
  16. package/dist/format.js +7 -5
  17. package/dist/fs-util.d.ts +2 -0
  18. package/dist/fs-util.js +15 -0
  19. package/dist/guard.d.ts +8 -0
  20. package/dist/guard.js +24 -3
  21. package/dist/mailbox.d.ts +11 -1
  22. package/dist/mailbox.js +21 -8
  23. package/dist/memory-tidy.d.ts +115 -0
  24. package/dist/memory-tidy.js +351 -0
  25. package/dist/policy.js +3 -3
  26. package/dist/process-runner.js +1 -2
  27. package/dist/project-lock.d.ts +10 -1
  28. package/dist/project-lock.js +39 -4
  29. package/dist/prompt.d.ts +20 -0
  30. package/dist/prompt.js +76 -3
  31. package/dist/run-cleanup.js +4 -3
  32. package/dist/run-log.d.ts +5 -0
  33. package/dist/run-log.js +18 -0
  34. package/dist/run-outcome.d.ts +22 -0
  35. package/dist/run-outcome.js +28 -0
  36. package/dist/run-session.d.ts +92 -0
  37. package/dist/run-session.js +602 -0
  38. package/dist/run-store.d.ts +3 -1
  39. package/dist/run-store.js +7 -6
  40. package/dist/scaffold.js +1 -0
  41. package/dist/schema.d.ts +72 -239
  42. package/dist/schema.js +8 -3
  43. package/dist/status.d.ts +9 -1
  44. package/dist/status.js +51 -15
  45. package/dist/validate.js +12 -8
  46. package/dist/worktree.js +7 -6
  47. package/package.json +14 -8
package/dist/validate.js CHANGED
@@ -3,6 +3,7 @@ import { enforcementFor, memoryDirs, ownsDirs } from "./policy.js";
3
3
  import { isInside } from "./paths.js";
4
4
  import { inferRuntime, RUNTIME_EFFORTS } from "./schema.js";
5
5
  import { isGitRepo, resolveWorkspaceMode } from "./worktree.js";
6
+ import { must } from "./assert.js";
6
7
  export function validateProject(project) {
7
8
  const issues = [];
8
9
  const err = (message) => issues.push({ level: "error", message });
@@ -45,8 +46,8 @@ export function validateProject(project) {
45
46
  mem.push({ agent: a.name, dir: d });
46
47
  for (let i = 0; i < mem.length; i++) {
47
48
  for (let j = i + 1; j < mem.length; j++) {
48
- const x = mem[i];
49
- const y = mem[j];
49
+ const x = must(mem[i], "memory dir");
50
+ const y = must(mem[j], "memory dir");
50
51
  if (x.agent === y.agent && x.dir !== y.dir)
51
52
  continue;
52
53
  if (isInside(x.dir, y.dir) || isInside(y.dir, x.dir)) {
@@ -63,10 +64,12 @@ export function validateProject(project) {
63
64
  }
64
65
  for (let i = 0; i < withOwns.length; i++) {
65
66
  for (let j = i + 1; j < withOwns.length; j++) {
66
- for (const x of ownsDirs(project, withOwns[i])) {
67
- for (const y of ownsDirs(project, withOwns[j])) {
67
+ const ai = must(withOwns[i], "agent");
68
+ const aj = must(withOwns[j], "agent");
69
+ for (const x of ownsDirs(project, ai)) {
70
+ for (const y of ownsDirs(project, aj)) {
68
71
  if (isInside(x, y) || isInside(y, x)) {
69
- err(`"owns" overlap: ${withOwns[i].name} (${x}) vs ${withOwns[j].name} (${y})`);
72
+ err(`"owns" overlap: ${ai.name} (${x}) vs ${aj.name} (${y})`);
70
73
  }
71
74
  }
72
75
  }
@@ -99,11 +102,12 @@ export function validateProject(project) {
99
102
  return { issues, enforcement, ok: !issues.some((i) => i.level === "error") };
100
103
  }
101
104
  export function formatEnforcement(list) {
102
- const rows = [["agent", "runtime", "memory", "AGENT.md", "others' ctx", "repo CLAUDE/AGENTS", "owns"]];
105
+ const header = ["agent", "runtime", "memory", "AGENT.md", "others' ctx", "repo CLAUDE/AGENTS", "owns"];
106
+ const rows = [header];
103
107
  for (const e of list)
104
108
  rows.push([e.agent, e.runtime, e.memory, e.agentMd, e.otherContext, e.repoInstructions, e.owns]);
105
- const w = rows[0].map((_, i) => Math.max(...rows.map((r) => r[i].length)));
106
- const lines = rows.map((r) => r.map((c, i) => c.padEnd(w[i])).join(" ").trimEnd());
109
+ const w = header.map((_, i) => Math.max(...rows.map((r) => (r[i] ?? "").length)));
110
+ const lines = rows.map((r) => r.map((c, i) => c.padEnd(w[i] ?? 0)).join(" ").trimEnd());
107
111
  lines.splice(1, 0, w.map((n) => "-".repeat(n)).join(" "));
108
112
  const extra = [];
109
113
  for (const e of list) {
package/dist/worktree.js CHANGED
@@ -45,7 +45,7 @@ export function dirtyPaths(dir) {
45
45
  const parts = out.split("\0").filter(Boolean);
46
46
  const paths = [];
47
47
  for (let i = 0; i < parts.length; i++) {
48
- const entry = parts[i];
48
+ const entry = parts[i] ?? "";
49
49
  paths.push(entry.slice(3));
50
50
  if (entry[0] === "R" || entry[0] === "C")
51
51
  i++; // a rename lists its old name next
@@ -162,7 +162,7 @@ export function removeAgentWorkspace(project, runId, agent) {
162
162
  export function globMatch(glob, file) {
163
163
  let re = "";
164
164
  for (let i = 0; i < glob.length; i++) {
165
- const c = glob[i];
165
+ const c = glob.charAt(i);
166
166
  if (c === "*" && glob[i + 1] === "*") {
167
167
  if (glob[i + 2] === "/") {
168
168
  re += "(?:.*/)?";
@@ -210,10 +210,10 @@ export function collectAgentChanges(workspace, owns) {
210
210
  const parts = raw.split("\0").filter(Boolean);
211
211
  const files = [];
212
212
  for (let i = 0; i + 1 < parts.length; i += 2) {
213
- const m = /^:(\d+) (\d+) \w+ \w+ (\w)$/.exec(parts[i]);
213
+ const m = /^:(\d+) (\d+) \w+ \w+ (\w)$/.exec(parts[i] ?? "");
214
214
  if (!m)
215
215
  continue;
216
- files.push({ path: parts[i + 1], status: m[3], mode: m[2] });
216
+ files.push({ path: parts[i + 1] ?? "", status: m[3], mode: m[2] ?? "" });
217
217
  }
218
218
  const rel = path.relative(workspace.root, workspace.dir).split(path.sep).join("/");
219
219
  const violations = [];
@@ -365,8 +365,9 @@ export function inspectWorkspace(project, runId, agent) {
365
365
  const raw = execFileSync("git", ["diff", "--raw", "-z", "--no-renames", "--no-abbrev", ws.base, head], { cwd: root, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 });
366
366
  const parts = raw.split("\0").filter(Boolean);
367
367
  for (let i = 1; i < parts.length; i += 2) {
368
- if (workingBlob(top, parts[i]) !== blobAt(top, head, parts[i]))
369
- work.unintegrated.push(parts[i]);
368
+ const file = parts[i] ?? "";
369
+ if (workingBlob(top, file) !== blobAt(top, head, file))
370
+ work.unintegrated.push(file);
370
371
  }
371
372
  }
372
373
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-lyceum",
3
- "version": "0.4.14",
3
+ "version": "0.6.0",
4
4
  "description": "Config + dispatcher for teams of Claude Code / Codex agents with scoped context and file-based mailboxes",
5
5
  "keywords": [
6
6
  "ai",
@@ -38,21 +38,27 @@
38
38
  "scripts": {
39
39
  "dev": "tsx src/cli.ts",
40
40
  "build": "tsc -p tsconfig.json",
41
- "typecheck": "tsc -p tsconfig.json --noEmit",
41
+ "typecheck": "tsc -p tsconfig.json --noEmit && npm run typecheck:plugin",
42
42
  "test": "vitest run",
43
43
  "prepare": "npm run build",
44
44
  "prepublishOnly": "npm run typecheck && npm test && npm run build",
45
- "release": "bash scripts/release.sh"
45
+ "release": "bash scripts/release.sh",
46
+ "typecheck:plugin": "tsc -p plugins/status-monitor/tsconfig.ci.json",
47
+ "check:pack": "node scripts/check-pack.mjs",
48
+ "lint": "biome lint",
49
+ "check:docs": "node scripts/check-docs.mjs"
46
50
  },
47
51
  "dependencies": {
48
- "commander": "^12.1.0",
52
+ "commander": "^14.0.3",
49
53
  "yaml": "^2.5.0",
50
- "zod": "^3.23.8"
54
+ "zod": "^4.6.5"
51
55
  },
52
56
  "devDependencies": {
53
- "@types/node": "^22.0.0",
57
+ "@biomejs/biome": "^2.5.15",
58
+ "@types/node": "^20.19.43",
54
59
  "tsx": "^4.19.0",
55
- "typescript": "^5.6.0",
56
- "vitest": "^2.1.0"
60
+ "typescript": "^7.0.2",
61
+ "vite": "^8.3.3",
62
+ "vitest": "^4.1.11"
57
63
  }
58
64
  }