@inkeep/agents-run-api 0.0.0-chat-to-edit-20251119071712

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.
package/LICENSE.md ADDED
@@ -0,0 +1,56 @@
1
+ <!--
2
+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
3
+ Source: ./LICENSE.md
4
+ This file is automatically copied from the root LICENSE.md during build.
5
+ Any changes should be made to the root LICENSE.md file.
6
+ -->
7
+
8
+ # Inkeep SDK – Elastic License 2.0 with Supplemental Terms
9
+
10
+ NOTE: The Inkeep SDK is licensed under the Elastic License 2.0 (ELv2), subject to Supplemental Terms included in [SUPPLEMENTAL_TERMS.md](SUPPLEMENTAL_TERMS.md). In the event of conflict, the Supplemental Terms control.
11
+
12
+ # Elastic License 2.0
13
+
14
+ ## Acceptance
15
+ By using the software, you agree to all of the terms and conditions below.
16
+
17
+ ## Copyright License
18
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.
19
+
20
+ ## Limitations
21
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
22
+
23
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
24
+
25
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
26
+
27
+ ## Patents
28
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
29
+
30
+ ## Notices
31
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
32
+
33
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
34
+
35
+ ## No Other Rights
36
+ These terms do not imply any licenses other than those expressly granted in these terms.
37
+
38
+ ## Termination
39
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
40
+
41
+ ## No Liability
42
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
43
+
44
+ ## Definitions
45
+ The **licensor** is the entity offering these terms, and the **software** is the software the licensor makes available under these terms, including any portion of it.
46
+
47
+ **you** refers to the individual or entity agreeing to these terms.
48
+
49
+ **your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
50
+
51
+ **your licenses** are all the licenses granted to you for the software under these terms.
52
+
53
+ **use** means anything you do with the software requiring one of your licenses.
54
+
55
+ **trademark** means trademarks, service marks, and similar rights.
56
+
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # Inkeep Agents Run API
2
+
3
+ The Agents Run API is responsible for runtime agent operations, including Agent-to-Agent (A2A) communication, chat completions, and MCP (Model Context Protocol) tool integrations.
4
+
5
+ ## Overview
6
+
7
+ This API handles the execution layer of the Inkeep Agent Framework:
8
+ - **A2A Communication**: JSON-RPC based agent-to-agent communication following Google's A2A specification
9
+ - **Chat Completions**: OpenAI-compatible chat API with multi-agent orchestration
10
+ - **MCP Integration**: Model Context Protocol tools and external integrations
11
+ - **Task Execution**: Real-time task processing and delegation workflows
12
+
13
+ ## Architecture
14
+
15
+ ### Core Components
16
+
17
+ - **A2A Protocol**: Agent communication via JSON-RPC methods (`tasks/send`, `tasks/get`, `tasks/cancel`)
18
+ - **Chat API**: OpenAI-compatible endpoints with agent routing and context preservation
19
+ - **MCP Tools**: Dynamic tool discovery and execution from multiple transport types (stdio, SSE, HTTP)
20
+ - **Task Management**: Hierarchical task execution with parent-child relationships
21
+
22
+ ### Key Features
23
+
24
+ - **Context Preservation**: Maintains conversation state across agent transfers and delegations
25
+ - **Multi-Agent Orchestration**: Hub-and-spoke and graph-based agent networks
26
+ - **Real-time Communication**: WebSocket and HTTP-based agent interactions
27
+ - **Tool Health Monitoring**: Automated health checks for external MCP tools
28
+
29
+ ## Development
30
+
31
+ ### Setup
32
+ ```bash
33
+ cd agents-run-api
34
+ pnpm install
35
+ ```
36
+
37
+ If you do not have the database setup, run migrations from the monorepo root:
38
+ ```bash
39
+ pnpm db:migrate
40
+ ```
41
+
42
+
43
+ ### Environment Variables
44
+ ```env
45
+ ENVIRONMENT=development|production|test
46
+ PORT=3003
47
+ DATABASE_URL=postgresql://dbuser:secretpassword@database.server.com:3211/mydb
48
+ ANTHROPIC_API_KEY=required
49
+ OPENAI_API_KEY=optional
50
+ LOG_LEVEL=debug|info|warn|error
51
+ ```
52
+
53
+ ### Development Commands
54
+ ```bash
55
+ pnpm dev # Start development server
56
+ pnpm test # Run test suite
57
+ pnpm test:coverage # Run tests with coverage
58
+ pnpm build # Build for production
59
+ pnpm lint # Run linting
60
+ pnpm format # Format code
61
+ ```
62
+
63
+ ### Testing
64
+ All tests are located in `src/__tests__/` and use Vitest with 60-second timeouts for A2A interactions.
65
+
66
+ ```bash
67
+ pnpm test # Run all tests
68
+ pnpm test:coverage # Run with coverage report
69
+ pnpm test src/__tests__/a2a/ # Run A2A-specific tests
70
+ ```
71
+
72
+ ## Configuration
73
+
74
+ The API uses environment-based configuration with defaults for local development. Key configuration areas:
75
+
76
+ - **Database**: PostgreSQL connection via `DATABASE_URL`
77
+ - **AI Models**: Anthropic and OpenAI API keys
78
+ - **Observability**: OpenTelemetry tracing support
79
+ - **CORS**: Configurable for web clients
80
+
81
+ ## Integration
82
+
83
+ ### With Agents Manage API
84
+ The Agents Run API reads agent configurations and relationships created by the Agents Manage API but doesn't modify them during runtime.
85
+
86
+ ### With MCP Tools
87
+ Supports multiple MCP transport types:
88
+ - **stdio**: Local process-based tools
89
+ - **SSE**: Server-sent events for streaming tools
90
+ - **HTTP**: REST-based tool integrations
91
+
92
+ ### With Agent Builder
93
+ Provides runtime execution for agents configured via the Agent Builder UI.
94
+
95
+ ## Observability
96
+
97
+ - **Structured Logging**: JSON-formatted logs with correlation IDs
98
+ - **OpenTelemetry**: Distributed tracing for agent interactions
99
+ - **Health Checks**: Endpoint monitoring and tool availability
100
+ - **Performance Metrics**: Request timing and success rates
101
+
102
+ ## Error Handling
103
+
104
+ The API implements comprehensive error handling:
105
+ - **Validation Errors**: Request schema validation
106
+ - **Agent Errors**: Agent execution failures and timeouts
107
+ - **Tool Errors**: MCP tool failures and recovery
108
+ - **Network Errors**: Resilient communication patterns
109
+
110
+ ## Security
111
+
112
+ - **API Key Authentication**: Configurable authentication methods
113
+ - **Input Validation**: Request sanitization and type checking
114
+ - **CORS**: Configurable cross-origin policies
115
+ - **Rate Limiting**: Configurable request throttling
@@ -0,0 +1,40 @@
1
+ <!--
2
+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
3
+ Source: ./SUPPLEMENTAL_TERMS.md
4
+ This file is automatically copied from the root SUPPLEMENTAL_TERMS.md during build.
5
+ Any changes should be made to the root SUPPLEMENTAL_TERMS.md file.
6
+ -->
7
+
8
+ # Inkeep SDK – Elastic License 2.0 with Supplemental Terms
9
+
10
+ The Inkeep [SDK] (the "Software") is licensed under the Elastic License 2.0 ("ELv2"), available at [https://www.elastic.co/licensing/elastic-license](https://www.elastic.co/licensing/elastic-license), subject to the supplemental terms below. By using the Software, you, your company, and your licensees agree to both ELv2 and these Supplemental Terms – for purposes of these Supplemental Terms, references to "you" have the same meaning as in ELv2 and include your company and contractors acting on your behalf. In the event of conflict, these Supplemental Terms control.
11
+
12
+ Any copy or redistribution of the Software must include both the ELv2 license reference and these Supplemental Terms.
13
+
14
+ ## 1. Restrictions
15
+
16
+ ### 1.1
17
+ You may not use the Software, directly or indirectly, to offer, enable, operate, or provide any Agent Builder.
18
+
19
+ ### 1.2
20
+ You may not repackage, rebrand, or otherwise expose the Software's agent-creation or orchestration functionality for third-party use, including in specialized or verticalized offerings that present substantially similar functionality to the Software.
21
+
22
+ ### 1.3
23
+ For clarity, the foregoing restrictions do not prohibit your use of the Software as Embedded Assistants or Professional Services, provided neither allow third parties to create, configure, train, orchestrate, deploy, or manage their own agents or agent workflows.
24
+
25
+ ## 2. Definitions
26
+
27
+ ### 2.1 Inkeep
28
+ **"Inkeep"** means Inkeep, Inc., a Delaware corporation with principal offices at 169 Madison Ave, Ste 2544, New York, NY, 10016, the licensor (as defined in ELv2) of the Software.
29
+
30
+ ### 2.2 Agent Builder
31
+ **"Agent Builder"** means any hosted or on-premise product, platform, UI or API that allows third parties (e.g., customers, developers, or community users other than your personnel) to create, configure, compose, train, orchestrate, deploy, or manage their own Agents using the Software, or that otherwise exposes a substantial set of the Agent-creation and orchestration functionality of the Software.
32
+
33
+ ### 2.3 Agents
34
+ **"Agents"** means autonomous, semi-autonomous, or automated systems — including assistants, copilots, workflows, orchestrations, or other systems powered by or incorporating artificial intelligence, machine learning, large language models, or related technologies.
35
+
36
+ ### 2.4 Embedded Assistant
37
+ **"Embedded Assistant"** means embedding the Software in your own products or services to power a specific assistant/copilot/agent experience for you or your end users (e.g., a support bot in your app or an internal helpdesk agent), where end users do not receive access to any substantial set of the Software's agent-creation or orchestration features.
38
+
39
+ ### 2.5 Professional Services
40
+ **"Professional Services"** means using the Software to deliver a bespoke solution to a single client where only your personnel operate the Software, the client receives access solely to the resulting assistant within the client's environment and not to the agent-creation/orchestration features of the Software, and no multi-tenant or self-service builder is provided.