@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
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # @cuylabs/agent-core
2
2
 
3
- Embeddable AI agent infrastructure built on the AI SDK.
3
+ Composable AI agent harness with pluggable execution control.
4
4
 
5
- `@cuylabs/agent-core` is the in-process execution layer in this workspace. It
6
- owns the `Agent` API, tool and model execution semantics, middleware, sessions,
7
- prompt construction, tracing, and the reusable task/turn/workflow primitives
8
- that higher layers build on.
5
+ `@cuylabs/agent-core` is the in-process execution kernel for AI agents. It owns
6
+ the `Agent` API, streaming execution, tool and model semantics, middleware and
7
+ lifecycle hooks, sessions, prompt construction, tracing, and the reusable
8
+ task/turn/workflow primitives that runtime packages build on for durability,
9
+ hosting, and scheduling.
9
10
 
10
11
  ## Package Boundary
11
12
 
@@ -15,15 +16,20 @@ Use `@cuylabs/agent-core` when you want:
15
16
  - tool definition and execution
16
17
  - model hooks, tool hooks, and lifecycle middleware
17
18
  - sessions, storage, branching, and prompt construction
18
- - tracing, MCP, skills, presets, and sub-agents
19
- - runtime-facing task/turn/workflow helpers from `@cuylabs/agent-core/runtime`
19
+ - tracing, MCP, skills, profiles, and dispatch-based child-agent tools
20
+ - execution-facing task/turn/workflow helpers from `@cuylabs/agent-core/execution`
20
21
 
21
22
  This package does not own outer orchestration or hosting:
22
23
 
23
- - use `@cuylabs/agent-runtime` for jobs, schedules, retries, and workload dispatch
24
- - use `@cuylabs/agent-runtime-dapr` for Dapr-backed durability and workflow hosting
24
+ - use `@cuylabs/agent-runtime` for the backend-agnostic orchestration contract — it defines the interfaces for scheduling, dispatch, workload lifecycle, and execution stores that runtime backends implement
25
+ - use `@cuylabs/agent-runtime-dapr` for a concrete backend that implements those contracts with Dapr workflows, state stores, and pub/sub
26
+ - use `@cuylabs/agent-server` for a transport-neutral local server with session management, turn execution, and streamed event fanout over WebSocket / stdio
25
27
  - use `@cuylabs/agent-http` for an AI SDK chat-stream HTTP adapter
26
28
 
29
+ `@cuylabs/agent-core` includes the default local execution host. Non-local
30
+ tool environments should live in separate packages so the execution semantics
31
+ and host implementations stay decoupled.
32
+
27
33
  ## Core Capabilities
28
34
 
29
35
  - Streaming agent execution with structured events
@@ -31,9 +37,11 @@ This package does not own outer orchestration or hosting:
31
37
  - Middleware for model input/output, stream chunks, tool calls, and lifecycle hooks
32
38
  - Session persistence with branching support
33
39
  - Prompt pipeline and dynamic prompt sections
34
- - Skills and built-in sub-agent delegation
40
+ - Skills and built-in dispatch-based child-agent delegation
35
41
  - OpenTelemetry tracing
36
42
  - MCP integration
43
+ - EventBus — pluggable pub/sub with history replay and backpressure
44
+ - AgentSignal — typed inter-agent signalling within teams
37
45
  - Runtime-facing task, turn, and workflow primitives for durable adapters
38
46
 
39
47
  ## Installation
@@ -110,17 +118,23 @@ structure when you want clearer boundaries:
110
118
  import { createAgent, Tool } from "@cuylabs/agent-core";
111
119
  import type { AgentMiddleware } from "@cuylabs/agent-core/middleware";
112
120
  import { Inference } from "@cuylabs/agent-core/inference";
113
- import { createAgentTaskRunner } from "@cuylabs/agent-core/runtime";
114
- import { localHost } from "@cuylabs/agent-core/host";
121
+ import { createAgentTaskRunner } from "@cuylabs/agent-core/execution";
122
+ import { localHost } from "@cuylabs/agent-core/tool/host";
115
123
  import { createPromptBuilder } from "@cuylabs/agent-core/prompt";
116
124
  import { withinScope } from "@cuylabs/agent-core/scope";
117
125
  import { createSkillRegistry } from "@cuylabs/agent-core/skill";
118
- import { createSubAgentTools } from "@cuylabs/agent-core/sub-agent";
126
+ import { createSubAgentTools } from "@cuylabs/agent-core/subagents";
119
127
  import { createMCPManager } from "@cuylabs/agent-core/mcp";
128
+ import { createEventBus } from "@cuylabs/agent-core/events";
129
+ import type { AgentSignal } from "@cuylabs/agent-core/signal";
120
130
  ```
121
131
 
122
132
  Additional focused entrypoints are available for `tool`, `tracking`, `storage`,
123
- `context`, `reasoning`, `models`, `mcp`, `inference`, `host`, and `scope`.
133
+ `reasoning`, `models`, `mcp`, `inference`, `tool/host`, `scope`, `dispatch`,
134
+ `subagents`, `events`, and `signal`.
135
+
136
+ For non-local tool execution environments, install a dedicated host package and
137
+ pass its host instance through the same `host` option.
124
138
 
125
139
  ## Relationship To The Runtime Packages
126
140
 
@@ -150,10 +164,12 @@ Start with the package docs:
150
164
 
151
165
  - [docs/README.md](./docs/README.md) for the learning path
152
166
  - [docs/agent.md](./docs/agent.md) for the main `Agent` API
153
- - [docs/middleware.md](./docs/middleware.md) for model/tool hooks and lifecycle middleware
167
+ - [docs/middleware/](./docs/middleware/README.md) for model/tool hooks and lifecycle middleware
154
168
  - [docs/scope.md](./docs/scope.md) for nested execution lineage and scope snapshots
155
- - [docs/tools.md](./docs/tools.md) for tool definition and execution
156
- - [docs/runtime-integration.md](./docs/runtime-integration.md) for task/turn/workflow runtime integration
169
+ - [docs/tools/](./docs/tools/README.md) for tool definition and execution
170
+ - [docs/execution/README.md](./docs/execution/README.md) for task/turn/workflow execution integration
171
+ - [docs/events.md](./docs/events.md) for the EventBus pub/sub interface
172
+ - [docs/signal.md](./docs/signal.md) for inter-agent signalling
157
173
  - [docs/tracing.md](./docs/tracing.md) for tracing setup
158
174
 
159
175
  Runnable examples live in [examples/README.md](./examples/README.md).