@cicctencent/agent-core 0.1.12 → 0.1.14

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 (121) hide show
  1. package/dist/cjs/a2a/client.d.ts +5 -3
  2. package/dist/cjs/a2a/client.d.ts.map +1 -1
  3. package/dist/cjs/a2a/client.js +36 -55
  4. package/dist/cjs/a2a/client.js.map +1 -1
  5. package/dist/cjs/a2a/index.d.ts +4 -4
  6. package/dist/cjs/a2a/runner.d.ts +3 -3
  7. package/dist/cjs/a2a/runner.d.ts.map +1 -1
  8. package/dist/cjs/a2a/runner.js +12 -32
  9. package/dist/cjs/a2a/runner.js.map +1 -1
  10. package/dist/cjs/agent/engine.d.ts +4 -4
  11. package/dist/cjs/agent/engine.d.ts.map +1 -1
  12. package/dist/cjs/agent/engine.js +9 -2
  13. package/dist/cjs/agent/engine.js.map +1 -1
  14. package/dist/cjs/agent/history-manager.d.ts +2 -2
  15. package/dist/cjs/agent/llm-caller.d.ts +6 -6
  16. package/dist/cjs/agent/tool-executor.d.ts +7 -7
  17. package/dist/cjs/agent/types.d.ts +9 -9
  18. package/dist/cjs/context/collector.d.ts +1 -1
  19. package/dist/cjs/context/manager.d.ts +2 -2
  20. package/dist/cjs/context/manager.d.ts.map +1 -1
  21. package/dist/cjs/context/manager.js +4 -2
  22. package/dist/cjs/context/manager.js.map +1 -1
  23. package/dist/cjs/context/types.d.ts +3 -3
  24. package/dist/cjs/context/types.d.ts.map +1 -1
  25. package/dist/cjs/hooks/types.d.ts +2 -2
  26. package/dist/cjs/index.d.ts +76 -76
  27. package/dist/cjs/llm/anthropic-provider.d.ts +1 -1
  28. package/dist/cjs/llm/factory.d.ts +1 -1
  29. package/dist/cjs/llm/ollama-provider.d.ts +2 -2
  30. package/dist/cjs/llm/openai-provider.d.ts +1 -1
  31. package/dist/cjs/llm/provider.d.ts +6 -6
  32. package/dist/cjs/llm/types.d.ts +2 -2
  33. package/dist/cjs/mcp/base-client.d.ts +2 -2
  34. package/dist/cjs/mcp/client.d.ts +2 -2
  35. package/dist/cjs/mcp/factory.d.ts +1 -1
  36. package/dist/cjs/mcp/http-client.d.ts +2 -2
  37. package/dist/cjs/mcp/stdio-client.d.ts +2 -2
  38. package/dist/cjs/mcp/types.d.ts +2 -2
  39. package/dist/cjs/memory/extractor.d.ts +2 -2
  40. package/dist/cjs/memory/persona.d.ts +2 -2
  41. package/dist/cjs/memory/pipeline.d.ts +4 -4
  42. package/dist/cjs/memory/recall.d.ts +1 -1
  43. package/dist/cjs/memory/scene.d.ts +1 -1
  44. package/dist/cjs/middleware/audit-log.d.ts +2 -2
  45. package/dist/cjs/middleware/timing.d.ts +2 -2
  46. package/dist/cjs/middleware/tool-guard.d.ts +2 -2
  47. package/dist/cjs/middleware/types.d.ts +1 -1
  48. package/dist/cjs/pool/engine-pool.d.ts +1 -1
  49. package/dist/cjs/runtime/run-registry.d.ts +1 -1
  50. package/dist/cjs/sandbox/types.d.ts +2 -2
  51. package/dist/cjs/security/guard.d.ts +1 -1
  52. package/dist/cjs/security/permission.d.ts +1 -1
  53. package/dist/cjs/skill/manager.d.ts +1 -1
  54. package/dist/cjs/skill/router.d.ts +2 -2
  55. package/dist/cjs/store/file-tool-result-store.d.ts +1 -1
  56. package/dist/cjs/tool/delegate.d.ts +2 -2
  57. package/dist/cjs/tool/registry.d.ts +1 -1
  58. package/dist/cjs/tool/types.d.ts +1 -1
  59. package/dist/cjs/utils/event-collector.d.ts +1 -1
  60. package/dist/cjs/utils/token-counter.d.ts +1 -1
  61. package/dist/esm/a2a/client.d.ts +5 -3
  62. package/dist/esm/a2a/client.d.ts.map +1 -1
  63. package/dist/esm/a2a/client.js +36 -55
  64. package/dist/esm/a2a/client.js.map +1 -1
  65. package/dist/esm/a2a/index.d.ts +4 -4
  66. package/dist/esm/a2a/runner.d.ts +3 -3
  67. package/dist/esm/a2a/runner.d.ts.map +1 -1
  68. package/dist/esm/a2a/runner.js +12 -32
  69. package/dist/esm/a2a/runner.js.map +1 -1
  70. package/dist/esm/agent/engine.d.ts +4 -4
  71. package/dist/esm/agent/engine.d.ts.map +1 -1
  72. package/dist/esm/agent/engine.js +9 -2
  73. package/dist/esm/agent/engine.js.map +1 -1
  74. package/dist/esm/agent/history-manager.d.ts +2 -2
  75. package/dist/esm/agent/llm-caller.d.ts +6 -6
  76. package/dist/esm/agent/tool-executor.d.ts +7 -7
  77. package/dist/esm/agent/types.d.ts +9 -9
  78. package/dist/esm/context/collector.d.ts +1 -1
  79. package/dist/esm/context/manager.d.ts +2 -2
  80. package/dist/esm/context/manager.d.ts.map +1 -1
  81. package/dist/esm/context/manager.js +4 -2
  82. package/dist/esm/context/manager.js.map +1 -1
  83. package/dist/esm/context/types.d.ts +3 -3
  84. package/dist/esm/context/types.d.ts.map +1 -1
  85. package/dist/esm/hooks/types.d.ts +2 -2
  86. package/dist/esm/index.d.ts +76 -76
  87. package/dist/esm/llm/anthropic-provider.d.ts +1 -1
  88. package/dist/esm/llm/factory.d.ts +1 -1
  89. package/dist/esm/llm/ollama-provider.d.ts +2 -2
  90. package/dist/esm/llm/openai-provider.d.ts +1 -1
  91. package/dist/esm/llm/provider.d.ts +6 -6
  92. package/dist/esm/llm/types.d.ts +2 -2
  93. package/dist/esm/mcp/base-client.d.ts +2 -2
  94. package/dist/esm/mcp/client.d.ts +2 -2
  95. package/dist/esm/mcp/factory.d.ts +1 -1
  96. package/dist/esm/mcp/http-client.d.ts +2 -2
  97. package/dist/esm/mcp/stdio-client.d.ts +2 -2
  98. package/dist/esm/mcp/types.d.ts +2 -2
  99. package/dist/esm/memory/extractor.d.ts +2 -2
  100. package/dist/esm/memory/persona.d.ts +2 -2
  101. package/dist/esm/memory/pipeline.d.ts +4 -4
  102. package/dist/esm/memory/recall.d.ts +1 -1
  103. package/dist/esm/memory/scene.d.ts +1 -1
  104. package/dist/esm/middleware/audit-log.d.ts +2 -2
  105. package/dist/esm/middleware/timing.d.ts +2 -2
  106. package/dist/esm/middleware/tool-guard.d.ts +2 -2
  107. package/dist/esm/middleware/types.d.ts +1 -1
  108. package/dist/esm/pool/engine-pool.d.ts +1 -1
  109. package/dist/esm/runtime/run-registry.d.ts +1 -1
  110. package/dist/esm/sandbox/types.d.ts +2 -2
  111. package/dist/esm/security/guard.d.ts +1 -1
  112. package/dist/esm/security/permission.d.ts +1 -1
  113. package/dist/esm/skill/manager.d.ts +1 -1
  114. package/dist/esm/skill/router.d.ts +2 -2
  115. package/dist/esm/store/file-tool-result-store.d.ts +1 -1
  116. package/dist/esm/tool/delegate.d.ts +2 -2
  117. package/dist/esm/tool/registry.d.ts +1 -1
  118. package/dist/esm/tool/types.d.ts +1 -1
  119. package/dist/esm/utils/event-collector.d.ts +1 -1
  120. package/dist/esm/utils/token-counter.d.ts +1 -1
  121. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import type { AgentEvent, Message, ToolCall, ToolCallRecord } from '../types.ts';
2
- import type { ToolRegistry } from '../tool/registry.ts';
3
- import type { ToolContext } from '../tool/types.ts';
4
- import type { SecurityGuard } from '../security/guard.ts';
5
- import type { HookEvent, HookContext, HookResult } from '../hooks/types.ts';
6
- import type { Middleware } from '../middleware/types.ts';
7
- import type { HistoryManager } from './history-manager.ts';
1
+ import type { AgentEvent, Message, ToolCall, ToolCallRecord } from '../types.js';
2
+ import type { ToolRegistry } from '../tool/registry.js';
3
+ import type { ToolContext } from '../tool/types.js';
4
+ import type { SecurityGuard } from '../security/guard.js';
5
+ import type { HookEvent, HookContext, HookResult } from '../hooks/types.js';
6
+ import type { Middleware } from '../middleware/types.js';
7
+ import type { HistoryManager } from './history-manager.js';
8
8
  /** 工具执行配置 */
9
9
  export interface ToolExecutorConfig {
10
10
  /** Tool Registry */
@@ -1,12 +1,12 @@
1
- import type { LLMProvider } from '../llm/types.ts';
2
- import type { ToolRegistry } from '../tool/registry.ts';
3
- import type { SkillManager } from '../skill/manager.ts';
4
- import type { SkillRouter } from '../skill/router.ts';
5
- import type { ContextManager } from '../context/manager.ts';
6
- import type { SecurityGuard } from '../security/guard.ts';
7
- import type { SessionContext } from '../types.ts';
8
- import type { Hook } from '../hooks/types.ts';
9
- import type { Middleware } from '../middleware/types.ts';
1
+ import type { LLMProvider } from '../llm/types.js';
2
+ import type { ToolRegistry } from '../tool/registry.js';
3
+ import type { SkillManager } from '../skill/manager.js';
4
+ import type { SkillRouter } from '../skill/router.js';
5
+ import type { ContextManager } from '../context/manager.js';
6
+ import type { SecurityGuard } from '../security/guard.js';
7
+ import type { SessionContext } from '../types.js';
8
+ import type { Hook } from '../hooks/types.js';
9
+ import type { Middleware } from '../middleware/types.js';
10
10
  /** 上下文卸载条目(工具结果摘要 + 原文引用,用于非破坏性压缩) */
11
11
  export interface OffloadEntry {
12
12
  /** 唯一引用 ID,格式:{toolName}_{timestamp}_{hash} */
@@ -1,4 +1,4 @@
1
- import type { EnvInfo, EnvCollector as IEnvCollector } from './types.ts';
1
+ import type { EnvInfo, EnvCollector as IEnvCollector } from './types.js';
2
2
  /**
3
3
  * 默认本地环境采集器
4
4
  * 采集当前机器的 OS、CPU、内存、Shell 等信息
@@ -1,5 +1,5 @@
1
- import type { Message } from '../types.ts';
2
- import type { BuildContextOptions } from './types.ts';
1
+ import type { Message } from '../types.js';
2
+ import type { BuildContextOptions } from './types.js';
3
3
  /**
4
4
  * 消息构建器(纯函数式,无状态)
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/context/manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,qBAAa,cAAc;IAEzB;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,EAAE;CAoBvD"}
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/context/manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,qBAAa,cAAc;IAEzB;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,EAAE;CAsBvD"}
@@ -24,8 +24,10 @@ export class ContextManager {
24
24
  if (options.history?.length) {
25
25
  messages.push(...options.history);
26
26
  }
27
- // ③ 当前用户输入
28
- messages.push({ role: 'user', content: options.userMessage });
27
+ // ③ 当前用户输入(历史已包含时跳过,避免重复)
28
+ if (options.userMessage != null) {
29
+ messages.push({ role: 'user', content: options.userMessage });
30
+ }
29
31
  return messages;
30
32
  }
31
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/context/manager.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,yBAAyB;AACzB,+DAA+D;AAK/D;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IAEzB;;;OAGG;IACH,aAAa,CAAC,OAA4B;QACxC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,mBAAmB;QACnB,IAAI,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACxC,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC9B,YAAY,IAAI,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;QACrD,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;QAEzD,4BAA4B;QAC5B,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,WAAW;QACX,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAE9D,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/context/manager.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,yBAAyB;AACzB,+DAA+D;AAK/D;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IAEzB;;;OAGG;IACH,aAAa,CAAC,OAA4B;QACxC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,mBAAmB;QACnB,IAAI,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACxC,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC9B,YAAY,IAAI,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;QACrD,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;QAEzD,4BAA4B;QAC5B,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,0BAA0B;QAC1B,IAAI,OAAO,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import type { Message } from '../types.ts';
1
+ import type { Message } from '../types.js';
2
2
  export interface EnvInfo {
3
3
  /** 操作系统信息,e.g. "Linux 5.15.0 x86_64" */
4
4
  os: string;
@@ -24,8 +24,8 @@ export interface BuildContextOptions {
24
24
  systemPrompt: string;
25
25
  /** 对话历史(由上层管理,core 仅负责插入到消息列表中) */
26
26
  history?: Message[];
27
- /** 用户当前输入 */
28
- userMessage: string;
27
+ /** 用户当前输入(可选,历史已包含时可省略) */
28
+ userMessage?: string;
29
29
  /** 额外系统提示片段(上层注入,追加到 systemPrompt 之后) */
30
30
  extraSystemPrompt?: string;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,MAAM,WAAW,OAAO;IACtB,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAID,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,aAAa;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,0CAA0C;IAC1C,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI3C,MAAM,WAAW,OAAO;IACtB,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAID,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,0CAA0C;IAC1C,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B"}
@@ -1,5 +1,5 @@
1
- import type { Message, TokenUsage } from '../types.ts';
2
- import type { ToolDefinition } from '../tool/types.ts';
1
+ import type { Message, TokenUsage } from '../types.js';
2
+ import type { ToolDefinition } from '../tool/types.js';
3
3
  export type HookEvent = 'before_tool' | 'after_tool' | 'before_ll_call' | 'after_ll_call' | 'on_iteration_start' | 'on_error' | 'on_complete';
4
4
  /**
5
5
  * Hook 处理器接收的上下文信息
@@ -1,77 +1,77 @@
1
- export type { Message, MessageRole, ToolCall, AgentEvent, BaseEvent, ThinkingEvent, ToolCallEvent, ToolResultEvent, MessageEvent, DoneEvent, ErrorEvent, SteeringEvent, RetryEvent, AgentResult, AgentStatus, SessionContext, TokenUsage, ToolCallRecord, } from './types.ts';
2
- export { AgentEngine } from './agent/engine.ts';
3
- export { DEFAULT_COMPLEX_WORKFLOW_TEMPLATE, buildDebateInstructions, buildStructuredOutputInstruction, buildWorkflowDecisionMemory, formatDebateOutput, formatStructuredAgentOutput, formatWorkflowTemplateForPrompt, getWorkflowRoleStage, getWorkflowTemplate, parseDebateOutput, parseStructuredAgentOutput, wrapTaskWithWorkflowInstructions, } from './agent/workflow.ts';
4
- export type { StructuredAgentOutput, WorkflowCheckpoint, WorkflowDecisionLog, WorkflowRole, WorkflowStageTemplate, WorkflowTemplate, DebateOutput } from './agent/workflow.ts';
5
- export { HistoryManager } from './agent/history-manager.ts';
6
- export { LLMCaller } from './agent/llm-caller.ts';
7
- export { AgentToolExecutor } from './agent/tool-executor.ts';
8
- export type { AgentConfig, RunOptions, RetryPolicy, ToolResultStore, OffloadEntry } from './agent/types.ts';
9
- export type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk, } from './llm/types.ts';
10
- export { OpenAIProvider } from './llm/openai-provider.ts';
11
- export { AnthropicProvider } from './llm/anthropic-provider.ts';
12
- export { OllamaProvider } from './llm/ollama-provider.ts';
13
- export { createLLMProvider, BUILTIN_PROVIDERS } from './llm/factory.ts';
14
- export type { BuiltinProvider } from './llm/factory.ts';
15
- export { ContextManager } from './context/manager.ts';
16
- export { LocalEnvCollector } from './context/collector.ts';
17
- export type { BuildContextOptions, EnvInfo, EnvCollector, } from './context/types.ts';
18
- export { SkillManager } from './skill/manager.ts';
19
- export { SkillRouter } from './skill/router.ts';
20
- export type { Skill, SkillManifest, SkillSource, RouteResult, RouteStrategy, MatchType, } from './skill/types.ts';
21
- export { ToolRegistry } from './tool/registry.ts';
22
- export type { DefineToolOptions } from './tool/registry.ts';
23
- export { createDelegateTool } from './tool/delegate.ts';
24
- export type { SubAgentRunner } from './tool/delegate.ts';
25
- export type { ToolDefinition, ToolExecutor, ToolContext, SubAgentEventEmitter, WidgetEventEmitter, ArtifactEventEmitter, ArtifactData, RegisteredTool, ToolCategory, ShellExecutor, FileSystemExecutor, } from './tool/types.ts';
26
- export { registerMCPTools, MCP_TOOL_PREFIX, buildMCPToolName, sanitizeForToolName } from './mcp/client.ts';
27
- export { createMCPClient, registerTransport } from './mcp/factory.ts';
28
- export type { TransportFactory } from './mcp/factory.ts';
29
- export { MCPClientBase } from './mcp/base-client.ts';
30
- export { StdioMCPClient } from './mcp/stdio-client.ts';
31
- export { HttpMCPClient } from './mcp/http-client.ts';
32
- export { resolveProxyAgentForCategory, resolveProxyUrlForCategory, getSystemProxyUrl, clearSystemProxyCache, getWindowsSystemProxy, DEFAULT_PROXY_SETTINGS, } from './mcp/proxy-agent.ts';
33
- export type { ProxyMode, ProxyCategoryConfig, ProxySettings, } from './mcp/proxy-agent.ts';
34
- export type { MCPClient, MCPServerConfig, MCPTransport, } from './mcp/types.ts';
35
- export { SecurityGuard } from './security/guard.ts';
36
- export type { SanitizeResult, SecurityRule, SecurityPolicy, Severity, } from './security/types.ts';
37
- export { assessToolRisk, isLowRiskTool, clearRiskCache, setToolSecurityPolicyProvider, } from './security/risk.ts';
38
- export type { ToolRiskLevel, ToolRiskAssessment, ToolSecurityPolicy, ToolSecurityPolicyProvider, } from './security/risk.ts';
39
- export { createPermissionRequest, listPermissionRequests, findApprovedPermission, decidePermissionRequest, configurePermissionManager, InMemoryPermissionStore, } from './security/permission.ts';
40
- export type { PermissionDecision, PermissionRequest, PermissionStore, } from './security/permission.ts';
41
- export type { Sandbox, SandboxConfig, SandboxManager, ScriptLanguage, } from './sandbox/types.ts';
42
- export { SANDBOX_BLOCKED_COMMANDS, SANDBOX_SAFE_ENV_KEYS, DEFAULT_SANDBOX_CONFIG } from './sandbox/types.ts';
43
- export { logEvent, setLogTransport } from './observability/logger.ts';
44
- export type { LogLevel, ObservabilityEvent, LogTransport, } from './observability/logger.ts';
45
- export { EnginePool } from './pool/engine-pool.ts';
46
- export { RunRegistry, InMemoryRunStateStore } from './runtime/run-registry.ts';
47
- export type { BufferedEvent, RunToolCallRecord, EventSubscriber, RunStatus, ActiveRun, RunSnapshot, RunStateStore, } from './runtime/run-registry.ts';
48
- export { JsonStore, JsonListStore } from './store/json-store.ts';
49
- export type { JsonStoreOptions } from './store/json-store.ts';
50
- export { FileToolResultStore } from './store/file-tool-result-store.ts';
51
- export type { FileToolResultStoreOptions } from './store/file-tool-result-store.ts';
52
- export { TimingMiddleware } from './middleware/timing.ts';
53
- export type { TimingReport } from './middleware/timing.ts';
54
- export { ToolGuardMiddleware } from './middleware/tool-guard.ts';
55
- export { AuditLogMiddleware } from './middleware/audit-log.ts';
56
- export type { Hook, HookEvent, HookContext, HookResult, } from './hooks/types.ts';
57
- export type { Middleware, MiddlewareContext, } from './middleware/types.ts';
58
- export type { MemoryEntry, MemoryLayer, MemoryServiceLike, } from './memory/types.ts';
59
- export { MemoryExtractor } from './memory/extractor.ts';
60
- export type { AtomFact, ExtractorOptions } from './memory/extractor.ts';
61
- export { SceneAggregator } from './memory/scene.ts';
62
- export type { SceneBlock, SceneAggregatorOptions } from './memory/scene.ts';
63
- export { PersonaGenerator } from './memory/persona.ts';
64
- export type { PersonaFacet, PersonaGeneratorOptions } from './memory/persona.ts';
65
- export { MemoryCheckpoint, getMemoryCheckpoint, resetMemoryCheckpoint } from './memory/checkpoint.ts';
66
- export type { CheckpointData } from './memory/checkpoint.ts';
67
- export { MemoryRecallEngine, formatRecallForPrompt } from './memory/recall.ts';
68
- export type { RecallResult, ScoredMemoryEntry, RecallOptions } from './memory/recall.ts';
69
- export { MemoryPipeline } from './memory/pipeline.ts';
70
- export type { PipelineOptions, PipelineResult } from './memory/pipeline.ts';
71
- export { getDataPath, getProjectDataPath, ensureDataDir, ensureProjectDataDir, expandEnvVars, setAppName, getAppName, } from './utils/data-dir.ts';
72
- export { collectEngineOutput } from './utils/event-collector.ts';
73
- export type { EngineRunResult } from './utils/event-collector.ts';
74
- export { A2AClient, createA2ARemoteRunner, extractTextFromMessage, } from './a2a/index.ts';
75
- export type { A2ARemoteRunnerConfig, } from './a2a/index.ts';
76
- export type { A2AAgentCard, A2AAgentSkill, A2AAgentCapabilities, A2APart, A2ATextPart, A2AFilePart, A2ADataPart, A2AMessage, A2ATaskState, A2ATaskStatus, A2AArtifact, A2ATask, A2ATaskStatusUpdateEvent, A2ATaskArtifactUpdateEvent, A2ATaskEvent, A2AJsonRpcRequest, A2AJsonRpcResponse, A2AJsonRpcError, A2ASendTaskParams, A2ASendSubscribeParams, A2AGetTaskParams, A2ACancelTaskParams, A2ARemoteAgentConfig, } from './a2a/index.ts';
1
+ export type { Message, MessageRole, ToolCall, AgentEvent, BaseEvent, ThinkingEvent, ToolCallEvent, ToolResultEvent, MessageEvent, DoneEvent, ErrorEvent, SteeringEvent, RetryEvent, AgentResult, AgentStatus, SessionContext, TokenUsage, ToolCallRecord, } from './types.js';
2
+ export { AgentEngine } from './agent/engine.js';
3
+ export { DEFAULT_COMPLEX_WORKFLOW_TEMPLATE, buildDebateInstructions, buildStructuredOutputInstruction, buildWorkflowDecisionMemory, formatDebateOutput, formatStructuredAgentOutput, formatWorkflowTemplateForPrompt, getWorkflowRoleStage, getWorkflowTemplate, parseDebateOutput, parseStructuredAgentOutput, wrapTaskWithWorkflowInstructions, } from './agent/workflow.js';
4
+ export type { StructuredAgentOutput, WorkflowCheckpoint, WorkflowDecisionLog, WorkflowRole, WorkflowStageTemplate, WorkflowTemplate, DebateOutput } from './agent/workflow.js';
5
+ export { HistoryManager } from './agent/history-manager.js';
6
+ export { LLMCaller } from './agent/llm-caller.js';
7
+ export { AgentToolExecutor } from './agent/tool-executor.js';
8
+ export type { AgentConfig, RunOptions, RetryPolicy, ToolResultStore, OffloadEntry } from './agent/types.js';
9
+ export type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk, } from './llm/types.js';
10
+ export { OpenAIProvider } from './llm/openai-provider.js';
11
+ export { AnthropicProvider } from './llm/anthropic-provider.js';
12
+ export { OllamaProvider } from './llm/ollama-provider.js';
13
+ export { createLLMProvider, BUILTIN_PROVIDERS } from './llm/factory.js';
14
+ export type { BuiltinProvider } from './llm/factory.js';
15
+ export { ContextManager } from './context/manager.js';
16
+ export { LocalEnvCollector } from './context/collector.js';
17
+ export type { BuildContextOptions, EnvInfo, EnvCollector, } from './context/types.js';
18
+ export { SkillManager } from './skill/manager.js';
19
+ export { SkillRouter } from './skill/router.js';
20
+ export type { Skill, SkillManifest, SkillSource, RouteResult, RouteStrategy, MatchType, } from './skill/types.js';
21
+ export { ToolRegistry } from './tool/registry.js';
22
+ export type { DefineToolOptions } from './tool/registry.js';
23
+ export { createDelegateTool } from './tool/delegate.js';
24
+ export type { SubAgentRunner } from './tool/delegate.js';
25
+ export type { ToolDefinition, ToolExecutor, ToolContext, SubAgentEventEmitter, WidgetEventEmitter, ArtifactEventEmitter, ArtifactData, RegisteredTool, ToolCategory, ShellExecutor, FileSystemExecutor, } from './tool/types.js';
26
+ export { registerMCPTools, MCP_TOOL_PREFIX, buildMCPToolName, sanitizeForToolName } from './mcp/client.js';
27
+ export { createMCPClient, registerTransport } from './mcp/factory.js';
28
+ export type { TransportFactory } from './mcp/factory.js';
29
+ export { MCPClientBase } from './mcp/base-client.js';
30
+ export { StdioMCPClient } from './mcp/stdio-client.js';
31
+ export { HttpMCPClient } from './mcp/http-client.js';
32
+ export { resolveProxyAgentForCategory, resolveProxyUrlForCategory, getSystemProxyUrl, clearSystemProxyCache, getWindowsSystemProxy, DEFAULT_PROXY_SETTINGS, } from './mcp/proxy-agent.js';
33
+ export type { ProxyMode, ProxyCategoryConfig, ProxySettings, } from './mcp/proxy-agent.js';
34
+ export type { MCPClient, MCPServerConfig, MCPTransport, } from './mcp/types.js';
35
+ export { SecurityGuard } from './security/guard.js';
36
+ export type { SanitizeResult, SecurityRule, SecurityPolicy, Severity, } from './security/types.js';
37
+ export { assessToolRisk, isLowRiskTool, clearRiskCache, setToolSecurityPolicyProvider, } from './security/risk.js';
38
+ export type { ToolRiskLevel, ToolRiskAssessment, ToolSecurityPolicy, ToolSecurityPolicyProvider, } from './security/risk.js';
39
+ export { createPermissionRequest, listPermissionRequests, findApprovedPermission, decidePermissionRequest, configurePermissionManager, InMemoryPermissionStore, } from './security/permission.js';
40
+ export type { PermissionDecision, PermissionRequest, PermissionStore, } from './security/permission.js';
41
+ export type { Sandbox, SandboxConfig, SandboxManager, ScriptLanguage, } from './sandbox/types.js';
42
+ export { SANDBOX_BLOCKED_COMMANDS, SANDBOX_SAFE_ENV_KEYS, DEFAULT_SANDBOX_CONFIG } from './sandbox/types.js';
43
+ export { logEvent, setLogTransport } from './observability/logger.js';
44
+ export type { LogLevel, ObservabilityEvent, LogTransport, } from './observability/logger.js';
45
+ export { EnginePool } from './pool/engine-pool.js';
46
+ export { RunRegistry, InMemoryRunStateStore } from './runtime/run-registry.js';
47
+ export type { BufferedEvent, RunToolCallRecord, EventSubscriber, RunStatus, ActiveRun, RunSnapshot, RunStateStore, } from './runtime/run-registry.js';
48
+ export { JsonStore, JsonListStore } from './store/json-store.js';
49
+ export type { JsonStoreOptions } from './store/json-store.js';
50
+ export { FileToolResultStore } from './store/file-tool-result-store.js';
51
+ export type { FileToolResultStoreOptions } from './store/file-tool-result-store.js';
52
+ export { TimingMiddleware } from './middleware/timing.js';
53
+ export type { TimingReport } from './middleware/timing.js';
54
+ export { ToolGuardMiddleware } from './middleware/tool-guard.js';
55
+ export { AuditLogMiddleware } from './middleware/audit-log.js';
56
+ export type { Hook, HookEvent, HookContext, HookResult, } from './hooks/types.js';
57
+ export type { Middleware, MiddlewareContext, } from './middleware/types.js';
58
+ export type { MemoryEntry, MemoryLayer, MemoryServiceLike, } from './memory/types.js';
59
+ export { MemoryExtractor } from './memory/extractor.js';
60
+ export type { AtomFact, ExtractorOptions } from './memory/extractor.js';
61
+ export { SceneAggregator } from './memory/scene.js';
62
+ export type { SceneBlock, SceneAggregatorOptions } from './memory/scene.js';
63
+ export { PersonaGenerator } from './memory/persona.js';
64
+ export type { PersonaFacet, PersonaGeneratorOptions } from './memory/persona.js';
65
+ export { MemoryCheckpoint, getMemoryCheckpoint, resetMemoryCheckpoint } from './memory/checkpoint.js';
66
+ export type { CheckpointData } from './memory/checkpoint.js';
67
+ export { MemoryRecallEngine, formatRecallForPrompt } from './memory/recall.js';
68
+ export type { RecallResult, ScoredMemoryEntry, RecallOptions } from './memory/recall.js';
69
+ export { MemoryPipeline } from './memory/pipeline.js';
70
+ export type { PipelineOptions, PipelineResult } from './memory/pipeline.js';
71
+ export { getDataPath, getProjectDataPath, ensureDataDir, ensureProjectDataDir, expandEnvVars, setAppName, getAppName, } from './utils/data-dir.js';
72
+ export { collectEngineOutput } from './utils/event-collector.js';
73
+ export type { EngineRunResult } from './utils/event-collector.js';
74
+ export { A2AClient, createA2ARemoteRunner, extractTextFromMessage, } from './a2a/index.js';
75
+ export type { A2ARemoteRunnerConfig, } from './a2a/index.js';
76
+ export type { A2AAgentCard, A2AAgentSkill, A2AAgentCapabilities, A2APart, A2ATextPart, A2AFilePart, A2ADataPart, A2AMessage, A2ATaskState, A2ATaskStatus, A2AArtifact, A2ATask, A2ATaskStatusUpdateEvent, A2ATaskArtifactUpdateEvent, A2ATaskEvent, A2AJsonRpcRequest, A2AJsonRpcResponse, A2AJsonRpcError, A2ASendTaskParams, A2ASendSubscribeParams, A2AGetTaskParams, A2ACancelTaskParams, A2ARemoteAgentConfig, } from './a2a/index.js';
77
77
  //# sourceMappingURL=index.d.ts.map
@@ -3,7 +3,7 @@
3
3
  * @description 实现 Anthropic Messages API,支持 Claude 系列模型,
4
4
  * 内部自动完成 OpenAI 格式 ↔ Anthropic 格式的双向转换
5
5
  */
6
- import type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.ts';
6
+ import type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.js';
7
7
  export declare class AnthropicProvider implements LLMProvider {
8
8
  private config;
9
9
  constructor(config: ModelConfig);
@@ -3,7 +3,7 @@
3
3
  * @description 根据 ModelConfig.provider 自动创建对应的 LLMProvider 实例
4
4
  * 支持 'openai' | 'anthropic' | 'ollama' 及任意 OpenAI 兼容供应商
5
5
  */
6
- import type { ModelConfig, LLMProvider } from './types.ts';
6
+ import type { ModelConfig, LLMProvider } from './types.js';
7
7
  /** 已注册的供应商名称集合 */
8
8
  export declare const BUILTIN_PROVIDERS: readonly ["openai", "anthropic", "ollama"];
9
9
  export type BuiltinProvider = (typeof BUILTIN_PROVIDERS)[number];
@@ -4,8 +4,8 @@
4
4
  * Ollama 原生支持 OpenAI 兼容接口(/v1/chat/completions)
5
5
  * 默认地址 http://localhost:11434/v1
6
6
  */
7
- import type { ModelConfig, ModelInfo } from './types.ts';
8
- import { OpenAIProvider } from './openai-provider.ts';
7
+ import type { ModelConfig, ModelInfo } from './types.js';
8
+ import { OpenAIProvider } from './openai-provider.js';
9
9
  export declare class OllamaProvider extends OpenAIProvider {
10
10
  constructor(config: ModelConfig);
11
11
  getModel(): ModelInfo;
@@ -2,7 +2,7 @@
2
2
  * @file OpenAI 兼容 LLM Provider
3
3
  * @description 使用原生 fetch 实现,支持任意 OpenAI 兼容端点(OpenAI / DeepSeek / Ollama / vLLM 等)
4
4
  */
5
- import type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.ts';
5
+ import type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.js';
6
6
  export declare class OpenAIProvider implements LLMProvider {
7
7
  protected config: Required<Pick<ModelConfig, 'provider' | 'model'>> & ModelConfig;
8
8
  constructor(config: ModelConfig);
@@ -1,7 +1,7 @@
1
- export type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.ts';
2
- export { OpenAIProvider } from './openai-provider.ts';
3
- export { AnthropicProvider } from './anthropic-provider.ts';
4
- export { OllamaProvider } from './ollama-provider.ts';
5
- export { createLLMProvider, BUILTIN_PROVIDERS } from './factory.ts';
6
- export type { BuiltinProvider } from './factory.ts';
1
+ export type { LLMProvider, ModelConfig, ModelInfo, ChatParams, ChatResponse, ChatChunk } from './types.js';
2
+ export { OpenAIProvider } from './openai-provider.js';
3
+ export { AnthropicProvider } from './anthropic-provider.js';
4
+ export { OllamaProvider } from './ollama-provider.js';
5
+ export { createLLMProvider, BUILTIN_PROVIDERS } from './factory.js';
6
+ export type { BuiltinProvider } from './factory.js';
7
7
  //# sourceMappingURL=provider.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { Message, TokenUsage } from '../types.ts';
2
- import type { ToolDefinition } from '../tool/types.ts';
1
+ import type { Message, TokenUsage } from '../types.js';
2
+ import type { ToolDefinition } from '../tool/types.js';
3
3
  export interface ModelConfig {
4
4
  /** 供应商标识:'openai' | 'anthropic' | 'azure' | 'ollama' | 自定义 */
5
5
  provider: string;
@@ -1,5 +1,5 @@
1
- import type { MCPClient, MCPServerConfig } from './types.ts';
2
- import type { ToolDefinition } from '../tool/types.ts';
1
+ import type { MCPClient, MCPServerConfig } from './types.js';
2
+ import type { ToolDefinition } from '../tool/types.js';
3
3
  /** JSON-RPC 请求 */
4
4
  interface JsonRpcRequest {
5
5
  jsonrpc: '2.0';
@@ -1,5 +1,5 @@
1
- import type { MCPClient } from './types.ts';
2
- import type { ToolRegistry } from '../tool/registry.ts';
1
+ import type { MCPClient } from './types.js';
2
+ import type { ToolRegistry } from '../tool/registry.js';
3
3
  /** MCP 工具名前缀,用于与 builtin/skill 等工具区分 */
4
4
  export declare const MCP_TOOL_PREFIX = "mcp_";
5
5
  /**
@@ -1,4 +1,4 @@
1
- import type { MCPClient, MCPServerConfig } from './types.ts';
1
+ import type { MCPClient, MCPServerConfig } from './types.js';
2
2
  /** 自定义 transport 工厂函数签名 */
3
3
  export type TransportFactory = () => MCPClient;
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { MCPClientBase } from './base-client.ts';
2
- import type { MCPServerConfig } from './types.ts';
1
+ import { MCPClientBase } from './base-client.js';
2
+ import type { MCPServerConfig } from './types.js';
3
3
  export declare class HttpMCPClient extends MCPClientBase {
4
4
  private endpoint;
5
5
  private sessionId?;
@@ -1,5 +1,5 @@
1
- import { MCPClientBase } from './base-client.ts';
2
- import type { MCPServerConfig } from './types.ts';
1
+ import { MCPClientBase } from './base-client.js';
2
+ import type { MCPServerConfig } from './types.js';
3
3
  export declare class StdioMCPClient extends MCPClientBase {
4
4
  private process;
5
5
  private buffer;
@@ -1,5 +1,5 @@
1
- import type { ToolDefinition } from '../tool/types.ts';
2
- import type { ProxyCategoryConfig } from './proxy-agent.ts';
1
+ import type { ToolDefinition } from '../tool/types.js';
2
+ import type { ProxyCategoryConfig } from './proxy-agent.js';
3
3
  export type MCPTransport = 'stdio' | 'http' | 'sse' | 'streamableHttp' | (string & {});
4
4
  export interface MCPServerConfig {
5
5
  name: string;
@@ -1,5 +1,5 @@
1
- import type { LLMProvider } from '../llm/types.ts';
2
- import type { Message } from '../types.ts';
1
+ import type { LLMProvider } from '../llm/types.js';
2
+ import type { Message } from '../types.js';
3
3
  /** 从对话中提取的原子事实 */
4
4
  export interface AtomFact {
5
5
  /** 记忆键(snake_case,用于 upsert) */
@@ -1,5 +1,5 @@
1
- import type { LLMProvider } from '../llm/types.ts';
2
- import type { SceneBlock } from './scene.ts';
1
+ import type { LLMProvider } from '../llm/types.js';
2
+ import type { SceneBlock } from './scene.js';
3
3
  /** 画像维度 */
4
4
  export interface PersonaFacet {
5
5
  /** 维度键(如 coding_style, tool_preference) */
@@ -1,7 +1,7 @@
1
- import type { LLMProvider } from '../llm/types.ts';
2
- import type { MemoryServiceLike } from './types.ts';
3
- import { type SceneBlock } from './scene.ts';
4
- import type { Message } from '../types.ts';
1
+ import type { LLMProvider } from '../llm/types.js';
2
+ import type { MemoryServiceLike } from './types.js';
3
+ import { type SceneBlock } from './scene.js';
4
+ import type { Message } from '../types.js';
5
5
  /** 管道配置 */
6
6
  export interface PipelineOptions {
7
7
  llmProvider: LLMProvider;
@@ -1,4 +1,4 @@
1
- import type { MemoryEntry, MemoryLayer } from './types.ts';
1
+ import type { MemoryEntry, MemoryLayer } from './types.js';
2
2
  /** 召回结果 */
3
3
  export interface RecallResult {
4
4
  /** 召回的记忆条目(按相关度排序) */
@@ -1,4 +1,4 @@
1
- import type { LLMProvider } from '../llm/types.ts';
1
+ import type { LLMProvider } from '../llm/types.js';
2
2
  /** 场景块(L2) */
3
3
  export interface SceneBlock {
4
4
  /** 场景 ID(snake_case) */
@@ -1,5 +1,5 @@
1
- import type { Middleware, MiddlewareContext } from '../middleware/types.ts';
2
- import type { HookContext, HookResult } from '../hooks/types.ts';
1
+ import type { Middleware, MiddlewareContext } from '../middleware/types.js';
2
+ import type { HookContext, HookResult } from '../hooks/types.js';
3
3
  /**
4
4
  * 记录每轮迭代和工具调用的审计日志
5
5
  * - before/after: 记录迭代开始/结束 + 消息数量
@@ -1,5 +1,5 @@
1
- import type { Middleware, MiddlewareContext } from '../middleware/types.ts';
2
- import type { HookContext, HookResult } from '../hooks/types.ts';
1
+ import type { Middleware, MiddlewareContext } from '../middleware/types.js';
2
+ import type { HookContext, HookResult } from '../hooks/types.js';
3
3
  export interface TimingReport {
4
4
  type: 'iteration' | 'tool';
5
5
  sessionId?: string;
@@ -1,5 +1,5 @@
1
- import type { Middleware } from '../middleware/types.ts';
2
- import type { HookContext, HookResult } from '../hooks/types.ts';
1
+ import type { Middleware } from '../middleware/types.js';
2
+ import type { HookContext, HookResult } from '../hooks/types.js';
3
3
  /**
4
4
  * 工具调用守卫:对指定工具进行拦截
5
5
  * - 可配置需要拦截的工具名列表
@@ -1,4 +1,4 @@
1
- import type { HookContext, HookResult } from '../hooks/types.ts';
1
+ import type { HookContext, HookResult } from '../hooks/types.js';
2
2
  /**
3
3
  * 中间件 before/after 接收的上下文信息
4
4
  * 包含当前迭代的关键状态快照,中间件可读取但不应直接修改
@@ -1,4 +1,4 @@
1
- import type { AgentEngine } from '../agent/engine.ts';
1
+ import type { AgentEngine } from '../agent/engine.js';
2
2
  /** AgentEngine 实例复用池 */
3
3
  export declare class EnginePool {
4
4
  private pool;
@@ -1,4 +1,4 @@
1
- import type { WorkflowCheckpoint } from '../agent/workflow.ts';
1
+ import type { WorkflowCheckpoint } from '../agent/workflow.js';
2
2
  /** 单条事件 */
3
3
  export interface BufferedEvent {
4
4
  event: string;
@@ -1,5 +1,5 @@
1
- import type { SecurityRule } from '../security/types.ts';
2
- import type { ShellExecutor, FileSystemExecutor } from '../tool/types.ts';
1
+ import type { SecurityRule } from '../security/types.js';
2
+ import type { ShellExecutor, FileSystemExecutor } from '../tool/types.js';
3
3
  /** 沙箱配置 */
4
4
  export interface SandboxConfig {
5
5
  /** 沙箱根目录(默认 ~/.workai/sandboxes/{id}) */
@@ -1,4 +1,4 @@
1
- import type { SanitizeResult, SecurityRule, SecurityPolicy } from './types.ts';
1
+ import type { SanitizeResult, SecurityRule, SecurityPolicy } from './types.js';
2
2
  export declare class SecurityGuard {
3
3
  private policy;
4
4
  /** 已编译的正则规则缓存(避免每次 sanitize 重复遍历数组) */
@@ -1,4 +1,4 @@
1
- import type { ToolRiskAssessment } from './risk.ts';
1
+ import type { ToolRiskAssessment } from './risk.js';
2
2
  export type PermissionDecision = 'pending' | 'approved' | 'rejected' | 'expired';
3
3
  export interface PermissionRequest {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import type { Skill, SkillManifest, SkillSource } from './types.ts';
1
+ import type { Skill, SkillManifest, SkillSource } from './types.js';
2
2
  /** 懒加载配置 */
3
3
  interface LazyLoadConfig {
4
4
  /** content LRU 缓存容量(默认 30) */
@@ -1,5 +1,5 @@
1
- import type { RouteResult, RouteStrategy } from './types.ts';
2
- import type { SkillManager } from './manager.ts';
1
+ import type { RouteResult, RouteStrategy } from './types.js';
2
+ import type { SkillManager } from './manager.js';
3
3
  export declare class SkillRouter {
4
4
  private strategies;
5
5
  private skillManager;
@@ -1,4 +1,4 @@
1
- import type { ToolResultStore, OffloadEntry } from '../agent/types.ts';
1
+ import type { ToolResultStore, OffloadEntry } from '../agent/types.js';
2
2
  export interface FileToolResultStoreOptions {
3
3
  /** 工具结果存储目录(默认 {cwd}/data/tool-results) */
4
4
  storeDir: string;
@@ -1,5 +1,5 @@
1
- import type { RegisteredTool, ToolContext } from './types.ts';
2
- import type { StructuredAgentOutput, WorkflowRole } from '../agent/workflow.ts';
1
+ import type { RegisteredTool, ToolContext } from './types.js';
2
+ import type { StructuredAgentOutput, WorkflowRole } from '../agent/workflow.js';
3
3
  /**
4
4
  * 子 Agent 执行器接口
5
5
  * 由上层(agent.service.ts)实现,Core 层只定义接口
@@ -1,4 +1,4 @@
1
- import type { ToolDefinition, ToolExecutor, ToolContext, RegisteredTool, ToolCategory } from './types.ts';
1
+ import type { ToolDefinition, ToolExecutor, ToolContext, RegisteredTool, ToolCategory } from './types.js';
2
2
  /** defineTool 简化参数 */
3
3
  export interface DefineToolOptions {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { EnvInfo } from '../context/types.ts';
1
+ import type { EnvInfo } from '../context/types.js';
2
2
  export interface ToolDefinition {
3
3
  type: 'function';
4
4
  function: {
@@ -1,4 +1,4 @@
1
- import type { AgentEvent } from '../types.ts';
1
+ import type { AgentEvent } from '../types.js';
2
2
  /** Engine 事件流消费结果 */
3
3
  export interface EngineRunResult {
4
4
  finalContent: string;
@@ -1,4 +1,4 @@
1
- import type { Message } from '../types.ts';
1
+ import type { Message } from '../types.js';
2
2
  /**
3
3
  * 计算文本的 token 数量(带 LRU 缓存)
4
4
  * @param text 输入文本
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cicctencent/agent-core",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Core engine for AI agent — LLM orchestration, tool execution, MCP, skill routing, security, and memory pipeline.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",