@makaio/framework 1.0.0-dev-1790348008233 → 1.0.0-dev-1790538920793
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/README.md +2 -2
- package/dist/.makaio-build.json +2 -2
- package/dist/adapter-subsystem/index.d.mts +1 -1
- package/dist/adapters/config/index.d.mts +7 -7
- package/dist/adapters/index.d.mts +16 -19
- package/dist/adapters/node.d.mts +1 -1
- package/dist/artifact-C4J_FDq8.mjs +1 -0
- package/dist/{base-orchestrator-FNFJ6Cwf.d.mts → base-orchestrator-DH6W4NQg.d.mts} +2 -4
- package/dist/bus/index.mjs +1 -1
- package/dist/bus-CgswamdO.mjs +9 -0
- package/dist/{config-namespace-CeTODseW.d.mts → config-namespace-Ctia-VDG.d.mts} +1 -1
- 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 +3 -3
- package/dist/contracts/artifact/index.mjs +1 -1
- package/dist/contracts/automation-trigger/index.d.mts +1 -1
- package/dist/contracts/capabilities/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/config/index.d.mts +1 -1
- package/dist/contracts/extension/index.d.mts +4 -4
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/harness/index.d.mts +2 -2
- package/dist/contracts/harness/index.mjs +1 -1
- package/dist/contracts/index.d.mts +30 -30
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +2 -2
- package/dist/contracts/materialization/index.mjs +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/provider/index.d.mts +2 -2
- package/dist/contracts/reaction/index.d.mts +1 -1
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/worker/index.d.mts +1 -1
- package/dist/contracts/worker/index.mjs +1 -1
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/{contribution-kpR61mnG.d.mts → contribution-DTb65rRN.d.mts} +1 -1
- package/dist/{definition-D2SO1tX-.d.mts → definition-Cx175qXh.d.mts} +1 -1
- package/dist/{extension-C6ANjR33.mjs → extension-BOMfXdko.mjs} +1 -1
- package/dist/{extension-context-CmhBCbbq.d.mts → extension-context-DH84KOm9.d.mts} +3 -3
- package/dist/{harness-DBxywOGi.mjs → harness-DMlk3uEj.mjs} +1 -1
- package/dist/{hook-responses-C3nUIm-6.d.mts → hook-responses-OETFKaAL.d.mts} +1 -1
- package/dist/{index-C9Dz8UoK2.d.mts → index-2YW8DTb62.d.mts} +6 -6
- package/dist/{index-D5Lw1UsO.d.mts → index-9NQQkY0Z.d.mts} +3 -3
- package/dist/{index-CRk46fit.d.mts → index-AMzzMjhN.d.mts} +9 -9
- package/dist/{index-oE2q0pTG.d.mts → index-B1uHTa1l.d.mts} +1 -1
- package/dist/{index-HN4m0hiI.d.mts → index-BM8oUon_.d.mts} +16 -16
- package/dist/{index-BMGkU3IM.d.mts → index-BRXETFym.d.mts} +1 -1
- package/dist/{index-DYnahvOm.d.mts → index-BZw3MR6v.d.mts} +19 -1
- package/dist/{index-Ce6-SiB3.d.mts → index-C9vF42jh.d.mts} +1 -1
- package/dist/{index-CydQ1dLS2.d.mts → index-CPOJqxrf2.d.mts} +3 -0
- package/dist/{index-Cuz4nfUz.d.mts → index-CU0AgN84.d.mts} +1 -1
- package/dist/{index-DMBxHEQ_.d.mts → index-CeAkK4Oq.d.mts} +7 -7
- package/dist/{index-D5ihXDAA.d.mts → index-CoD7P-IS.d.mts} +1 -1
- package/dist/{index-CCTrhWEB2.d.mts → index-DIEnLLhi2.d.mts} +5 -5
- package/dist/{index-DifOjlJ5.d.mts → index-DUpW-4X8.d.mts} +5 -5
- package/dist/{index-D5BLD2Pw.d.mts → index-DqN1u0Y2.d.mts} +6 -6
- package/dist/{index-wGlFWRXg.d.mts → index-wQB90bP1.d.mts} +1 -3
- package/dist/{index-wiATEDG_.d.mts → index-xPzwlPjm.d.mts} +374 -290
- package/dist/kernel/extension/index.d.mts +2 -2
- package/dist/kernel/index.d.mts +2 -2
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kind-registration-DdbhhvaT.mjs +1 -0
- package/dist/{materialization-CIrHHspa.mjs → materialization-CxV6fpuB.mjs} +1 -1
- package/dist/{namespace-C5tKjqgb.d.mts → namespace-B9iQN3FQ.d.mts} +4 -4
- package/dist/{namespace-C1-ZAKEG.d.mts → namespace-CNX4llM5.d.mts} +6 -6
- package/dist/{package-BswWlFSn.d.mts → package-BjtsXnaA.d.mts} +1 -0
- package/dist/package.json +1 -1
- package/dist/runtime-node/static/model-registry.yaml +0 -29
- package/dist/{schema-De6d0FWI.d.mts → schema-MdntS6Eu.d.mts} +1 -1
- package/dist/{schemas-rliUGyrt.d.mts → schemas-B2fs9-uF.d.mts} +5 -1
- package/dist/{schemas-CjFPsYeV.d.mts → schemas-BjhhkGN_.d.mts} +4 -4
- package/dist/{schemas-Dyp3rHZ7.d.mts → schemas-D9pXu76T.d.mts} +4 -4
- package/dist/{schemas-DPtj1sPC2.d.mts → schemas-RwAlAMbq2.d.mts} +7 -7
- package/dist/schemas-W3nT06vH.mjs +1 -0
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +3 -3
- package/dist/services/filesystem/namespace.d.mts +12 -12
- package/dist/services/filesystem/schemas.d.mts +6 -6
- package/dist/services/git/namespace.d.mts +4 -4
- package/dist/services/git/schemas.d.mts +3 -3
- package/dist/services/harness/storage/schema.d.mts +1 -1
- package/dist/services/index.d.mts +23 -23
- package/dist/services/log-import/browser.d.mts +1 -1
- package/dist/services/log-import/index.d.mts +1 -1
- 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/provider-context/index.d.mts +1 -1
- package/dist/services/session/index.d.mts +4 -4
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/{session-lineage-CmP7L5g2.d.mts → session-lineage-BQ9NWlt6.d.mts} +1 -1
- package/dist/{storage-namespace-CwwiV3kt.d.mts → storage-namespace-NHTWAjaX.d.mts} +10 -10
- package/dist/{transition-B0qsutdE.d.mts → transition-ClMo_PUJ.d.mts} +1 -1
- package/dist/{types-BrsmFcWl.d.mts → types-CG3PWgMt.d.mts} +21 -23
- package/dist/{types-DyBD5MdV2.d.mts → types-CW-4Y0k_2.d.mts} +2 -2
- package/dist/{types-DfbdwLQ6.d.mts → types-DTpwvvY9.d.mts} +3 -3
- 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/{view-builder-Zw-TCgSp.d.mts → view-builder-B8WSU6WT.d.mts} +1 -1
- package/dist/{worker-DyyO9DCO.mjs → worker-zHq43Iyk.mjs} +1 -1
- package/dist/{workflow-B0ZGun4r.mjs → workflow-BFAraH3Y.mjs} +1 -1
- package/dist/workflow-engine/index.d.mts +2 -2
- package/dist/workflow-engine/package.d.mts +1 -1
- package/package.json +1 -1
- package/dist/artifact-eleyznpA.mjs +0 -1
- package/dist/bus-DgpPEPoM.mjs +0 -9
- package/dist/kind-registration-Dzfo6kyb.mjs +0 -1
- package/dist/schemas-CHM0wMq4.mjs +0 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
Makaio Framework is runtime infrastructure for AI agent systems. It provides a typed event bus where agents, services, tools, and storage communicate through events and RPC — across threads, processes, or machines.
|
|
15
15
|
|
|
16
|
-
- **
|
|
16
|
+
- **9 provider adapters** (Anthropic, OpenAI, Claude Code, Codex, Cursor, Qwen, and more)
|
|
17
17
|
- **Typed event bus** with pub/sub, RPC, namespaces, and cross-process transports
|
|
18
18
|
- **Extension system** — capabilities load at runtime, not compile time
|
|
19
19
|
- **Bus-mediated storage** — swap backends without touching service code
|
|
@@ -39,7 +39,7 @@ const { messageId } = await MakaioBus.request(SessionSubjects.sendMessage, {
|
|
|
39
39
|
sessionId,
|
|
40
40
|
agent: {
|
|
41
41
|
kind: 'adapter',
|
|
42
|
-
adapterName: 'anthropic-sdk', // or 'openai-node', '
|
|
42
|
+
adapterName: 'anthropic-sdk', // or 'openai-node', 'pi-sdk', etc.
|
|
43
43
|
systemPrompt: 'You are a security reviewer. Be concise.',
|
|
44
44
|
},
|
|
45
45
|
message: 'Review the changes in src/ for security issues',
|
package/dist/.makaio-build.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"fingerprint": "
|
|
4
|
-
"builtAt": "2026-09-
|
|
3
|
+
"fingerprint": "f110117a4598444e44beb436099ecfcce1c9c44c7a160e1419d5257d32d806b8",
|
|
4
|
+
"builtAt": "2026-09-27T19:56:34.209Z",
|
|
5
5
|
"declarations": true,
|
|
6
6
|
"declarationBackend": "tsc"
|
|
7
7
|
}
|
|
@@ -257,7 +257,7 @@ interface PlatformDefaults {
|
|
|
257
257
|
*
|
|
258
258
|
* Examples:
|
|
259
259
|
* - `@makaio/ai-adapters-claude-code` → `'claude-code'`
|
|
260
|
-
* - `@scope/ai-adapters-
|
|
260
|
+
* - `@scope/ai-adapters-openai-node` → `'openai-node'`
|
|
261
261
|
* - `some-package` → `'some-package'` (fallback: full name)
|
|
262
262
|
* @param packageName - NPM package name for the adapter.
|
|
263
263
|
* @returns Non-empty stable identifier used for deterministic routing.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as bindProviderAuth, B as PreparedAdapterAuthRuntime, G as AdapterAuthError, H as SuppliedAdapterAuthRuntime, J as BoundProviderAuthContext, K as AdapterAuthErrorReason, L as AdapterAuthLeaseHandle, Q as ResolvedConnectorAuthDelivery, R as AdapterAuthRuntimePreparer, U as applySuppliedAdapterAuthRuntime, V as ResolvedAdapterRuntimeConfig, W as prepareAdapterAuthRuntime, X as ResolvedAdapterAuth, Y as ResolveAuthCredentialRefs, Z as ResolvedAuthCredentialValues, _ as BaseAgentConnectorConfig, et as getOptionalAuthCredentialFields, q as BindProviderAuthOptions, tt as resolveBoundProviderAuth, z as BoundAdapterRuntimeConfig } from "../../types-
|
|
1
|
+
import { $ as bindProviderAuth, B as PreparedAdapterAuthRuntime, G as AdapterAuthError, H as SuppliedAdapterAuthRuntime, J as BoundProviderAuthContext, K as AdapterAuthErrorReason, L as AdapterAuthLeaseHandle, Q as ResolvedConnectorAuthDelivery, R as AdapterAuthRuntimePreparer, U as applySuppliedAdapterAuthRuntime, V as ResolvedAdapterRuntimeConfig, W as prepareAdapterAuthRuntime, X as ResolvedAdapterAuth, Y as ResolveAuthCredentialRefs, Z as ResolvedAuthCredentialValues, _ as BaseAgentConnectorConfig, et as getOptionalAuthCredentialFields, q as BindProviderAuthOptions, tt as resolveBoundProviderAuth, z as BoundAdapterRuntimeConfig } from "../../types-CG3PWgMt.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { TimeoutConfig, TrackedTimeoutConfig } from "@makaio/framework/utils";
|
|
4
4
|
import { AIModelSchema, AdapterProviderAuth, ProtocolId, ProviderContext, ResolvedProviderAuth } from "@makaio/framework/contracts";
|
|
@@ -107,7 +107,7 @@ type AdapterDefaults<TConfig extends BaseAgentConnectorConfig = BaseAgentConnect
|
|
|
107
107
|
* @typeParam TConfig - The adapter's full config type for type-safe defaults
|
|
108
108
|
*/
|
|
109
109
|
interface CreateAdapterConfigFactoryOptions<TConfig extends BaseAgentConnectorConfig> {
|
|
110
|
-
/** Adapter type name (e.g., 'claude-code', '
|
|
110
|
+
/** Adapter type name (e.g., 'claude-code', 'openai-node') */
|
|
111
111
|
adapterName: string;
|
|
112
112
|
/** Adapter-level defaults (model required, others optional including providerConfig) */
|
|
113
113
|
adapterDefaults: AdapterDefaults<TConfig>;
|
|
@@ -188,10 +188,10 @@ type AdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TProviderCon
|
|
|
188
188
|
* @returns Factory with getConfig method
|
|
189
189
|
* @example
|
|
190
190
|
* ```typescript
|
|
191
|
-
* export const
|
|
192
|
-
* adapterName:
|
|
193
|
-
* adapterDefaults: {
|
|
194
|
-
* schema:
|
|
191
|
+
* export const OpenAINodeConfig = createAdapterConfigFactory<OpenAINodeAgentConfig>(() => ({
|
|
192
|
+
* adapterName: OpenAINodeAdapterName,
|
|
193
|
+
* adapterDefaults: { reasoningEffort: 'low' },
|
|
194
|
+
* schema: OpenAINodeProviderConfigSchema,
|
|
195
195
|
* adapterDefinition: { defaultTimeouts: DEFAULT_TIMEOUTS },
|
|
196
196
|
* }));
|
|
197
197
|
* ```
|
|
@@ -355,7 +355,7 @@ interface SessionEnvironmentOptions {
|
|
|
355
355
|
globalBus?: IMakaioBus;
|
|
356
356
|
/**
|
|
357
357
|
* Stable client identifier passed to `resolveClientBinary`
|
|
358
|
-
* (e.g. `'claude-code'`, `'qwen'`, `'
|
|
358
|
+
* (e.g. `'claude-code'`, `'qwen'`, `'codex'`). Omit for
|
|
359
359
|
* connector-only SDK adapters with no managed binary.
|
|
360
360
|
*/
|
|
361
361
|
clientId?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $t as SessionToolLedger, A as AgentTeardownArbiter, At as runBestEffortStage, Bt as MessageHandle, C as NormalizedCallUsage, Ct as ObservedExitOptions, D as AdapterProviderDefinition, Dt as reportBestEffortStages, E as StartAgentOptions, Et as exitWasObserved, F as TeardownSubject, Ft as unknownTeardown, Gt as MessageState, Ht as NormalizedMessageInput, I as CreateConnectorRuntimeOptions, It as CONNECTOR_EXIT_OBSERVATION_MS, Jt as AIModel, Kt as ProcessingState, Lt as SWAP_SETTLEMENT_WAIT_MS, M as ConnectorReplacementSettlement, Mt as TeardownReport, N as ConnectorSwapAdmission, Nt as aggregateTeardownReports, O as ConfigFactoryInput, Ot as reportObservedExit, P as ConnectorSwapHandover, Pt as rethrowTeardownFailure, Qt as LedgerSessionContext, R as AdapterAuthRuntimePreparer, Rt as AIAgentConnector, S as GetCapabilitiesResponsePayload, St as SupersededGeneration, T as SendMessageResponsePayload, Tt as describeTeardownFailure, Ut as normalizeMessageInput, Vt as markCompletedWithFinalResult, Wt as MessageResult, Xt as ReasoningLevelMap, Yt as AIReasoningLevel, Zt as ISessionToolLedger, _ as BaseAgentConnectorConfig, _t as BaseConnectorTurn, a as AgentCredentialChangeResponsePayload, at as WireSessionSubjects, b as ContextWindowInput, bt as ConnectorSessionConfig, c as AgentIdentity, ct as QueueableTurn, d as AgentMcpServersSetRequestPayload, dt as rejectQueuedHandles, en as ToolLedgerEntry, f as AgentMcpServersSetResponsePayload, ft as UserMessageQueue, g as AgentStartResult, gt as TurnSubjects, h as AgentSendMessageOptions, ht as ProceduralTurnState, i as AgentCredentialChangeRequestPayload, it as WireSessionConfig, j as ClosableConnectorRuntime, jt as stageFailure, k as IAdapterConfigFactory, kt as reportRepeatTeardown, l as AgentInterruptRequestPayload, lt as SESSION_CLOSED_QUEUE_ERROR, m as AgentModelChangeResponsePayload, mt as ProceduralTurnConfig, n as AgentConnectorConfigOverrides, nt as ProceduralAgentConnector, o as AgentCwdChangeRequestPayload, ot as MergeResult, p as AgentModelChangeRequestPayload, pt as ProceduralConnectorTurn, qt as SendMessageOptions, r as AgentContext, rt as ProceduralConnectorSession, s as AgentCwdChangeResponsePayload, st as ProcessQueueCallbacks, t as AIAgentConfig, u as AgentInterruptResponsePayload, ut as processQueueMessages, v as ConnectorSendMessageOptions, vt as PauseResult, w as SendMessageRequestPayload, wt as capTeardownEvidence, x as ExecutionContext, xt as GenerationRetirementLedger, y as ConnectorStartOptions, yt as BaseConnectorSession, zt as MessageDeliveryMode } from "../types-
|
|
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 { $t as SessionToolLedger, A as AgentTeardownArbiter, At as runBestEffortStage, Bt as MessageHandle, C as NormalizedCallUsage, Ct as ObservedExitOptions, D as AdapterProviderDefinition, Dt as reportBestEffortStages, E as StartAgentOptions, Et as exitWasObserved, F as TeardownSubject, Ft as unknownTeardown, Gt as MessageState, Ht as NormalizedMessageInput, I as CreateConnectorRuntimeOptions, It as CONNECTOR_EXIT_OBSERVATION_MS, Jt as AIModel, Kt as ProcessingState, Lt as SWAP_SETTLEMENT_WAIT_MS, M as ConnectorReplacementSettlement, Mt as TeardownReport, N as ConnectorSwapAdmission, Nt as aggregateTeardownReports, O as ConfigFactoryInput, Ot as reportObservedExit, P as ConnectorSwapHandover, Pt as rethrowTeardownFailure, Qt as LedgerSessionContext, R as AdapterAuthRuntimePreparer, Rt as AIAgentConnector, S as GetCapabilitiesResponsePayload, St as SupersededGeneration, T as SendMessageResponsePayload, Tt as describeTeardownFailure, Ut as normalizeMessageInput, Vt as markCompletedWithFinalResult, Wt as MessageResult, Xt as ReasoningLevelMap, Yt as AIReasoningLevel, Zt as ISessionToolLedger, _ as BaseAgentConnectorConfig, _t as BaseConnectorTurn, a as AgentCredentialChangeResponsePayload, at as WireSessionSubjects, b as ContextWindowInput, bt as ConnectorSessionConfig, c as AgentIdentity, ct as QueueableTurn, d as AgentMcpServersSetRequestPayload, dt as rejectQueuedHandles, en as ToolLedgerEntry, f as AgentMcpServersSetResponsePayload, ft as UserMessageQueue, g as AgentStartResult, gt as TurnSubjects, h as AgentSendMessageOptions, ht as ProceduralTurnState, i as AgentCredentialChangeRequestPayload, it as WireSessionConfig, j as ClosableConnectorRuntime, jt as stageFailure, k as IAdapterConfigFactory, kt as reportRepeatTeardown, l as AgentInterruptRequestPayload, lt as SESSION_CLOSED_QUEUE_ERROR, m as AgentModelChangeResponsePayload, mt as ProceduralTurnConfig, n as AgentConnectorConfigOverrides, nt as ProceduralAgentConnector, o as AgentCwdChangeRequestPayload, ot as MergeResult, p as AgentModelChangeRequestPayload, pt as ProceduralConnectorTurn, qt as SendMessageOptions, r as AgentContext, rt as ProceduralConnectorSession, s as AgentCwdChangeResponsePayload, st as ProcessQueueCallbacks, t as AIAgentConfig, u as AgentInterruptResponsePayload, ut as processQueueMessages, v as ConnectorSendMessageOptions, vt as PauseResult, w as SendMessageRequestPayload, wt as capTeardownEvidence, x as ExecutionContext, xt as GenerationRetirementLedger, y as ConnectorStartOptions, yt as BaseConnectorSession, zt as MessageDeliveryMode } from "../types-CG3PWgMt.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-DH6W4NQg.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";
|
|
@@ -209,8 +209,7 @@ declare function formatContextBlockAsText(tag: string, content: string): string;
|
|
|
209
209
|
* Each adapter converts these blocks to its wire format:
|
|
210
210
|
* - Claude SDK: each block → prependContextBlock(msg, tag, content)
|
|
211
211
|
* - Anthropic/OpenAI: join and prepend to user message
|
|
212
|
-
* -
|
|
213
|
-
* - CLI/Copilot: prepend to prompt string
|
|
212
|
+
* - CLI: prepend to prompt string
|
|
214
213
|
* - Codex: push as userInput
|
|
215
214
|
* @param turnContext - The context record from MessageHandle.turnContext
|
|
216
215
|
* @returns Ordered blocks: skillCatalog, skills, contextRules, then remaining keys alphabetical.
|
|
@@ -767,7 +766,7 @@ declare function serializeBlockToText(block: MessageBlock$1): string;
|
|
|
767
766
|
interface ToolApprovalContext {
|
|
768
767
|
/** Adapter instance ID */
|
|
769
768
|
adapterId: string;
|
|
770
|
-
/** Adapter type name (e.g., '
|
|
769
|
+
/** Adapter type name (e.g., 'openai-node', 'anthropic-sdk') */
|
|
771
770
|
adapterName: string;
|
|
772
771
|
/** Agent ID within the adapter */
|
|
773
772
|
agentId: string;
|
|
@@ -834,7 +833,7 @@ declare function mergeScopedToolApproval(payload: ScopedToolApprovalRequest, con
|
|
|
834
833
|
* (or equivalent) injects `sessionId` from its own context before forwarding
|
|
835
834
|
* to the global `AgentSubjects.toolApprove` subject, where `sessionId` is required.
|
|
836
835
|
*
|
|
837
|
-
* Adapters with a genuinely different wire format (e.g.,
|
|
836
|
+
* Adapters with a genuinely different wire format (e.g., a callId/name pair)
|
|
838
837
|
* should define their own schema rather than extending this one.
|
|
839
838
|
*/
|
|
840
839
|
declare const ScopedToolApprovalSchema: {
|
|
@@ -894,9 +893,9 @@ type FromGlobalToolApprovalFn<TResponse> = (response: AgentToolApproveResponse)
|
|
|
894
893
|
* @returns Handler registration function
|
|
895
894
|
* @example
|
|
896
895
|
* ```typescript
|
|
897
|
-
* // In
|
|
896
|
+
* // In <adapter>/src/tool-handling.ts
|
|
898
897
|
* export const registerToolApprovalHandler = createToolApprovalHandler(
|
|
899
|
-
*
|
|
898
|
+
* AdapterConnectorSubjects.tool_approval,
|
|
900
899
|
* toGlobalToolApproval,
|
|
901
900
|
* fromGlobalToolApproval,
|
|
902
901
|
* );
|
|
@@ -1442,8 +1441,8 @@ type AdapterNamespace<Domain extends string = string> = Omit<BusNamespace<Domain
|
|
|
1442
1441
|
* const bus = await ClaudeCodeNamespace.scopedBus();
|
|
1443
1442
|
* bus.withFilter({ content: 'test' }); // ✅ Type-checked
|
|
1444
1443
|
*
|
|
1445
|
-
* // For adapters
|
|
1446
|
-
* const
|
|
1444
|
+
* // For adapters whose SDK bundles a conflicting Zod version:
|
|
1445
|
+
* const LegacyNamespace = createAdapterNamespace('adapter:legacy', schemas, {
|
|
1447
1446
|
* busValidationMode: 'skip', // Skip validation due to Zod version conflict
|
|
1448
1447
|
* });
|
|
1449
1448
|
*
|
|
@@ -2016,8 +2015,8 @@ declare function extractMcpCallTarget(args: Record<string, unknown>): string | u
|
|
|
2016
2015
|
* stays in sync with the toolset definition automatically.
|
|
2017
2016
|
*
|
|
2018
2017
|
* Callers are responsible for stripping provider-specific prefixes before
|
|
2019
|
-
* calling this function (e.g.,
|
|
2020
|
-
* removed at the call site
|
|
2018
|
+
* calling this function (e.g., an SDK-added `default_api.` prefix must be
|
|
2019
|
+
* removed at the call site).
|
|
2021
2020
|
* @param toolName - Normalized tool name from the tool call
|
|
2022
2021
|
* @returns `true` if this is an `mcp_call` invocation
|
|
2023
2022
|
*/
|
|
@@ -2309,7 +2308,7 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
2309
2308
|
* Start mode for the next `emitStart()` call (consume-on-read).
|
|
2310
2309
|
*
|
|
2311
2310
|
* Set before dispatch; {@link emitStart} reads and clears the slot so
|
|
2312
|
-
* subsequent calls within the same dispatch (e.g.
|
|
2311
|
+
* subsequent calls within the same dispatch (e.g. SDK sub-turns)
|
|
2313
2312
|
* fall back to `'rotation'`. The `undefined` initial value is safe —
|
|
2314
2313
|
* every first-start path sets the mode before the connector fires.
|
|
2315
2314
|
*/
|
|
@@ -2335,7 +2334,7 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
|
|
|
2335
2334
|
get agentId(): string;
|
|
2336
2335
|
/** @returns Adapter instance identifier */
|
|
2337
2336
|
get adapterId(): string;
|
|
2338
|
-
/** @returns Adapter type name (e.g., 'claude-code', '
|
|
2337
|
+
/** @returns Adapter type name (e.g., 'claude-code', 'openai-node') */
|
|
2339
2338
|
get adapterName(): string;
|
|
2340
2339
|
/** @returns Adapter capabilities for runtime feature detection */
|
|
2341
2340
|
get capabilities(): string[];
|
|
@@ -3291,7 +3290,7 @@ interface ConformanceTestConfig<TBus extends ScopedBus<string> = ScopedBus<strin
|
|
|
3291
3290
|
* @defaultValue 2 (when not specified)
|
|
3292
3291
|
* @example
|
|
3293
3292
|
* ```typescript
|
|
3294
|
-
* // Rate-limited API (e.g.,
|
|
3293
|
+
* // Rate-limited API (e.g., a free-tier API key)
|
|
3295
3294
|
* concurrency: 1 // Run test files sequentially
|
|
3296
3295
|
*
|
|
3297
3296
|
* // High-throughput API
|
|
@@ -3306,7 +3305,6 @@ interface ConformanceTestConfig<TBus extends ScopedBus<string> = ScopedBus<strin
|
|
|
3306
3305
|
* Derived from the default provider preset's `fastModel` (or `defaultModel` as fallback).
|
|
3307
3306
|
*
|
|
3308
3307
|
* **Claude**: `{ definitionId: 'anthropic', modelName: 'haiku' }`
|
|
3309
|
-
* **Gemini**: `{ definitionId: 'gemini', modelName: 'gemini-2.5-flash' }`
|
|
3310
3308
|
* @example
|
|
3311
3309
|
* ```typescript
|
|
3312
3310
|
* primaryModel: { definitionId: 'anthropic', modelName: 'haiku' }
|
|
@@ -3320,7 +3318,6 @@ interface ConformanceTestConfig<TBus extends ScopedBus<string> = ScopedBus<strin
|
|
|
3320
3318
|
* Derived from the default provider preset's `defaultModel`.
|
|
3321
3319
|
*
|
|
3322
3320
|
* **Claude**: `{ definitionId: 'anthropic', modelName: 'sonnet' }`
|
|
3323
|
-
* **Gemini**: `{ definitionId: 'gemini', modelName: 'gemini-2.5-pro' }`
|
|
3324
3321
|
* @example
|
|
3325
3322
|
* ```typescript
|
|
3326
3323
|
* secondaryModel: { definitionId: 'anthropic', modelName: 'sonnet' }
|
|
@@ -3344,7 +3341,7 @@ interface ConformanceTestConfig<TBus extends ScopedBus<string> = ScopedBus<strin
|
|
|
3344
3341
|
*
|
|
3345
3342
|
* When set, test infrastructure serializes context creation and key
|
|
3346
3343
|
* operations through a per-adapter queue. Useful for adapters with
|
|
3347
|
-
* aggressive rate limits (e.g.,
|
|
3344
|
+
* aggressive rate limits (e.g., free-tier API keys).
|
|
3348
3345
|
*
|
|
3349
3346
|
* **Default**: undefined (no throttling - tests run fully concurrent)
|
|
3350
3347
|
* @example
|
|
@@ -3885,7 +3882,7 @@ interface TurnEvent {
|
|
|
3885
3882
|
* Adapters provide detection functions specific to their log format:
|
|
3886
3883
|
* - Claude Code: `detectTurnStart` triggers on user messages,
|
|
3887
3884
|
* `detectTurnComplete` triggers on final text content blocks
|
|
3888
|
-
* -
|
|
3885
|
+
* - Formats with explicit `turn_start`/`turn_end` events may bypass this tracker
|
|
3889
3886
|
* @typeParam TRecord - The adapter's native log record type
|
|
3890
3887
|
* @see {@link TurnTracker} - Uses these options
|
|
3891
3888
|
*/
|
package/dist/adapters/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-
|
|
1
|
+
import { _ as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-DH6W4NQg.mjs";
|
|
2
2
|
|
|
3
3
|
//#region adapters/core/src/log-importer/jsonl-parser.d.ts
|
|
4
4
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{n as t,o as n,s as r}from"./json-value-DM-EjTC1.mjs";import{C as i,_ as a,a as o,b as s,c,d as l,i as u,l as d,n as ee,p as te,r as ne,t as re,u as ie,w as f,x as ae,y as oe}from"./schemas-W3nT06vH.mjs";import{A as se,D as ce,a as p,m as le,r as ue,s as m,t as h,u as g,x as de,y as fe}from"./kind-registration-DdbhhvaT.mjs";import{t as pe}from"./zod-json-schema-ZUmGtQhT.mjs";import{t as me}from"./ajv-Cvnmw2yn.mjs";import{t as he}from"./2020-CRfgqanb.mjs";import{t as ge}from"./dist-onY7e-pd.mjs";import{z as _}from"zod";import{createBusNamespace as _e}from"@makaio/framework/core";const ve=_.strictObject({evidence:i}),v=_.strictObject({kind:_.literal(`text`),text:_.string()}),[ye,be,xe]=i.options,Se=_.union([ye.pick({source:!0,location:!0}).extend({content:v}),be.pick({source:!0,location:!0}).extend({content:v}),xe.pick({source:!0,location:!0}).extend({content:v})]);function y(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function b(e){return e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}function Ce(e,t){if(t===`#`)return{node:e,pointer:``};if(!t.startsWith(`#/`))return;let n;try{n=decodeURIComponent(t.slice(1))}catch{return}let r=e;for(let e of n.slice(1).split(`/`)){let t=e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`);if(Array.isArray(r)){if(!/^(0|[1-9]\d*)$/.test(t)||Number(t)>=r.length)return;r=r[Number(t)]}else{let e=y(r);if(!e||!Object.hasOwn(e,t))return;r=e[t]}}let i=typeof r==`boolean`?r:y(r);return i===void 0?void 0:{node:i,pointer:n}}function x(e,t){if(t===``)return!1;let n=e;for(let e of t.slice(1).split(`/`)){let t=e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`);if(n=Array.isArray(n)?n[Number(t)]:y(n)?.[t],typeof y(n)?.$id==`string`)return!0}return!1}function we(e,t,n){if(e[`x-makaio-value-type`]!==`evidence/v1`)return;let r=i.safeParse(t);if(!r.success)throw Error(`Invalid schema-declared evidence at ${n}`);return{evidence:r.data,dataPath:n}}function Te(e,t,n,r){if(typeof t.$ref!=`string`)return!1;if(r)return!0;let i=Ce(e,t.$ref);return i===void 0?!0:typeof i.node!=`boolean`&&S(e,i.node,n,x(e,i.pointer))}function S(e,t,n=new WeakSet,r=!1){let i=y(t);if(!i||n.has(i))return!1;n.add(i);let a=r||i!==e&&typeof i.$id==`string`;if(i[`x-makaio-value-type`]===`evidence/v1`||typeof i.$dynamicRef==`string`||Te(e,i,n,a)||[`additionalItems`,`additionalProperties`,`contains`,`else`,`if`,`items`,`then`,`unevaluatedItems`,`unevaluatedProperties`].some(t=>S(e,i[t],n,a))||[`allOf`,`anyOf`,`oneOf`,`prefixItems`].some(t=>Array.isArray(i[t])&&i[t].some(t=>S(e,t,n,a)))||Array.isArray(i.items)&&i.items.some(t=>S(e,t,n,a)))return!0;for(let t of[`dependentSchemas`,`dependencies`,`patternProperties`,`properties`]){let r=y(i[t]);if(r&&Object.values(r).some(t=>S(e,t,n,a)))return!0}return!1}var Ee=class{dataSchema;matchesSchema;occurrences=new Map;visited=new WeakMap;constructor(e,t){this.dataSchema=e,this.matchesSchema=t}extract(e){return this.visit(this.dataSchema,e,`/data`),[...this.occurrences.values()]}visit(e,t,n,r=``){let i=this.visited.get(e)??new Set;if(i.has(n))return;if(i.add(n),this.visited.set(e,i),typeof e.$dynamicRef==`string`)throw Error(`Evidence discovery does not support active $dynamicRef at ${n}`);if(typeof e.$ref==`string`){if(x(this.dataSchema,r))throw Error(`Evidence discovery does not support local $ref inside nested $id resource at ${n}`);let i=Ce(this.dataSchema,e.$ref);if(i===void 0)throw Error(`Cannot resolve local schema reference ${e.$ref} at ${n}`);if(typeof i.node!=`boolean`&&this.visit(i.node,t,n,i.pointer),this.dataSchema.$schema!==`https://json-schema.org/draft/2020-12/schema`)return}let a=we(e,t,n);if(a){this.occurrences.set(n,a);return}this.visitCombiners(e,t,n,r),this.visitConditional(e,t,n,r),this.visitDependencies(e,t,n,r),this.assertSupportedApplicators(e,n,r),Array.isArray(t)?this.visitArray(e,t,n,r):typeof t==`object`&&t&&this.visitObject(e,t,n,r)}visitCombiners(e,t,n,r){for(let i of[`allOf`,`anyOf`,`oneOf`]){let a=e[i];if(Array.isArray(a))for(let[e,o]of a.entries()){let a=y(o),s=`${r}/${i}/${e}`;a&&(i===`allOf`||this.matchesSchema(this.dataSchema,s,t))&&this.visit(a,t,n,s)}}}visitConditional(e,t,n,r){let i=typeof e.if==`boolean`?e.if:y(e.if);if(i===void 0)return;let a=`${r}/if`,o=this.matchesSchema(this.dataSchema,a,t);o&&typeof i!=`boolean`&&this.visit(i,t,n,a);let s=o?`then`:`else`,c=y(e[s]);c&&this.visit(c,t,n,`${r}/${s}`)}visitDependencies(e,t,n,r){if(!(typeof t!=`object`||!t||Array.isArray(t)))for(let i of[`dependentSchemas`,`dependencies`]){let a=y(e[i]);if(a)for(let[e,o]of Object.entries(a)){let a=y(o);Object.hasOwn(t,e)&&a&&this.visit(a,t,n,`${r}/${i}/${b(e)}`)}}}assertSupportedApplicators(e,t,n){for(let r of[`unevaluatedProperties`,`unevaluatedItems`])if(S(this.dataSchema,e[r],void 0,x(this.dataSchema,n)))throw Error(`Evidence under unsupported ${r} applicator at ${t}`)}visitArray(e,t,n,r){let i=Array.isArray(e.prefixItems),a=i?e.prefixItems:Array.isArray(e.items)?e.items:[];a.forEach((e,a)=>{let o=y(e),s=i?`prefixItems`:`items`;o&&a<t.length&&this.visit(o,t[a],`${n}/${a}`,`${r}/${s}/${a}`)});let o=Array.isArray(e.items)?y(e.additionalItems):y(e.items);if(o){let i=Array.isArray(e.items)?`additionalItems`:`items`;t.slice(a.length).forEach((e,t)=>this.visit(o,e,`${n}/${a.length+t}`,`${r}/${i}`))}this.visitContains(e,t,n,r)}visitContains(e,t,n,r){let i=y(e.contains);if(!i)return;let a=`${r}/contains`;t.forEach((e,t)=>{this.matchesSchema(this.dataSchema,a,e)&&this.visit(i,e,`${n}/${t}`,a)})}visitObject(e,t,n,r){let i=y(e.properties),a=y(e.patternProperties);for(let[o,s]of Object.entries(t)){let t=b(o),c=i!==void 0&&Object.hasOwn(i,o),l=y(i?.[o]);l&&this.visit(l,s,`${n}/${t}`,`${r}/properties/${t}`);let u=this.visitPatterns(a,o,s,`${n}/${t}`,r),d=y(e.additionalProperties);!c&&!u&&d&&this.visit(d,s,`${n}/${t}`,`${r}/additionalProperties`)}}visitPatterns(e,t,n,r,i){let a=!1;for(let[o,s]of Object.entries(e??{})){if(!new RegExp(o,`u`).test(t))continue;a=!0;let e=y(s);e&&this.visit(e,n,r,`${i}/patternProperties/${b(o)}`)}return a}};function De(e,t,n){return new Ee(e,n.matchesSchema).extract(t)}function Oe(e){let{dataSchema:t,hooks:n,...r}=e,i={$schema:`https://json-schema.org/draft/2020-12/schema`,...pe(t)};ce(i);let a=p.parse({...r,dataSchema:i});if(a.kind!==e.kind)throw Error(`Artifact kind identifiers must not contain surrounding whitespace`);let o=_.fromJSONSchema(a.dataSchema),s=_.unknown().superRefine((e,t)=>{let n=o.safeParse(e);if(!n.success)for(let e of n.error.issues)t.addIssue({code:`custom`,path:e.path,message:e.message})}).pipe(t).superRefine((e,t)=>{Object.hasOwn(e,`slug`)&&t.addIssue({code:`custom`,path:[fe],message:de});try{se(e,a.titlePath)}catch(e){t.addIssue({code:`custom`,path:a.titlePath.split(`.`),message:e instanceof Error?e.message:`Artifact title must be a nonblank string`})}});return{...structuredClone(a),kind:e.kind,schemaVersion:e.schemaVersion,dataSchema:s,...n?{hooks:n}:{},toRegistration:()=>structuredClone(a)}}var ke=e(me(),1),Ae=e(he(),1),je=e(ge(),1);function C(e){let t={allErrors:!0,strict:!1,strictSchema:!0},n=e.dataSchema.$schema===`https://json-schema.org/draft/2020-12/schema`?new Ae.default(t):new ke.default(t);return(0,je.default)(n),n.addKeyword({keyword:ae,schemaType:`string`,valid:!0}),n.compile(e.dataSchema)}function Me(e){return e.replace(/~1/gu,`/`).replace(/~0/gu,`~`)}function Ne(e){let t=e.instancePath.split(`/`).slice(1).map(Me),n=e.keyword===`required`?e.params.missingProperty:e.params.additionalProperty;return typeof n==`string`&&(e.keyword===`required`||e.keyword===`additionalProperties`)&&t.push(n),t.join(`.`)}function Pe(e){if(e.keyword!==`type`)return;let t=e.params.type;if(typeof t==`string`)return t;if(Array.isArray(t)&&t.every(e=>typeof e==`string`))return t.join(` | `)}const Fe=n.array();function Ie(e){if(e.keyword!==`enum`)return;let t=Fe.safeParse(e.params.allowedValues);return t.success?t.data:void 0}function Le(e){return(e??[]).map(e=>{let t=Pe(e),n=Ie(e);return{path:Ne(e),reason:e.message??`violates ${e.keyword}`,...t===void 0?{}:{expectedType:t},...n===void 0?{}:{allowedValues:n}}})}function w(e){return typeof e==`object`&&!!e&&Object.hasOwn(e,`slug`)}const Re={path:fe,reason:de};function ze(e){let t=C(e);return e=>t(e)&&!w(e)}function Be(e){let t=C(e);return e=>{let n=t(e)?[]:Le(t.errors);return w(e)&&n.push(Re),n.length===0?{valid:!0}:{valid:!1,issues:n}}}function Ve(e){return{hooks:[...e.hooks]}}const He=[`inline`,`summary`,`link`,`omit`],T=[`outbound`,`inbound`],E=_.string().min(1),D=_.enum(T),Ue=_.object({kinds:_.array(_.string().min(1)).optional(),hint:E.optional(),depth:_.number().int().min(1).max(20).optional(),nested:_.lazy(()=>O).optional(),direction:D.optional()}),O=_.record(_.string().min(1),Ue);function k(e){return JSON.stringify([e.kind,e.id,e.revision])}const We=_.enum([`not-selected`,`not-found`,`depth-exceeded`,`unsupported-ref-class`,`cycle-detected`]),Ge=_.object({target:d,sourceRef:f,relationType:_.string().min(1),sourceLocalId:c.shape.sourceLocalId,direction:D.optional(),hint:E,status:_.enum([`resolved`,`unresolved`]),reason:We.optional()}).superRefine((e,t)=>{e.status===`unresolved`&&e.reason===void 0&&t.addIssue({code:_.ZodIssueCode.custom,path:[`reason`],message:`reason is required for unresolved artifact context refs`}),e.status===`resolved`&&e.reason!==void 0&&t.addIssue({code:_.ZodIssueCode.custom,path:[`reason`],message:`reason must be omitted for resolved artifact context refs`}),e.status===`resolved`&&e.target.refClass!==`artifact`&&t.addIssue({code:_.ZodIssueCode.custom,path:[`target`],message:`resolved artifact context refs must target an artifact revision`})}),A=_.object({rootRef:f,refs:_.array(Ge),resolved:_.array(l)}).superRefine((e,t)=>{let n=new Set(e.resolved.map(k));n.has(k(e.rootRef))||t.addIssue({code:_.ZodIssueCode.custom,path:[`resolved`],message:`resolved artifact context wire payloads must include the root artifact revision`}),e.refs.forEach((e,r)=>{n.has(k(e.sourceRef))||t.addIssue({code:_.ZodIssueCode.custom,path:[`refs`,r,`sourceRef`],message:`artifact context ref sources must have a matching revision in resolved`}),!(e.status!==`resolved`||e.target.refClass!==`artifact`)&&(n.has(k(e.target))||t.addIssue({code:_.ZodIssueCode.custom,path:[`refs`,r,`target`],message:`resolved artifact context refs must have a matching revision in resolved`}))})});function Ke(e){let t=A.parse(e),n=new Map(t.resolved.map(e=>[k(e),e])),r=new Map;for(let e of t.refs){let t=k(e.sourceRef),n=r.get(t);n||(n=[],r.set(t,n)),n.push(e)}let i=n.get(k(t.rootRef));if(!i)throw Error(`Resolved artifact context is missing root artifact '${k(t.rootRef)}'`);let a=qe(t.rootRef,i,`inline`,r,n);return{root:a,flatten(){let e=[];return Xe(a,e),e}}}function qe(e,t,n,r,i){return{status:`resolved`,ref:e,artifact:t,hint:n,children:Ye(e,r,i,new Set([k(e)]))}}function Je(e,t,n,r,i,a,o,s,c){let l=k(e),u=new Set(c);return u.add(l),{status:`resolved`,ref:e,artifact:t,relation:n,sourceLocalId:r,direction:i,hint:a,children:Ye(e,o,s,u)}}function Ye(e,t,n,r){return(t.get(k(e))??[]).map(e=>{if(e.status===`unresolved`)return{status:`unresolved`,target:e.target,relation:e.relationType,sourceLocalId:e.sourceLocalId,direction:e.direction,hint:e.hint,reason:e.reason};if(e.target.refClass!==`artifact`)throw Error(`Resolved artifact context refs must target an artifact revision`);let i=k(e.target),a=n.get(i);if(!a)throw Error(`Resolved artifact context is missing target artifact '${i}'`);return r.has(i)?{status:`unresolved`,target:e.target,relation:e.relationType,sourceLocalId:e.sourceLocalId,direction:e.direction,hint:e.hint,reason:`cycle-detected`}:Je(e.target,a,e.relationType,e.sourceLocalId,e.direction,e.hint,t,n,r)})}function Xe(e,t){if(e.status!==`unresolved`){t.push(e.artifact);for(let n of e.children)Xe(n,t)}}const j=[`$set`,`$unset`,`$push`,`$pull`],M=`[A-Za-z_$][A-Za-z0-9_$]*`,N=`[A-Za-z_$][A-Za-z0-9_$-]*`,Ze=`(?:0|[1-9][0-9]*)`,Qe=`(?:${`\\$\\[${M}\\]`}|${Ze}|${N})`,$e=RegExp(`^${N}(?:\\.${Qe})*$`),et=RegExp(`^${M}(?:\\.${N})*$`),tt=RegExp(`^${Ze}$`),nt=RegExp(`^\\$\\[(${M})\\]$`),P=_.string().regex($e,`Expected a data-relative path of object properties, array positions, or $[filter] placeholders`);function rt(e){let t=nt.exec(e);return t?.[1]===void 0?tt.test(e)?{kind:`index`,index:Number(e)}:{kind:`property`,name:e}:{kind:`filter`,placeholder:t[1]}}function it(e){return e.split(`.`).map(rt)}function at(e){return it(e).flatMap(e=>e.kind===`filter`?[e.placeholder]:[])}const ot=r(_.record(_.string().regex(et,`Expected a filter key of the form name or name.field.path`),n),{prototypeKey:`an array filter cannot compare a __proto__ key, which JSON transport drops`,nonPlainObject:`an array filter must be a plain object of comparison keys`,symbolKey:`an array filter cannot carry symbol-keyed comparisons`,nonEnumerableKey:`an array filter cannot carry non-enumerable comparison keys`,extraArrayKey:`an array filter must be a plain object, not an array`});function st(e){let t=new Set(Object.keys(e).map(e=>e.split(`.`)[0]));if(t.size!==1)return;let[n]=t;return n!==void 0&&n.length>0?n:void 0}function F(e,t){return r(_.record(P,t),{prototypeKey:`${e} cannot address __proto__, which JSON transport drops`,nonPlainObject:`${e} must be a plain object of path instructions`,symbolKey:`${e} cannot carry symbol-keyed instructions`,nonEnumerableKey:`${e} cannot carry non-enumerable instructions`,extraArrayKey:`${e} must be a plain object, not an array`})}const ct=_.literal(!0),lt=_.strictObject({$set:F(`$set`,n).optional(),$unset:F(`$unset`,ct).optional(),$push:F(`$push`,n).optional(),$pull:F(`$pull`,n).optional(),arrayFilters:_.array(ot).optional()});function I(e){return j.flatMap(t=>Object.entries(e[t]??{}).map(([e,n])=>({operator:t,path:e,value:n})))}function ut(e,t){let n=I(e),r=new Map;(e.arrayFilters??[]).forEach((e,n)=>{let i=st(e);if(i===void 0){t.addIssue({code:`custom`,path:[`arrayFilters`,n],message:`An array filter must bind exactly one placeholder name across all of its keys`});return}if(r.has(i)){t.addIssue({code:`custom`,path:[`arrayFilters`,n],message:`Array filter placeholder ${i} is already bound by another filter`});return}r.set(i,n)});let i=new Set;for(let{operator:e,path:a}of n)for(let n of at(a))i.add(n),r.has(n)||t.addIssue({code:`custom`,path:[e,a],message:`Path uses placeholder $[${n}] without a matching entry in arrayFilters`});for(let[e,n]of r)i.has(e)||t.addIssue({code:`custom`,path:[`arrayFilters`,n],message:`Array filter binds placeholder ${e}, which no path uses`})}const dt=lt.superRefine(ut).superRefine((e,t)=>{I(e).length===0&&t.addIssue({code:`custom`,message:`Declare at least one of ${j.join(`, `)}`})}),ft=lt.superRefine(ut),pt=_.strictObject({kind:f.shape.kind,id:f.shape.id}),mt=_.strictObject({ref:pt,baseRevision:f.shape.revision,patch:ft,dryRun:_.boolean().optional(),schemaVersion:g.optional().describe(`Target schema version for the patched revision; defaults to the base revision's. Use it to migrate an artifact left at an older version by a kind bump.`),statusPath:te.optional(),representations:ie.strict().nullable().optional().describe(`Rendering hints (markdown, summary, plaintext) for the new revision. Omit to keep the previous revision's hints. An object replaces all of them, it does not merge: send every hint you want to keep. null clears them.`)}).superRefine((e,t)=>{e.schemaVersion===void 0&&I(e.patch).length===0&&t.addIssue({code:`custom`,path:[`patch`],message:`Declare at least one of ${j.join(`, `)}, or name a schemaVersion to migrate a payload that already fits`})}),ht=[`ARTIFACT_NOT_FOUND`,`BASE_REVISION_CONFLICT`,`KIND_NOT_REGISTERED`,`SCHEMA_VERSION_MISMATCH`,`PATH_NOT_DECLARED`,`PATH_NOT_RESOLVABLE`,`TARGET_NOT_A_COLLECTION`,`UNSUPPORTED_TARGET`,`NO_MATCH`,`SCHEMA_VALIDATION_FAILED`,`PAYLOAD_INVARIANT_FAILED`,`NO_CHANGE`,`STORE_REJECTED`,`HOST_FAILED`],gt=_.strictObject({path:_.string(),reason:_.string().min(1),expectedType:_.string().min(1).optional(),allowedValues:_.array(n).optional()}),_t=_.strictObject({code:_.enum(ht),message:_.string().min(1),operator:_.enum(j).optional(),path:P.optional(),currentRevision:f.shape.revision.optional(),issues:_.array(gt).optional(),repair:_.string().min(1)}).superRefine((e,t)=>{e.code===`BASE_REVISION_CONFLICT`&&e.currentRevision===void 0&&t.addIssue({code:_.ZodIssueCode.custom,message:`A BASE_REVISION_CONFLICT must name the revision the artifact carries.`,path:[`currentRevision`]})}),vt=_.strictObject({operator:_.enum(j),path:P,matched:_.number().int().positive()}),yt=_.strictObject({from:g,to:g}).refine(e=>e.to>e.from,{path:[`to`],message:`A migration moves the artifact forward to a newer schema version`}),bt=_.strictObject({ok:_.literal(!0),base:f,operations:_.array(vt),migration:yt.optional()});function xt(e,t){e.operations.length===0&&e.migration===void 0&&t.addIssue({code:`custom`,path:[`operations`],message:`A success without a migration must report at least one applied instruction`})}const St=bt.extend({dryRun:_.literal(!0)}).superRefine(xt),Ct=bt.extend({dryRun:_.literal(!1),artifact:f}).superRefine(xt),wt=_.discriminatedUnion(`dryRun`,[St,Ct]),Tt=_.strictObject({ok:_.literal(!1),error:_t}),Et=_.union([wt,Tt]),Dt=_.object({ref:oe}),Ot=_.union([_.strictObject({ok:_.literal(!0),ref:oe,areaPath:ue,part:t}),_.strictObject({ok:_.literal(!1),error:le})]),L=f.pick({kind:!0,id:!0}),R=_.number().int().positive(),z=R,B={knowledge:`valid`,commitment:`proposed`,interaction:`open`},V=_.discriminatedUnion(`category`,[_.strictObject({category:_.literal(`knowledge`),state:_.enum(h.knowledge),version:z}),_.strictObject({category:_.literal(`commitment`),state:_.enum(h.commitment),version:z}),_.strictObject({category:_.literal(`interaction`),state:_.enum(h.interaction),version:z})]).superRefine((e,t)=>{e.version===1&&e.state!==B[e.category]&&t.addIssue({code:`custom`,path:[`state`],message:`Lifecycle version 1 is reserved for the category initial state`})}),H=_.union([V,_.strictObject({category:_.literal(`record`)})]),U=_.string().trim().min(1),kt=_.strictObject({kind:U,ref:U}),W=_.discriminatedUnion(`kind`,[_.strictObject({kind:_.literal(`revision-assessment`),assessedRevision:f.shape.revision,source:kt.optional()}),_.strictObject({kind:_.literal(`handover`),source:kt})]),At={artifact:L,expectedVersion:z,state:m,situation:W,reason:U.optional()},G=_.strictObject(At),jt=_.strictObject({...At,actor:re}),Mt={valid:[`retired`],retired:[`valid`],proposed:[`decided`],decided:[`fulfilled`,`revoked`],fulfilled:[],revoked:[],open:[`resolved`,`closed-without-resolution`],resolved:[],"closed-without-resolution":[]};function K(e,t){return Mt[e].includes(t)}const Nt={artifact:L,lifecycle:V,actor:re,timestamp:_.number().int().nonnegative(),observedRevision:f.shape.revision},Pt=_.strictObject({...Nt,operation:_.literal(`initialized`)}).superRefine((e,t)=>{(e.lifecycle.version!==1||e.lifecycle.state!==B[e.lifecycle.category])&&t.addIssue({code:`custom`,path:[`lifecycle`],message:`Initialization requires the category initial state and version 1`})});function Ft(e,t){return t===`retired`||e===`retired`&&t===`valid`}const It=`Retiring or reinstating knowledge requires a reason`,q=_.strictObject({...Nt,operation:_.literal(`transitioned`),previousState:m,situation:W,reason:G.shape.reason}).superRefine((e,t)=>{(!K(e.previousState,e.lifecycle.state)||e.lifecycle.version<=1)&&t.addIssue({code:`custom`,path:[`lifecycle`],message:`History requires a category-compatible transition after initialization`}),Ft(e.previousState,e.lifecycle.state)&&!e.reason&&t.addIssue({code:`custom`,path:[`reason`],message:It}),e.situation.kind===`revision-assessment`&&e.situation.assessedRevision!==e.observedRevision&&t.addIssue({code:`custom`,path:[`situation`],message:`An assessment cannot authorize a different observed content revision`})}),Lt=_.discriminatedUnion(`operation`,[Pt,q]),J=_.discriminatedUnion(`reason`,[_.strictObject({reason:_.literal(`lifecycle-version-conflict`),expectedVersion:z,current:V,requestedState:m}),_.strictObject({reason:_.literal(`content-basis-conflict`),assessedRevision:f.shape.revision,currentRevision:f.shape.revision}),_.strictObject({reason:_.literal(`invalid-transition`),current:H,requestedState:m}),_.strictObject({reason:_.literal(`precondition-failed`),current:V,requestedState:m})]),Y=`artifact-lifecycle-rejected`;var X=class extends Error{code=Y;data;constructor(e,t){super(e),this.name=`ArtifactLifecycleError`,this.data=J.parse(t)}};function Rt(e){return e===`record`?{category:`record`}:V.parse({category:e,state:B[e],version:1})}function zt(e){let t=H.parse(e.current),n=f.shape.revision.parse(e.currentRevision),r=jt.parse(e.command);if(t.category===`record`)throw new X(`Record artifacts do not have a lifecycle`,{reason:`invalid-transition`,current:t,requestedState:r.state});if(r.expectedVersion!==t.version)throw new X(`Artifact lifecycle changed since the supplied baseline`,{reason:`lifecycle-version-conflict`,expectedVersion:r.expectedVersion,current:t,requestedState:r.state});if(r.situation.kind===`revision-assessment`&&r.situation.assessedRevision!==n)throw new X(`Assessed content revision is no longer current`,{reason:`content-basis-conflict`,assessedRevision:r.situation.assessedRevision,currentRevision:n});if(!K(t.state,r.state))throw new X(`Artifact lifecycle transition is not allowed`,{reason:`invalid-transition`,current:t,requestedState:r.state});if(Ft(t.state,r.state)&&!r.reason)throw new X(It,{reason:`precondition-failed`,current:t,requestedState:r.state});return V.parse({...t,state:r.state,version:t.version+1})}const Bt=_.strictObject({artifact:L}),Vt=_.strictObject({lifecycle:H}),Ht=_.strictObject({artifact:L,afterVersion:R.optional(),limit:_.number().int().min(1).max(100).default(50)}),Ut=_.strictObject({entries:_.array(Lt).max(100),nextCursor:R.optional()}).superRefine(({entries:e,nextCursor:t},n)=>{let r=e[0],i;for(let[t,a]of e.entries()){let e=a.artifact.kind===r?.artifact.kind&&a.artifact.id===r?.artifact.id,o=i===void 0||a.lifecycle.version===i.lifecycle.version+1,s=i===void 0||a.operation===`transitioned`&&a.lifecycle.category===i.lifecycle.category&&a.previousState===i.lifecycle.state;if(!e||!o||!s){n.addIssue({code:`custom`,path:[`entries`,t],message:`History pages contain one artifact in contiguous ascending, state-linked order`});break}i=a}t!==void 0&&t!==i?.lifecycle.version&&n.addIssue({code:`custom`,path:[`nextCursor`],message:`nextCursor must equal the last returned lifecycle version`})}),Z=_.strictObject({entry:q}),Wt=Z,Gt=_.strictObject({code:_.literal(Y),message:_.string().min(1),data:J});function Kt(e){return{code:e.code,message:e.message,data:e.data}}function qt(e,t){switch(t.reason){case`content-basis-conflict`:return Yt(e,t);case`lifecycle-version-conflict`:return[...Q(e,t),...Jt(e,t)];case`invalid-transition`:case`precondition-failed`:return[...Q(e,t),...Xt(e,t)]}}function Q(e,t){return t.requestedState===e.state?[]:[{path:[`requestedState`],message:`Rejection requestedState must match the rejected transition`}]}function Jt(e,t){let n=[];return t.expectedVersion!==e.expectedVersion&&n.push({path:[`expectedVersion`],message:`Version conflict baseline must match the rejected transition`}),t.current.version===e.expectedVersion&&n.push({path:[`current`,`version`],message:`Version conflict requires a current version different from the supplied baseline`}),n}function Yt(e,t){let n=[];return(e.situation.kind!==`revision-assessment`||t.assessedRevision!==e.situation.assessedRevision)&&n.push({path:[`assessedRevision`],message:`Content conflict must identify the rejected revision assessment`}),t.currentRevision===t.assessedRevision&&n.push({path:[`currentRevision`],message:`Content conflict requires a current revision different from the assessed revision`}),n}function Xt(e,t){if(t.current.category===`record`)return[];let n=[];t.current.version!==e.expectedVersion&&n.push({path:[`current`,`version`],message:`A rejection after the version check must report the supplied baseline version`});let r=K(t.current.state,t.requestedState);return t.reason===`invalid-transition`&&r&&n.push({path:[`reason`],message:`invalid-transition requires a transition the lifecycle matrix disallows`}),t.reason===`precondition-failed`&&!r&&n.push({path:[`reason`],message:`precondition-failed requires a transition the lifecycle matrix allows`}),n}const Zt=_.strictObject({transition:G,error:Gt}).superRefine(({transition:e,error:t},n)=>{for(let r of qt(e,t.data))n.addIssue({code:`custom`,path:[`error`,`data`,...r.path],message:r.message})}),Qt={"lifecycle.get":{request:Bt,response:Vt},"lifecycle.history":{request:Ht,response:Ut},"lifecycle.transition":{request:G,response:Z},"lifecycle.committed":Wt,"lifecycle.rejected":Zt},$t=l.omit({id:!0,slug:!0,revision:!0,timestamp:!0}),en={...Qt,"kind.register":{request:p,response:_.object({registered:_.boolean()})},"kind.list":{request:_.object({kind:_.string().min(1).optional()}),response:_.object({kinds:_.array(p)})},"relation-type.register":{request:s,response:_.object({registered:_.boolean()})},"relation-type.list":{request:_.object({type:_.string().min(1).optional()}),response:_.object({relationTypes:_.array(s)})},create:{request:$t.extend({id:f.shape.id.optional(),slug:l.shape.slug.optional()}),response:_.object({artifact:l})},revise:{request:_.object({previous:f,statusPath:te.optional(),revision:$t}),response:_.object({artifact:l})},patch:{request:mt,response:Et},resolve:{request:_.object({ref:f}),response:_.object({artifact:l.nullable()})},resolvePart:{request:Dt,response:Ot},query:{request:o,response:_.object({artifacts:_.array(l)})},compare:{request:ee,response:ne},"evidence.resolve":{request:ve,response:Se},resolveContext:{request:_.object({ref:f,selectors:O.optional(),maxDepth:_.number().int().min(1).max(20).default(5)}),response:_.object({context:A})},created:_.object({artifact:l}),revised:_.object({previous:f,artifact:l}),"relation.added":_.object({artifact:f,relation:c}),"observation.added":_.object({artifact:f,observation:u}),"status.changed":_.object({artifact:f,path:_.string().min(1),previous:_.unknown().optional(),current:_.unknown().optional()}),"kind.changed":_.object({kind:_.string().min(1),schemaVersion:g})},tn=_e(`artifact`,en),nn=tn.subjects,rn=_.discriminatedUnion(`refClass`,[f.omit({revision:!0}),a]);function an(e){if(e.refClass===`artifact`)return{refClass:`artifact`,kind:e.kind,id:e.id};if(e.refClass===`entity`)return{refClass:`entity`,entityType:e.entityType,id:e.id}}function $(e){return e.refClass===`artifact`?JSON.stringify([`artifact`,e.kind,e.id]):JSON.stringify([`entity`,e.entityType,e.id])}function on(e){return e.refClass===`artifact`?`artifact:${e.kind}/${e.id}`:`entity:${e.entityType}/${e.id}`}const sn=[`relation-target`,`data`];function cn(e,t){if(!e||e.length===0)return{ok:!0,rules:[]};let n=[];for(let[r,i]of e.entries()){for(let[e,a]of i.by.entries())(!sn.includes(a.kind)||!t.includes(a.kind))&&n.push({ruleIndex:r,selectorIndex:e,capability:a.kind,message:`rule #${r}, selector #${e}: '${a.kind}' selectors are not supported`});i.lifecycleStates!==void 0&&!t.includes(`lifecycle-states`)&&n.push({ruleIndex:r,capability:`lifecycle-states`,message:`rule #${r}: lifecycleStates is declared but 'lifecycle-states' is not a supported capability`})}return n.length>0?{ok:!1,issues:n}:{ok:!0,rules:e}}function ln(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return;n=Reflect.get(n,e)}return{value:n}}function un(e,t,n,r){let{path:i}=e,a=ln(t,i);if(a===void 0||a.value===null||a.value===void 0)return{ruleIndex:n,selectorIndex:r,reason:`missing-value`,dataPath:i,message:`rule #${n}, selector #${r}, data path '${i}': no value found`};let{value:o}=a;return typeof o!=`string`&&typeof o!=`number`&&typeof o!=`boolean`?{ruleIndex:n,selectorIndex:r,reason:`unsupported-value-type`,dataPath:i,message:`rule #${n}, selector #${r}, data path '${i}': value must be a scalar (string, number, or boolean)`}:{path:i,value:o}}function dn(e,t,n,r,i){if(e.kind===`data`)return un(e,n,r,i);let{relationType:a}=e,o=t.filter(e=>e.type===a&&e.sourceLocalId===void 0),s=new Set,c,l;for(let e of o){let t=an(e.target);if(t===void 0){l=e.target.refClass;break}s.add($(t)),c=t}return l===void 0?c===void 0?{ruleIndex:r,selectorIndex:i,reason:`missing-target`,relationType:a,message:`rule #${r}, selector #${i}, relation '${a}': no relations of this type found`}:s.size>1?{ruleIndex:r,selectorIndex:i,reason:`ambiguous-target`,relationType:a,message:`rule #${r}, selector #${i}, relation '${a}': ${s.size} distinct targets; expected exactly one`}:{type:a,target:c}:{ruleIndex:r,selectorIndex:i,reason:`unsupported-target`,relationType:a,message:`rule #${r}, selector #${i}, relation '${a}': found a relation with refClass '${l}'; only artifact and entity targets are supported`}}function fn(e){return`target`in e?[`relation-target`,e.type,$(e.target)]:[`data`,e.path,e.value]}function pn(e,t,n){let r=[],i=[];for(let[a,o]of e.entries()){let e=o.by.map((e,r)=>dn(e,t,n,a,r)),s=e.filter(e=>`reason`in e);if(s.length>0){i.push(...s);continue}let c=e.filter(e=>!(`reason`in e)),l=JSON.stringify(c.map(e=>fn(e)));r.push({rule:o,ruleIndex:a,parts:c,serialized:l})}return{keys:r,issues:i}}function mn(e){return e.parts.map(e=>`target`in e?`${e.type} → ${on(e.target)}`:`${e.path} → ${JSON.stringify(e.value)}`).join(`; `)}export{wt as $,jt as A,j as B,X as C,Se as Ct,J as D,Pt as E,Rt as F,Tt as G,dt as H,K as I,vt as J,gt as K,Dt as L,q as M,R as N,W as O,zt as P,Et as Q,Ot as R,H as S,ve as St,L as T,St as U,ot as V,_t as W,Ct as X,P as Y,mt as Z,Zt as _,Ve as _t,an as a,it as at,Kt as b,Oe as bt,tn as c,We as ct,Wt as d,T as dt,pt as et,Gt as f,He as ft,Ut as g,O as gt,Ht as h,E as ht,rn as i,rt as it,G as j,V as k,en as l,A as lt,Vt as m,Ue as mt,pn as n,I as nt,on as o,Ke as ot,Bt as p,D as pt,yt as q,mn as r,at as rt,$ as s,Ge as st,cn as t,st as tt,nn as u,k as ut,Qt as v,Be as vt,Lt as w,Y as x,De as xt,Z as y,ze as yt,ht as z};
|
|
@@ -352,7 +352,7 @@ interface DiscoveryMetadata {
|
|
|
352
352
|
* Contract for log importers (adapters and extensions).
|
|
353
353
|
*
|
|
354
354
|
* Importers implement this interface to import external session logs
|
|
355
|
-
* into Makaio's event system. Both AI adapters (Claude Code, Codex
|
|
355
|
+
* into Makaio's event system. Both AI adapters (Claude Code, Codex)
|
|
356
356
|
* and extensions can provide log importers.
|
|
357
357
|
* @remarks
|
|
358
358
|
* The importer is responsible for:
|
|
@@ -388,7 +388,6 @@ interface LogImporter<TRecord, TState = unknown> {
|
|
|
388
388
|
* Example implementations:
|
|
389
389
|
* - Claude Code: Check for `type` field in `['started', 'message', 'tool_use']`
|
|
390
390
|
* - Codex: Check for `event` field matching Codex schema patterns
|
|
391
|
-
* - Gemini: Check for Gemini-specific log structure
|
|
392
391
|
*
|
|
393
392
|
* Return `{ confidence: 0.95 }` for high confidence matches,
|
|
394
393
|
* `{ confidence: 0.5 }` for ambiguous formats, or `false` for incompatible.
|
|
@@ -403,7 +402,6 @@ interface LogImporter<TRecord, TState = unknown> {
|
|
|
403
402
|
* Examples of log directories:
|
|
404
403
|
* - Claude Code: `~/.claude/projects/` (contains `session.jsonl` files)
|
|
405
404
|
* - Codex: `~/.codex/sessions/` (date-organized subdirectories)
|
|
406
|
-
* - Gemini: `~/.gemini/tmp/` (hash-organized project directories)
|
|
407
405
|
*/
|
|
408
406
|
getLogDirectory(): string;
|
|
409
407
|
/**
|
|
@@ -526,7 +524,7 @@ interface LogImportTestConfig<TRecord = unknown, TState = unknown> {
|
|
|
526
524
|
* Fixture file name for conformance tests.
|
|
527
525
|
*
|
|
528
526
|
* Relative to the conformance harness fixture directory.
|
|
529
|
-
* @example 'codex-session.jsonl' or '
|
|
527
|
+
* @example 'codex-session.jsonl' or 'claude-session.jsonl'
|
|
530
528
|
*/
|
|
531
529
|
fixtureFile: string;
|
|
532
530
|
/**
|
package/dist/bus/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as ee,M as te,N as f,O as ne,P as re,Q as p,R as m,S as h,T as ie,U as ae,V as g,W as oe,X as se,Y as ce,Z as le,_ as ue,a as de,at as fe,b as pe,d as _,et as me,f as he,g as v,h as y,i as ge,it as b,j as x,k as S,l as C,m as w,nt as T,o as E,p as D,q as O,r as k,rt as A,s as j,t as M,tt as N,u as P,v as F,w as I,x as L,y as _e,z as ve}from"../bus-DgpPEPoM.mjs";import{z as R}from"zod";const z={"channel.open":{request:R.object({endpoint:R.string(),token:R.string(),clientPubKey:R.string(),transports:R.array(R.string())}),response:R.object({channelId:R.string(),endpointPubKey:R.string()})}};function B(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=String.fromCharCode(t[e]);return btoa(n.join(``))}function V(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}async function H(){return globalThis.crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveKey`])}async function U(e){return B(await globalThis.crypto.subtle.exportKey(`raw`,e))}async function W(e){let t=V(e);return globalThis.crypto.subtle.importKey(`raw`,t,{name:`ECDH`,namedCurve:`P-256`},!1,[])}async function G(e,t){return globalThis.crypto.subtle.deriveKey({name:`ECDH`,public:t},e,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function K(e,t,n){let r=globalThis.crypto.getRandomValues(new Uint8Array(12)),i=new TextEncoder().encode(t),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.encrypt(a,e,i);return{iv:B(r),data:B(o)}}async function q(e,t,n){let r=V(t.iv),i=V(t.data),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.decrypt(a,e,i);return new TextDecoder().decode(o)}function J(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!1,payload:{},local:!1,channel:!1}}}function Y(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!0,payload:{},local:!1,channel:!1}}}var X=class{channelId;sharedKey;context;transportNames;cleanups=[];pendingRequests=new Set;closed=!1;constructor(e,t,n,r){this.channelId=e,this.sharedKey=t,this.context=n,this.transportNames=r;let i=J(e,`$close`);this.cleanups.push(this.registerEventHandler(i,t,e=>{this.handlePeerClose()}))}on(e,t,n){this.assertOpen();let r=this.requireKey(),i=e.$meta.isRequest?this.registerRequestHandler(e,r,t,n):this.registerEventHandler(e,r,t,n);return this.cleanups.push(i),()=>{i();let e=this.cleanups.indexOf(i);e!==-1&&this.cleanups.splice(e,1)}}once(e,t){this.assertOpen();let n=this.requireKey(),r=null,i=(e=>{let n=r;if(r=null,n){let e=this.cleanups.indexOf(n);e!==-1&&this.cleanups.splice(e,1)}return n?.(),t(e)});return r=e.$meta.isRequest?this.registerRequestHandler(e,n,i):this.registerEventHandler(e,n,i),this.cleanups.push(r),()=>{if(r){let e=r;r=null;let t=this.cleanups.indexOf(e);t!==-1&&this.cleanups.splice(t,1),e()}}}async emit(e,t){this.assertOpen();let n=this.requireKey(),r=J(this.channelId,e.subject),i=await K(n,JSON.stringify(t),`${this.channelId}:${e.subject}:evt`);await w(this.context,r,i,{...this.transportNames?{transports:[...this.transportNames]}:{}})}async request(e,t,n){this.assertOpen();let r=this.requireKey(),i=new AbortController;this.pendingRequests.add(i);try{let a=Y(this.channelId,e.subject),o=await K(r,JSON.stringify(t),`${this.channelId}:${e.subject}:req`),s=await q(r,await _(this.context,a,o,{signal:i.signal,...n?.timeout===void 0?{}:{timeout:n.timeout},...this.transportNames?{transports:[...this.transportNames]}:{}}),`${this.channelId}:${e.subject}:res`);return JSON.parse(s)}finally{this.pendingRequests.delete(i)}}async requestOptional(e,t,n){try{return{handled:!0,data:await this.request(e,t,n)}}catch(e){if(e instanceof l)return{handled:!1};throw e}}close(){if(this.closed)return;this.closed=!0;let e=this.sharedKey;if(e){let t=J(this.channelId,`$close`);K(e,JSON.stringify({}),`${this.channelId}:$close:evt`).then(e=>w(this.context,t,e,{...this.transportNames?{transports:[...this.transportNames]}:{}})).catch(()=>{})}this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null}assertOpen(){if(this.closed)throw new g(this.channelId)}requireKey(){return this.sharedKey}registerEventHandler(e,t,n,r){let i=J(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:evt`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r);return n({...e,payload:i})},r)}registerRequestHandler(e,t,n,r){let i=Y(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:req`,o=`${this.channelId}:${e.subject}:res`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r),s,c=e=>{s={value:e}},l=e=>{s={value:{...s?.value??{},...e}}},u=async()=>{let n=s;if(await e.next(),n!==void 0){s=n;return}let r=e.result;if(r!==void 0){let e=await q(t,r,o);s={value:JSON.parse(e)}}};if(await n({...e,payload:i,get result(){return s?.value},setResult:c,extendResult:l,next:u}),s!==void 0){let n=await K(t,JSON.stringify(s.value),o);e.setResult(n)}},r)}handlePeerClose(){this.closed||(this.closed=!0,this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null)}abortPendingRequests(){let e=new g(this.channelId);for(let t of this.pendingRequests)t.abort(e);this.pendingRequests.clear()}runCleanups(){for(let e of this.cleanups)try{e()}catch{}this.cleanups.length=0}};function Z(e){return e.namespaceRegistry.registerNamespace(p(`system`,z)).subjects.channel.open}function ye(e,t,n,r){let i=v(e,Z(e),async i=>{if(i.payload.endpoint!==t){await i.next();return}if(i.payload.token!==r.token)throw new c(t);let{publicKey:a,privateKey:o}=await H(),s=await G(o,await W(i.payload.clientPubKey)),l=globalThis.crypto.randomUUID(),u=new Set(e.transportRegistry.names()),d=new X(l,s,e,(i.payload.transports??[]).filter(e=>u.has(e)));try{n(d),i.setResult({channelId:l,endpointPubKey:await U(a)})}catch(e){throw d.close(),e}});return{name:t,token:r.token,close:i}}async function be(e,t,n){let r=Z(e),{publicKey:i,privateKey:a}=await H(),o=await U(i),s=n.transports!==void 0,c=s?[...n.transports]:[...e.transportRegistry.names()],l=s?{transports:c}:void 0,u=await _(e,r,{endpoint:t,token:n.token,clientPubKey:o,transports:c},l),d=await G(a,await W(u.endpointPubKey));return new X(u.channelId,d,e,c)}var xe=class{pending;constructor(){this.pending=new Map}track(e,t,n){return new Promise((r,i)=>{if(n?.aborted){i(s(n.reason));return}let a=t===0?void 0:setTimeout(()=>{let n=this.pending.get(e);n!==void 0&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(new f(e,t)))},t);if(this.pending.set(e,{resolve:r,reject:i,timeoutId:a,removeAbortListener:void 0}),n){let t=()=>{this.reject(e,s(n.reason))};n.addEventListener(`abort`,t,{once:!0});let r=()=>{n.removeEventListener(`abort`,t)},i=this.pending.get(e);i&&(i.removeAbortListener=r)}n?.aborted&&this.reject(e,s(n.reason))})}resolve(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.resolve(t))}reject(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(t))}cancel(e,t){this.reject(e,t??s(void 0))}rejectAll(e){for(let[t,n]of this.pending.entries())clearTimeout(n.timeoutId),n.removeAbortListener?.(),n.reject(e);this.pending.clear()}cleanup(){this.rejectAll(Error(`Transport disconnected`))}};const Se=p(`bus:lifecycle`,de).subjects;function Ce(e,t){let n={},r={},i={};for(let[t,a]of e)n[t]=a.priorities,r[t]=a.deliveryClass??`relayable`,a.filter!==void 0&&(i[t]=a.filter);return{type:`subscribe`,...t===void 0?{}:{ackId:t},subjects:n,deliveryClasses:r,...Object.keys(i).length>0&&{filters:i}}}function we(e,t){return{type:`unsubscribe`,...t===void 0?{}:{ackId:t},subjects:e}}function Q(e,t){let n=e.trim();if(n.length===0||n.startsWith(`extension:`))throw Error(`Invalid extensionName: expected a non-empty extension name without the "extension:" prefix.`);let r=n;return{...p(`extension:${r}`,t.schemas),domain:r,extensions:t.extensions??{}}}function $(e,t){return`${e}.${t}`}function Te(){let e=new Map;return{register(t){let n=$(t.namespace,t.subject);return e.set(n,t),()=>{e.get(n)===t&&e.delete(n)}},get(t,n){return e.get($(t,n))}}}const Ee=x.fact.$meta.namespace,De=x.fact.subject;function Oe(e){return e.type===`event`||e.type===`request`||e.type===`broadcast`}async function ke(e,t,n,r,i,a){let o=y({message:t,direction:`outbound`,observedAt:a(),machineId:i,namespaceRegistry:n,projectorRegistry:r});for(let n of o)await e.send({type:`event`,namespace:Ee,subject:De,payload:n,messageId:`${t.messageId}:telemetry:${n.factId}`,correlationId:t.correlationId})}function Ae(e,t,n,r,i){return async function(a,o){if(!Oe(a))return!0;if(await ke(e,a,t,n,r,i),a.type===`request`)throw Error(`Projected telemetry transport cannot satisfy request responses; exclude it from request routing.`);return a.type===`broadcast`?[]:!0}}function je(e){let{inner:t,namespaceRegistry:n,projectorRegistry:r,machineId:i,now:a=Date.now}=e,o={name:e.name,send:Ae(t,n,r,i,a),onReceive(e){return t.onReceive(async()=>{})},connect(){return t.connect()},disconnect(){return t.disconnect()},subscribe(){return Promise.resolve()},unsubscribe(){return Promise.resolve()},get ready(){return t.ready},get onNewReadySession(){return t.onNewReadySession},set onNewReadySession(e){t.onNewReadySession=e},get onConnected(){return t.onConnected},set onConnected(e){t.onConnected=e},get onDisconnected(){return t.onDisconnected},set onDisconnected(e){t.onDisconnected=e},isReady(){return t.isReady?.()??!0},cancelRequest(e,n){t.cancelRequest?.(e,n)},onBroadcastResults(e,n,r){t.onBroadcastResults?.(e,n,r)}};return t.reconnect&&(o.reconnect=()=>t.reconnect()),o}export{ae as BusAbortError,d as BusError,Se as BusLifecycle,m as CONNECTION_LOST_ERROR_CODE,c as ChannelAuthError,g as ChannelClosedError,n as ChannelOnlyError,ve as ConnectionLostError,xe as CorrelationTracker,he as DEFAULT_READINESS_TIMEOUT_MS,D as DEFAULT_REQUEST_TIMEOUT_MS,pe as LOCAL_ORIGIN,ee as LocalSubjectError,M as MakaioBus,o as NO_HANDLER_ERROR_CODE,l as NoHandlerError,P as OnceAbortError,L as REMOTE_ORIGIN,re as RequestError,z as SystemChannelSchemas,f as TimeoutError,te as ValidationError,F as __resetWarnedSubjects,Ce as buildSubscribeMessage,we as buildUnsubscribeMessage,b as channelSubject,me as collectorOnlySubject,k as createBusContext,ge as createBusInstance,ye as createChannelEndpoint,Q as createExtensionNamespace,C as createFilteredBus,je as createProjectedTelemetryTransport,Te as createSubjectTelemetryProjectorRegistry,N as defaultTransports,E as defineSubjectExtension,a as deserializeTransportError,j as extendSubject,i as findInErrorChain,e as getFullSubjectForSubjectDefinition,O as getPath,ne as getSubjectFromBusMessage,h as handleCorrelationResponse,T as hostLocalRequest,S as isNoHandlerErrorForSubject,oe as isRequestCancellation,fe as isRequestSchema,A as localSubject,se as matchesAnySubscription,u as matchesFilter,le as matchesSubscription,ce as mergeFilters,be as openChannel,_e as parseBusUrl,y as projectSubjectTelemetryFacts,r as serializeTransportError,I as shouldReceiveMessage,ie as trackMessageCorrelation,t as transportErrorData,ue as waitForSubscriptionPropagation};
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as ee,M as te,N as f,O as ne,P as re,Q as p,R as m,S as h,T as ie,U as ae,V as g,W as oe,X as se,Y as ce,Z as le,_ as ue,a as de,at as fe,b as pe,d as _,et as me,f as he,g as v,h as y,i as ge,it as b,j as x,k as S,l as C,m as w,nt as T,o as E,p as D,q as O,r as k,rt as A,s as j,t as M,tt as N,u as P,v as F,w as I,x as L,y as _e,z as ve}from"../bus-CgswamdO.mjs";import{z as R}from"zod";const z={"channel.open":{request:R.object({endpoint:R.string(),token:R.string(),clientPubKey:R.string(),transports:R.array(R.string())}),response:R.object({channelId:R.string(),endpointPubKey:R.string()})}};function B(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=String.fromCharCode(t[e]);return btoa(n.join(``))}function V(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}async function H(){return globalThis.crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveKey`])}async function U(e){return B(await globalThis.crypto.subtle.exportKey(`raw`,e))}async function W(e){let t=V(e);return globalThis.crypto.subtle.importKey(`raw`,t,{name:`ECDH`,namedCurve:`P-256`},!1,[])}async function G(e,t){return globalThis.crypto.subtle.deriveKey({name:`ECDH`,public:t},e,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function K(e,t,n){let r=globalThis.crypto.getRandomValues(new Uint8Array(12)),i=new TextEncoder().encode(t),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.encrypt(a,e,i);return{iv:B(r),data:B(o)}}async function q(e,t,n){let r=V(t.iv),i=V(t.data),a={name:`AES-GCM`,iv:r};n!==void 0&&(a.additionalData=new TextEncoder().encode(n));let o=await globalThis.crypto.subtle.decrypt(a,e,i);return new TextDecoder().decode(o)}function J(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!1,payload:{},local:!1,channel:!1}}}function Y(e,t){return{subject:t,$meta:{namespace:`channel:${e}`,isRequest:!0,payload:{},local:!1,channel:!1}}}var X=class{channelId;sharedKey;context;transportNames;cleanups=[];pendingRequests=new Set;closed=!1;constructor(e,t,n,r){this.channelId=e,this.sharedKey=t,this.context=n,this.transportNames=r;let i=J(e,`$close`);this.cleanups.push(this.registerEventHandler(i,t,e=>{this.handlePeerClose()}))}on(e,t,n){this.assertOpen();let r=this.requireKey(),i=e.$meta.isRequest?this.registerRequestHandler(e,r,t,n):this.registerEventHandler(e,r,t,n);return this.cleanups.push(i),()=>{i();let e=this.cleanups.indexOf(i);e!==-1&&this.cleanups.splice(e,1)}}once(e,t){this.assertOpen();let n=this.requireKey(),r=null,i=(e=>{let n=r;if(r=null,n){let e=this.cleanups.indexOf(n);e!==-1&&this.cleanups.splice(e,1)}return n?.(),t(e)});return r=e.$meta.isRequest?this.registerRequestHandler(e,n,i):this.registerEventHandler(e,n,i),this.cleanups.push(r),()=>{if(r){let e=r;r=null;let t=this.cleanups.indexOf(e);t!==-1&&this.cleanups.splice(t,1),e()}}}async emit(e,t){this.assertOpen();let n=this.requireKey(),r=J(this.channelId,e.subject),i=await K(n,JSON.stringify(t),`${this.channelId}:${e.subject}:evt`);await w(this.context,r,i,{...this.transportNames?{transports:[...this.transportNames]}:{}})}async request(e,t,n){this.assertOpen();let r=this.requireKey(),i=new AbortController;this.pendingRequests.add(i);try{let a=Y(this.channelId,e.subject),o=await K(r,JSON.stringify(t),`${this.channelId}:${e.subject}:req`),s=await q(r,await _(this.context,a,o,{signal:i.signal,...n?.timeout===void 0?{}:{timeout:n.timeout},...this.transportNames?{transports:[...this.transportNames]}:{}}),`${this.channelId}:${e.subject}:res`);return JSON.parse(s)}finally{this.pendingRequests.delete(i)}}async requestOptional(e,t,n){try{return{handled:!0,data:await this.request(e,t,n)}}catch(e){if(e instanceof l)return{handled:!1};throw e}}close(){if(this.closed)return;this.closed=!0;let e=this.sharedKey;if(e){let t=J(this.channelId,`$close`);K(e,JSON.stringify({}),`${this.channelId}:$close:evt`).then(e=>w(this.context,t,e,{...this.transportNames?{transports:[...this.transportNames]}:{}})).catch(()=>{})}this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null}assertOpen(){if(this.closed)throw new g(this.channelId)}requireKey(){return this.sharedKey}registerEventHandler(e,t,n,r){let i=J(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:evt`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r);return n({...e,payload:i})},r)}registerRequestHandler(e,t,n,r){let i=Y(this.channelId,e.subject),a=`${this.channelId}:${e.subject}:req`,o=`${this.channelId}:${e.subject}:res`;return v(this.context,i,async e=>{let r=await q(t,e.payload,a),i=JSON.parse(r),s,c=e=>{s={value:e}},l=e=>{s={value:{...s?.value??{},...e}}},u=async()=>{let n=s;if(await e.next(),n!==void 0){s=n;return}let r=e.result;if(r!==void 0){let e=await q(t,r,o);s={value:JSON.parse(e)}}};if(await n({...e,payload:i,get result(){return s?.value},setResult:c,extendResult:l,next:u}),s!==void 0){let n=await K(t,JSON.stringify(s.value),o);e.setResult(n)}},r)}handlePeerClose(){this.closed||(this.closed=!0,this.abortPendingRequests(),this.runCleanups(),this.sharedKey=null)}abortPendingRequests(){let e=new g(this.channelId);for(let t of this.pendingRequests)t.abort(e);this.pendingRequests.clear()}runCleanups(){for(let e of this.cleanups)try{e()}catch{}this.cleanups.length=0}};function Z(e){return e.namespaceRegistry.registerNamespace(p(`system`,z)).subjects.channel.open}function ye(e,t,n,r){let i=v(e,Z(e),async i=>{if(i.payload.endpoint!==t){await i.next();return}if(i.payload.token!==r.token)throw new c(t);let{publicKey:a,privateKey:o}=await H(),s=await G(o,await W(i.payload.clientPubKey)),l=globalThis.crypto.randomUUID(),u=new Set(e.transportRegistry.names()),d=new X(l,s,e,(i.payload.transports??[]).filter(e=>u.has(e)));try{n(d),i.setResult({channelId:l,endpointPubKey:await U(a)})}catch(e){throw d.close(),e}});return{name:t,token:r.token,close:i}}async function be(e,t,n){let r=Z(e),{publicKey:i,privateKey:a}=await H(),o=await U(i),s=n.transports!==void 0,c=s?[...n.transports]:[...e.transportRegistry.names()],l=s?{transports:c}:void 0,u=await _(e,r,{endpoint:t,token:n.token,clientPubKey:o,transports:c},l),d=await G(a,await W(u.endpointPubKey));return new X(u.channelId,d,e,c)}var xe=class{pending;constructor(){this.pending=new Map}track(e,t,n){return new Promise((r,i)=>{if(n?.aborted){i(s(n.reason));return}let a=t===0?void 0:setTimeout(()=>{let n=this.pending.get(e);n!==void 0&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(new f(e,t)))},t);if(this.pending.set(e,{resolve:r,reject:i,timeoutId:a,removeAbortListener:void 0}),n){let t=()=>{this.reject(e,s(n.reason))};n.addEventListener(`abort`,t,{once:!0});let r=()=>{n.removeEventListener(`abort`,t)},i=this.pending.get(e);i&&(i.removeAbortListener=r)}n?.aborted&&this.reject(e,s(n.reason))})}resolve(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.resolve(t))}reject(e,t){let n=this.pending.get(e);n&&(clearTimeout(n.timeoutId),n.removeAbortListener?.(),this.pending.delete(e),n.reject(t))}cancel(e,t){this.reject(e,t??s(void 0))}rejectAll(e){for(let[t,n]of this.pending.entries())clearTimeout(n.timeoutId),n.removeAbortListener?.(),n.reject(e);this.pending.clear()}cleanup(){this.rejectAll(Error(`Transport disconnected`))}};const Se=p(`bus:lifecycle`,de).subjects;function Ce(e,t){let n={},r={},i={};for(let[t,a]of e)n[t]=a.priorities,r[t]=a.deliveryClass??`relayable`,a.filter!==void 0&&(i[t]=a.filter);return{type:`subscribe`,...t===void 0?{}:{ackId:t},subjects:n,deliveryClasses:r,...Object.keys(i).length>0&&{filters:i}}}function we(e,t){return{type:`unsubscribe`,...t===void 0?{}:{ackId:t},subjects:e}}function Q(e,t){let n=e.trim();if(n.length===0||n.startsWith(`extension:`))throw Error(`Invalid extensionName: expected a non-empty extension name without the "extension:" prefix.`);let r=n;return{...p(`extension:${r}`,t.schemas),domain:r,extensions:t.extensions??{}}}function $(e,t){return`${e}.${t}`}function Te(){let e=new Map;return{register(t){let n=$(t.namespace,t.subject);return e.set(n,t),()=>{e.get(n)===t&&e.delete(n)}},get(t,n){return e.get($(t,n))}}}const Ee=x.fact.$meta.namespace,De=x.fact.subject;function Oe(e){return e.type===`event`||e.type===`request`||e.type===`broadcast`}async function ke(e,t,n,r,i,a){let o=y({message:t,direction:`outbound`,observedAt:a(),machineId:i,namespaceRegistry:n,projectorRegistry:r});for(let n of o)await e.send({type:`event`,namespace:Ee,subject:De,payload:n,messageId:`${t.messageId}:telemetry:${n.factId}`,correlationId:t.correlationId})}function Ae(e,t,n,r,i){return async function(a,o){if(!Oe(a))return!0;if(await ke(e,a,t,n,r,i),a.type===`request`)throw Error(`Projected telemetry transport cannot satisfy request responses; exclude it from request routing.`);return a.type===`broadcast`?[]:!0}}function je(e){let{inner:t,namespaceRegistry:n,projectorRegistry:r,machineId:i,now:a=Date.now}=e,o={name:e.name,send:Ae(t,n,r,i,a),onReceive(e){return t.onReceive(async()=>{})},connect(){return t.connect()},disconnect(){return t.disconnect()},subscribe(){return Promise.resolve()},unsubscribe(){return Promise.resolve()},get ready(){return t.ready},get onNewReadySession(){return t.onNewReadySession},set onNewReadySession(e){t.onNewReadySession=e},get onConnected(){return t.onConnected},set onConnected(e){t.onConnected=e},get onDisconnected(){return t.onDisconnected},set onDisconnected(e){t.onDisconnected=e},isReady(){return t.isReady?.()??!0},cancelRequest(e,n){t.cancelRequest?.(e,n)},onBroadcastResults(e,n,r){t.onBroadcastResults?.(e,n,r)}};return t.reconnect&&(o.reconnect=()=>t.reconnect()),o}export{ae as BusAbortError,d as BusError,Se as BusLifecycle,m as CONNECTION_LOST_ERROR_CODE,c as ChannelAuthError,g as ChannelClosedError,n as ChannelOnlyError,ve as ConnectionLostError,xe as CorrelationTracker,he as DEFAULT_READINESS_TIMEOUT_MS,D as DEFAULT_REQUEST_TIMEOUT_MS,pe as LOCAL_ORIGIN,ee as LocalSubjectError,M as MakaioBus,o as NO_HANDLER_ERROR_CODE,l as NoHandlerError,P as OnceAbortError,L as REMOTE_ORIGIN,re as RequestError,z as SystemChannelSchemas,f as TimeoutError,te as ValidationError,F as __resetWarnedSubjects,Ce as buildSubscribeMessage,we as buildUnsubscribeMessage,b as channelSubject,me as collectorOnlySubject,k as createBusContext,ge as createBusInstance,ye as createChannelEndpoint,Q as createExtensionNamespace,C as createFilteredBus,je as createProjectedTelemetryTransport,Te as createSubjectTelemetryProjectorRegistry,N as defaultTransports,E as defineSubjectExtension,a as deserializeTransportError,j as extendSubject,i as findInErrorChain,e as getFullSubjectForSubjectDefinition,O as getPath,ne as getSubjectFromBusMessage,h as handleCorrelationResponse,T as hostLocalRequest,S as isNoHandlerErrorForSubject,oe as isRequestCancellation,fe as isRequestSchema,A as localSubject,se as matchesAnySubscription,u as matchesFilter,le as matchesSubscription,ce as mergeFilters,be as openChannel,_e as parseBusUrl,y as projectSubjectTelemetryFacts,r as serializeTransportError,I as shouldReceiveMessage,ie as trackMessageCorrelation,t as transportErrorData,ue as waitForSubscriptionPropagation};
|