@makaio/framework 1.0.0-dev-1783439621927 → 1.0.0-dev-1783615060726
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/.makaio-build.json +2 -2
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/index.d.mts +106 -167
- package/dist/adapters/index.mjs +6 -6
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +4 -4
- package/dist/{base-orchestrator-ODRyDBzu.d.mts → base-orchestrator-J1WKAUkF.d.mts} +24 -3
- package/dist/bus/index.mjs +1 -1
- package/dist/{client-n0OJiTt1.mjs → client-l1Rq5p6X.mjs} +1 -1
- package/dist/clients/index.d.mts +30 -0
- package/dist/clients/index.mjs +2 -2
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/config/index.d.mts +6 -6
- package/dist/contracts/extension/index.d.mts +3 -3
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +105 -105
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/provider/index.d.mts +1 -1
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/{definition-DpkfJi8v.d.mts → definition-DePb3ke-.d.mts} +1 -1
- package/dist/{index-BwGfdbI0.d.mts → index-2fK9iSHI.d.mts} +9 -9
- package/dist/{index-DTBQOCar.d.mts → index-BMbmoarE.d.mts} +16 -16
- package/dist/{index-DmJ-OpTD.d.mts → index-BSprsrul.d.mts} +82 -44
- package/dist/{index-D7Fu3375.d.mts → index-BbQpQ1N3.d.mts} +3 -3
- package/dist/{index-B5Uczo3R.d.mts → index-C9FCWOhp.d.mts} +28 -28
- package/dist/{index-NkNbYFud.d.mts → index-CaerrEDH.d.mts} +1 -1
- package/dist/{index-BvjLe_w9.d.mts → index-Cx1Bm6WD.d.mts} +8 -8
- package/dist/{index-CwHP8Jxs.d.mts → index-D8wmMJLi.d.mts} +189 -1
- package/dist/{index-CYHWOXUm.d.mts → index-DEzdNQum.d.mts} +1 -1
- package/dist/{index-BIZeIA5k.d.mts → index-DKaEpPFS.d.mts} +9 -9
- package/dist/{index-DS6kxiFl.d.mts → index-DWu3qrwe.d.mts} +29 -29
- package/dist/{index-DFK3tpEY.d.mts → index-DZ14azod.d.mts} +79 -16
- package/dist/{index-B3fjN5HX.d.mts → index-DZPNuWMc.d.mts} +4 -4
- package/dist/{index-C8k2f_E0.d.mts → index-DoEF9LAc.d.mts} +1 -1
- package/dist/{index-Cyi7y_aG.d.mts → index-Qd1Qom8M.d.mts} +16 -16
- package/dist/{index-Dtb2cVJz.d.mts → index-S7lj2TLp.d.mts} +81 -81
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/{namespace-JFzrlNs4.d.mts → namespace-CZK2ff3B.d.mts} +5 -5
- package/dist/{namespace-DRXQyBe0.d.mts → namespace-Ceg3zkt2.d.mts} +24 -0
- package/dist/{namespace-BLER-Qom.d.mts → namespace-CfvtDD_U.d.mts} +2 -2
- package/dist/{namespace-6sIu5nBI2.d.mts → namespace-D8P8Sxce2.d.mts} +2 -2
- package/dist/{namespace-D4Uf5Mw_.d.mts → namespace-Dc94fHZW.d.mts} +18 -18
- package/dist/{namespace-CGxFYDlK.d.mts → namespace-DuUCiVmK.d.mts} +26 -26
- package/dist/{namespace-C74bbsdZ.d.mts → namespace-j7vFsmYL.d.mts} +2 -2
- package/dist/node/transports/index.d.mts +25 -3
- package/dist/node/transports/index.mjs +1 -1
- package/dist/package.json +1 -1
- package/dist/{schemas-CurUbHy4.d.mts → schemas-BemsLc_V.d.mts} +4 -4
- package/dist/{schemas-9S9Y9PHT2.d.mts → schemas-Br-rSxPE2.d.mts} +11 -11
- package/dist/{schemas-B_t6oOK-.d.mts → schemas-CoFCV42v.d.mts} +2 -2
- package/dist/{schemas-DXeGCbJ9.d.mts → schemas-D512XweP.d.mts} +5 -5
- package/dist/{schemas-DnmbwE_V.d.mts → schemas-DWfo0wp4.d.mts} +7 -7
- package/dist/{schemas-CW6YsPT4.d.mts → schemas-lnE9YoG7.d.mts} +3 -3
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/index.d.mts +2 -2
- package/dist/services/agent-runtime/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +6 -6
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/index.d.mts +43 -43
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/index.mjs +2 -2
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/session/index.d.mts +5 -5
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/testing/index.mjs +1 -1
- package/dist/services/settings/namespace.d.mts +8 -8
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- package/dist/services/subagent-template/index.d.mts +2 -2
- package/dist/services/subagent-template/namespace.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/tray-menu/index.d.mts +2 -2
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/session-CX6QDhi2.mjs +76 -0
- package/dist/{session-Dp7z5N1d.mjs → session-D5rVMqmE.mjs} +1 -1
- package/dist/{session-lineage-C1M7-O3C.d.mts → session-lineage-NBFNVkUE.d.mts} +1 -1
- package/dist/{storage-namespace-BvRF22by.d.mts → storage-namespace-Di1A3DMm.d.mts} +10 -10
- package/dist/{tool-approval-service-BIbUSuqg.mjs → tool-approval-service-DEiMKTv9.mjs} +1 -1
- package/dist/tools-CGFZkB7F.mjs +1 -0
- package/dist/{transition-DYorNHZu.d.mts → transition-CmI3q3FA.d.mts} +1 -1
- package/dist/{types-9XCB1aPK.d.mts → types-Dhou-Itn.d.mts} +14 -14
- package/dist/{types-N_BOtTqt.d.mts → types-VwMx5_lS.d.mts} +31 -1
- package/dist/ui-kernel/index.d.mts +4 -4
- package/dist/ui-kernel/pages/namespace.d.mts +4 -4
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/workflow-engine/index.d.mts +69 -69
- package/package.json +1 -1
- package/dist/session-CZUrp7gC.mjs +0 -69
- package/dist/tools-Yz8XyiwA.mjs +0 -1
package/dist/.makaio-build.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"fingerprint": "
|
|
4
|
-
"builtAt": "2026-07-
|
|
3
|
+
"fingerprint": "305e2b44c67a83ae6ba9698f20dcf72efb14d497813db06ded1e9cfde150809f",
|
|
4
|
+
"builtAt": "2026-07-09T16:38:44.937Z"
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as BaseAgentConnectorConfig } from "../../types-VwMx5_lS.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { IMakaioBus, MakaioBusContext } from "@makaio/framework/bus";
|
|
4
4
|
import { AIModelSchema, ProtocolId, ProviderContext } from "@makaio/framework/contracts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-
|
|
1
|
+
import { A as MessageDeliveryMode, B as AIReasoningLevel, C as NormalizedCallUsage, D as ConfigFactoryInput, E as StartAgentOptions, F as MessageResult, G as ToolLedgerEntry, H as ISessionToolLedger, I as MessageState, L as ProcessingState, M as markCompletedWithFinalResult, N as NormalizedMessageInput, O as IAdapterConfigFactory, P as normalizeMessageInput, R as SendMessageOptions, S as GetCapabilitiesResponsePayload, T as SendMessageResponsePayload, U as LedgerSessionContext, V as ReasoningLevelMap, W as SessionToolLedger, _ as BaseAgentConnectorConfig, a as AgentCredentialChangeResponsePayload, b as ContextWindowInput, c as AgentIdentity, d as AgentMcpServersSetRequestPayload, f as AgentMcpServersSetResponsePayload, g as AgentStartResult, h as AgentSendMessageOptions, i as AgentCredentialChangeRequestPayload, j as MessageHandle, k as AIAgentConnector, l as AgentInterruptRequestPayload, m as AgentModelChangeResponsePayload, n as AgentConnectorConfigOverrides, o as AgentCwdChangeRequestPayload, p as AgentModelChangeRequestPayload, r as AgentContext, s as AgentCwdChangeResponsePayload, t as AIAgentConfig, u as AgentInterruptResponsePayload, v as ConnectorSendMessageOptions, w as SendMessageRequestPayload, x as ExecutionContext, y as ConnectorStartOptions, z as AIModel } from "../types-VwMx5_lS.mjs";
|
|
2
|
+
import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-J1WKAUkF.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
5
5
|
import { CreateBusNamespaceOptions, ExtractSubjectPayload, FilterablePayloadIntersection, HandlerForSubjectDefinition, RegistrableBusNamespaceDefinition, RequestContext, SchemaRecord, ScopedSubjectDefinition, SubjectDefinition, SubjectRecordFromSchemaRecord } from "@makaio/framework/core";
|
|
@@ -1702,12 +1702,106 @@ declare class ToolCallTracker {
|
|
|
1702
1702
|
clear(): void;
|
|
1703
1703
|
}
|
|
1704
1704
|
//#endregion
|
|
1705
|
-
//#region adapters/core/src/agent/
|
|
1706
|
-
|
|
1705
|
+
//#region adapters/core/src/agent/agent-event-bridge.d.ts
|
|
1706
|
+
/**
|
|
1707
|
+
* Dependencies for AgentEventBridge.
|
|
1708
|
+
*/
|
|
1709
|
+
interface AgentEventBridgeConfig {
|
|
1710
|
+
/** Emit usage payload (agent context gets added by AIAgent). */
|
|
1711
|
+
emitUsage: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.usage>, keyof AgentContext>) => Promise<void>;
|
|
1712
|
+
/** Emit context window status payload. */
|
|
1713
|
+
emitContextWindowUpdated: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.contextWindow.updated>, keyof AgentContext>) => Promise<void>;
|
|
1714
|
+
/** Emit tool.use payload. */
|
|
1715
|
+
emitToolUse: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.tool.use>, keyof AgentContext>) => Promise<void>;
|
|
1716
|
+
/** Emit tool.output payload. */
|
|
1717
|
+
emitToolOutput: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.tool.output>, keyof AgentContext>) => Promise<void>;
|
|
1718
|
+
/** Emit adapter log payload. */
|
|
1719
|
+
emitAdapterLog: (payload: Omit<ExtractSubjectPayload<typeof AdapterSubjects.log>, 'adapterId' | 'adapterName'>) => Promise<void>;
|
|
1720
|
+
/** Emit step.started payload. */
|
|
1721
|
+
emitStepStarted: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.step.started>, keyof AgentContext>) => Promise<void>;
|
|
1722
|
+
/** Emit step.finished payload. */
|
|
1723
|
+
emitStepFinished: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.step.finished>, keyof AgentContext>) => Promise<void>;
|
|
1724
|
+
/** Correlation tracker for tool.use -\> tool.output. */
|
|
1725
|
+
toolCallTracker: ToolCallTracker;
|
|
1726
|
+
/** Current content block index getter. */
|
|
1727
|
+
getBlockIndex: () => number;
|
|
1728
|
+
/** Increment block index after step completion. */
|
|
1729
|
+
incrementBlockIndex: () => void;
|
|
1730
|
+
/** Resolve model name for usage events. */
|
|
1731
|
+
getUsageModel: () => string | undefined;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* Resolution metadata returned when emitting tool output.
|
|
1735
|
+
*/
|
|
1736
|
+
interface ToolOutputResult {
|
|
1707
1737
|
toolCallId: string;
|
|
1708
1738
|
toolName: string;
|
|
1709
1739
|
args?: Record<string, unknown>;
|
|
1710
1740
|
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Event-focused helper for AIAgent.
|
|
1743
|
+
*
|
|
1744
|
+
* Keeps event payload formatting, correlation warnings, and block-indexed
|
|
1745
|
+
* step emissions out of the base class while preserving existing behavior.
|
|
1746
|
+
*/
|
|
1747
|
+
declare class AgentEventBridge {
|
|
1748
|
+
private readonly emitUsagePayload;
|
|
1749
|
+
private readonly emitContextWindowUpdatedPayload;
|
|
1750
|
+
private readonly emitToolUsePayload;
|
|
1751
|
+
private readonly emitToolOutputPayload;
|
|
1752
|
+
private readonly emitAdapterLogPayload;
|
|
1753
|
+
private readonly emitStepStartedPayload;
|
|
1754
|
+
private readonly emitStepFinishedPayload;
|
|
1755
|
+
private readonly toolCallTracker;
|
|
1756
|
+
private readonly getBlockIndex;
|
|
1757
|
+
private readonly incrementBlockIndex;
|
|
1758
|
+
private readonly getUsageModel;
|
|
1759
|
+
/**
|
|
1760
|
+
* Create an event bridge with emission and correlation dependencies.
|
|
1761
|
+
* @param config - Event bridge dependencies (emitters, tracker, and block-index accessors)
|
|
1762
|
+
*/
|
|
1763
|
+
constructor(config: AgentEventBridgeConfig);
|
|
1764
|
+
/**
|
|
1765
|
+
* Emit usage event to global bus.
|
|
1766
|
+
* @param normalized - Provider-normalized usage metrics
|
|
1767
|
+
*/
|
|
1768
|
+
trackUsage(normalized: NormalizedCallUsage): Promise<void>;
|
|
1769
|
+
/**
|
|
1770
|
+
* Emit context window health signal.
|
|
1771
|
+
* @param input - Raw usage and capacity metrics
|
|
1772
|
+
*/
|
|
1773
|
+
emitContextWindowUpdate(input: ContextWindowInput): Promise<void>;
|
|
1774
|
+
/**
|
|
1775
|
+
* Emit tool.use event with correlation tracking.
|
|
1776
|
+
* @param toolName - Tool identifier
|
|
1777
|
+
* @param args - Tool arguments
|
|
1778
|
+
* @param nativeId - Provider-native call ID
|
|
1779
|
+
* @returns Correlation ID for the call
|
|
1780
|
+
*/
|
|
1781
|
+
emitToolUse(toolName: string, args?: Record<string, unknown>, nativeId?: string): Promise<string>;
|
|
1782
|
+
/**
|
|
1783
|
+
* Emit tool.output event with best-effort correlation resolution.
|
|
1784
|
+
* @param output - Tool output text
|
|
1785
|
+
* @param hints - Correlation hints from adapter events
|
|
1786
|
+
* @returns Resolved toolCallId, toolName (falls back to 'unknown'), and args from the matched tool.use call
|
|
1787
|
+
*/
|
|
1788
|
+
emitToolOutput(output: string, hints: ResolveHints): Promise<ToolOutputResult>;
|
|
1789
|
+
/**
|
|
1790
|
+
* Emit step.started for the current block index.
|
|
1791
|
+
* @param stepType - Block step type
|
|
1792
|
+
* @param blockData - Optional step metadata
|
|
1793
|
+
* @param content - Optional immediate block content
|
|
1794
|
+
*/
|
|
1795
|
+
emitStepStarted(stepType: StepType, blockData?: BlockData, content?: SessionMessageBlock): Promise<void>;
|
|
1796
|
+
/**
|
|
1797
|
+
* Emit step.finished and advance block index.
|
|
1798
|
+
* @param stepType - Completed step type
|
|
1799
|
+
* @param content - Final block content
|
|
1800
|
+
*/
|
|
1801
|
+
emitStepFinished(stepType: StepType, content: SessionMessageBlock): Promise<void>;
|
|
1802
|
+
}
|
|
1803
|
+
//#endregion
|
|
1804
|
+
//#region adapters/core/src/agent/ai-agent.d.ts
|
|
1711
1805
|
/**
|
|
1712
1806
|
* Abstract base class for AI agents.
|
|
1713
1807
|
*
|
|
@@ -1728,7 +1822,7 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
1728
1822
|
private initialized;
|
|
1729
1823
|
/** Runtime system prompt captured from start/initialize, preserved across connector swaps. */
|
|
1730
1824
|
private runtimeSystemPrompt?;
|
|
1731
|
-
/** Tracks message lifecycle and emits turn events. */
|
|
1825
|
+
/** Tracks message lifecycle and emits turn events (emission is lazy — safe as field initializer). */
|
|
1732
1826
|
protected readonly lifecycleTracker: MessageLifecycleTracker;
|
|
1733
1827
|
/** Tracks tool.use → tool.output correlation across adapters. */
|
|
1734
1828
|
protected readonly toolCallTracker: ToolCallTracker;
|
|
@@ -1770,13 +1864,8 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
1770
1864
|
* @param config - Agent configuration
|
|
1771
1865
|
*/
|
|
1772
1866
|
constructor(config: AIAgentConfig<TBus, TConnector>);
|
|
1867
|
+
private getAgentContextBase;
|
|
1773
1868
|
private getEventMetadataDefaults;
|
|
1774
|
-
private createLifecycleEmitter;
|
|
1775
|
-
/**
|
|
1776
|
-
* Create the structured-output manager for this agent.
|
|
1777
|
-
* @returns Configured manager instance
|
|
1778
|
-
*/
|
|
1779
|
-
private createStructuredOutputManager;
|
|
1780
1869
|
/** @returns Unique agent identifier */
|
|
1781
1870
|
get agentId(): string;
|
|
1782
1871
|
/** @returns Adapter instance identifier */
|
|
@@ -1892,7 +1981,7 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
1892
1981
|
* @param hints - Hints for correlation (nativeId and/or toolName)
|
|
1893
1982
|
* @returns Resolved toolCallId, toolName (falls back to 'unknown'), and args from the matched tool.use call
|
|
1894
1983
|
*/
|
|
1895
|
-
protected emitToolOutput(output: string, hints: ResolveHints): Promise<
|
|
1984
|
+
protected emitToolOutput(output: string, hints: ResolveHints): Promise<ToolOutputResult>;
|
|
1896
1985
|
/**
|
|
1897
1986
|
* Emit step.started event with automatic block index management.
|
|
1898
1987
|
* Call this when a content block begins processing.
|
|
@@ -1963,29 +2052,12 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
1963
2052
|
* @param configOverrides - Optional config overrides (e.g., new cwd, model)
|
|
1964
2053
|
* @throws Error if connector is currently processing a turn
|
|
1965
2054
|
*/
|
|
1966
|
-
swapConnector(configOverrides?:
|
|
1967
|
-
cwd: string;
|
|
1968
|
-
model: string;
|
|
1969
|
-
providerContext: ProviderContext;
|
|
1970
|
-
adapterSessionId: string;
|
|
1971
|
-
resumeAdapterSessionId: string;
|
|
1972
|
-
mcpSessionContext: McpRuntimeSessionContext | McpSessionContext | LedgerSessionContext;
|
|
1973
|
-
}>): Promise<void>;
|
|
1974
|
-
/**
|
|
1975
|
-
* Resolve the supported reasoning levels for a given model name.
|
|
1976
|
-
*
|
|
1977
|
-
* Centralised lookup into `availableModels` so callers do not repeat the
|
|
1978
|
-
* find/optional-chain pattern inline.
|
|
1979
|
-
* @param model - Model name to look up, or `undefined` to return `undefined`
|
|
1980
|
-
* @returns The `supportedReasoningLevels` map for the model, or `undefined`
|
|
1981
|
-
*/
|
|
1982
|
-
private getSupportedReasoningLevels;
|
|
2055
|
+
swapConnector(configOverrides?: AgentConnectorConfigOverrides): Promise<void>;
|
|
1983
2056
|
/**
|
|
1984
2057
|
* Build config factory input from agent config with optional overrides.
|
|
1985
2058
|
*
|
|
1986
|
-
*
|
|
1987
|
-
*
|
|
1988
|
-
* into the factory.
|
|
2059
|
+
* Delegates to {@link buildConfigFactoryInput} with live connector-derived
|
|
2060
|
+
* values (reasoning effort) and the agent's error sink.
|
|
1989
2061
|
* @param overrides - Optional field overrides (e.g., cwd, model, adapterSessionId)
|
|
1990
2062
|
* @returns ConfigFactoryInput ready for config factory
|
|
1991
2063
|
*/
|
|
@@ -1997,26 +2069,6 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
1997
2069
|
* @returns Callback function for connector config
|
|
1998
2070
|
*/
|
|
1999
2071
|
private createOnMessageSent;
|
|
2000
|
-
/**
|
|
2001
|
-
* Handle agent.cwd.change request — prefers native in-place change, falls back to connector swap.
|
|
2002
|
-
* @param ctx - Request context with newCwd payload
|
|
2003
|
-
*/
|
|
2004
|
-
private handleCwdChange;
|
|
2005
|
-
/**
|
|
2006
|
-
* Handle agent.model.change request — prefers native in-place change, falls back to connector swap.
|
|
2007
|
-
* @param ctx - Request context with newModel payload
|
|
2008
|
-
*/
|
|
2009
|
-
private handleModelChange;
|
|
2010
|
-
/**
|
|
2011
|
-
* Handle agent.mcp.servers.set request — rebuilds immediately when idle or stages for the next turn.
|
|
2012
|
-
* @param ctx - Request context with replacement MCP session context
|
|
2013
|
-
*/
|
|
2014
|
-
private handleMcpServersSet;
|
|
2015
|
-
/**
|
|
2016
|
-
* Handle agent.credential.change request — defers when a turn is active, otherwise swaps connector.
|
|
2017
|
-
* @param ctx - Request context with credential change payload
|
|
2018
|
-
*/
|
|
2019
|
-
private handleCredentialChanged;
|
|
2020
2072
|
/**
|
|
2021
2073
|
* Wire adapter-specific connector events.
|
|
2022
2074
|
* Called automatically during init() and connector swap.
|
|
@@ -2204,105 +2256,6 @@ interface AIAdapterContext<Scope extends ScopedBus<string>> {
|
|
|
2204
2256
|
globalBus: IMakaioBus;
|
|
2205
2257
|
}
|
|
2206
2258
|
//#endregion
|
|
2207
|
-
//#region adapters/core/src/agent/agent-event-bridge.d.ts
|
|
2208
|
-
/**
|
|
2209
|
-
* Dependencies for AgentEventBridge.
|
|
2210
|
-
*/
|
|
2211
|
-
interface AgentEventBridgeConfig {
|
|
2212
|
-
/** Emit usage payload (agent context gets added by AIAgent). */
|
|
2213
|
-
emitUsage: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.usage>, keyof AgentContext>) => Promise<void>;
|
|
2214
|
-
/** Emit context window status payload. */
|
|
2215
|
-
emitContextWindowUpdated: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.contextWindow.updated>, keyof AgentContext>) => Promise<void>;
|
|
2216
|
-
/** Emit tool.use payload. */
|
|
2217
|
-
emitToolUse: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.tool.use>, keyof AgentContext>) => Promise<void>;
|
|
2218
|
-
/** Emit tool.output payload. */
|
|
2219
|
-
emitToolOutput: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.tool.output>, keyof AgentContext>) => Promise<void>;
|
|
2220
|
-
/** Emit adapter log payload. */
|
|
2221
|
-
emitAdapterLog: (payload: Omit<ExtractSubjectPayload<typeof AdapterSubjects.log>, 'adapterId' | 'adapterName'>) => Promise<void>;
|
|
2222
|
-
/** Emit step.started payload. */
|
|
2223
|
-
emitStepStarted: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.step.started>, keyof AgentContext>) => Promise<void>;
|
|
2224
|
-
/** Emit step.finished payload. */
|
|
2225
|
-
emitStepFinished: (payload: Omit<ExtractSubjectPayload<typeof AgentSubjects.step.finished>, keyof AgentContext>) => Promise<void>;
|
|
2226
|
-
/** Correlation tracker for tool.use -\> tool.output. */
|
|
2227
|
-
toolCallTracker: ToolCallTracker;
|
|
2228
|
-
/** Current content block index getter. */
|
|
2229
|
-
getBlockIndex: () => number;
|
|
2230
|
-
/** Increment block index after step completion. */
|
|
2231
|
-
incrementBlockIndex: () => void;
|
|
2232
|
-
/** Resolve model name for usage events. */
|
|
2233
|
-
getUsageModel: () => string | undefined;
|
|
2234
|
-
}
|
|
2235
|
-
/**
|
|
2236
|
-
* Resolution metadata returned when emitting tool output.
|
|
2237
|
-
*/
|
|
2238
|
-
interface ToolOutputResult {
|
|
2239
|
-
toolCallId: string;
|
|
2240
|
-
toolName: string;
|
|
2241
|
-
args?: Record<string, unknown>;
|
|
2242
|
-
}
|
|
2243
|
-
/**
|
|
2244
|
-
* Event-focused helper for AIAgent.
|
|
2245
|
-
*
|
|
2246
|
-
* Keeps event payload formatting, correlation warnings, and block-indexed
|
|
2247
|
-
* step emissions out of the base class while preserving existing behavior.
|
|
2248
|
-
*/
|
|
2249
|
-
declare class AgentEventBridge {
|
|
2250
|
-
private readonly emitUsagePayload;
|
|
2251
|
-
private readonly emitContextWindowUpdatedPayload;
|
|
2252
|
-
private readonly emitToolUsePayload;
|
|
2253
|
-
private readonly emitToolOutputPayload;
|
|
2254
|
-
private readonly emitAdapterLogPayload;
|
|
2255
|
-
private readonly emitStepStartedPayload;
|
|
2256
|
-
private readonly emitStepFinishedPayload;
|
|
2257
|
-
private readonly toolCallTracker;
|
|
2258
|
-
private readonly getBlockIndex;
|
|
2259
|
-
private readonly incrementBlockIndex;
|
|
2260
|
-
private readonly getUsageModel;
|
|
2261
|
-
/**
|
|
2262
|
-
* Create an event bridge with emission and correlation dependencies.
|
|
2263
|
-
* @param config - Event bridge dependencies (emitters, tracker, and block-index accessors)
|
|
2264
|
-
*/
|
|
2265
|
-
constructor(config: AgentEventBridgeConfig);
|
|
2266
|
-
/**
|
|
2267
|
-
* Emit usage event to global bus.
|
|
2268
|
-
* @param normalized - Provider-normalized usage metrics
|
|
2269
|
-
*/
|
|
2270
|
-
trackUsage(normalized: NormalizedCallUsage): Promise<void>;
|
|
2271
|
-
/**
|
|
2272
|
-
* Emit context window health signal.
|
|
2273
|
-
* @param input - Raw usage and capacity metrics
|
|
2274
|
-
*/
|
|
2275
|
-
emitContextWindowUpdate(input: ContextWindowInput): Promise<void>;
|
|
2276
|
-
/**
|
|
2277
|
-
* Emit tool.use event with correlation tracking.
|
|
2278
|
-
* @param toolName - Tool identifier
|
|
2279
|
-
* @param args - Tool arguments
|
|
2280
|
-
* @param nativeId - Provider-native call ID
|
|
2281
|
-
* @returns Correlation ID for the call
|
|
2282
|
-
*/
|
|
2283
|
-
emitToolUse(toolName: string, args?: Record<string, unknown>, nativeId?: string): Promise<string>;
|
|
2284
|
-
/**
|
|
2285
|
-
* Emit tool.output event with best-effort correlation resolution.
|
|
2286
|
-
* @param output - Tool output text
|
|
2287
|
-
* @param hints - Correlation hints from adapter events
|
|
2288
|
-
* @returns Resolved toolCallId, toolName (falls back to 'unknown'), and args from the matched tool.use call
|
|
2289
|
-
*/
|
|
2290
|
-
emitToolOutput(output: string, hints: ResolveHints): Promise<ToolOutputResult>;
|
|
2291
|
-
/**
|
|
2292
|
-
* Emit step.started for the current block index.
|
|
2293
|
-
* @param stepType - Block step type
|
|
2294
|
-
* @param blockData - Optional step metadata
|
|
2295
|
-
* @param content - Optional immediate block content
|
|
2296
|
-
*/
|
|
2297
|
-
emitStepStarted(stepType: StepType, blockData?: BlockData, content?: SessionMessageBlock): Promise<void>;
|
|
2298
|
-
/**
|
|
2299
|
-
* Emit step.finished and advance block index.
|
|
2300
|
-
* @param stepType - Completed step type
|
|
2301
|
-
* @param content - Final block content
|
|
2302
|
-
*/
|
|
2303
|
-
emitStepFinished(stepType: StepType, content: SessionMessageBlock): Promise<void>;
|
|
2304
|
-
}
|
|
2305
|
-
//#endregion
|
|
2306
2259
|
//#region adapters/core/src/agent/agent-turn-executor.d.ts
|
|
2307
2260
|
/**
|
|
2308
2261
|
* Runtime dependencies for AgentTurnExecutor.
|
|
@@ -2576,14 +2529,7 @@ interface AgentConnectorLifecycleManagerConfig<TBus extends ScopedBus<string>, T
|
|
|
2576
2529
|
/** Stable agent identifier (used for diagnostics). */
|
|
2577
2530
|
agentId: string;
|
|
2578
2531
|
/** Create config input for connector/config factories. */
|
|
2579
|
-
buildConfigInput: (overrides?:
|
|
2580
|
-
cwd: string;
|
|
2581
|
-
model: string;
|
|
2582
|
-
providerContext: ProviderContext;
|
|
2583
|
-
adapterSessionId: string;
|
|
2584
|
-
resumeAdapterSessionId: string;
|
|
2585
|
-
mcpSessionContext: McpRuntimeSessionContext | McpSessionContext | LedgerSessionContext;
|
|
2586
|
-
}>) => ConfigFactoryInput<TBus>;
|
|
2532
|
+
buildConfigInput: (overrides?: AgentConnectorConfigOverrides) => ConfigFactoryInput<TBus>;
|
|
2587
2533
|
/** Adapter config factory from AIAgent config. */
|
|
2588
2534
|
configFactory: (input: ConfigFactoryInput<TBus>) => Promise<BaseAgentConnectorConfig<TBus> & {
|
|
2589
2535
|
adapterId: string;
|
|
@@ -2637,14 +2583,7 @@ declare class AgentConnectorLifecycleManager<TBus extends ScopedBus<string>, TCo
|
|
|
2637
2583
|
* Uses create-before-close pattern with rollback to preserve availability.
|
|
2638
2584
|
* @param configOverrides - Optional runtime override fields
|
|
2639
2585
|
*/
|
|
2640
|
-
swapConnector(configOverrides?:
|
|
2641
|
-
cwd: string;
|
|
2642
|
-
model: string;
|
|
2643
|
-
providerContext: ProviderContext;
|
|
2644
|
-
adapterSessionId: string;
|
|
2645
|
-
resumeAdapterSessionId: string;
|
|
2646
|
-
mcpSessionContext: McpRuntimeSessionContext | McpSessionContext | LedgerSessionContext;
|
|
2647
|
-
}>): Promise<void>;
|
|
2586
|
+
swapConnector(configOverrides?: AgentConnectorConfigOverrides): Promise<void>;
|
|
2648
2587
|
}
|
|
2649
2588
|
//#endregion
|
|
2650
2589
|
//#region adapters/core/src/agent/agent-lifecycle-emitter.d.ts
|