@cuylabs/agent-core 0.8.0 → 0.10.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 (127) hide show
  1. package/README.md +33 -17
  2. package/dist/chunk-2O4MCSQS.js +780 -0
  3. package/dist/chunk-2TTOLHBT.js +198 -0
  4. package/dist/chunk-5FMSGQVX.js +281 -0
  5. package/dist/chunk-5NVVNXPQ.js +288 -0
  6. package/dist/{chunk-CAA7FHIH.js → chunk-6HZBHFOL.js} +3 -103
  7. package/dist/chunk-CJI7PVS2.js +58 -0
  8. package/dist/{chunk-N6HWIEEA.js → chunk-CMYN2RCB.js} +278 -61
  9. package/dist/chunk-FII65CN7.js +117 -0
  10. package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
  11. package/dist/chunk-I6PKJ7XQ.js +292 -0
  12. package/dist/{chunk-BDBZ3SLK.js → chunk-ICZ66572.js} +48 -4
  13. package/dist/chunk-KYLPMBHD.js +316 -0
  14. package/dist/chunk-MXAP4UG6.js +2956 -0
  15. package/dist/{chunk-RZITT45F.js → chunk-N3VX7FEE.js} +39 -6
  16. package/dist/{chunk-YSLSEQ6B.js → chunk-NDZWXCBZ.js} +218 -95
  17. package/dist/{chunk-P6YF7USR.js → chunk-Q742PSH3.js} +23 -38
  18. package/dist/chunk-QAL3OMI3.js +943 -0
  19. package/dist/{chunk-RFEKJKTO.js → chunk-RN6WZEUF.js} +330 -280
  20. package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
  21. package/dist/chunk-SPBFQXOT.js +0 -0
  22. package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
  23. package/dist/chunk-SSFBF3US.js +602 -0
  24. package/dist/chunk-SZ2XBPTW.js +8 -0
  25. package/dist/chunk-T4UIX5D7.js +115 -0
  26. package/dist/chunk-TIHPYVAJ.js +102 -0
  27. package/dist/{chunk-YUUJK53A.js → chunk-TOTDGK3P.js} +1 -1
  28. package/dist/chunk-V4RFNEET.js +563 -0
  29. package/dist/chunk-VOUEJSW6.js +0 -0
  30. package/dist/{chunk-4BDA7DQY.js → chunk-WBPOZ7CL.js} +673 -273
  31. package/dist/chunk-X4VN4GIJ.js +185 -0
  32. package/dist/dispatch/index.d.ts +93 -0
  33. package/dist/dispatch/index.js +37 -0
  34. package/dist/events/index.d.ts +93 -0
  35. package/dist/events/index.js +6 -0
  36. package/dist/{runtime → execution}/index.d.ts +120 -34
  37. package/dist/{runtime → execution}/index.js +18 -13
  38. package/dist/index-BCqEGzBj.d.ts +251 -0
  39. package/dist/index.d.ts +490 -122
  40. package/dist/index.js +2104 -615
  41. package/dist/{errors → inference/errors}/index.d.ts +2 -2
  42. package/dist/{errors → inference/errors}/index.js +1 -1
  43. package/dist/inference/index.d.ts +16 -23
  44. package/dist/inference/index.js +45 -16
  45. package/dist/instance-BqV2D5pc.d.ts +5723 -0
  46. package/dist/logger/index.d.ts +50 -0
  47. package/dist/logger/index.js +11 -0
  48. package/dist/mcp/index.d.ts +5 -9
  49. package/dist/mcp/index.js +2 -3
  50. package/dist/middleware/index.d.ts +10 -149
  51. package/dist/middleware/index.js +11 -3
  52. package/dist/model-messages-B4nK9D1-.d.ts +13 -0
  53. package/dist/models/index.d.ts +23 -18
  54. package/dist/models/index.js +48 -11
  55. package/dist/models/reasoning/index.d.ts +4 -0
  56. package/dist/{reasoning → models/reasoning}/index.js +3 -3
  57. package/dist/plugin/index.d.ts +458 -0
  58. package/dist/plugin/index.js +32 -0
  59. package/dist/profiles/index.d.ts +55 -0
  60. package/dist/profiles/index.js +30 -0
  61. package/dist/prompt/index.d.ts +8 -12
  62. package/dist/prompt/index.js +3 -2
  63. package/dist/safety/index.d.ts +109 -14
  64. package/dist/safety/index.js +59 -3
  65. package/dist/sandbox/index.d.ts +81 -0
  66. package/dist/sandbox/index.js +1 -0
  67. package/dist/skill/index.d.ts +10 -8
  68. package/dist/skill/index.js +3 -3
  69. package/dist/storage/index.d.ts +12 -4
  70. package/dist/storage/index.js +1 -1
  71. package/dist/subagents/index.d.ts +177 -0
  72. package/dist/subagents/index.js +78 -0
  73. package/dist/team/index.d.ts +544 -0
  74. package/dist/team/index.js +41 -0
  75. package/dist/tool/host/index.d.ts +41 -0
  76. package/dist/tool/host/index.js +10 -0
  77. package/dist/tool/index.d.ts +125 -21
  78. package/dist/tool/index.js +20 -13
  79. package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
  80. package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
  81. package/dist/types-RSCv7nQ4.d.ts +59 -0
  82. package/package.json +58 -53
  83. package/dist/builder-UpOWQMW3.d.ts +0 -34
  84. package/dist/chunk-7MUFEN4K.js +0 -559
  85. package/dist/chunk-7VKQ4WPB.js +0 -73
  86. package/dist/chunk-BFM2YHNM.js +0 -222
  87. package/dist/chunk-DWYX7ASF.js +0 -26
  88. package/dist/chunk-KUVSERLJ.js +0 -50
  89. package/dist/chunk-N7P4PN3O.js +0 -84
  90. package/dist/chunk-SDSBEQXG.js +0 -157
  91. package/dist/chunk-SQU2AJHO.js +0 -305
  92. package/dist/chunk-VBWWUHWI.js +0 -724
  93. package/dist/chunk-VEKUXUVF.js +0 -41
  94. package/dist/chunk-VNQBHPCT.js +0 -398
  95. package/dist/chunk-WWYYNWEW.js +0 -259
  96. package/dist/context/index.d.ts +0 -259
  97. package/dist/context/index.js +0 -26
  98. package/dist/events-CE72w8W4.d.ts +0 -149
  99. package/dist/host/index.d.ts +0 -45
  100. package/dist/host/index.js +0 -8
  101. package/dist/index-CWSchSql.d.ts +0 -1058
  102. package/dist/messages-BYWGn8TY.d.ts +0 -110
  103. package/dist/presets/index.d.ts +0 -53
  104. package/dist/presets/index.js +0 -28
  105. package/dist/reasoning/index.d.ts +0 -116
  106. package/dist/registry-DwYqsQkX.d.ts +0 -164
  107. package/dist/runner-e2YRcUoX.d.ts +0 -786
  108. package/dist/scope/index.d.ts +0 -10
  109. package/dist/scope/index.js +0 -14
  110. package/dist/session-manager-B_CWGTsl.d.ts +0 -274
  111. package/dist/signal/index.d.ts +0 -28
  112. package/dist/signal/index.js +0 -6
  113. package/dist/sub-agent/index.d.ts +0 -23
  114. package/dist/sub-agent/index.js +0 -15
  115. package/dist/tool-BHbyUAy3.d.ts +0 -150
  116. package/dist/tool-DLXAR9Ce.d.ts +0 -145
  117. package/dist/tracker-DClqYqTj.d.ts +0 -96
  118. package/dist/tracking/index.d.ts +0 -111
  119. package/dist/tracking/index.js +0 -20
  120. package/dist/types-BfNpU8NS.d.ts +0 -270
  121. package/dist/types-BnpEOYV-.d.ts +0 -50
  122. package/dist/types-CQL-SvTn.d.ts +0 -29
  123. package/dist/types-CWm-7rvB.d.ts +0 -55
  124. package/dist/types-KKDrdU9Y.d.ts +0 -325
  125. package/dist/types-QA4WhEfz.d.ts +0 -138
  126. package/dist/types-QKHHQLLq.d.ts +0 -336
  127. package/dist/types-YuWV4ag7.d.ts +0 -72
@@ -1,5 +1,5 @@
1
- import { E as ErrorCategory, R as ResponseHeaders } from '../llm-error-D93FNNLY.js';
2
- export { L as LLMError, a as LLMErrorOptions } from '../llm-error-D93FNNLY.js';
1
+ import { E as ErrorCategory, R as ResponseHeaders } from '../../llm-error-D93FNNLY.js';
2
+ export { L as LLMError, a as LLMErrorOptions } from '../../llm-error-D93FNNLY.js';
3
3
 
4
4
  declare function isRetryableCategory(category: ErrorCategory): boolean;
5
5
  declare function parseRetryDelay(headers: ResponseHeaders): number | undefined;
@@ -5,7 +5,7 @@ import {
5
5
  isRetryable,
6
6
  isRetryableCategory,
7
7
  parseRetryDelay
8
- } from "../chunk-RZITT45F.js";
8
+ } from "../../chunk-N3VX7FEE.js";
9
9
  export {
10
10
  LLMError,
11
11
  getErrorCategory,
@@ -1,19 +1,16 @@
1
+ import { T as Tool, a as TurnTrackerContext, H as HumanInputController, b as MiddlewareRunner, A as AgentEvent, c as ToolExecutionMode, I as InferenceStreamInput, d as ModelCallContext, e as AnyInferenceResult } from '../instance-BqV2D5pc.js';
2
+ export { D as DEFAULT_MAX_OUTPUT_TOKENS, f as DEFAULT_RETRY_CONFIG, g as InferenceCustomResult, h as InferenceStepInfo, i as InferenceStreamResult, R as RetryConfig, j as RetryHandlerOptions, k as RetryState, l as calculateDelay, m as createRetryHandler, n as createRetryState, s as shouldRetry, o as sleep, w as withRetry } from '../instance-BqV2D5pc.js';
1
3
  import { ToolSet } from 'ai';
2
- import { T as Tool } from '../tool-BHbyUAy3.js';
3
- import { T as ToolHost } from '../types-CHiPh8U2.js';
4
- import { M as MiddlewareRunner } from '../runner-e2YRcUoX.js';
5
- export { S as StreamChunk } from '../runner-e2YRcUoX.js';
6
- import { d as TurnTrackerContext } from '../tool-DLXAR9Ce.js';
7
- import { T as ToolExecutionMode, I as InferenceStreamInput, A as AnyInferenceResult } from '../types-KKDrdU9Y.js';
8
- export { a as AnyStreamResult, C as CustomStreamProvider, b as CustomStreamResult, D as DEFAULT_MAX_OUTPUT_TOKENS, c as InferenceCustomResult, d as InferenceStepInfo, e as InferenceStreamResult, L as LLMStreamInput, f as LLMStreamResult, O as OUTPUT_TOKEN_MAX, S as StepInfo } from '../types-KKDrdU9Y.js';
4
+ import { T as ToolHost } from '../types-C_LCeYNg.js';
5
+ export { c as convertAgentMessagesToModelMessages } from '../model-messages-B4nK9D1-.js';
6
+ export { E as ErrorCategory, L as LLMError, a as LLMErrorOptions, R as ResponseHeaders } from '../llm-error-D93FNNLY.js';
7
+ export { getErrorCategory, getRetryDelay, isRetryable, isRetryableCategory, parseRetryDelay } from './errors/index.js';
8
+ import '../types-RSCv7nQ4.js';
9
9
  import 'zod';
10
- import '@ai-sdk/provider-utils';
11
- import '../events-CE72w8W4.js';
12
- import '../messages-BYWGn8TY.js';
13
- import '../types-BfNpU8NS.js';
14
- import '../types-CQL-SvTn.js';
15
10
  import '../types-CQaXbRsS.js';
16
- import '../llm-error-D93FNNLY.js';
11
+ import '../types-Bj_J8u_W.js';
12
+ import '@ai-sdk/provider-utils';
13
+ import '../sandbox/index.js';
17
14
 
18
15
  /**
19
16
  * Build a Vercel AI SDK `ToolSet` from `Tool.Info` definitions.
@@ -22,14 +19,18 @@ declare function buildToolSet(options: {
22
19
  tools: Record<string, Tool.Info>;
23
20
  cwd: string;
24
21
  sessionID: string;
22
+ turnID?: string;
25
23
  messageID: string;
26
24
  abort: AbortSignal;
27
25
  turnTracker?: TurnTrackerContext;
28
26
  host?: ToolHost;
27
+ humanInputController?: HumanInputController;
29
28
  middleware?: MiddlewareRunner;
29
+ onEvent?: (event: AgentEvent) => void | Promise<void>;
30
30
  executionMode?: ToolExecutionMode;
31
31
  }): Promise<ToolSet>;
32
32
 
33
+ declare function buildModelCallContext(input: InferenceStreamInput): ModelCallContext;
33
34
  /**
34
35
  * Create a model inference stream with optional retry support.
35
36
  */
@@ -44,19 +45,11 @@ declare function streamOnce(input: InferenceStreamInput): Promise<AnyInferenceRe
44
45
  declare function streamStep(input: InferenceStreamInput): Promise<AnyInferenceResult>;
45
46
 
46
47
  declare const Inference: {
47
- readonly buildToolSet: typeof buildToolSet;
48
- readonly stream: typeof stream;
49
- readonly streamOnce: typeof streamOnce;
50
- readonly streamStep: typeof streamStep;
51
- };
52
- /**
53
- * @deprecated Use `Inference`.
54
- */
55
- declare const LLM: {
48
+ readonly buildModelCallContext: typeof buildModelCallContext;
56
49
  readonly buildToolSet: typeof buildToolSet;
57
50
  readonly stream: typeof stream;
58
51
  readonly streamOnce: typeof streamOnce;
59
52
  readonly streamStep: typeof streamStep;
60
53
  };
61
54
 
62
- export { AnyInferenceResult, Inference, InferenceStreamInput, LLM, ToolExecutionMode, buildToolSet, stream, streamOnce, streamStep };
55
+ export { AnyInferenceResult, Inference, InferenceStreamInput, ToolExecutionMode, buildModelCallContext, buildToolSet, stream, streamOnce, streamStep };
@@ -1,27 +1,56 @@
1
1
  import {
2
- DEFAULT_MAX_OUTPUT_TOKENS,
2
+ DEFAULT_RETRY_CONFIG,
3
3
  Inference,
4
- LLM,
5
- OUTPUT_TOKEN_MAX,
4
+ buildModelCallContext,
6
5
  buildToolSet,
6
+ calculateDelay,
7
+ convertAgentMessagesToModelMessages,
8
+ createRetryHandler,
9
+ createRetryState,
10
+ shouldRetry,
11
+ sleep,
7
12
  stream,
8
13
  streamOnce,
9
- streamStep
10
- } from "../chunk-N6HWIEEA.js";
11
- import "../chunk-7VKQ4WPB.js";
12
- import "../chunk-VEKUXUVF.js";
13
- import "../chunk-SQU2AJHO.js";
14
- import "../chunk-N7P4PN3O.js";
15
- import "../chunk-RZITT45F.js";
16
- import "../chunk-RFEKJKTO.js";
17
- import "../chunk-DWYX7ASF.js";
14
+ streamStep,
15
+ withRetry
16
+ } from "../chunk-CMYN2RCB.js";
17
+ import "../chunk-5NVVNXPQ.js";
18
+ import {
19
+ LLMError,
20
+ getErrorCategory,
21
+ getRetryDelay,
22
+ isRetryable,
23
+ isRetryableCategory,
24
+ parseRetryDelay
25
+ } from "../chunk-N3VX7FEE.js";
26
+ import "../chunk-RN6WZEUF.js";
27
+ import {
28
+ DEFAULT_MAX_TOKENS
29
+ } from "../chunk-CJI7PVS2.js";
30
+ import "../chunk-I6PKJ7XQ.js";
31
+ import "../chunk-V4RFNEET.js";
32
+ import "../chunk-FII65CN7.js";
33
+ import "../chunk-T4UIX5D7.js";
18
34
  export {
19
- DEFAULT_MAX_OUTPUT_TOKENS,
35
+ DEFAULT_MAX_TOKENS as DEFAULT_MAX_OUTPUT_TOKENS,
36
+ DEFAULT_RETRY_CONFIG,
20
37
  Inference,
21
- LLM,
22
- OUTPUT_TOKEN_MAX,
38
+ LLMError,
39
+ buildModelCallContext,
23
40
  buildToolSet,
41
+ calculateDelay,
42
+ convertAgentMessagesToModelMessages,
43
+ createRetryHandler,
44
+ createRetryState,
45
+ getErrorCategory,
46
+ getRetryDelay,
47
+ isRetryable,
48
+ isRetryableCategory,
49
+ parseRetryDelay,
50
+ shouldRetry,
51
+ sleep,
24
52
  stream,
25
53
  streamOnce,
26
- streamStep
54
+ streamStep,
55
+ withRetry
27
56
  };