@inkeep/agents-sdk 0.39.5 → 0.41.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 (59) hide show
  1. package/dist/_virtual/rolldown_runtime.js +7 -0
  2. package/dist/agent.d.ts +186 -0
  3. package/dist/agent.js +720 -0
  4. package/dist/agentFullClient.d.ts +22 -0
  5. package/dist/agentFullClient.js +120 -0
  6. package/dist/artifact-component.d.ts +34 -0
  7. package/dist/artifact-component.js +104 -0
  8. package/dist/builderFunctions.d.ts +283 -0
  9. package/dist/builderFunctions.js +327 -0
  10. package/dist/builderFunctionsExperimental.d.ts +24 -0
  11. package/dist/builderFunctionsExperimental.js +27 -0
  12. package/dist/builders.d.ts +111 -0
  13. package/dist/builders.js +52 -0
  14. package/dist/credential-provider.d.ts +176 -0
  15. package/dist/credential-provider.js +237 -0
  16. package/dist/credential-ref.d.ts +60 -0
  17. package/dist/credential-ref.js +33 -0
  18. package/dist/data-component.d.ts +39 -0
  19. package/dist/data-component.js +109 -0
  20. package/dist/environment-settings.d.ts +27 -0
  21. package/dist/environment-settings.js +41 -0
  22. package/dist/external-agent.d.ts +64 -0
  23. package/dist/external-agent.js +156 -0
  24. package/dist/function-tool.d.ts +37 -0
  25. package/dist/function-tool.js +66 -0
  26. package/dist/index.d.ts +19 -1825
  27. package/dist/index.js +19 -4058
  28. package/dist/module-hosted-tool-manager.d.ts +40 -0
  29. package/dist/module-hosted-tool-manager.js +359 -0
  30. package/dist/project.d.ts +214 -0
  31. package/dist/project.js +615 -0
  32. package/dist/projectFullClient.d.ts +23 -0
  33. package/dist/projectFullClient.js +162 -0
  34. package/dist/runner.d.ts +41 -0
  35. package/dist/runner.js +145 -0
  36. package/dist/status-component.d.ts +22 -0
  37. package/dist/status-component.js +36 -0
  38. package/dist/subAgent.d.ts +52 -0
  39. package/dist/subAgent.js +616 -0
  40. package/dist/telemetry-provider.d.ts +218 -0
  41. package/dist/telemetry-provider.js +390 -0
  42. package/dist/tool.d.ts +53 -0
  43. package/dist/tool.js +130 -0
  44. package/dist/types.d.ts +296 -0
  45. package/dist/types.js +39 -0
  46. package/dist/utils/generateIdFromName.d.ts +9 -0
  47. package/dist/utils/generateIdFromName.js +12 -0
  48. package/dist/utils/getFunctionToolDeps.d.ts +17 -0
  49. package/dist/utils/getFunctionToolDeps.js +131 -0
  50. package/dist/utils/tool-normalization.d.ts +42 -0
  51. package/dist/utils/tool-normalization.js +41 -0
  52. package/dist/utils/validateFunction.d.ts +10 -0
  53. package/dist/utils/validateFunction.js +13 -0
  54. package/package.json +11 -16
  55. package/dist/index.cjs +0 -4147
  56. package/dist/index.d.cts +0 -1825
  57. package/dist/index.d.cts.map +0 -1
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ //#region src/utils/tool-normalization.ts
2
+ /**
3
+ * Type guard to check if a value is an AgentMcpConfig
4
+ */
5
+ function isAgentMcpConfig(value) {
6
+ return value !== null && typeof value === "object" && "server" in value && value.server && typeof value.server === "object";
7
+ }
8
+ /**
9
+ * Type guard to check if a value is a Tool instance
10
+ */
11
+ function isTool(value) {
12
+ return value !== null && typeof value === "object" && "config" in value && (typeof value.getId === "function" || "id" in value);
13
+ }
14
+ /**
15
+ * Type guard to narrow down AgentCanUseType
16
+ */
17
+ function isAgentCanUseType(value) {
18
+ return isAgentMcpConfig(value) || isTool(value);
19
+ }
20
+ /**
21
+ * Safely extracts tool information from AgentCanUseType with proper typing
22
+ */
23
+ function normalizeAgentCanUseType(value, fallbackName) {
24
+ if (isAgentMcpConfig(value)) return {
25
+ tool: value.server,
26
+ toolId: value.server.getId(),
27
+ selectedTools: value.selectedTools,
28
+ headers: value.headers,
29
+ toolPolicies: value.toolPolicies,
30
+ isWrapped: true
31
+ };
32
+ if (isTool(value)) return {
33
+ tool: value,
34
+ toolId: value.getId?.() || value.id || fallbackName || "unknown",
35
+ isWrapped: false
36
+ };
37
+ throw new Error(`Invalid AgentCanUseType: expected Tool or AgentMcpConfig, got ${typeof value}`);
38
+ }
39
+
40
+ //#endregion
41
+ export { isAgentCanUseType, isAgentMcpConfig, isTool, normalizeAgentCanUseType };
@@ -0,0 +1,10 @@
1
+ //#region src/utils/validateFunction.d.ts
2
+ /**
3
+ * Validates that a value is a function
4
+ * @param value - The value to check
5
+ * @param name - The name of the parameter (for error messages)
6
+ * @throws {Error} If the value is not a function
7
+ */
8
+ declare function validateFunction(value: unknown, name: string): void;
9
+ //#endregion
10
+ export { validateFunction };
@@ -0,0 +1,13 @@
1
+ //#region src/utils/validateFunction.ts
2
+ /**
3
+ * Validates that a value is a function
4
+ * @param value - The value to check
5
+ * @param name - The name of the parameter (for error messages)
6
+ * @throws {Error} If the value is not a function
7
+ */
8
+ function validateFunction(value, name) {
9
+ if (typeof value !== "function") throw new Error(`${name} must be a function`);
10
+ }
11
+
12
+ //#endregion
13
+ export { validateFunction };
package/package.json CHANGED
@@ -1,26 +1,28 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.39.5",
3
+ "version": "0.41.0",
4
4
  "description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
5
- "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
6
  "type": "module",
7
- "clean-package": "./clean-package.config.json",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
8
14
  "dependencies": {
9
15
  "@yarnpkg/lockfile": "^1.1.0",
10
- "esbuild": "^0.25.10",
11
16
  "js-yaml": "^4.1.0",
12
- "nanoid": "^5.1.5",
13
17
  "typescript": "^5.3.3",
14
18
  "zod": "^4.1.11",
15
- "@inkeep/agents-core": "^0.39.5"
19
+ "@inkeep/agents-core": "^0.41.0"
16
20
  },
17
21
  "devDependencies": {
18
22
  "@types/js-yaml": "^4.0.9",
19
23
  "@types/node": "^20.11.24",
20
24
  "@types/yarnpkg__lockfile": "^1.1.0",
21
25
  "@vitest/coverage-v8": "^3.2.4",
22
- "clean-package": "^2.2.0",
23
- "tsx": "^4.7.1",
24
26
  "vitest": "^3.2.4"
25
27
  },
26
28
  "engines": {
@@ -50,15 +52,8 @@
50
52
  ],
51
53
  "author": "Inkeep",
52
54
  "license": "SEE LICENSE IN LICENSE.md",
53
- "types": "dist/index.d.ts",
54
- "exports": {
55
- ".": {
56
- "types": "./dist/index.d.ts",
57
- "import": "./dist/index.js"
58
- },
59
- "./package.json": "./package.json"
60
- },
61
55
  "scripts": {
56
+ "knip": "knip --directory ../.. --workspace packages/agents-sdk --config packages/agents-sdk/knip.config.ts --dependencies",
62
57
  "build": "tsdown",
63
58
  "test": "ENVIRONMENT=test vitest --run",
64
59
  "test:watch": "ENVIRONMENT=test vitest",