@n8n/agents 0.8.1 → 0.9.1
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/dist/build.tsbuildinfo +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +57 -4
- package/dist/index.js.map +1 -1
- package/dist/integrations/langsmith.js +28 -2
- package/dist/integrations/langsmith.js.map +1 -1
- package/dist/runtime/agent-runtime.d.ts +12 -1
- package/dist/runtime/agent-runtime.js +243 -119
- package/dist/runtime/agent-runtime.js.map +1 -1
- package/dist/runtime/episodic-memory-defaults.d.ts +17 -0
- package/dist/runtime/episodic-memory-defaults.js +615 -0
- package/dist/runtime/episodic-memory-defaults.js.map +1 -0
- package/dist/runtime/episodic-memory.d.ts +45 -0
- package/dist/runtime/episodic-memory.js +479 -0
- package/dist/runtime/episodic-memory.js.map +1 -0
- package/dist/runtime/execution-counter.d.ts +9 -0
- package/dist/runtime/execution-counter.js +16 -0
- package/dist/runtime/execution-counter.js.map +1 -0
- package/dist/runtime/fix-tool-call.d.ts +7 -0
- package/dist/runtime/fix-tool-call.js +38 -0
- package/dist/runtime/fix-tool-call.js.map +1 -0
- package/dist/runtime/lazy-ai.d.ts +2 -0
- package/dist/runtime/lazy-ai.js +12 -0
- package/dist/runtime/lazy-ai.js.map +1 -0
- package/dist/runtime/mcp-connection.d.ts +1 -1
- package/dist/runtime/mcp-connection.js +71 -16
- package/dist/runtime/mcp-connection.js.map +1 -1
- package/dist/runtime/memory-lifecycle.d.ts +34 -0
- package/dist/runtime/memory-lifecycle.js +63 -0
- package/dist/runtime/memory-lifecycle.js.map +1 -0
- package/dist/runtime/memory-store.d.ts +22 -7
- package/dist/runtime/memory-store.js +240 -50
- package/dist/runtime/memory-store.js.map +1 -1
- package/dist/runtime/message-list.d.ts +1 -0
- package/dist/runtime/message-list.js +5 -0
- package/dist/runtime/message-list.js.map +1 -1
- package/dist/runtime/messages.js +14 -1
- package/dist/runtime/messages.js.map +1 -1
- package/dist/runtime/model-factory.d.ts +5 -1
- package/dist/runtime/model-factory.js +3 -2
- package/dist/runtime/model-factory.js.map +1 -1
- package/dist/runtime/observation-log-defaults.js +6 -5
- package/dist/runtime/observation-log-defaults.js.map +1 -1
- package/dist/runtime/observation-log-observer.d.ts +7 -13
- package/dist/runtime/observation-log-observer.js +11 -21
- package/dist/runtime/observation-log-observer.js.map +1 -1
- package/dist/runtime/observation-log-reflector.d.ts +5 -5
- package/dist/runtime/observation-log-reflector.js +9 -21
- package/dist/runtime/observation-log-reflector.js.map +1 -1
- package/dist/runtime/scoped-memory-task-runner.d.ts +2 -4
- package/dist/runtime/scoped-memory-task-runner.js +3 -7
- package/dist/runtime/scoped-memory-task-runner.js.map +1 -1
- package/dist/runtime/stream.js +11 -1
- package/dist/runtime/stream.js.map +1 -1
- package/dist/runtime/title-generation.d.ts +5 -2
- package/dist/runtime/title-generation.js +7 -3
- package/dist/runtime/title-generation.js.map +1 -1
- package/dist/runtime/tool-adapter.d.ts +1 -1
- package/dist/runtime/tool-adapter.js +5 -4
- package/dist/runtime/tool-adapter.js.map +1 -1
- package/dist/sdk/agent.d.ts +10 -0
- package/dist/sdk/agent.js +77 -11
- package/dist/sdk/agent.js.map +1 -1
- package/dist/sdk/memory.d.ts +6 -2
- package/dist/sdk/memory.js +57 -3
- package/dist/sdk/memory.js.map +1 -1
- package/dist/sdk/telemetry.d.ts +1 -0
- package/dist/sdk/telemetry.js +7 -0
- package/dist/sdk/telemetry.js.map +1 -1
- package/dist/skills/index.d.ts +6 -0
- package/dist/skills/index.js +29 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/prompt.d.ts +6 -0
- package/dist/skills/prompt.js +49 -0
- package/dist/skills/prompt.js.map +1 -0
- package/dist/skills/registry.d.ts +14 -0
- package/dist/skills/registry.js +380 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/skills/tools.d.ts +6 -0
- package/dist/skills/tools.js +312 -0
- package/dist/skills/tools.js.map +1 -0
- package/dist/skills/types.d.ts +141 -0
- package/dist/skills/types.js +15 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/skills/validator.d.ts +15 -0
- package/dist/skills/validator.js +336 -0
- package/dist/skills/validator.js.map +1 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +1 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/runtime/event.d.ts +1 -1
- package/dist/types/sdk/agent-builder.d.ts +4 -1
- package/dist/types/sdk/agent.d.ts +2 -1
- package/dist/types/sdk/memory.d.ts +153 -2
- package/dist/types/sdk/observation-log.d.ts +7 -10
- package/dist/types/sdk/observation-log.js +0 -9
- package/dist/types/sdk/observation-log.js.map +1 -1
- package/dist/types/sdk/observation.d.ts +1 -4
- package/dist/workspace/tools/execute-command.js +2 -0
- package/dist/workspace/tools/execute-command.js.map +1 -1
- package/dist/workspace/types.d.ts +1 -0
- package/dist/workspace/types.js.map +1 -1
- package/package.json +28 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type { BuiltTool, BuiltProviderTool, BuiltAgent, BuiltMemory, BuiltGuardrail, BuiltEval, RunOptions, AgentResult, GenerateResult, StreamResult, EvalInput, EvalScore, EvalRunResult, EvalResults, ToolContext, InterruptibleToolContext, CheckpointStore, StreamChunk, SubAgentUsage, Provider, ThinkingConfig, ThinkingConfigFor, AnthropicThinkingConfig, OpenAIThinkingConfig, GoogleThinkingConfig, XaiThinkingConfig, SerializableAgentState, AgentRunState, MemoryConfig, ObservationLogMemoryConfig, MemoryDescriptor, ObservationCapableMemory, TitleGenerationConfig, Thread, SemanticRecallConfig, ResumeOptions, McpServerConfig, McpVerifyResult, ModelConfig, ExecutionOptions, AgentExecutionCounter, PersistedExecutionOptions, BuiltTelemetry, AttributeValue, ObservationCursor, ObservationalMemoryConfig,
|
|
1
|
+
export type { BuiltTool, BuiltProviderTool, BuiltAgent, BuiltMemory, BuiltEpisodicMemoryStore, BuiltGuardrail, BuiltEval, RunOptions, AgentResult, GenerateResult, StreamResult, EvalInput, EvalScore, EvalRunResult, EvalResults, ToolContext, InterruptibleToolContext, CheckpointStore, StreamChunk, SubAgentUsage, Provider, ThinkingConfig, ThinkingConfigFor, AnthropicThinkingConfig, OpenAIThinkingConfig, GoogleThinkingConfig, XaiThinkingConfig, SerializableAgentState, AgentRunState, MemoryConfig, ObservationLogMemoryConfig, MemoryDescriptor, ObservationCapableMemory, TitleGenerationConfig, Thread, EpisodicMemoryConfig, EpisodicMemoryCursor, EpisodicMemoryEmbeddingProviderOptions, EpisodicMemoryEntry, EpisodicMemoryEntrySource, EpisodicMemoryExtractFn, EpisodicMemoryExtraction, EpisodicMemoryExtractionCandidate, EpisodicMemoryExtractorInput, EpisodicMemoryMethods, EpisodicMemoryPrompts, EpisodicMemoryReflectFn, EpisodicMemoryReflection, EpisodicMemoryReflectionApply, EpisodicMemoryReflectionApplyMerge, EpisodicMemoryReflectionMerge, EpisodicMemoryReflectionResult, EpisodicMemoryReflectorInput, EpisodicMemoryScope, EpisodicMemorySearchOptions, EpisodicMemoryStatus, EpisodicMemoryTaskLockHandle, EpisodicMemoryTaskLockMethods, NewEpisodicMemoryCursor, NewEpisodicMemoryEntry, NewEpisodicMemoryEntrySource, NewEpisodicMemoryEntrySourceForEntry, RetrievedEpisodicMemoryEntry, SemanticRecallConfig, ResumeOptions, McpServerConfig, McpVerifyResult, ModelConfig, ExecutionOptions, AgentExecutionCounter, PersistedExecutionOptions, BuiltTelemetry, AttributeValue, ObservationCursor, ObservationalMemoryConfig, BuiltObservationLogStore, BuiltObservationLogTaskLockStore, NewObservationLogEntry, ObservationLogEntry, ObservationLogMarker, ObservationLogMerge, ObservationLogReadOptions, ObservationLogReflection, ObservationLogReflectionResult, ObservationLogScope, ObservationLogStatus, ObservationLogTaskKind, ObservationLogTaskLockHandle, TokenCounter, } from './types';
|
|
2
2
|
export type { ProviderOptions } from '@ai-sdk/provider-utils';
|
|
3
3
|
export { AgentEvent } from './types';
|
|
4
4
|
export type { AgentEventData, AgentEventHandler } from './types';
|
|
5
|
-
export {
|
|
5
|
+
export { estimateObservationTokens, OBSERVATION_LOG_MARKERS, OBSERVATION_LOG_STATUSES, } from './types';
|
|
6
6
|
export { Tool, wrapToolForApproval } from './sdk/tool';
|
|
7
7
|
export { Memory } from './sdk/memory';
|
|
8
8
|
export { Guardrail } from './sdk/guardrail';
|
|
@@ -15,6 +15,8 @@ export { LangSmithTelemetry } from './integrations/langsmith';
|
|
|
15
15
|
export type { LangSmithTelemetryConfig } from './integrations/langsmith';
|
|
16
16
|
export { Agent } from './sdk/agent';
|
|
17
17
|
export type { AgentSnapshot } from './sdk/agent';
|
|
18
|
+
export { appendSkillCatalogToInstructions, createListSkillsTool, createRuntimeSkillRegistry, createRuntimeSkillSource, createRuntimeSkillTools, createSkillLoadTool, formatSkillValidationErrors, InvalidRuntimeSkillError, loadRuntimeSkillsFromDirectory, loadRuntimeSkillSourceFromDirectory, parseRuntimeSkillMarkdown, renderSkillCatalogPrompt, RUNTIME_SKILL_TOOL_NAMES, RUNTIME_SKILL_FILE_NAME, RUNTIME_SKILL_LINKED_FILE_GROUPS, RUNTIME_SKILL_NAME_PATTERN, RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION, LIST_SKILLS_TOOL_NAME, SKILL_LOAD_TOOL_NAME, validateRuntimeSkill, } from './skills';
|
|
19
|
+
export type { RenderSkillCatalogOptions, RuntimeSkill, RuntimeSkillContent, RuntimeSkillDependenciesContract, RuntimeSkillFileContent, RuntimeSkillFileLoader, RuntimeSkillIndexEntry, RuntimeSkillInterfaceContract, RuntimeSkillLinkedFile, RuntimeSkillLinkedFileGroup, RuntimeSkillLinkedFiles, RuntimeSkillLoader, RuntimeSkillMcpServerDependency, RuntimeSkillPolicyContract, RuntimeSkillRegistry, RuntimeSkillRegistryEntry, RuntimeSkillSource, RuntimeSkillValidationError, RuntimeSkillValidationResult, } from './skills';
|
|
18
20
|
export type { AgentBuilder, CredentialProvider, ResolvedCredential, CredentialListItem, } from './types';
|
|
19
21
|
export { McpClient } from './sdk/mcp-client';
|
|
20
22
|
export { Network } from './sdk/network';
|
|
@@ -31,7 +33,13 @@ export type { ProviderCatalog, ProviderInfo, ModelInfo, ModelCost, ModelLimits,
|
|
|
31
33
|
export { BaseMemory } from './storage/base-memory';
|
|
32
34
|
export type { ToolDescriptor } from './types/sdk/tool-descriptor';
|
|
33
35
|
export { createModel } from './runtime/model-factory';
|
|
36
|
+
export { createEmbeddingModel } from './runtime/model-factory';
|
|
34
37
|
export { generateTitleFromMessage } from './runtime/title-generation';
|
|
38
|
+
export { activeLifecycleState, droppedLifecycleState, markLifecycleActive, markLifecycleDropped, markLifecycleSuperseded, normalizeFlatReflectionActions, supersededLifecycleState, uniqueStrings, } from './runtime/memory-lifecycle';
|
|
39
|
+
export { RECALL_MEMORY_TOOL_NAME, createRecallMemoryTool, getEpisodicMemoryScope, hashEpisodicMemoryContent, hashEpisodicMemoryEvidence, hasEpisodicMemoryStore, isEpisodicMemoryEnabled, rankEpisodicMemoryEntries, runEpisodicMemoryIndexer, withEpisodicMemoryDefaults, } from './runtime/episodic-memory';
|
|
40
|
+
export { DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL, DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT, DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN, DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION, DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT, DEFAULT_EPISODIC_MEMORY_TOP_K, buildEpisodicMemoryExtractorPrompt, buildEpisodicMemoryReflectorPrompt, createEpisodicMemoryExtractFn, createEpisodicMemoryReflectFn, } from './runtime/episodic-memory-defaults';
|
|
41
|
+
export type { CreateEpisodicMemoryExtractFnOptions, CreateEpisodicMemoryReflectFnOptions, } from './runtime/episodic-memory-defaults';
|
|
42
|
+
export type { MemoryLifecycleState, MemoryLifecycleStatus } from './runtime/memory-lifecycle';
|
|
35
43
|
export { parseObservationLogMarkdown, renderObserverTranscript, runObservationLogObserver, } from './runtime/observation-log-observer';
|
|
36
44
|
export { normalizeObservationLogReflection, parseObservationLogReflectionJson, renderObservationLogForReflection, runObservationLogReflector, } from './runtime/observation-log-reflector';
|
|
37
45
|
export { ScopedMemoryTaskRunner } from './runtime/scoped-memory-task-runner';
|
package/dist/index.js
CHANGED
|
@@ -33,13 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
36
|
+
exports.markLifecycleDropped = exports.markLifecycleActive = exports.droppedLifecycleState = exports.activeLifecycleState = exports.generateTitleFromMessage = exports.createEmbeddingModel = exports.createModel = exports.BaseMemory = exports.providerCapabilities = exports.fetchProviderCatalog = exports.isLlmMessage = exports.filterLlmMessages = exports.verify = exports.providerTools = exports.Network = exports.McpClient = exports.validateRuntimeSkill = exports.SKILL_LOAD_TOOL_NAME = exports.LIST_SKILLS_TOOL_NAME = exports.RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION = exports.RUNTIME_SKILL_NAME_PATTERN = exports.RUNTIME_SKILL_LINKED_FILE_GROUPS = exports.RUNTIME_SKILL_FILE_NAME = exports.RUNTIME_SKILL_TOOL_NAMES = exports.renderSkillCatalogPrompt = exports.parseRuntimeSkillMarkdown = exports.loadRuntimeSkillSourceFromDirectory = exports.loadRuntimeSkillsFromDirectory = exports.InvalidRuntimeSkillError = exports.formatSkillValidationErrors = exports.createSkillLoadTool = exports.createRuntimeSkillTools = exports.createRuntimeSkillSource = exports.createRuntimeSkillRegistry = exports.createListSkillsTool = exports.appendSkillCatalogToInstructions = exports.Agent = exports.LangSmithTelemetry = exports.Telemetry = exports.evals = exports.evaluate = exports.Eval = exports.Guardrail = exports.Memory = exports.wrapToolForApproval = exports.Tool = exports.OBSERVATION_LOG_STATUSES = exports.OBSERVATION_LOG_MARKERS = exports.estimateObservationTokens = exports.AgentEvent = void 0;
|
|
37
|
+
exports.isZodSchema = exports.ProcessHandle = exports.SandboxProcessManager = exports.createWorkspaceTools = exports.BaseSandbox = exports.BaseFilesystem = exports.Workspace = exports.DEFAULT_OBSERVATION_LOG_TAIL_LIMIT = exports.DEFAULT_OBSERVATION_LOG_RENDER_TOKEN_BUDGET = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_REFLECTOR_PROMPT = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_THRESHOLD_TOKENS = exports.DEFAULT_OBSERVATION_LOG_OBSERVER_PROMPT = exports.DEFAULT_OBSERVATION_LOG_LOCK_TTL_MS = exports.createObservationLogObserveFn = exports.createObservationLogReflectFn = exports.buildObservationLogObserverPrompt = exports.buildObservationLogReflectorPrompt = exports.ScopedMemoryTaskRunner = exports.runObservationLogReflector = exports.renderObservationLogForReflection = exports.parseObservationLogReflectionJson = exports.normalizeObservationLogReflection = exports.runObservationLogObserver = exports.renderObserverTranscript = exports.parseObservationLogMarkdown = exports.createEpisodicMemoryReflectFn = exports.createEpisodicMemoryExtractFn = exports.buildEpisodicMemoryReflectorPrompt = exports.buildEpisodicMemoryExtractorPrompt = exports.DEFAULT_EPISODIC_MEMORY_TOP_K = exports.DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION = exports.DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN = exports.DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT = exports.DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL = exports.withEpisodicMemoryDefaults = exports.runEpisodicMemoryIndexer = exports.rankEpisodicMemoryEntries = exports.isEpisodicMemoryEnabled = exports.hasEpisodicMemoryStore = exports.hashEpisodicMemoryEvidence = exports.hashEpisodicMemoryContent = exports.getEpisodicMemoryScope = exports.createRecallMemoryTool = exports.RECALL_MEMORY_TOOL_NAME = exports.uniqueStrings = exports.supersededLifecycleState = exports.normalizeFlatReflectionActions = exports.markLifecycleSuperseded = void 0;
|
|
38
|
+
exports.zodToJsonSchema = void 0;
|
|
38
39
|
var types_1 = require("./types");
|
|
39
40
|
Object.defineProperty(exports, "AgentEvent", { enumerable: true, get: function () { return types_1.AgentEvent; } });
|
|
40
41
|
var types_2 = require("./types");
|
|
41
|
-
Object.defineProperty(exports, "createObservationLogThreadScopeId", { enumerable: true, get: function () { return types_2.createObservationLogThreadScopeId; } });
|
|
42
|
-
Object.defineProperty(exports, "createObservationLogThreadScopePrefix", { enumerable: true, get: function () { return types_2.createObservationLogThreadScopePrefix; } });
|
|
43
42
|
Object.defineProperty(exports, "estimateObservationTokens", { enumerable: true, get: function () { return types_2.estimateObservationTokens; } });
|
|
44
43
|
Object.defineProperty(exports, "OBSERVATION_LOG_MARKERS", { enumerable: true, get: function () { return types_2.OBSERVATION_LOG_MARKERS; } });
|
|
45
44
|
Object.defineProperty(exports, "OBSERVATION_LOG_STATUSES", { enumerable: true, get: function () { return types_2.OBSERVATION_LOG_STATUSES; } });
|
|
@@ -61,6 +60,27 @@ var langsmith_1 = require("./integrations/langsmith");
|
|
|
61
60
|
Object.defineProperty(exports, "LangSmithTelemetry", { enumerable: true, get: function () { return langsmith_1.LangSmithTelemetry; } });
|
|
62
61
|
var agent_1 = require("./sdk/agent");
|
|
63
62
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
|
|
63
|
+
var skills_1 = require("./skills");
|
|
64
|
+
Object.defineProperty(exports, "appendSkillCatalogToInstructions", { enumerable: true, get: function () { return skills_1.appendSkillCatalogToInstructions; } });
|
|
65
|
+
Object.defineProperty(exports, "createListSkillsTool", { enumerable: true, get: function () { return skills_1.createListSkillsTool; } });
|
|
66
|
+
Object.defineProperty(exports, "createRuntimeSkillRegistry", { enumerable: true, get: function () { return skills_1.createRuntimeSkillRegistry; } });
|
|
67
|
+
Object.defineProperty(exports, "createRuntimeSkillSource", { enumerable: true, get: function () { return skills_1.createRuntimeSkillSource; } });
|
|
68
|
+
Object.defineProperty(exports, "createRuntimeSkillTools", { enumerable: true, get: function () { return skills_1.createRuntimeSkillTools; } });
|
|
69
|
+
Object.defineProperty(exports, "createSkillLoadTool", { enumerable: true, get: function () { return skills_1.createSkillLoadTool; } });
|
|
70
|
+
Object.defineProperty(exports, "formatSkillValidationErrors", { enumerable: true, get: function () { return skills_1.formatSkillValidationErrors; } });
|
|
71
|
+
Object.defineProperty(exports, "InvalidRuntimeSkillError", { enumerable: true, get: function () { return skills_1.InvalidRuntimeSkillError; } });
|
|
72
|
+
Object.defineProperty(exports, "loadRuntimeSkillsFromDirectory", { enumerable: true, get: function () { return skills_1.loadRuntimeSkillsFromDirectory; } });
|
|
73
|
+
Object.defineProperty(exports, "loadRuntimeSkillSourceFromDirectory", { enumerable: true, get: function () { return skills_1.loadRuntimeSkillSourceFromDirectory; } });
|
|
74
|
+
Object.defineProperty(exports, "parseRuntimeSkillMarkdown", { enumerable: true, get: function () { return skills_1.parseRuntimeSkillMarkdown; } });
|
|
75
|
+
Object.defineProperty(exports, "renderSkillCatalogPrompt", { enumerable: true, get: function () { return skills_1.renderSkillCatalogPrompt; } });
|
|
76
|
+
Object.defineProperty(exports, "RUNTIME_SKILL_TOOL_NAMES", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_TOOL_NAMES; } });
|
|
77
|
+
Object.defineProperty(exports, "RUNTIME_SKILL_FILE_NAME", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_FILE_NAME; } });
|
|
78
|
+
Object.defineProperty(exports, "RUNTIME_SKILL_LINKED_FILE_GROUPS", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_LINKED_FILE_GROUPS; } });
|
|
79
|
+
Object.defineProperty(exports, "RUNTIME_SKILL_NAME_PATTERN", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_NAME_PATTERN; } });
|
|
80
|
+
Object.defineProperty(exports, "RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION", { enumerable: true, get: function () { return skills_1.RUNTIME_SKILL_REGISTRY_SCHEMA_VERSION; } });
|
|
81
|
+
Object.defineProperty(exports, "LIST_SKILLS_TOOL_NAME", { enumerable: true, get: function () { return skills_1.LIST_SKILLS_TOOL_NAME; } });
|
|
82
|
+
Object.defineProperty(exports, "SKILL_LOAD_TOOL_NAME", { enumerable: true, get: function () { return skills_1.SKILL_LOAD_TOOL_NAME; } });
|
|
83
|
+
Object.defineProperty(exports, "validateRuntimeSkill", { enumerable: true, get: function () { return skills_1.validateRuntimeSkill; } });
|
|
64
84
|
var mcp_client_1 = require("./sdk/mcp-client");
|
|
65
85
|
Object.defineProperty(exports, "McpClient", { enumerable: true, get: function () { return mcp_client_1.McpClient; } });
|
|
66
86
|
var network_1 = require("./sdk/network");
|
|
@@ -80,8 +100,41 @@ var base_memory_1 = require("./storage/base-memory");
|
|
|
80
100
|
Object.defineProperty(exports, "BaseMemory", { enumerable: true, get: function () { return base_memory_1.BaseMemory; } });
|
|
81
101
|
var model_factory_1 = require("./runtime/model-factory");
|
|
82
102
|
Object.defineProperty(exports, "createModel", { enumerable: true, get: function () { return model_factory_1.createModel; } });
|
|
103
|
+
var model_factory_2 = require("./runtime/model-factory");
|
|
104
|
+
Object.defineProperty(exports, "createEmbeddingModel", { enumerable: true, get: function () { return model_factory_2.createEmbeddingModel; } });
|
|
83
105
|
var title_generation_1 = require("./runtime/title-generation");
|
|
84
106
|
Object.defineProperty(exports, "generateTitleFromMessage", { enumerable: true, get: function () { return title_generation_1.generateTitleFromMessage; } });
|
|
107
|
+
var memory_lifecycle_1 = require("./runtime/memory-lifecycle");
|
|
108
|
+
Object.defineProperty(exports, "activeLifecycleState", { enumerable: true, get: function () { return memory_lifecycle_1.activeLifecycleState; } });
|
|
109
|
+
Object.defineProperty(exports, "droppedLifecycleState", { enumerable: true, get: function () { return memory_lifecycle_1.droppedLifecycleState; } });
|
|
110
|
+
Object.defineProperty(exports, "markLifecycleActive", { enumerable: true, get: function () { return memory_lifecycle_1.markLifecycleActive; } });
|
|
111
|
+
Object.defineProperty(exports, "markLifecycleDropped", { enumerable: true, get: function () { return memory_lifecycle_1.markLifecycleDropped; } });
|
|
112
|
+
Object.defineProperty(exports, "markLifecycleSuperseded", { enumerable: true, get: function () { return memory_lifecycle_1.markLifecycleSuperseded; } });
|
|
113
|
+
Object.defineProperty(exports, "normalizeFlatReflectionActions", { enumerable: true, get: function () { return memory_lifecycle_1.normalizeFlatReflectionActions; } });
|
|
114
|
+
Object.defineProperty(exports, "supersededLifecycleState", { enumerable: true, get: function () { return memory_lifecycle_1.supersededLifecycleState; } });
|
|
115
|
+
Object.defineProperty(exports, "uniqueStrings", { enumerable: true, get: function () { return memory_lifecycle_1.uniqueStrings; } });
|
|
116
|
+
var episodic_memory_1 = require("./runtime/episodic-memory");
|
|
117
|
+
Object.defineProperty(exports, "RECALL_MEMORY_TOOL_NAME", { enumerable: true, get: function () { return episodic_memory_1.RECALL_MEMORY_TOOL_NAME; } });
|
|
118
|
+
Object.defineProperty(exports, "createRecallMemoryTool", { enumerable: true, get: function () { return episodic_memory_1.createRecallMemoryTool; } });
|
|
119
|
+
Object.defineProperty(exports, "getEpisodicMemoryScope", { enumerable: true, get: function () { return episodic_memory_1.getEpisodicMemoryScope; } });
|
|
120
|
+
Object.defineProperty(exports, "hashEpisodicMemoryContent", { enumerable: true, get: function () { return episodic_memory_1.hashEpisodicMemoryContent; } });
|
|
121
|
+
Object.defineProperty(exports, "hashEpisodicMemoryEvidence", { enumerable: true, get: function () { return episodic_memory_1.hashEpisodicMemoryEvidence; } });
|
|
122
|
+
Object.defineProperty(exports, "hasEpisodicMemoryStore", { enumerable: true, get: function () { return episodic_memory_1.hasEpisodicMemoryStore; } });
|
|
123
|
+
Object.defineProperty(exports, "isEpisodicMemoryEnabled", { enumerable: true, get: function () { return episodic_memory_1.isEpisodicMemoryEnabled; } });
|
|
124
|
+
Object.defineProperty(exports, "rankEpisodicMemoryEntries", { enumerable: true, get: function () { return episodic_memory_1.rankEpisodicMemoryEntries; } });
|
|
125
|
+
Object.defineProperty(exports, "runEpisodicMemoryIndexer", { enumerable: true, get: function () { return episodic_memory_1.runEpisodicMemoryIndexer; } });
|
|
126
|
+
Object.defineProperty(exports, "withEpisodicMemoryDefaults", { enumerable: true, get: function () { return episodic_memory_1.withEpisodicMemoryDefaults; } });
|
|
127
|
+
var episodic_memory_defaults_1 = require("./runtime/episodic-memory-defaults");
|
|
128
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_EMBEDDING_MODEL; } });
|
|
129
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_EXTRACTION_PROMPT; } });
|
|
130
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN; } });
|
|
131
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION; } });
|
|
132
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_REFLECTION_PROMPT; } });
|
|
133
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_MEMORY_TOP_K", { enumerable: true, get: function () { return episodic_memory_defaults_1.DEFAULT_EPISODIC_MEMORY_TOP_K; } });
|
|
134
|
+
Object.defineProperty(exports, "buildEpisodicMemoryExtractorPrompt", { enumerable: true, get: function () { return episodic_memory_defaults_1.buildEpisodicMemoryExtractorPrompt; } });
|
|
135
|
+
Object.defineProperty(exports, "buildEpisodicMemoryReflectorPrompt", { enumerable: true, get: function () { return episodic_memory_defaults_1.buildEpisodicMemoryReflectorPrompt; } });
|
|
136
|
+
Object.defineProperty(exports, "createEpisodicMemoryExtractFn", { enumerable: true, get: function () { return episodic_memory_defaults_1.createEpisodicMemoryExtractFn; } });
|
|
137
|
+
Object.defineProperty(exports, "createEpisodicMemoryReflectFn", { enumerable: true, get: function () { return episodic_memory_defaults_1.createEpisodicMemoryReflectFn; } });
|
|
85
138
|
var observation_log_observer_1 = require("./runtime/observation-log-observer");
|
|
86
139
|
Object.defineProperty(exports, "parseObservationLogMarkdown", { enumerable: true, get: function () { return observation_log_observer_1.parseObservationLogMarkdown; } });
|
|
87
140
|
Object.defineProperty(exports, "renderObserverTranscript", { enumerable: true, get: function () { return observation_log_observer_1.renderObserverTranscript; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AAEnB,iCAIiB;AAHhB,kHAAA,yBAAyB,OAAA;AACzB,gHAAA,uBAAuB,OAAA;AACvB,iHAAA,wBAAwB,OAAA;AAGzB,mCAAuD;AAA9C,4FAAA,IAAI,OAAA;AAAE,2GAAA,mBAAmB,OAAA;AAClC,uCAAsC;AAA7B,gGAAA,MAAM,OAAA;AACf,6CAA4C;AAAnC,sGAAA,SAAS,OAAA;AAClB,mCAAkC;AAAzB,4FAAA,IAAI,OAAA;AACb,2CAA0C;AAAjC,oGAAA,QAAQ,OAAA;AAEjB,uDAAuC;AAC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AAuC,OAAA;AACvC,6JAAA,iDAAiD,OAAA;AACjD,oJAAA,wCAAwC,OAAA;AACxC,8JAAA,kDAAkD,OAAA;AAClD,uJAAA,2CAA2C,OAAA;AAC3C,8IAAA,kCAAkC,OAAA;AAmCnC,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AACvB,yCAA0C;AAAjC,wGAAA,WAAW,OAAA;AACpB,yCAAmD;AAA1C,iHAAA,oBAAoB,OAAA;AAC7B,yCAAmE;AAA1D,kHAAA,qBAAqB,OAAA;AAAE,0GAAA,aAAa,OAAA;AAiC7C,mCAA2D;AAAlD,kGAAA,WAAW,OAAA;AAAE,sGAAA,eAAe,OAAA"}
|
|
@@ -48,6 +48,29 @@ const TRACEABLE_AI_SDK_OPERATIONS = new Set([
|
|
|
48
48
|
'ai.streamObject.doStream',
|
|
49
49
|
'ai.toolCall',
|
|
50
50
|
]);
|
|
51
|
+
const OTEL_EXPORT_RESULT_FAILED = 1;
|
|
52
|
+
function toExportError(error) {
|
|
53
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
54
|
+
}
|
|
55
|
+
function createHeaderRefreshingLangSmithExporter(LangSmithOTLPTraceExporter, getExporterConfig, getHeaders) {
|
|
56
|
+
return {
|
|
57
|
+
export(spans, resultCallback) {
|
|
58
|
+
void (async () => {
|
|
59
|
+
try {
|
|
60
|
+
const headers = await getHeaders();
|
|
61
|
+
const exporter = new LangSmithOTLPTraceExporter(getExporterConfig(headers));
|
|
62
|
+
exporter.export(spans, resultCallback);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
resultCallback({ code: OTEL_EXPORT_RESULT_FAILED, error: toExportError(error) });
|
|
66
|
+
}
|
|
67
|
+
})();
|
|
68
|
+
},
|
|
69
|
+
async shutdown() {
|
|
70
|
+
await Promise.resolve();
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
51
74
|
function isOtelSpanLike(value) {
|
|
52
75
|
return (value !== null &&
|
|
53
76
|
typeof value === 'object' &&
|
|
@@ -147,8 +170,7 @@ async function createLangSmithTracer(config, resolvedApiKey) {
|
|
|
147
170
|
? undefined
|
|
148
171
|
: (config?.url ??
|
|
149
172
|
(config?.endpoint ? `${config.endpoint.replace(/\/$/, '')}/otel/v1/traces` : undefined));
|
|
150
|
-
const
|
|
151
|
-
const exporter = new LangSmithOTLPTraceExporter({
|
|
173
|
+
const buildExporterConfig = (headers) => ({
|
|
152
174
|
apiKey,
|
|
153
175
|
projectName: config?.project,
|
|
154
176
|
...(headers ? { headers } : {}),
|
|
@@ -157,6 +179,10 @@ async function createLangSmithTracer(config, resolvedApiKey) {
|
|
|
157
179
|
: {}),
|
|
158
180
|
...(url ? { url } : {}),
|
|
159
181
|
});
|
|
182
|
+
const headers = config?.headers;
|
|
183
|
+
const exporter = typeof headers === 'function'
|
|
184
|
+
? createHeaderRefreshingLangSmithExporter(LangSmithOTLPTraceExporter, buildExporterConfig, headers)
|
|
185
|
+
: new LangSmithOTLPTraceExporter(buildExporterConfig(headers));
|
|
160
186
|
const processor = createLangSmithSpanProcessor({
|
|
161
187
|
exporter,
|
|
162
188
|
BatchSpanProcessor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langsmith.js","sourceRoot":"","sources":["../../src/integrations/langsmith.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA6C;AAG7C,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAC9C,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,uCAAuC,GAAG,yCAAyC,CAAC;AAC1F,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC3C,4BAA4B;IAC5B,wBAAwB;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ChB,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAG1B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QAIlC,OAAO,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC/B,CAAC;CACD;AAnCD,gDAmCC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProviderOptions } from '@ai-sdk/provider-utils';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { BuiltMemory, BuiltProviderTool, BuiltTelemetry, BuiltTool, CheckpointStore, GenerateResult, ObservationalMemoryConfig, ObservationLogMemoryConfig, RunOptions, SemanticRecallConfig, SerializableAgentState, StreamResult, ThinkingConfig, TitleGenerationConfig } from '../types';
|
|
3
|
+
import type { BuiltMemory, BuiltProviderTool, BuiltTelemetry, BuiltTool, CheckpointStore, EpisodicMemoryConfig, GenerateResult, ObservationalMemoryConfig, ObservationLogMemoryConfig, RunOptions, SemanticRecallConfig, SerializableAgentState, StreamResult, ThinkingConfig, TitleGenerationConfig } from '../types';
|
|
4
4
|
import { AgentEventBus } from './event-bus';
|
|
5
5
|
import type { ExecutionOptions, ModelConfig } from '../types/sdk/agent';
|
|
6
6
|
import type { AgentMessage } from '../types/sdk/message';
|
|
@@ -19,6 +19,7 @@ export interface AgentRuntimeConfig {
|
|
|
19
19
|
lastMessages?: number;
|
|
20
20
|
observationLog?: ObservationLogMemoryConfig;
|
|
21
21
|
observationalMemory?: ObservationalMemoryConfig;
|
|
22
|
+
episodicMemory?: EpisodicMemoryConfig;
|
|
22
23
|
semanticRecall?: SemanticRecallConfig;
|
|
23
24
|
structuredOutput?: z.ZodType;
|
|
24
25
|
checkpointStorage?: 'memory' | CheckpointStore;
|
|
@@ -36,8 +37,10 @@ export declare class AgentRuntime {
|
|
|
36
37
|
private modelCost;
|
|
37
38
|
private backgroundTasks;
|
|
38
39
|
private memoryTasks;
|
|
40
|
+
private episodicMemoryTasksByResource;
|
|
39
41
|
private deferredToolManager;
|
|
40
42
|
constructor(config: AgentRuntimeConfig);
|
|
43
|
+
setTelemetry(telemetry: BuiltTelemetry | undefined): void;
|
|
41
44
|
dispose(): Promise<void>;
|
|
42
45
|
getState(): SerializableAgentState;
|
|
43
46
|
abort(): void;
|
|
@@ -52,12 +55,14 @@ export declare class AgentRuntime {
|
|
|
52
55
|
toolCallId: string;
|
|
53
56
|
} & ExecutionOptions): Promise<StreamResult>;
|
|
54
57
|
private buildMessageList;
|
|
58
|
+
private loadHistoryMessages;
|
|
55
59
|
private performSemanticRecall;
|
|
56
60
|
private expandMessageRange;
|
|
57
61
|
private initRun;
|
|
58
62
|
private finalizeGenerate;
|
|
59
63
|
private resolveTelemetry;
|
|
60
64
|
private flushTelemetry;
|
|
65
|
+
private buildAiSdkOptions;
|
|
61
66
|
private buildTelemetryOptions;
|
|
62
67
|
private buildTelemetryRootAttributes;
|
|
63
68
|
private buildTelemetryMetadataAttributes;
|
|
@@ -73,6 +78,11 @@ export declare class AgentRuntime {
|
|
|
73
78
|
private runStreamLoop;
|
|
74
79
|
private saveToMemory;
|
|
75
80
|
private scheduleObservationLogJobs;
|
|
81
|
+
private scheduleEpisodicMemoryJob;
|
|
82
|
+
private scheduleEpisodicMemoryTask;
|
|
83
|
+
private runEpisodicMemoryTask;
|
|
84
|
+
private releaseEpisodicMemoryTaskLock;
|
|
85
|
+
private scheduleMemoryTask;
|
|
76
86
|
private getMemoryTaskRunner;
|
|
77
87
|
private getObservationLogScope;
|
|
78
88
|
private saveEmbeddingsForMessages;
|
|
@@ -84,6 +94,7 @@ export declare class AgentRuntime {
|
|
|
84
94
|
private buildStaticLoopContext;
|
|
85
95
|
private buildToolLoopContext;
|
|
86
96
|
private getCurrentTools;
|
|
97
|
+
private createRecallMemoryToolForRun;
|
|
87
98
|
private hydrateDeferredToolsFromList;
|
|
88
99
|
private composeEffectiveInstructions;
|
|
89
100
|
private persistSuspension;
|