@esotech/contextuate 2.0.0 → 2.1.1

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 (103) hide show
  1. package/README.md +169 -1
  2. package/dist/commands/claude.d.ts +21 -0
  3. package/dist/commands/claude.js +213 -0
  4. package/dist/commands/context.d.ts +1 -0
  5. package/dist/commands/create.d.ts +3 -0
  6. package/dist/commands/index.d.ts +4 -0
  7. package/dist/commands/init.d.ts +7 -0
  8. package/dist/commands/init.js +67 -6
  9. package/dist/commands/install.d.ts +28 -0
  10. package/dist/commands/install.js +100 -11
  11. package/dist/commands/monitor.d.ts +55 -0
  12. package/dist/commands/monitor.js +1007 -0
  13. package/dist/commands/remove.d.ts +3 -0
  14. package/dist/commands/run.d.ts +6 -0
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.js +113 -1
  17. package/dist/monitor/daemon/circuit-breaker.d.ts +121 -0
  18. package/dist/monitor/daemon/circuit-breaker.js +552 -0
  19. package/dist/monitor/daemon/cli.d.ts +8 -0
  20. package/dist/monitor/daemon/cli.js +82 -0
  21. package/dist/monitor/daemon/index.d.ts +137 -0
  22. package/dist/monitor/daemon/index.js +695 -0
  23. package/dist/monitor/daemon/notifier.d.ts +25 -0
  24. package/dist/monitor/daemon/notifier.js +98 -0
  25. package/dist/monitor/daemon/processor.d.ts +89 -0
  26. package/dist/monitor/daemon/processor.js +455 -0
  27. package/dist/monitor/daemon/state.d.ts +80 -0
  28. package/dist/monitor/daemon/state.js +162 -0
  29. package/dist/monitor/daemon/watcher.d.ts +47 -0
  30. package/dist/monitor/daemon/watcher.js +171 -0
  31. package/dist/monitor/daemon/wrapper-manager.d.ts +106 -0
  32. package/dist/monitor/daemon/wrapper-manager.js +374 -0
  33. package/dist/monitor/hooks/emit-event.js +652 -0
  34. package/dist/monitor/persistence/file-store.d.ts +88 -0
  35. package/dist/monitor/persistence/file-store.js +335 -0
  36. package/dist/monitor/persistence/index.d.ts +7 -0
  37. package/dist/monitor/persistence/index.js +10 -0
  38. package/dist/monitor/server/adapters/redis.d.ts +38 -0
  39. package/dist/monitor/server/adapters/redis.js +213 -0
  40. package/dist/monitor/server/adapters/unix-socket.d.ts +33 -0
  41. package/dist/monitor/server/adapters/unix-socket.js +182 -0
  42. package/dist/monitor/server/broker.d.ts +135 -0
  43. package/dist/monitor/server/broker.js +475 -0
  44. package/dist/monitor/server/cli.d.ts +8 -0
  45. package/dist/monitor/server/cli.js +98 -0
  46. package/dist/monitor/server/fastify.d.ts +16 -0
  47. package/dist/monitor/server/fastify.js +184 -0
  48. package/dist/monitor/server/index.d.ts +36 -0
  49. package/dist/monitor/server/index.js +153 -0
  50. package/dist/monitor/server/websocket.d.ts +80 -0
  51. package/dist/monitor/server/websocket.js +453 -0
  52. package/dist/monitor/ui/assets/index-4IssW9On.js +59 -0
  53. package/dist/monitor/ui/assets/index-vo9hLe5R.css +32 -0
  54. package/dist/monitor/ui/favicon.png +0 -0
  55. package/dist/monitor/ui/index.html +14 -0
  56. package/dist/monitor/ui/logo.png +0 -0
  57. package/dist/monitor/ui/logo.svg +1 -0
  58. package/dist/runtime/driver.d.ts +16 -0
  59. package/dist/runtime/tools.d.ts +10 -0
  60. package/dist/templates/README.md +33 -7
  61. package/dist/templates/agents/aegis.md +4 -0
  62. package/dist/templates/agents/archon.md +13 -22
  63. package/dist/templates/agents/atlas.md +4 -0
  64. package/dist/templates/agents/canvas.md +4 -0
  65. package/dist/templates/agents/chronicle.md +4 -0
  66. package/dist/templates/agents/chronos.md +4 -0
  67. package/dist/templates/agents/cipher.md +4 -0
  68. package/dist/templates/agents/crucible.md +4 -0
  69. package/dist/templates/agents/echo.md +4 -0
  70. package/dist/templates/agents/forge.md +4 -0
  71. package/dist/templates/agents/ledger.md +4 -0
  72. package/dist/templates/agents/meridian.md +4 -0
  73. package/dist/templates/agents/nexus.md +4 -0
  74. package/dist/templates/agents/pythia.md +217 -0
  75. package/dist/templates/agents/scribe.md +4 -0
  76. package/dist/templates/agents/sentinel.md +4 -0
  77. package/dist/templates/agents/{oracle.md → thoth.md} +11 -7
  78. package/dist/templates/agents/unity.md +4 -0
  79. package/dist/templates/agents/vox.md +4 -0
  80. package/dist/templates/agents/weaver.md +4 -0
  81. package/dist/templates/commands/consult.md +138 -0
  82. package/dist/templates/commands/orchestrate.md +173 -0
  83. package/dist/templates/framework-agents/documentation-expert.md +3 -3
  84. package/dist/templates/framework-agents/tools-expert.md +8 -8
  85. package/dist/templates/standards/agent-roles.md +68 -21
  86. package/dist/templates/standards/coding-standards.md +9 -26
  87. package/dist/templates/templates/context.md +17 -2
  88. package/dist/templates/templates/contextuate.md +21 -28
  89. package/dist/templates/tools/{agent-creator.tool.md → agent-creator.md} +3 -3
  90. package/dist/types/monitor.d.ts +660 -0
  91. package/dist/types/monitor.js +75 -0
  92. package/dist/utils/git.d.ts +9 -0
  93. package/dist/utils/tokens.d.ts +10 -0
  94. package/package.json +18 -5
  95. package/dist/templates/version.json +0 -8
  96. /package/dist/templates/templates/standards/{go.standards.md → go.md} +0 -0
  97. /package/dist/templates/templates/standards/{java.standards.md → java.md} +0 -0
  98. /package/dist/templates/templates/standards/{javascript.standards.md → javascript.md} +0 -0
  99. /package/dist/templates/templates/standards/{php.standards.md → php.md} +0 -0
  100. /package/dist/templates/templates/standards/{python.standards.md → python.md} +0 -0
  101. /package/dist/templates/tools/{quickref.tool.md → quickref.md} +0 -0
  102. /package/dist/templates/tools/{spawn.tool.md → spawn.md} +0 -0
  103. /package/dist/templates/tools/{standards-detector.tool.md → standards-detector.md} +0 -0
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * Contextuate Monitor - Type Definitions
4
+ *
5
+ * Shared TypeScript types for the monitor feature.
6
+ * Used by both server and client components.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DEFAULT_CIRCUIT_BREAKER_CONFIG = exports.DEFAULT_CONFIG = void 0;
10
+ exports.getDefaultMonitorPaths = getDefaultMonitorPaths;
11
+ /**
12
+ * Default configuration values
13
+ */
14
+ exports.DEFAULT_CONFIG = {
15
+ mode: 'local',
16
+ server: {
17
+ host: '0.0.0.0',
18
+ port: 3847,
19
+ wsPort: 3848,
20
+ },
21
+ redis: {
22
+ host: 'localhost',
23
+ port: 6379,
24
+ password: null,
25
+ channel: 'contextuate:events',
26
+ },
27
+ persistence: {
28
+ enabled: true,
29
+ type: 'file',
30
+ },
31
+ socketPath: '/tmp/contextuate-monitor.sock',
32
+ };
33
+ /**
34
+ * Get default monitor paths
35
+ *
36
+ * @returns MonitorPaths with all default directory and file paths
37
+ */
38
+ function getDefaultMonitorPaths() {
39
+ // Note: We use lazy imports to avoid circular dependencies
40
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
41
+ const path = require('path');
42
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
43
+ const os = require('os');
44
+ const baseDir = path.join(os.homedir(), '.contextuate', 'monitor');
45
+ return {
46
+ baseDir,
47
+ configFile: path.join(baseDir, 'config.json'),
48
+ rawDir: path.join(baseDir, 'raw'),
49
+ processedDir: path.join(baseDir, 'processed'),
50
+ sessionsDir: path.join(baseDir, 'sessions'),
51
+ hooksDir: path.join(baseDir, 'hooks'),
52
+ daemonPidFile: path.join(baseDir, 'daemon.pid'),
53
+ daemonLogFile: path.join(baseDir, 'daemon.log'),
54
+ daemonStateFile: path.join(baseDir, 'daemon.state.json'),
55
+ serverPidFile: path.join(baseDir, 'server.pid'),
56
+ serverLogFile: path.join(baseDir, 'server.log'),
57
+ };
58
+ }
59
+ /**
60
+ * Default circuit breaker configuration
61
+ */
62
+ exports.DEFAULT_CIRCUIT_BREAKER_CONFIG = {
63
+ enabled: true,
64
+ noEventTimeout: 300,
65
+ noProgressTimeout: 600,
66
+ maxSessionDuration: 7200,
67
+ noProgressLoops: 3,
68
+ sameErrorThreshold: 5,
69
+ healthCheckInterval: '*/30 * * * * *',
70
+ autoInjectPrompt: true,
71
+ autoKill: false,
72
+ autoRestart: false,
73
+ gracePeriodMs: 60000,
74
+ stuckPrompt: 'You appear to be stuck. Please try a different approach or describe what is blocking you.',
75
+ };
@@ -0,0 +1,9 @@
1
+ export declare class GitManager {
2
+ private cwd;
3
+ constructor(cwd: string);
4
+ isGitRepo(): Promise<boolean>;
5
+ getCurrentBranch(): Promise<string>;
6
+ createWorktree(agentName: string, sessionId: string): Promise<string>;
7
+ removeWorktree(worktreePath: string, deleteBranch?: boolean): Promise<void>;
8
+ commitChanges(worktreePath: string, message: string): Promise<void>;
9
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Estimates the number of tokens in a string.
3
+ * Uses a simple heuristic: ~4 characters per token for English text/code.
4
+ */
5
+ export declare function estimateTokens(text: string): number;
6
+ /**
7
+ * Generates a compact file tree representation of a directory.
8
+ * Respects .gitignore via a simple filter (can be enhanced).
9
+ */
10
+ export declare function generateFileTree(dir: string, maxDepth?: number): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esotech/contextuate",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "**Standardized AI Context for Software Projects**",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -11,8 +11,10 @@
11
11
  },
12
12
  "scripts": {
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "build": "tsc && mkdir -p dist/templates && cp -r src/templates/* dist/templates/",
15
- "prepublishOnly": "npm run build"
14
+ "build": "tsc && rm -rf dist/templates && mkdir -p dist/templates && cp -r src/templates/* dist/templates/ && mkdir -p dist/monitor/hooks && cp src/monitor/hooks/emit-event.js dist/monitor/hooks/ && chmod +x dist/index.js dist/monitor/hooks/emit-event.js dist/monitor/daemon/cli.js dist/monitor/server/cli.js",
15
+ "build:monitor-ui": "cd src/monitor/ui && npm install && npm run build",
16
+ "build:all": "npm run build && npm run build:monitor-ui",
17
+ "prepublishOnly": "npm run build:all"
16
18
  },
17
19
  "repository": {
18
20
  "type": "git",
@@ -31,7 +33,8 @@
31
33
  "copilot",
32
34
  "cursor",
33
35
  "anthropic",
34
- "claude"
36
+ "claude",
37
+ "monitor"
35
38
  ],
36
39
  "author": "Alexander David Conroy <alex@esotech.com> (https://github.com/geilt)",
37
40
  "license": "MIT",
@@ -47,13 +50,23 @@
47
50
  "@types/fs-extra": "^11.0.4",
48
51
  "@types/inquirer": "^9.0.9",
49
52
  "@types/node": "^24.10.1",
53
+ "@types/node-cron": "^3.0.11",
54
+ "@types/ws": "^8.5.13",
50
55
  "typescript": "^5.9.3"
51
56
  },
52
57
  "dependencies": {
58
+ "@fastify/cors": "^10.0.1",
59
+ "@fastify/static": "^8.0.3",
53
60
  "chalk": "^5.6.2",
54
61
  "commander": "^14.0.2",
62
+ "fastify": "^5.2.0",
55
63
  "fs-extra": "^11.3.2",
56
64
  "gray-matter": "^4.0.3",
57
- "inquirer": "^13.0.1"
65
+ "inquirer": "^13.0.1",
66
+ "ioredis": "^5.4.2",
67
+ "node-cron": "^4.2.1",
68
+ "node-pty": "^1.2.0-beta.2",
69
+ "uuid": "^11.0.3",
70
+ "ws": "^8.18.0"
58
71
  }
59
72
  }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "contextuate",
3
- "version": "1.0.0",
4
- "description": "AI Context Framework - Standardized documentation for AI coding assistants",
5
- "repository": "https://github.com/esotech/contextuate",
6
- "installed": null,
7
- "updated": null
8
- }