@animus-labs/cortex 0.2.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.
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/budget-guard.d.ts +75 -0
- package/dist/budget-guard.d.ts.map +1 -0
- package/dist/budget-guard.js +142 -0
- package/dist/budget-guard.js.map +1 -0
- package/dist/compaction/compaction.d.ts +99 -0
- package/dist/compaction/compaction.d.ts.map +1 -0
- package/dist/compaction/compaction.js +302 -0
- package/dist/compaction/compaction.js.map +1 -0
- package/dist/compaction/failsafe.d.ts +57 -0
- package/dist/compaction/failsafe.d.ts.map +1 -0
- package/dist/compaction/failsafe.js +135 -0
- package/dist/compaction/failsafe.js.map +1 -0
- package/dist/compaction/index.d.ts +381 -0
- package/dist/compaction/index.d.ts.map +1 -0
- package/dist/compaction/index.js +979 -0
- package/dist/compaction/index.js.map +1 -0
- package/dist/compaction/microcompaction.d.ts +219 -0
- package/dist/compaction/microcompaction.d.ts.map +1 -0
- package/dist/compaction/microcompaction.js +536 -0
- package/dist/compaction/microcompaction.js.map +1 -0
- package/dist/compaction/observational/buffering.d.ts +225 -0
- package/dist/compaction/observational/buffering.d.ts.map +1 -0
- package/dist/compaction/observational/buffering.js +354 -0
- package/dist/compaction/observational/buffering.js.map +1 -0
- package/dist/compaction/observational/constants.d.ts +70 -0
- package/dist/compaction/observational/constants.d.ts.map +1 -0
- package/dist/compaction/observational/constants.js +507 -0
- package/dist/compaction/observational/constants.js.map +1 -0
- package/dist/compaction/observational/index.d.ts +219 -0
- package/dist/compaction/observational/index.d.ts.map +1 -0
- package/dist/compaction/observational/index.js +641 -0
- package/dist/compaction/observational/index.js.map +1 -0
- package/dist/compaction/observational/observer.d.ts +97 -0
- package/dist/compaction/observational/observer.d.ts.map +1 -0
- package/dist/compaction/observational/observer.js +424 -0
- package/dist/compaction/observational/observer.js.map +1 -0
- package/dist/compaction/observational/recall-tool.d.ts +27 -0
- package/dist/compaction/observational/recall-tool.d.ts.map +1 -0
- package/dist/compaction/observational/recall-tool.js +93 -0
- package/dist/compaction/observational/recall-tool.js.map +1 -0
- package/dist/compaction/observational/reflector.d.ts +94 -0
- package/dist/compaction/observational/reflector.d.ts.map +1 -0
- package/dist/compaction/observational/reflector.js +167 -0
- package/dist/compaction/observational/reflector.js.map +1 -0
- package/dist/compaction/observational/types.d.ts +271 -0
- package/dist/compaction/observational/types.d.ts.map +1 -0
- package/dist/compaction/observational/types.js +15 -0
- package/dist/compaction/observational/types.js.map +1 -0
- package/dist/context-manager.d.ts +134 -0
- package/dist/context-manager.d.ts.map +1 -0
- package/dist/context-manager.js +170 -0
- package/dist/context-manager.js.map +1 -0
- package/dist/cortex-agent.d.ts +1020 -0
- package/dist/cortex-agent.d.ts.map +1 -0
- package/dist/cortex-agent.js +3589 -0
- package/dist/cortex-agent.js.map +1 -0
- package/dist/error-classifier.d.ts +48 -0
- package/dist/error-classifier.d.ts.map +1 -0
- package/dist/error-classifier.js +152 -0
- package/dist/error-classifier.js.map +1 -0
- package/dist/event-bridge.d.ts +166 -0
- package/dist/event-bridge.d.ts.map +1 -0
- package/dist/event-bridge.js +381 -0
- package/dist/event-bridge.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-client.d.ts +119 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +474 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/model-wrapper.d.ts +58 -0
- package/dist/model-wrapper.d.ts.map +1 -0
- package/dist/model-wrapper.js +86 -0
- package/dist/model-wrapper.js.map +1 -0
- package/dist/noop-logger.d.ts +4 -0
- package/dist/noop-logger.d.ts.map +1 -0
- package/dist/noop-logger.js +8 -0
- package/dist/noop-logger.js.map +1 -0
- package/dist/prompt-diagnostics.d.ts +47 -0
- package/dist/prompt-diagnostics.d.ts.map +1 -0
- package/dist/prompt-diagnostics.js +230 -0
- package/dist/prompt-diagnostics.js.map +1 -0
- package/dist/provider-manager.d.ts +224 -0
- package/dist/provider-manager.d.ts.map +1 -0
- package/dist/provider-manager.js +563 -0
- package/dist/provider-manager.js.map +1 -0
- package/dist/provider-registry.d.ts +115 -0
- package/dist/provider-registry.d.ts.map +1 -0
- package/dist/provider-registry.js +305 -0
- package/dist/provider-registry.js.map +1 -0
- package/dist/schema-converter.d.ts +20 -0
- package/dist/schema-converter.d.ts.map +1 -0
- package/dist/schema-converter.js +48 -0
- package/dist/schema-converter.js.map +1 -0
- package/dist/skill-preprocessor.d.ts +46 -0
- package/dist/skill-preprocessor.d.ts.map +1 -0
- package/dist/skill-preprocessor.js +237 -0
- package/dist/skill-preprocessor.js.map +1 -0
- package/dist/skill-registry.d.ts +107 -0
- package/dist/skill-registry.d.ts.map +1 -0
- package/dist/skill-registry.js +330 -0
- package/dist/skill-registry.js.map +1 -0
- package/dist/skill-tool.d.ts +54 -0
- package/dist/skill-tool.d.ts.map +1 -0
- package/dist/skill-tool.js +88 -0
- package/dist/skill-tool.js.map +1 -0
- package/dist/sub-agent-manager.d.ts +90 -0
- package/dist/sub-agent-manager.d.ts.map +1 -0
- package/dist/sub-agent-manager.js +192 -0
- package/dist/sub-agent-manager.js.map +1 -0
- package/dist/token-estimator.d.ts +23 -0
- package/dist/token-estimator.d.ts.map +1 -0
- package/dist/token-estimator.js +27 -0
- package/dist/token-estimator.js.map +1 -0
- package/dist/tool-contract.d.ts +68 -0
- package/dist/tool-contract.d.ts.map +1 -0
- package/dist/tool-contract.js +35 -0
- package/dist/tool-contract.js.map +1 -0
- package/dist/tool-result-persistence.d.ts +89 -0
- package/dist/tool-result-persistence.d.ts.map +1 -0
- package/dist/tool-result-persistence.js +152 -0
- package/dist/tool-result-persistence.js.map +1 -0
- package/dist/tools/bash/index.d.ts +71 -0
- package/dist/tools/bash/index.d.ts.map +1 -0
- package/dist/tools/bash/index.js +485 -0
- package/dist/tools/bash/index.js.map +1 -0
- package/dist/tools/bash/interactive.d.ts +47 -0
- package/dist/tools/bash/interactive.d.ts.map +1 -0
- package/dist/tools/bash/interactive.js +262 -0
- package/dist/tools/bash/interactive.js.map +1 -0
- package/dist/tools/bash/safety.d.ts +149 -0
- package/dist/tools/bash/safety.d.ts.map +1 -0
- package/dist/tools/bash/safety.js +1116 -0
- package/dist/tools/bash/safety.js.map +1 -0
- package/dist/tools/edit.d.ts +57 -0
- package/dist/tools/edit.d.ts.map +1 -0
- package/dist/tools/edit.js +310 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/glob.d.ts +34 -0
- package/dist/tools/glob.d.ts.map +1 -0
- package/dist/tools/glob.js +268 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/grep.d.ts +53 -0
- package/dist/tools/grep.d.ts.map +1 -0
- package/dist/tools/grep.js +673 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +62 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +52 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/read.d.ts +43 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +459 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/runtime.d.ts +62 -0
- package/dist/tools/runtime.d.ts.map +1 -0
- package/dist/tools/runtime.js +116 -0
- package/dist/tools/runtime.js.map +1 -0
- package/dist/tools/shared/cwd-tracker.d.ts +32 -0
- package/dist/tools/shared/cwd-tracker.d.ts.map +1 -0
- package/dist/tools/shared/cwd-tracker.js +44 -0
- package/dist/tools/shared/cwd-tracker.js.map +1 -0
- package/dist/tools/shared/edit-history.d.ts +55 -0
- package/dist/tools/shared/edit-history.d.ts.map +1 -0
- package/dist/tools/shared/edit-history.js +72 -0
- package/dist/tools/shared/edit-history.js.map +1 -0
- package/dist/tools/shared/edit-matcher.d.ts +83 -0
- package/dist/tools/shared/edit-matcher.d.ts.map +1 -0
- package/dist/tools/shared/edit-matcher.js +359 -0
- package/dist/tools/shared/edit-matcher.js.map +1 -0
- package/dist/tools/shared/file-mutation-lock.d.ts +22 -0
- package/dist/tools/shared/file-mutation-lock.d.ts.map +1 -0
- package/dist/tools/shared/file-mutation-lock.js +35 -0
- package/dist/tools/shared/file-mutation-lock.js.map +1 -0
- package/dist/tools/shared/gitignore.d.ts +17 -0
- package/dist/tools/shared/gitignore.d.ts.map +1 -0
- package/dist/tools/shared/gitignore.js +59 -0
- package/dist/tools/shared/gitignore.js.map +1 -0
- package/dist/tools/shared/pdf-extractor.d.ts +96 -0
- package/dist/tools/shared/pdf-extractor.d.ts.map +1 -0
- package/dist/tools/shared/pdf-extractor.js +196 -0
- package/dist/tools/shared/pdf-extractor.js.map +1 -0
- package/dist/tools/shared/read-registry.d.ts +66 -0
- package/dist/tools/shared/read-registry.d.ts.map +1 -0
- package/dist/tools/shared/read-registry.js +65 -0
- package/dist/tools/shared/read-registry.js.map +1 -0
- package/dist/tools/shared/safe-env.d.ts +18 -0
- package/dist/tools/shared/safe-env.d.ts.map +1 -0
- package/dist/tools/shared/safe-env.js +70 -0
- package/dist/tools/shared/safe-env.js.map +1 -0
- package/dist/tools/sub-agent.d.ts +91 -0
- package/dist/tools/sub-agent.d.ts.map +1 -0
- package/dist/tools/sub-agent.js +89 -0
- package/dist/tools/sub-agent.js.map +1 -0
- package/dist/tools/task-output.d.ts +38 -0
- package/dist/tools/task-output.d.ts.map +1 -0
- package/dist/tools/task-output.js +186 -0
- package/dist/tools/task-output.js.map +1 -0
- package/dist/tools/tool-search/index.d.ts +40 -0
- package/dist/tools/tool-search/index.d.ts.map +1 -0
- package/dist/tools/tool-search/index.js +110 -0
- package/dist/tools/tool-search/index.js.map +1 -0
- package/dist/tools/tool-search/registry.d.ts +82 -0
- package/dist/tools/tool-search/registry.d.ts.map +1 -0
- package/dist/tools/tool-search/registry.js +238 -0
- package/dist/tools/tool-search/registry.js.map +1 -0
- package/dist/tools/undo-edit.d.ts +51 -0
- package/dist/tools/undo-edit.d.ts.map +1 -0
- package/dist/tools/undo-edit.js +231 -0
- package/dist/tools/undo-edit.js.map +1 -0
- package/dist/tools/web-fetch/cache.d.ts +49 -0
- package/dist/tools/web-fetch/cache.d.ts.map +1 -0
- package/dist/tools/web-fetch/cache.js +89 -0
- package/dist/tools/web-fetch/cache.js.map +1 -0
- package/dist/tools/web-fetch/index.d.ts +53 -0
- package/dist/tools/web-fetch/index.d.ts.map +1 -0
- package/dist/tools/web-fetch/index.js +513 -0
- package/dist/tools/web-fetch/index.js.map +1 -0
- package/dist/tools/write.d.ts +59 -0
- package/dist/tools/write.d.ts.map +1 -0
- package/dist/tools/write.js +316 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/types.d.ts +881 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/working-tags.d.ts +44 -0
- package/dist/working-tags.d.ts.map +1 -0
- package/dist/working-tags.js +103 -0
- package/dist/working-tags.js.map +1 -0
- package/package.json +87 -0
- package/src/budget-guard.ts +170 -0
- package/src/compaction/compaction.ts +386 -0
- package/src/compaction/failsafe.ts +185 -0
- package/src/compaction/index.ts +1199 -0
- package/src/compaction/microcompaction.ts +709 -0
- package/src/compaction/observational/buffering.ts +430 -0
- package/src/compaction/observational/constants.ts +532 -0
- package/src/compaction/observational/index.ts +837 -0
- package/src/compaction/observational/observer.ts +510 -0
- package/src/compaction/observational/recall-tool.ts +130 -0
- package/src/compaction/observational/reflector.ts +221 -0
- package/src/compaction/observational/types.ts +343 -0
- package/src/context-manager.ts +237 -0
- package/src/cortex-agent.ts +4297 -0
- package/src/error-classifier.ts +199 -0
- package/src/event-bridge.ts +508 -0
- package/src/index.ts +292 -0
- package/src/mcp-client.ts +582 -0
- package/src/model-wrapper.ts +128 -0
- package/src/noop-logger.ts +9 -0
- package/src/prompt-diagnostics.ts +296 -0
- package/src/provider-manager.ts +823 -0
- package/src/provider-registry.ts +386 -0
- package/src/schema-converter.ts +51 -0
- package/src/skill-preprocessor.ts +314 -0
- package/src/skill-registry.ts +378 -0
- package/src/skill-tool.ts +130 -0
- package/src/sub-agent-manager.ts +236 -0
- package/src/token-estimator.ts +26 -0
- package/src/tool-contract.ts +113 -0
- package/src/tool-result-persistence.ts +197 -0
- package/src/tools/bash/index.ts +633 -0
- package/src/tools/bash/interactive.ts +302 -0
- package/src/tools/bash/safety.ts +1297 -0
- package/src/tools/edit.ts +422 -0
- package/src/tools/glob.ts +330 -0
- package/src/tools/grep.ts +819 -0
- package/src/tools/index.ts +110 -0
- package/src/tools/read.ts +580 -0
- package/src/tools/runtime.ts +173 -0
- package/src/tools/shared/cwd-tracker.ts +50 -0
- package/src/tools/shared/edit-history.ts +96 -0
- package/src/tools/shared/edit-matcher.ts +457 -0
- package/src/tools/shared/file-mutation-lock.ts +40 -0
- package/src/tools/shared/gitignore.ts +61 -0
- package/src/tools/shared/pdf-extractor.ts +290 -0
- package/src/tools/shared/read-registry.ts +93 -0
- package/src/tools/shared/safe-env.ts +82 -0
- package/src/tools/sub-agent.ts +171 -0
- package/src/tools/task-output.ts +236 -0
- package/src/tools/tool-search/index.ts +167 -0
- package/src/tools/tool-search/registry.ts +278 -0
- package/src/tools/undo-edit.ts +314 -0
- package/src/tools/web-fetch/cache.ts +112 -0
- package/src/tools/web-fetch/index.ts +604 -0
- package/src/tools/write.ts +385 -0
- package/src/types.ts +1057 -0
- package/src/working-tags.ts +118 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @animus-labs/cortex
|
|
3
|
+
*
|
|
4
|
+
* Production-grade agent wrapper for pi-agent-core.
|
|
5
|
+
* Provides context management, MCP tool support, tool permissions,
|
|
6
|
+
* budget guards, compaction, skill system, and event logging.
|
|
7
|
+
*
|
|
8
|
+
* Phase 1A exports: types and pure utility modules.
|
|
9
|
+
* Phase 1B exports: CortexAgent, ContextManager, EventBridge, BudgetGuard.
|
|
10
|
+
* Phase 1C exports: Built-in tools (Read, Write, Edit, Glob, Grep, Bash, TaskOutput, WebFetch).
|
|
11
|
+
* Phase 1D exports: ProviderManager, model wrapper, provider registry.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Types
|
|
15
|
+
export type {
|
|
16
|
+
CortexLogger,
|
|
17
|
+
CortexUsage,
|
|
18
|
+
SessionUsage,
|
|
19
|
+
CortexLifecycleState,
|
|
20
|
+
CortexToolPermissionDecision,
|
|
21
|
+
CortexToolPermissionResult,
|
|
22
|
+
CortexAgentConfig,
|
|
23
|
+
CortexDiagnosticsConfig,
|
|
24
|
+
ContextManagerConfig,
|
|
25
|
+
ErrorCategory,
|
|
26
|
+
ErrorSeverity,
|
|
27
|
+
ClassifiedError,
|
|
28
|
+
AgentTextOutput,
|
|
29
|
+
ToolContentDetails,
|
|
30
|
+
BudgetGuardConfig,
|
|
31
|
+
ToolCategory,
|
|
32
|
+
MicrocompactionConfig,
|
|
33
|
+
CompactionConfig,
|
|
34
|
+
FailsafeConfig,
|
|
35
|
+
AdaptiveThresholdConfig,
|
|
36
|
+
CortexCompactionConfig,
|
|
37
|
+
CompactionTarget,
|
|
38
|
+
CompactionResult,
|
|
39
|
+
CompactionDegradedInfo,
|
|
40
|
+
CompactionExhaustedInfo,
|
|
41
|
+
PersistResultFn,
|
|
42
|
+
CortexEvents,
|
|
43
|
+
UtilityModelDefaults,
|
|
44
|
+
McpTransportConfig,
|
|
45
|
+
McpStdioConfig,
|
|
46
|
+
McpHttpConfig,
|
|
47
|
+
McpConnectionState,
|
|
48
|
+
SkillConfig,
|
|
49
|
+
SkillEntry,
|
|
50
|
+
LoadedSkill,
|
|
51
|
+
CortexScriptContext,
|
|
52
|
+
SubAgentSpawnConfig,
|
|
53
|
+
SubAgentResult,
|
|
54
|
+
TrackedSubAgent,
|
|
55
|
+
ThinkingLevel,
|
|
56
|
+
ModelThinkingCapabilities,
|
|
57
|
+
ToolExecuteContext,
|
|
58
|
+
ToolCallStartPayload,
|
|
59
|
+
ToolCallUpdatePayload,
|
|
60
|
+
ToolCallEndPayload,
|
|
61
|
+
PromptWatchdogDiagnosticsConfig,
|
|
62
|
+
} from './types.js';
|
|
63
|
+
|
|
64
|
+
// Logger
|
|
65
|
+
export { NOOP_LOGGER } from './noop-logger.js';
|
|
66
|
+
|
|
67
|
+
// Schema Converter
|
|
68
|
+
export { zodToTypebox } from './schema-converter.js';
|
|
69
|
+
|
|
70
|
+
// Token Estimator
|
|
71
|
+
export { estimateTokens } from './token-estimator.js';
|
|
72
|
+
|
|
73
|
+
// Working Tags Parser
|
|
74
|
+
export {
|
|
75
|
+
stripWorkingTags,
|
|
76
|
+
extractWorkingContent,
|
|
77
|
+
parseWorkingTags,
|
|
78
|
+
} from './working-tags.js';
|
|
79
|
+
|
|
80
|
+
// Error Classifier
|
|
81
|
+
export { classifyError } from './error-classifier.js';
|
|
82
|
+
export type { ClassifyErrorOptions } from './error-classifier.js';
|
|
83
|
+
|
|
84
|
+
// Context Manager (Phase 1B)
|
|
85
|
+
export { ContextManager } from './context-manager.js';
|
|
86
|
+
export type {
|
|
87
|
+
AgentMessage,
|
|
88
|
+
AgentStateAccessor,
|
|
89
|
+
AgentContext,
|
|
90
|
+
} from './context-manager.js';
|
|
91
|
+
|
|
92
|
+
// Event Bridge (Phase 1B)
|
|
93
|
+
export { EventBridge } from './event-bridge.js';
|
|
94
|
+
export type {
|
|
95
|
+
CortexEventType,
|
|
96
|
+
CortexEvent,
|
|
97
|
+
CortexEventListener,
|
|
98
|
+
PiEventType,
|
|
99
|
+
PiEvent,
|
|
100
|
+
PiEventSource,
|
|
101
|
+
} from './event-bridge.js';
|
|
102
|
+
|
|
103
|
+
// Budget Guard (Phase 1B)
|
|
104
|
+
export { BudgetGuard } from './budget-guard.js';
|
|
105
|
+
|
|
106
|
+
// CortexAgent (Phase 1B)
|
|
107
|
+
export { CortexAgent, MINIMUM_CONTEXT_WINDOW, TOOL_RESULT_WORKING_TAGS_REMINDER } from './cortex-agent.js';
|
|
108
|
+
export type { PiAgent, PiModel } from './cortex-agent.js';
|
|
109
|
+
|
|
110
|
+
// Tool Contracts
|
|
111
|
+
export { fromPiAgentTool, assertValidCortexTool } from './tool-contract.js';
|
|
112
|
+
export type { CortexTool, PiAgentTool } from './tool-contract.js';
|
|
113
|
+
|
|
114
|
+
// MCP Client Manager (Phase 3)
|
|
115
|
+
export { McpClientManager } from './mcp-client.js';
|
|
116
|
+
export type { AgentTool } from './mcp-client.js';
|
|
117
|
+
|
|
118
|
+
// Built-in Tools (Phase 1C)
|
|
119
|
+
export {
|
|
120
|
+
ReadRegistry,
|
|
121
|
+
CwdTracker,
|
|
122
|
+
CortexToolRuntime,
|
|
123
|
+
BackgroundTaskStore,
|
|
124
|
+
WebFetchRuntimeState,
|
|
125
|
+
globalBackgroundTaskStore,
|
|
126
|
+
attachRuntimeAwareTool,
|
|
127
|
+
getRuntimeAwareToolMetadata,
|
|
128
|
+
cloneRuntimeAwareTool,
|
|
129
|
+
createReadTool,
|
|
130
|
+
createWriteTool,
|
|
131
|
+
createEditTool,
|
|
132
|
+
createGlobTool,
|
|
133
|
+
createGrepTool,
|
|
134
|
+
createBashTool,
|
|
135
|
+
createTaskOutputTool,
|
|
136
|
+
createWebFetchTool,
|
|
137
|
+
WebFetchCache,
|
|
138
|
+
getBackgroundTask,
|
|
139
|
+
getAllBackgroundTasks,
|
|
140
|
+
buildSafeEnv,
|
|
141
|
+
isCriticalPath,
|
|
142
|
+
classifyCommand,
|
|
143
|
+
checkObfuscation,
|
|
144
|
+
stripInvisibleChars,
|
|
145
|
+
checkScriptPreflight,
|
|
146
|
+
checkAutoModeClassifier,
|
|
147
|
+
runSafetyChecks,
|
|
148
|
+
validateWritePaths,
|
|
149
|
+
extractWritePaths,
|
|
150
|
+
TOOL_NAMES,
|
|
151
|
+
} from './tools/index.js';
|
|
152
|
+
export type {
|
|
153
|
+
ReadDetails,
|
|
154
|
+
ReadParamsType,
|
|
155
|
+
ReadToolConfig,
|
|
156
|
+
WriteDetails,
|
|
157
|
+
WriteParamsType,
|
|
158
|
+
WriteToolConfig,
|
|
159
|
+
DiffHunk,
|
|
160
|
+
EditDetails,
|
|
161
|
+
EditParamsType,
|
|
162
|
+
EditToolConfig,
|
|
163
|
+
GlobDetails,
|
|
164
|
+
GlobParamsType,
|
|
165
|
+
GlobToolConfig,
|
|
166
|
+
GrepDetails,
|
|
167
|
+
GrepParamsType,
|
|
168
|
+
GrepToolConfig,
|
|
169
|
+
BashDetails,
|
|
170
|
+
BashStreamUpdate,
|
|
171
|
+
BashParamsType,
|
|
172
|
+
BashToolConfig,
|
|
173
|
+
BackgroundTask,
|
|
174
|
+
TaskOutputDetails,
|
|
175
|
+
TaskOutputParamsType,
|
|
176
|
+
TaskOutputToolConfig,
|
|
177
|
+
WebFetchDetails,
|
|
178
|
+
WebFetchParamsType,
|
|
179
|
+
WebFetchToolConfig,
|
|
180
|
+
CacheEntry,
|
|
181
|
+
CommandClassification,
|
|
182
|
+
SafetyCheckResult,
|
|
183
|
+
BuiltInToolName,
|
|
184
|
+
SubAgentToolConfig,
|
|
185
|
+
SubAgentDetails,
|
|
186
|
+
SubAgentParamsType,
|
|
187
|
+
} from './tools/index.js';
|
|
188
|
+
|
|
189
|
+
// Skill System (Phase 4)
|
|
190
|
+
export { SkillRegistry, parseFrontmatter } from './skill-registry.js';
|
|
191
|
+
export { preprocessSkillBody, substituteVariables, executeShellCommand, executeScript } from './skill-preprocessor.js';
|
|
192
|
+
export { createLoadSkillTool, buildLoadSkillDescription, LOAD_SKILL_TOOL_NAME } from './skill-tool.js';
|
|
193
|
+
export type { LoadSkillToolConfig, LoadSkillParamsType } from './skill-tool.js';
|
|
194
|
+
export { LoadSkillParams } from './skill-tool.js';
|
|
195
|
+
|
|
196
|
+
// Sub-Agent Manager (Phase 4)
|
|
197
|
+
export { SubAgentManager } from './sub-agent-manager.js';
|
|
198
|
+
export type { SubAgentManagerConfig, SubAgentLifecycleHooks } from './sub-agent-manager.js';
|
|
199
|
+
|
|
200
|
+
// Deferred Tool Loading / ToolSearch
|
|
201
|
+
export { DeferredToolRegistry } from './tools/tool-search/registry.js';
|
|
202
|
+
export type { ToolSearchResult } from './tools/tool-search/registry.js';
|
|
203
|
+
export {
|
|
204
|
+
createToolSearchTool,
|
|
205
|
+
TOOL_SEARCH_TOOL_NAME,
|
|
206
|
+
ToolSearchParams,
|
|
207
|
+
} from './tools/tool-search/index.js';
|
|
208
|
+
export type {
|
|
209
|
+
ToolSearchToolConfig,
|
|
210
|
+
ToolSearchDetails,
|
|
211
|
+
ToolSearchParamsType,
|
|
212
|
+
} from './tools/tool-search/index.js';
|
|
213
|
+
export type { DeferredToolsConfig } from './types.js';
|
|
214
|
+
|
|
215
|
+
// Compaction (Phase 5)
|
|
216
|
+
export {
|
|
217
|
+
CompactionManager,
|
|
218
|
+
buildCompactionConfig,
|
|
219
|
+
DEFAULT_COMPACTION_CONFIG,
|
|
220
|
+
ADAPTIVE_DEFAULTS,
|
|
221
|
+
computeAdaptiveThreshold,
|
|
222
|
+
MicrocompactionEngine,
|
|
223
|
+
capToolResult,
|
|
224
|
+
runCompaction,
|
|
225
|
+
shouldCompact,
|
|
226
|
+
partitionHistory,
|
|
227
|
+
buildSummaryMessage,
|
|
228
|
+
emergencyTruncate,
|
|
229
|
+
shouldTruncate,
|
|
230
|
+
isContextOverflow,
|
|
231
|
+
} from './compaction/index.js';
|
|
232
|
+
|
|
233
|
+
// Tool Result Persistence (proactive interceptor at the tool execution boundary)
|
|
234
|
+
export {
|
|
235
|
+
applyResultPersistence,
|
|
236
|
+
processToolResult,
|
|
237
|
+
resolveThreshold,
|
|
238
|
+
MAX_RESULT_TOKENS,
|
|
239
|
+
BOOKEND_CHARS,
|
|
240
|
+
SKIP_RESULT_PERSISTENCE,
|
|
241
|
+
DEFAULT_TOOL_THRESHOLDS,
|
|
242
|
+
} from './tool-result-persistence.js';
|
|
243
|
+
export type {
|
|
244
|
+
ApplyPersistenceOptions,
|
|
245
|
+
ProcessResultOptions,
|
|
246
|
+
} from './tool-result-persistence.js';
|
|
247
|
+
export type {
|
|
248
|
+
TrimAction,
|
|
249
|
+
TrimState,
|
|
250
|
+
CompleteFn,
|
|
251
|
+
FailsafeTruncationResult,
|
|
252
|
+
ObservationalMemoryConfig,
|
|
253
|
+
ObservationalMemoryState,
|
|
254
|
+
ObservationEvent,
|
|
255
|
+
ReflectionEvent,
|
|
256
|
+
RecallConfig,
|
|
257
|
+
RecallResult,
|
|
258
|
+
} from './compaction/index.js';
|
|
259
|
+
|
|
260
|
+
// Model Wrapper (Phase 1D)
|
|
261
|
+
export { wrapModel, unwrapModel, isCortexModel } from './model-wrapper.js';
|
|
262
|
+
export type { CortexModel } from './model-wrapper.js';
|
|
263
|
+
|
|
264
|
+
// Provider Registry (Phase 1D)
|
|
265
|
+
export {
|
|
266
|
+
PROVIDER_REGISTRY,
|
|
267
|
+
OAUTH_PROVIDER_IDS,
|
|
268
|
+
UTILITY_MODEL_DEFAULTS,
|
|
269
|
+
PRIMARY_MODEL_DEFAULTS,
|
|
270
|
+
PROVIDER_CACHE_CONFIG,
|
|
271
|
+
resolveCacheRetention,
|
|
272
|
+
} from './provider-registry.js';
|
|
273
|
+
export type {
|
|
274
|
+
AuthMethod,
|
|
275
|
+
ProviderInfo,
|
|
276
|
+
ModelInfo,
|
|
277
|
+
ProviderCacheConfig,
|
|
278
|
+
CacheRetention,
|
|
279
|
+
} from './provider-registry.js';
|
|
280
|
+
|
|
281
|
+
// Provider Manager (Phase 1D)
|
|
282
|
+
export { ProviderManager } from './provider-manager.js';
|
|
283
|
+
export type {
|
|
284
|
+
IProviderManager,
|
|
285
|
+
OAuthCallbacks,
|
|
286
|
+
OAuthMeta,
|
|
287
|
+
OAuthResult,
|
|
288
|
+
OAuthRefreshResult,
|
|
289
|
+
CustomModelConfig,
|
|
290
|
+
ApiKeyValidationStatus,
|
|
291
|
+
ApiKeyValidationResult,
|
|
292
|
+
} from './provider-manager.js';
|