@inkeep/agents-sdk 0.0.0-dev-20250910233133

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 (59) hide show
  1. package/LICENSE.md +56 -0
  2. package/README.md +53 -0
  3. package/dist/__tests__/utils/testTenant.d.ts +7 -0
  4. package/dist/__tests__/utils/testTenant.d.ts.map +1 -0
  5. package/dist/__tests__/utils/testTenant.js +10 -0
  6. package/dist/__tests__/utils/testTenant.js.map +1 -0
  7. package/dist/agent.d.ts +39 -0
  8. package/dist/agent.d.ts.map +1 -0
  9. package/dist/agent.js +513 -0
  10. package/dist/agent.js.map +1 -0
  11. package/dist/artifact-component.d.ts +27 -0
  12. package/dist/artifact-component.d.ts.map +1 -0
  13. package/dist/artifact-component.js +118 -0
  14. package/dist/artifact-component.js.map +1 -0
  15. package/dist/builders.d.ts +211 -0
  16. package/dist/builders.d.ts.map +1 -0
  17. package/dist/builders.js +244 -0
  18. package/dist/builders.js.map +1 -0
  19. package/dist/data-component.d.ts +25 -0
  20. package/dist/data-component.d.ts.map +1 -0
  21. package/dist/data-component.js +114 -0
  22. package/dist/data-component.js.map +1 -0
  23. package/dist/environment-settings.d.ts +28 -0
  24. package/dist/environment-settings.d.ts.map +1 -0
  25. package/dist/environment-settings.js +79 -0
  26. package/dist/environment-settings.js.map +1 -0
  27. package/dist/externalAgent.d.ts +58 -0
  28. package/dist/externalAgent.d.ts.map +1 -0
  29. package/dist/externalAgent.js +163 -0
  30. package/dist/externalAgent.js.map +1 -0
  31. package/dist/graph.d.ts +200 -0
  32. package/dist/graph.d.ts.map +1 -0
  33. package/dist/graph.js +1322 -0
  34. package/dist/graph.js.map +1 -0
  35. package/dist/graphFullClient.d.ts +22 -0
  36. package/dist/graphFullClient.d.ts.map +1 -0
  37. package/dist/graphFullClient.js +189 -0
  38. package/dist/graphFullClient.js.map +1 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +10 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/module-hosted-tool-manager.d.ts +37 -0
  44. package/dist/module-hosted-tool-manager.d.ts.map +1 -0
  45. package/dist/module-hosted-tool-manager.js +378 -0
  46. package/dist/module-hosted-tool-manager.js.map +1 -0
  47. package/dist/runner.d.ts +38 -0
  48. package/dist/runner.d.ts.map +1 -0
  49. package/dist/runner.js +164 -0
  50. package/dist/runner.js.map +1 -0
  51. package/dist/tool.d.ts +29 -0
  52. package/dist/tool.d.ts.map +1 -0
  53. package/dist/tool.js +122 -0
  54. package/dist/tool.js.map +1 -0
  55. package/dist/types.d.ts +286 -0
  56. package/dist/types.d.ts.map +1 -0
  57. package/dist/types.js +39 -0
  58. package/dist/types.js.map +1 -0
  59. package/package.json +62 -0
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,53 @@
1
+ # @inkeep/agents-sdk
2
+
3
+ SDK for building and managing agents in the Inkeep Agent Framework.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @inkeep/agents-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { agent, agentGraph, tool } from '@inkeep/agents-sdk';
15
+
16
+ // Create an agent
17
+ const myAgent = agent({
18
+ id: 'my-agent',
19
+ name: 'My Agent',
20
+ description: 'A helpful agent',
21
+ instructions: 'You are a helpful assistant.',
22
+ });
23
+
24
+ // Create a graph
25
+ export const graph = agentGraph({
26
+ id: 'my-graph',
27
+ name: 'My Graph',
28
+ description: 'My agent graph',
29
+ defaultAgent: myAgent,
30
+ agents: [myAgent],
31
+ });
32
+ ```
33
+
34
+ ## API Reference
35
+
36
+ ### Builders
37
+
38
+ - `agent()` - Create an agent configuration
39
+ - `agentGraph()` - Create an agent graph
40
+ - `tool()` - Create a tool configuration
41
+ - `mcpServer()` - Create an MCP server configuration
42
+ - `mcpTool()` - Create an MCP tool
43
+ - `dataComponent()` - Create a data component
44
+ - `artifactComponent()` - Create an artifact component
45
+ - `externalAgent()` - Create an external agent reference
46
+ - `transfer()` - Create a transfer configuration
47
+
48
+ ### Classes
49
+
50
+ - `Agent` - Agent class for runtime operations
51
+ - `AgentGraph` - Graph management and operations
52
+ - `Tool` - Base tool class
53
+ - `Runner` - Graph execution runner
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a unique tenant ID for testing to avoid conflicts
3
+ * @param prefix Optional prefix for the tenant ID
4
+ * @returns A unique tenant ID
5
+ */
6
+ export declare function createTestTenantId(prefix?: string): string;
7
+ //# sourceMappingURL=testTenant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testTenant.d.ts","sourceRoot":"","sources":["../../../src/__tests__/utils/testTenant.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,10 @@
1
+ import { nanoid } from "nanoid";
2
+ /**
3
+ * Creates a unique tenant ID for testing to avoid conflicts
4
+ * @param prefix Optional prefix for the tenant ID
5
+ * @returns A unique tenant ID
6
+ */
7
+ export function createTestTenantId(prefix = "test") {
8
+ return `${prefix}-${nanoid(8)}`;
9
+ }
10
+ //# sourceMappingURL=testTenant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testTenant.js","sourceRoot":"","sources":["../../../src/__tests__/utils/testTenant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAM,GAAG,MAAM;IACjD,OAAO,GAAG,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type ArtifactComponentApiInsert, type DataComponentApiInsert } from "@inkeep/agents-core";
2
+ import type { AgentConfig, AgentInterface, AllAgentInterface } from "./types";
3
+ export declare class Agent implements AgentInterface {
4
+ config: AgentConfig;
5
+ readonly type: "internal";
6
+ private baseURL;
7
+ private tenantId;
8
+ private projectId;
9
+ private initialized;
10
+ constructor(config: AgentConfig);
11
+ getId(): string;
12
+ getName(): string;
13
+ getInstructions(): string;
14
+ getTools(): Record<string, unknown>;
15
+ getModels(): typeof this.config.models;
16
+ setModels(models: typeof this.config.models): void;
17
+ getTransfers(): AgentInterface[];
18
+ getDelegates(): AllAgentInterface[];
19
+ getDataComponents(): DataComponentApiInsert[];
20
+ getArtifactComponents(): ArtifactComponentApiInsert[];
21
+ addTool(_name: string, tool: unknown): void;
22
+ addTransfer(...agents: AgentInterface[]): void;
23
+ addDelegate(...agents: AllAgentInterface[]): void;
24
+ init(): Promise<void>;
25
+ private upsertAgent;
26
+ private saveToolsAndRelations;
27
+ private saveDataComponents;
28
+ private saveArtifactComponents;
29
+ private loadDataComponents;
30
+ private loadArtifactComponents;
31
+ private createTool;
32
+ private createDataComponent;
33
+ private createArtifactComponent;
34
+ private createAgentDataComponentRelation;
35
+ private createAgentArtifactComponentRelation;
36
+ private createAgentToolRelation;
37
+ }
38
+ export declare function agent(config: AgentConfig): Agent;
39
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,0BAA0B,EAG/B,KAAK,sBAAsB,EAE3B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAY9E,qBAAa,KAAM,YAAW,cAAc;IACpC,MAAM,EAAE,WAAW,CAAC;IAC3B,SAAgB,IAAI,EAAG,UAAU,CAAU;IAC3C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAS;gBAChB,MAAM,EAAE,WAAW;IAiB/B,KAAK,IAAI,MAAM;IAKf,OAAO,IAAI,MAAM;IAIjB,eAAe,IAAI,MAAM;IAIzB,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAuBnC,SAAS,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;IAItC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI;IAIlD,YAAY,IAAI,cAAc,EAAE;IAMhC,YAAY,IAAI,iBAAiB,EAAE;IAMnC,iBAAiB,IAAI,sBAAsB,EAAE;IAI7C,qBAAqB,IAAI,0BAA0B,EAAE;IAIrD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAM3C,WAAW,CAAC,GAAG,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI;IAW9C,WAAW,CAAC,GAAG,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI;IAU3C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAyCb,WAAW;YA8EX,qBAAqB;YAqBrB,kBAAkB;YAalB,sBAAsB;YAatB,kBAAkB;YAgElB,sBAAsB;YAgEtB,UAAU;YA+EV,mBAAmB;YAwCnB,uBAAuB;YAyCvB,gCAAgC;YAkChC,oCAAoC;YAkCpC,uBAAuB;CA0BrC;AAGD,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAEhD"}