cladogram 0.5.5-beta.9 → 0.6.0-beta.10

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 (56) hide show
  1. package/README.md +106 -80
  2. package/bin/clado.js +35 -3
  3. package/docs/agent-context.md +63 -0
  4. package/docs/agent-reference.md +219 -0
  5. package/docs/release.md +123 -0
  6. package/package.json +5 -3
  7. package/plugins/agent/index.js +2485 -2982
  8. package/plugins/agent/settings.js +3592 -0
  9. package/plugins/agent/style.css +1441 -1315
  10. package/plugins/brand/index.js +84 -466
  11. package/plugins/brand/style.css +39 -172
  12. package/plugins/directory/index.js +10 -10
  13. package/plugins/view-controls/index.js +6 -1
  14. package/plugins/view-controls/style.css +41 -30
  15. package/skills/clado/SKILL.md +4 -2
  16. package/src/agent/automations.js +454 -0
  17. package/src/agent/clado-tools.js +792 -0
  18. package/src/agent/pi-bridge.js +2559 -0
  19. package/src/agent/pi-config.js +2411 -0
  20. package/src/agent/pi-hooks-perms.js +621 -0
  21. package/src/html/app-css.js +69 -1
  22. package/src/html/canvas-chain.js +32 -6
  23. package/src/html/canvas-focus.js +19 -13
  24. package/src/html/canvas-live-diff.js +1373 -0
  25. package/src/html/canvas-ui.css +503 -2
  26. package/src/html/canvas-wires.js +5 -1
  27. package/src/html/page.js +4 -2
  28. package/src/html/plugin-assets.js +5 -1
  29. package/src/html/plugin-ui.css +159 -134
  30. package/src/html/plugin-ui.js +3 -2
  31. package/src/html/runtime-api.js +152 -10
  32. package/src/html/runtime.js +546 -37
  33. package/src/server/agent.js +862 -1566
  34. package/src/server/assets/library-canvas.js +256 -9
  35. package/src/server/assets/library.css +951 -11
  36. package/src/server/assets/library.html +39 -4
  37. package/src/server/assets/library.js +1445 -224
  38. package/src/server/code-inspect.js +183 -0
  39. package/src/server/mcp.js +90 -22
  40. package/src/server/plugin-registry.js +671 -9
  41. package/src/server/plugins.js +1 -1
  42. package/src/server/workspace-hub.js +50 -0
  43. package/src/server/workspace.js +554 -39
  44. package/src/workspace/graph-snapshot.js +695 -0
  45. package/src/workspace/service.js +201 -9
  46. package/src/agent/commands.js +0 -204
  47. package/src/agent/context.js +0 -445
  48. package/src/agent/executors.js +0 -213
  49. package/src/agent/mcp-client.js +0 -308
  50. package/src/agent/probe.js +0 -234
  51. package/src/agent/providers/anthropic.js +0 -220
  52. package/src/agent/providers/index.js +0 -235
  53. package/src/agent/providers/openai.js +0 -146
  54. package/src/agent/runtime.js +0 -995
  55. package/src/agent/sessions.js +0 -336
  56. package/src/agent/skills.js +0 -190
@@ -8,8 +8,8 @@ import { DocumentError } from '../workspace/documents.js';
8
8
  import { capabilityDefinition, capabilityPermission, compileCapabilities, mountId, pluginId } from './plugin-capabilities.js';
9
9
  import { captureDefinition } from './canvas-capture.js';
10
10
  import { compileConfiguration, pluginConfiguration } from './plugin-settings.js';
11
- import { executorSchema } from '../agent/executors.js';
12
11
  import { locked, fail } from '../workspace/storage.js';
12
+ const executorSchema = z.object({ id: z.string().min(1), name: z.string().min(1) }).passthrough();
13
13
 
14
14
  export const PLUGIN_PROTOCOL = '1.0';
15
15
  export const PLUGIN_SLOTS = ['topbar', 'bottombar', 'sidebar', 'bottom-left', 'canvas-overlay', 'top-left', 'top-right', 'bottom-right'];
@@ -32,6 +32,52 @@ function countMarkdownInWorkspace(wsDir) {
32
32
  }
33
33
  }
34
34
 
35
+ const CODE_EXT_LANG = {
36
+ ts: 'TypeScript', tsx: 'TypeScript', js: 'JavaScript', jsx: 'JavaScript', mjs: 'JavaScript',
37
+ py: 'Python', go: 'Go', rs: 'Rust', java: 'Java', kt: 'Kotlin', rb: 'Ruby', php: 'PHP', vue: 'Vue', svelte: 'Svelte',
38
+ };
39
+
40
+ export function detectWorkspaceProfile(wsDir) {
41
+ let gitBranch = '';
42
+ try {
43
+ const headFile = join(wsDir, '.git', 'HEAD');
44
+ if (existsSync(headFile)) {
45
+ const text = readFileSync(headFile, 'utf8').trim();
46
+ const m = text.match(/^ref:\s*refs\/heads\/(.+)$/);
47
+ gitBranch = m ? m[1] : text.slice(0, 7);
48
+ }
49
+ } catch {}
50
+
51
+ let codeFiles = 0;
52
+ const langCounts = new Map();
53
+ const walk = (dir, depth) => {
54
+ if (depth > 3 || codeFiles >= 300) return;
55
+ let items = [];
56
+ try { items = readdirSync(dir, { withFileTypes: true }); } catch { return; }
57
+ for (const item of items) {
58
+ if (item.name.startsWith('.') || item.name === 'node_modules' || item.name === 'dist' || item.name === 'build' || item.name === 'vendor' || item.name === 'target') continue;
59
+ const full = join(dir, item.name);
60
+ if (item.isDirectory()) {
61
+ walk(full, depth + 1);
62
+ } else if (item.isFile()) {
63
+ const ext = item.name.split('.').pop()?.toLowerCase() || '';
64
+ const lang = CODE_EXT_LANG[ext];
65
+ if (lang) {
66
+ codeFiles++;
67
+ langCounts.set(lang, (langCounts.get(lang) || 0) + 1);
68
+ }
69
+ }
70
+ }
71
+ };
72
+ try { walk(wsDir, 0); } catch {}
73
+ let primaryLang = '';
74
+ let maxCount = 0;
75
+ for (const [lang, cnt] of langCounts) {
76
+ if (cnt > maxCount) { maxCount = cnt; primaryLang = lang; }
77
+ }
78
+ return { gitBranch, codeFiles, primaryLang };
79
+ }
80
+
35
81
  export function readRecentWorkspaces() {
36
82
  const file = recentsFilePath();
37
83
  if (!existsSync(file)) return [];
@@ -44,11 +90,15 @@ export function readRecentWorkspaces() {
44
90
  const p = resolve(item.path);
45
91
  try {
46
92
  if (!existsSync(p) || !statSync(p).isDirectory()) continue;
93
+ const prof = detectWorkspaceProfile(p);
47
94
  out.push({
48
95
  path: p,
49
96
  name: basename(p) || p,
50
97
  hasClado: existsSync(join(p, '.clado')),
51
98
  isGit: existsSync(join(p, '.git')),
99
+ gitBranch: prof.gitBranch,
100
+ codeFiles: prof.codeFiles,
101
+ primaryLang: prof.primaryLang,
52
102
  documents: countMarkdownInWorkspace(p),
53
103
  lastOpenedAt: item.lastOpenedAt || new Date().toISOString(),
54
104
  });