agent-common 1.0.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 (48) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +21 -0
  3. package/README.md +23 -0
  4. package/dist/dashboard.d.ts +29 -0
  5. package/dist/dashboard.d.ts.map +1 -0
  6. package/dist/dashboard.js +71 -0
  7. package/dist/dashboard.js.map +1 -0
  8. package/dist/domain/cleanup.d.ts +30 -0
  9. package/dist/domain/cleanup.d.ts.map +1 -0
  10. package/dist/domain/cleanup.js +54 -0
  11. package/dist/domain/cleanup.js.map +1 -0
  12. package/dist/domain/events.d.ts +13 -0
  13. package/dist/domain/events.d.ts.map +1 -0
  14. package/dist/domain/events.js +61 -0
  15. package/dist/domain/events.js.map +1 -0
  16. package/dist/index.d.ts +11 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +14 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/package-meta.d.ts +22 -0
  21. package/dist/package-meta.d.ts.map +1 -0
  22. package/dist/package-meta.js +48 -0
  23. package/dist/package-meta.js.map +1 -0
  24. package/dist/storage/database.d.ts +27 -0
  25. package/dist/storage/database.d.ts.map +1 -0
  26. package/dist/storage/database.js +73 -0
  27. package/dist/storage/database.js.map +1 -0
  28. package/dist/storage/fts.d.ts +27 -0
  29. package/dist/storage/fts.d.ts.map +1 -0
  30. package/dist/storage/fts.js +57 -0
  31. package/dist/storage/fts.js.map +1 -0
  32. package/dist/transport/mcp.d.ts +16 -0
  33. package/dist/transport/mcp.d.ts.map +1 -0
  34. package/dist/transport/mcp.js +111 -0
  35. package/dist/transport/mcp.js.map +1 -0
  36. package/dist/transport/rest.d.ts +18 -0
  37. package/dist/transport/rest.d.ts.map +1 -0
  38. package/dist/transport/rest.js +185 -0
  39. package/dist/transport/rest.js.map +1 -0
  40. package/dist/transport/ws.d.ts +28 -0
  41. package/dist/transport/ws.d.ts.map +1 -0
  42. package/dist/transport/ws.js +143 -0
  43. package/dist/transport/ws.js.map +1 -0
  44. package/dist/types.d.ts +33 -0
  45. package/dist/types.d.ts.map +1 -0
  46. package/dist/types.js +26 -0
  47. package/dist/types.js.map +1 -0
  48. package/package.json +71 -0
package/dist/types.js ADDED
@@ -0,0 +1,26 @@
1
+ // =============================================================================
2
+ // agent-kit — Shared types and error classes
3
+ // =============================================================================
4
+ export class KitError extends Error {
5
+ code;
6
+ statusCode;
7
+ constructor(message, code = 'KIT_ERROR', statusCode = 500) {
8
+ super(message);
9
+ this.code = code;
10
+ this.statusCode = statusCode;
11
+ this.name = 'KitError';
12
+ }
13
+ }
14
+ export class ValidationError extends KitError {
15
+ constructor(message) {
16
+ super(message, 'VALIDATION_ERROR', 400);
17
+ this.name = 'ValidationError';
18
+ }
19
+ }
20
+ export class NotFoundError extends KitError {
21
+ constructor(resource, identifier) {
22
+ super(identifier ? `${resource} not found: ${identifier}` : `${resource} not found`, 'NOT_FOUND', 404);
23
+ this.name = 'NotFoundError';
24
+ }
25
+ }
26
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6CAA6C;AAC7C,gFAAgF;AAEhF,MAAM,OAAO,QAAS,SAAQ,KAAK;IAGf;IACA;IAHlB,YACE,OAAe,EACC,OAAe,WAAW,EAC1B,aAAqB,GAAG;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAsB;QAC1B,eAAU,GAAV,UAAU,CAAc;QAGxC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,OAAO,aAAc,SAAQ,QAAQ;IACzC,YAAY,QAAgB,EAAE,UAAmB;QAC/C,KAAK,CACH,UAAU,CAAC,CAAC,CAAC,GAAG,QAAQ,eAAe,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,QAAQ,YAAY,EAC7E,WAAW,EACX,GAAG,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "agent-common",
3
+ "version": "1.0.0",
4
+ "description": "Shared foundation for agent-* MCP servers — SQLite, REST, WebSocket, MCP, cleanup, events, dashboard scaffolding",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "test": "vitest run",
17
+ "test:watch": "vitest",
18
+ "lint": "eslint src/ tests/",
19
+ "lint:fix": "eslint src/ tests/ --fix",
20
+ "format": "prettier --write .",
21
+ "format:check": "prettier --check .",
22
+ "typecheck": "tsc --noEmit",
23
+ "check": "npm run typecheck && npm run lint && npm run format:check && npm run test"
24
+ },
25
+ "dependencies": {
26
+ "better-sqlite3": "12.8.0",
27
+ "ws": "8.20.0"
28
+ },
29
+ "peerDependencies": {
30
+ "better-sqlite3": ">=11",
31
+ "ws": ">=8"
32
+ },
33
+ "devDependencies": {
34
+ "@eslint/js": "^10.0.1",
35
+ "@types/better-sqlite3": "^7.6.13",
36
+ "@types/node": "^22.0.0",
37
+ "@types/ws": "^8.18.1",
38
+ "eslint": "^10.1.0",
39
+ "prettier": "^3.8.1",
40
+ "typescript": "^5.7.0",
41
+ "typescript-eslint": "^8.58.0",
42
+ "vitest": "^3.0.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=20.11.0"
46
+ },
47
+ "keywords": [
48
+ "mcp",
49
+ "agent",
50
+ "sqlite",
51
+ "websocket",
52
+ "model-context-protocol",
53
+ "ai-agents",
54
+ "shared-foundation"
55
+ ],
56
+ "files": [
57
+ "dist/",
58
+ "README.md",
59
+ "CHANGELOG.md",
60
+ "LICENSE"
61
+ ],
62
+ "license": "MIT",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "https://github.com/keshrath/agent-common.git"
66
+ },
67
+ "homepage": "https://github.com/keshrath/agent-common#readme",
68
+ "bugs": {
69
+ "url": "https://github.com/keshrath/agent-common/issues"
70
+ }
71
+ }