@agentionai/agents 0.3.0-beta

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 (91) hide show
  1. package/README.md +517 -0
  2. package/dist/agents/Agent.d.ts +29 -0
  3. package/dist/agents/Agent.js +28 -0
  4. package/dist/agents/AgentConfig.d.ts +118 -0
  5. package/dist/agents/AgentConfig.js +3 -0
  6. package/dist/agents/AgentEvent.d.ts +18 -0
  7. package/dist/agents/AgentEvent.js +26 -0
  8. package/dist/agents/BaseAgent.d.ts +82 -0
  9. package/dist/agents/BaseAgent.js +121 -0
  10. package/dist/agents/anthropic/ClaudeAgent.d.ts +46 -0
  11. package/dist/agents/anthropic/ClaudeAgent.js +262 -0
  12. package/dist/agents/errors/AgentError.d.ts +47 -0
  13. package/dist/agents/errors/AgentError.js +74 -0
  14. package/dist/agents/google/GeminiAgent.d.ts +63 -0
  15. package/dist/agents/google/GeminiAgent.js +395 -0
  16. package/dist/agents/mistral/MistralAgent.d.ts +47 -0
  17. package/dist/agents/mistral/MistralAgent.js +313 -0
  18. package/dist/agents/model-types.d.ts +30 -0
  19. package/dist/agents/model-types.js +8 -0
  20. package/dist/agents/openai/OpenAiAgent.d.ts +48 -0
  21. package/dist/agents/openai/OpenAiAgent.js +338 -0
  22. package/dist/chunkers/Chunker.d.ts +53 -0
  23. package/dist/chunkers/Chunker.js +174 -0
  24. package/dist/chunkers/RecursiveChunker.d.ts +52 -0
  25. package/dist/chunkers/RecursiveChunker.js +166 -0
  26. package/dist/chunkers/TextChunker.d.ts +27 -0
  27. package/dist/chunkers/TextChunker.js +50 -0
  28. package/dist/chunkers/TokenChunker.d.ts +60 -0
  29. package/dist/chunkers/TokenChunker.js +176 -0
  30. package/dist/chunkers/index.d.ts +6 -0
  31. package/dist/chunkers/index.js +14 -0
  32. package/dist/chunkers/types.d.ts +95 -0
  33. package/dist/chunkers/types.js +3 -0
  34. package/dist/graph/AgentGraph.d.ts +99 -0
  35. package/dist/graph/AgentGraph.js +115 -0
  36. package/dist/graph/BaseExecutor.d.ts +86 -0
  37. package/dist/graph/BaseExecutor.js +61 -0
  38. package/dist/graph/GraphMetrics.d.ts +143 -0
  39. package/dist/graph/GraphMetrics.js +264 -0
  40. package/dist/graph/MapExecutor.d.ts +39 -0
  41. package/dist/graph/MapExecutor.js +123 -0
  42. package/dist/graph/ParallelExecutor.d.ts +51 -0
  43. package/dist/graph/ParallelExecutor.js +103 -0
  44. package/dist/graph/Pipeline.d.ts +44 -0
  45. package/dist/graph/Pipeline.js +109 -0
  46. package/dist/graph/RouterExecutor.d.ts +89 -0
  47. package/dist/graph/RouterExecutor.js +209 -0
  48. package/dist/graph/SequentialExecutor.d.ts +44 -0
  49. package/dist/graph/SequentialExecutor.js +115 -0
  50. package/dist/graph/VotingSystem.d.ts +54 -0
  51. package/dist/graph/VotingSystem.js +106 -0
  52. package/dist/history/History.d.ts +107 -0
  53. package/dist/history/History.js +166 -0
  54. package/dist/history/RedisHistory.d.ts +27 -0
  55. package/dist/history/RedisHistory.js +55 -0
  56. package/dist/history/transformers.d.ts +102 -0
  57. package/dist/history/transformers.js +415 -0
  58. package/dist/history/types.d.ts +130 -0
  59. package/dist/history/types.js +55 -0
  60. package/dist/index.d.ts +16 -0
  61. package/dist/index.js +48 -0
  62. package/dist/ingestion/IngestionPipeline.d.ts +86 -0
  63. package/dist/ingestion/IngestionPipeline.js +266 -0
  64. package/dist/ingestion/index.d.ts +3 -0
  65. package/dist/ingestion/index.js +7 -0
  66. package/dist/ingestion/types.d.ts +74 -0
  67. package/dist/ingestion/types.js +3 -0
  68. package/dist/team/Team.d.ts +46 -0
  69. package/dist/team/Team.js +104 -0
  70. package/dist/tools/Tool.d.ts +75 -0
  71. package/dist/tools/Tool.js +137 -0
  72. package/dist/vectorstore/Embeddings.d.ts +67 -0
  73. package/dist/vectorstore/Embeddings.js +54 -0
  74. package/dist/vectorstore/LanceDBVectorStore.d.ts +149 -0
  75. package/dist/vectorstore/LanceDBVectorStore.js +338 -0
  76. package/dist/vectorstore/OpenAIEmbeddings.d.ts +45 -0
  77. package/dist/vectorstore/OpenAIEmbeddings.js +109 -0
  78. package/dist/vectorstore/VectorStore.d.ts +255 -0
  79. package/dist/vectorstore/VectorStore.js +216 -0
  80. package/dist/vectorstore/index.d.ts +28 -0
  81. package/dist/vectorstore/index.js +35 -0
  82. package/dist/viz/VizConfig.d.ts +54 -0
  83. package/dist/viz/VizConfig.js +100 -0
  84. package/dist/viz/VizReporter.d.ts +127 -0
  85. package/dist/viz/VizReporter.js +595 -0
  86. package/dist/viz/index.d.ts +31 -0
  87. package/dist/viz/index.js +51 -0
  88. package/dist/viz/types.d.ts +105 -0
  89. package/dist/viz/types.js +7 -0
  90. package/package.json +109 -0
  91. package/readme.md +1 -0
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Visualization event types and interfaces for agent monitoring.
3
+ * These types define the contract between agention-lib and @agention/viz.
4
+ */
5
+ export type VizVendor = "anthropic" | "openai" | "mistral" | "gemini";
6
+ export type VizEventType = "session.start" | "session.end" | "pipeline.start" | "pipeline.end" | "executor.start" | "executor.end" | "agent.start" | "agent.complete" | "agent.error" | "tool.start" | "tool.complete" | "tool.error" | "message.user" | "message.assistant";
7
+ export type VizExecutorType = "sequential" | "parallel" | "map" | "voting" | "router";
8
+ export type VizStopReason = "end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "error";
9
+ export interface VizTokenUsage {
10
+ input: number;
11
+ output: number;
12
+ total: number;
13
+ }
14
+ export interface VizSource {
15
+ agentId: string;
16
+ agentName: string;
17
+ model: string;
18
+ vendor: VizVendor;
19
+ }
20
+ export interface VizPipelineStructure {
21
+ name: string;
22
+ type: "sequential" | "parallel" | "pipeline" | "map" | "voting" | "router" | "agent";
23
+ children?: VizPipelineStructure[];
24
+ }
25
+ export interface VizEvent {
26
+ eventId: string;
27
+ sessionId: string;
28
+ pipelineId?: string;
29
+ parentEventId?: string;
30
+ timestamp: number;
31
+ durationMs?: number;
32
+ eventType: VizEventType;
33
+ source: VizSource;
34
+ payload: VizEventPayload;
35
+ }
36
+ export interface SessionStartPayload {
37
+ name?: string;
38
+ }
39
+ export interface SessionEndPayload {
40
+ reason: "completed" | "error" | "timeout";
41
+ }
42
+ export interface PipelineStartPayload {
43
+ pipelineName: string;
44
+ nodeType: "pipeline";
45
+ structure: VizPipelineStructure;
46
+ inputPreview: string;
47
+ }
48
+ export interface PipelineEndPayload {
49
+ success: boolean;
50
+ totalTokens: VizTokenUsage;
51
+ nodeCount: number;
52
+ outputPreview?: string;
53
+ error?: string;
54
+ }
55
+ export interface ExecutorStartPayload {
56
+ executorName: string;
57
+ executorType: VizExecutorType;
58
+ childCount: number;
59
+ inputPreview: string;
60
+ }
61
+ export interface ExecutorEndPayload {
62
+ success: boolean;
63
+ totalTokens: VizTokenUsage;
64
+ outputPreview?: string;
65
+ error?: string;
66
+ }
67
+ export interface AgentStartPayload {
68
+ inputPreview: string;
69
+ }
70
+ export interface AgentCompletePayload {
71
+ tokens: VizTokenUsage;
72
+ stopReason: VizStopReason;
73
+ hasToolCalls: boolean;
74
+ toolCallCount: number;
75
+ outputPreview: string;
76
+ }
77
+ export interface AgentErrorPayload {
78
+ errorType: string;
79
+ errorMessage: string;
80
+ retryable: boolean;
81
+ }
82
+ export interface ToolStartPayload {
83
+ toolName: string;
84
+ toolId: string;
85
+ inputSummary: string;
86
+ }
87
+ export interface ToolCompletePayload {
88
+ toolName: string;
89
+ toolId: string;
90
+ success: boolean;
91
+ resultSummary: string;
92
+ }
93
+ export interface ToolErrorPayload {
94
+ toolName: string;
95
+ toolId: string;
96
+ errorMessage: string;
97
+ }
98
+ export interface MessagePayload {
99
+ role: "user" | "assistant";
100
+ contentPreview: string;
101
+ contentLength: number;
102
+ hasToolUse?: boolean;
103
+ }
104
+ export type VizEventPayload = SessionStartPayload | SessionEndPayload | PipelineStartPayload | PipelineEndPayload | ExecutorStartPayload | ExecutorEndPayload | AgentStartPayload | AgentCompletePayload | AgentErrorPayload | ToolStartPayload | ToolCompletePayload | ToolErrorPayload | MessagePayload;
105
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Visualization event types and interfaces for agent monitoring.
4
+ * These types define the contract between agention-lib and @agention/viz.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=types.js.map
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "@agentionai/agents",
3
+ "author": "Laurent Zuijdwijk",
4
+ "version": "0.3.0-beta",
5
+ "description": "Agent Library",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist/**/*.js",
10
+ "dist/**/*.d.ts",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/laurentzuijdwijk/agention-lib.git"
17
+ },
18
+ "scripts": {
19
+ "clean": "rimraf dist",
20
+ "build": "npm run clean && tsc",
21
+ "watch": "tsc -w",
22
+ "test": "jest",
23
+ "test:watch": "jest --watch",
24
+ "lint": "eslint 'lib/**/*.{js,ts}'",
25
+ "lint:fix": "eslint 'src/**/*.{js,ts}' --fix",
26
+ "format": "prettier --write 'src/**/*.{js,ts,json,md}'",
27
+ "prepare": "npm run build",
28
+ "example": "ts-node examples/index.ts",
29
+ "example:watch": "nodemon --watch examples --watch src --ext ts --exec 'ts-node' examples/index.ts",
30
+ "docs": "npm run docs:api && npm run docs:site",
31
+ "docs:api": "typedoc",
32
+ "docs:site": "vitepress build docs",
33
+ "docs:dev": "vitepress dev docs",
34
+ "docs:preview": "vitepress preview docs",
35
+ "publish:npm": "npm publish --registry=https://registry.npmjs.org",
36
+ "publish:github": "npm publish --registry=https://npm.pkg.github.com",
37
+ "publish:all": "npm run publish:npm && npm run publish:github"
38
+ },
39
+ "overrides": {
40
+ "ajv": "^8.17.1",
41
+ "whatwg-url": "^14.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@anthropic-ai/sdk": "^0.71.2",
45
+ "@babel/core": "^7.26.9",
46
+ "@babel/preset-env": "^7.26.9",
47
+ "@babel/preset-typescript": "^7.26.0",
48
+ "@eslint/js": "^9.23.0",
49
+ "@google/generative-ai": "^0.24.1",
50
+ "@lancedb/lancedb": "^0.23.0",
51
+ "@mistralai/mistralai": "^1.13.0",
52
+ "@types/jest": "^29.5.0",
53
+ "@types/node": "^18.15.11",
54
+ "@typescript-eslint/eslint-plugin": "^5.57.1",
55
+ "@typescript-eslint/parser": "^5.57.1",
56
+ "apache-arrow": "^18.1.0",
57
+ "babel-jest": "^29.7.0",
58
+ "docdash": "^2.0.2",
59
+ "eslint": "^8.57.1",
60
+ "eslint-config-prettier": "^8.8.0",
61
+ "eslint-plugin-prettier": "^4.2.1",
62
+ "globals": "^16.0.0",
63
+ "jest": "^29.5.0",
64
+ "jsdoc": "^4.0.4",
65
+ "jsdoc-to-markdown": "^9.1.1",
66
+ "nodemon": "^2.0.22",
67
+ "openai": "^6.16.0",
68
+ "prettier": "^2.8.7",
69
+ "rimraf": "^4.4.1",
70
+ "ts-jest": "^29.2.6",
71
+ "ts-node": "^10.9.1",
72
+ "typedoc": "^0.28.16",
73
+ "typedoc-plugin-markdown": "^4.9.0",
74
+ "typescript": "^5.0.3",
75
+ "typescript-eslint": "^8.28.0",
76
+ "vitepress": "^1.6.4"
77
+ },
78
+ "peerDependencies": {
79
+ "@anthropic-ai/sdk": "^0.71.2",
80
+ "@google/generative-ai": "^0.24.1",
81
+ "@lancedb/lancedb": "^0.23.0",
82
+ "@mistralai/mistralai": "^1.13.0",
83
+ "apache-arrow": "^18.0.0",
84
+ "openai": "^6.16.0"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "@lancedb/lancedb": {
88
+ "optional": true
89
+ },
90
+ "apache-arrow": {
91
+ "optional": true
92
+ },
93
+ "@google/generative-ai": {
94
+ "optional": true
95
+ },
96
+ "@mistralai/mistralai": {
97
+ "optional": true
98
+ },
99
+ "@anthropic-ai/sdk": {
100
+ "optional": true
101
+ },
102
+ "openai": {
103
+ "optional": true
104
+ }
105
+ },
106
+ "dependencies": {
107
+ "tokenx": "^1.2.1"
108
+ }
109
+ }
package/readme.md ADDED
@@ -0,0 +1 @@
1
+ Readme for atomic agents