@moltzap/client 2026.802.0 → 2026.804.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bounded-map.d.ts +3 -3
- package/dist/bounded-map.js +3 -3
- package/dist/channel-base/index.d.ts +1 -7
- package/dist/channel-base/index.d.ts.map +1 -1
- package/dist/channel-base/index.js +0 -6
- package/dist/channel-base/index.js.map +1 -1
- package/dist/channel-core-test-support.d.ts +5 -27
- package/dist/channel-core-test-support.d.ts.map +1 -1
- package/dist/channel-core-test-support.js +2 -90
- package/dist/channel-core-test-support.js.map +1 -1
- package/dist/channel-core.d.ts +156 -248
- package/dist/channel-core.d.ts.map +1 -1
- package/dist/channel-core.js +195 -525
- package/dist/channel-core.js.map +1 -1
- package/dist/cli/commands/start.d.ts +1 -5
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +0 -3
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/harness/client-runtime.d.ts +24 -0
- package/dist/harness/client-runtime.d.ts.map +1 -0
- package/dist/harness/client-runtime.js +107 -0
- package/dist/harness/client-runtime.js.map +1 -0
- package/dist/harness/index.d.ts +5 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +5 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/runtime.d.ts +149 -0
- package/dist/harness/runtime.d.ts.map +1 -0
- package/dist/harness/runtime.js +68 -0
- package/dist/harness/runtime.js.map +1 -0
- package/dist/harness-client.d.ts +43 -0
- package/dist/harness-client.d.ts.map +1 -0
- package/dist/harness-client.js +21 -0
- package/dist/harness-client.js.map +1 -0
- package/dist/harness-mcp-server.d.ts.map +1 -1
- package/dist/harness-mcp-server.js +107 -17
- package/dist/harness-mcp-server.js.map +1 -1
- package/dist/harness-mcp-subscription.d.ts +21 -0
- package/dist/harness-mcp-subscription.d.ts.map +1 -0
- package/dist/harness-mcp-subscription.js +324 -0
- package/dist/harness-mcp-subscription.js.map +1 -0
- package/dist/harness-mcp-wire.d.ts +9 -2
- package/dist/harness-mcp-wire.d.ts.map +1 -1
- package/dist/harness-mcp-wire.js +41 -10
- package/dist/harness-mcp-wire.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/local-daemon-rpc.d.ts +12 -195
- package/dist/local-daemon-rpc.d.ts.map +1 -1
- package/dist/local-daemon-rpc.js +1 -5
- package/dist/local-daemon-rpc.js.map +1 -1
- package/dist/moltzapd.d.ts +2 -1
- package/dist/moltzapd.d.ts.map +1 -1
- package/dist/moltzapd.js +19 -5
- package/dist/moltzapd.js.map +1 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts +14 -14
- package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +1 -1
- package/dist/notification/__tests__/subscribe-signatures.types-check.js +5 -5
- package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +1 -1
- package/dist/service-local-daemon.d.ts +1 -1
- package/dist/service-local-daemon.d.ts.map +1 -1
- package/dist/service-local-daemon.js +2 -4
- package/dist/service-local-daemon.js.map +1 -1
- package/dist/service.d.ts +4 -25
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +7 -44
- package/dist/service.js.map +1 -1
- package/dist/test-utils/channel-service-fixture.d.ts +1 -3
- package/dist/test-utils/channel-service-fixture.d.ts.map +1 -1
- package/dist/test-utils/channel-service-fixture.js +2 -22
- package/dist/test-utils/channel-service-fixture.js.map +1 -1
- package/dist/test-utils/ids.d.ts +0 -13
- package/dist/test-utils/ids.d.ts.map +1 -1
- package/dist/test-utils/ids.js +1 -16
- package/dist/test-utils/ids.js.map +1 -1
- package/dist/test-utils/index.d.ts +1 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -4
- package/dist/app-client.d.ts +0 -5
- package/dist/app-client.d.ts.map +0 -1
- package/dist/app-client.js +0 -3
- package/dist/app-client.js.map +0 -1
- package/dist/channel-base/lease-guard.d.ts +0 -31
- package/dist/channel-base/lease-guard.d.ts.map +0 -1
- package/dist/channel-base/lease-guard.js +0 -44
- package/dist/channel-base/lease-guard.js.map +0 -1
- package/dist/channel-base/lease-store.d.ts +0 -48
- package/dist/channel-base/lease-store.d.ts.map +0 -1
- package/dist/channel-base/lease-store.js +0 -77
- package/dist/channel-base/lease-store.js.map +0 -1
- package/dist/channel-base/lease.d.ts +0 -96
- package/dist/channel-base/lease.d.ts.map +0 -1
- package/dist/channel-base/lease.js +0 -106
- package/dist/channel-base/lease.js.map +0 -1
package/dist/bounded-map.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Bounded insertion-ordered map backing the client's per-key caches.
|
|
3
3
|
*
|
|
4
|
-
* The service dedup window
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The service dedup window and channel adapters' own per-host tables need the
|
|
5
|
+
* same fixed-capacity store. It sits at the package root rather than in
|
|
6
|
+
* `channel-base/` because
|
|
7
7
|
* that barrel re-exports the root modules, so owning it there would close a
|
|
8
8
|
* folder cycle; `channel-base` re-exports it for adapters instead.
|
|
9
9
|
*/
|
package/dist/bounded-map.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Bounded insertion-ordered map backing the client's per-key caches.
|
|
3
3
|
*
|
|
4
|
-
* The service dedup window
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The service dedup window and channel adapters' own per-host tables need the
|
|
5
|
+
* same fixed-capacity store. It sits at the package root rather than in
|
|
6
|
+
* `channel-base/` because
|
|
7
7
|
* that barrel re-exports the root modules, so owning it there would close a
|
|
8
8
|
* folder cycle; `channel-base` re-exports it for adapters instead.
|
|
9
9
|
*/
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/** @file Shared channel-adapter primitives for `@moltzap/client/channel-base`. */
|
|
2
2
|
/** Re-exports the public API from `../bounded-map.js`. */
|
|
3
3
|
export { BoundedMap } from "../bounded-map.js";
|
|
4
|
-
/** Re-exports the public API from `./lease.js`. */
|
|
5
|
-
export { LeaseAlreadyConsumed, projectLeaseInvalid, catchLeaseInvalid, type LeaseInvalidProjectionError, } from "./lease.js";
|
|
6
|
-
/** Re-exports the public API from `./lease-store.js`. */
|
|
7
|
-
export { LeaseStore } from "./lease-store.js";
|
|
8
|
-
/** Re-exports the public API from `./lease-guard.js`. */
|
|
9
|
-
export { LeaseGuard } from "./lease-guard.js";
|
|
10
4
|
/** Re-exports the public API from `./format-cross-conv.js`. */
|
|
11
5
|
export { formatCrossConv, type CrossConvFormatter, type CrossConvMarkup, } from "./format-cross-conv.js";
|
|
12
6
|
/** Re-exports the public API from `./format-group-block.js`. */
|
|
13
7
|
export { formatGroupBlock, getGroupFields, type GroupFields, type GroupFormatter, } from "./format-group-block.js";
|
|
14
8
|
/** Re-exports the public API from `../channel-core.js`. */
|
|
15
|
-
export { MoltZapChannelCore, type ChannelCoreOptions, type ChannelService, type ContextBlocks, type
|
|
9
|
+
export { MoltZapChannelCore, type ChannelCoreOptions, type ChannelService, type ContextBlocks, type EnrichedConversationMeta, type EnrichedInboundMessage, type EnrichedSender, type InboundHandler, type InboundInterceptDecision, type InboundInterceptor, } from "../channel-core.js";
|
|
16
10
|
/** Re-exports the public API from `../service.js`. */
|
|
17
11
|
export { sanitizeForSystemReminder, type CrossConversationEntry, type CrossConvMessage, } from "../service.js";
|
|
18
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,+DAA+D;AAC/D,OAAO,EACL,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAEhC,gEAAgE;AAChE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,yBAAyB,CAAC;AAEjC,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,sDAAsD;AACtD,OAAO,EACL,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC"}
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
// Channel adapters import per-key store primitives through channel-base.
|
|
3
3
|
/** Re-exports the public API from `../bounded-map.js`. */
|
|
4
4
|
export { BoundedMap } from "../bounded-map.js";
|
|
5
|
-
/** Re-exports the public API from `./lease.js`. */
|
|
6
|
-
export { LeaseAlreadyConsumed, projectLeaseInvalid, catchLeaseInvalid, } from "./lease.js";
|
|
7
|
-
/** Re-exports the public API from `./lease-store.js`. */
|
|
8
|
-
export { LeaseStore } from "./lease-store.js";
|
|
9
|
-
/** Re-exports the public API from `./lease-guard.js`. */
|
|
10
|
-
export { LeaseGuard } from "./lease-guard.js";
|
|
11
5
|
/** Re-exports the public API from `./format-cross-conv.js`. */
|
|
12
6
|
export { formatCrossConv, } from "./format-cross-conv.js";
|
|
13
7
|
/** Re-exports the public API from `./format-group-block.js`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channel-base/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,+DAA+D;AAC/D,OAAO,EACL,eAAe,GAGhB,MAAM,wBAAwB,CAAC;AAEhC,gEAAgE;AAChE,OAAO,EACL,gBAAgB,EAChB,cAAc,GAGf,MAAM,yBAAyB,CAAC;AAEjC,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,GAUnB,MAAM,oBAAoB,CAAC;AAE5B,sDAAsD;AACtD,OAAO,EACL,yBAAyB,GAG1B,MAAM,eAAe,CAAC"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { ForbiddenError } from "@moltzap/protocol/rpc";
|
|
2
|
-
import type { LeaseId } from "@moltzap/protocol/message/dispatch";
|
|
3
1
|
import type { Message } from "@moltzap/protocol/message";
|
|
4
2
|
import type { AgentId } from "@moltzap/protocol/identity";
|
|
5
3
|
import type { ConversationId, MessageId } from "@moltzap/protocol/conversation";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { buildMessage, createFakeChannelService, flushDispatchChainEffect, testLeaseId, type FakeChannelService } from "./test-utils/index.js";
|
|
4
|
+
import { MoltZapChannelCore, type ChannelService, type EnrichedInboundMessage, type InboundInterceptDecision } from "./channel-core.js";
|
|
5
|
+
import type { CrossConversationEntry } from "./service.js";
|
|
6
|
+
import { buildMessage, createFakeChannelService, flushDispatchChainEffect, type FakeChannelService } from "./test-utils/index.js";
|
|
10
7
|
/** Re-exports the public API from `current module`. */
|
|
11
|
-
export { MoltZapChannelCore,
|
|
8
|
+
export { MoltZapChannelCore, buildMessage, createFakeChannelService, flushDispatchChainEffect, };
|
|
12
9
|
/** Re-exports the public API from `current module`. */
|
|
13
|
-
export type {
|
|
14
|
-
/** Provides the stuck message lease timeout ms runtime value. */
|
|
15
|
-
export declare const STUCK_MESSAGE_LEASE_TIMEOUT_MS = 50;
|
|
10
|
+
export type { CrossConversationEntry, EnrichedInboundMessage, FakeChannelService, InboundInterceptDecision, Message, };
|
|
16
11
|
/** Provides the effect test runtime value. */
|
|
17
12
|
export declare const effectTest: import("@effect/vitest").Vitest.Tester<import("effect/TestServices").TestServices>;
|
|
18
13
|
/** Provides the alice cached name runtime value. */
|
|
@@ -27,14 +22,6 @@ export declare const CAPTION_TEXT = "caption";
|
|
|
27
22
|
export declare const FIRST_TEXT = "first";
|
|
28
23
|
/** Provides the second text runtime value. */
|
|
29
24
|
export declare const SECOND_TEXT = "second";
|
|
30
|
-
/** Provides the time to vote text runtime value. */
|
|
31
|
-
export declare const TIME_TO_VOTE_TEXT = "Time to vote";
|
|
32
|
-
/** Provides the after marker text runtime value. */
|
|
33
|
-
export declare const AFTER_MARKER_TEXT = "after marker";
|
|
34
|
-
/** Provides the old discussion text runtime value. */
|
|
35
|
-
export declare const OLD_DISCUSSION_TEXT = "old discussion";
|
|
36
|
-
/** Provides the marker lease id runtime value. */
|
|
37
|
-
export declare const MARKER_LEASE_ID: LeaseId;
|
|
38
25
|
/** Provides the devs group name runtime value. */
|
|
39
26
|
export declare const DEVS_GROUP_NAME = "devs";
|
|
40
27
|
/** Provides the first visit text runtime value. */
|
|
@@ -47,21 +34,12 @@ export declare class TestInboundHandlerError extends TestInboundHandlerError_bas
|
|
|
47
34
|
readonly message: string;
|
|
48
35
|
}> {
|
|
49
36
|
}
|
|
50
|
-
type AdmissionRequest = DispatchAdmissionRequest;
|
|
51
|
-
/**
|
|
52
|
-
* Executes the install admission operation.
|
|
53
|
-
* @param fake Value supplied to the operation.
|
|
54
|
-
* @param decide Value supplied to the operation.
|
|
55
|
-
*/
|
|
56
|
-
export declare function installAdmission(fake: FakeChannelService, decide: (request: AdmissionRequest) => Effect.Effect<DispatchAdmissionDecision, ServiceRpcError>): void;
|
|
57
37
|
/** Provides the agent runtime value. */
|
|
58
38
|
export declare const agent: (agentLabel: string) => AgentId;
|
|
59
39
|
/** Provides the conversation runtime value. */
|
|
60
40
|
export declare const conversation: (conversationLabel: string) => ConversationId;
|
|
61
41
|
/** Provides the message runtime value. */
|
|
62
42
|
export declare const message: (messageLabel: string) => MessageId;
|
|
63
|
-
/** Re-exports the public API from `current module`. */
|
|
64
|
-
export { testLeaseId };
|
|
65
43
|
/**
|
|
66
44
|
* Provides the participant runtime value.
|
|
67
45
|
* @param agentLabel Value supplied to the operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-core-test-support.d.ts","sourceRoot":"","sources":["../src/channel-core-test-support.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"channel-core-test-support.d.ts","sourceRoot":"","sources":["../src/channel-core-test-support.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGhF,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EAIxB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAE/B,uDAAuD;AACvD,OAAO,EACL,kBAA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jC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,CAU7D;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CACpC,CAUA;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAKxE"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { it as effectIt } from "@effect/vitest";
|
|
2
|
-
import { ForbiddenError } from "@moltzap/protocol/rpc";
|
|
3
2
|
import { Data, Effect } from "effect";
|
|
4
3
|
import { MoltZapChannelCore, } from "./channel-core.js";
|
|
5
|
-
import { buildMessage, createFakeChannelService, flushDispatchChainEffect, testAgentId, testConversationId,
|
|
4
|
+
import { buildMessage, createFakeChannelService, flushDispatchChainEffect, testAgentId, testConversationId, testMessageId, } from "./test-utils/index.js";
|
|
6
5
|
/** Re-exports the public API from `current module`. */
|
|
7
|
-
export { MoltZapChannelCore,
|
|
8
|
-
/** Provides the stuck message lease timeout ms runtime value. */
|
|
9
|
-
export const STUCK_MESSAGE_LEASE_TIMEOUT_MS = 50;
|
|
6
|
+
export { MoltZapChannelCore, buildMessage, createFakeChannelService, flushDispatchChainEffect, };
|
|
10
7
|
/** Provides the effect test runtime value. */
|
|
11
8
|
export const effectTest = effectIt.effect;
|
|
12
9
|
/** Provides the alice cached name runtime value. */
|
|
@@ -21,14 +18,6 @@ export const CAPTION_TEXT = "caption";
|
|
|
21
18
|
export const FIRST_TEXT = "first";
|
|
22
19
|
/** Provides the second text runtime value. */
|
|
23
20
|
export const SECOND_TEXT = "second";
|
|
24
|
-
/** Provides the time to vote text runtime value. */
|
|
25
|
-
export const TIME_TO_VOTE_TEXT = "Time to vote";
|
|
26
|
-
/** Provides the after marker text runtime value. */
|
|
27
|
-
export const AFTER_MARKER_TEXT = "after marker";
|
|
28
|
-
/** Provides the old discussion text runtime value. */
|
|
29
|
-
export const OLD_DISCUSSION_TEXT = "old discussion";
|
|
30
|
-
/** Provides the marker lease id runtime value. */
|
|
31
|
-
export const MARKER_LEASE_ID = testLeaseId("lease-marker");
|
|
32
21
|
/** Provides the devs group name runtime value. */
|
|
33
22
|
export const DEVS_GROUP_NAME = "devs";
|
|
34
23
|
/** Provides the first visit text runtime value. */
|
|
@@ -36,89 +25,12 @@ export const FIRST_VISIT_TEXT = "first visit";
|
|
|
36
25
|
/** Reports test inbound handler failures. */
|
|
37
26
|
export class TestInboundHandlerError extends Data.TaggedError("TestInboundHandlerError") {
|
|
38
27
|
}
|
|
39
|
-
const FALLBACK_RECEIVED_AT = "1970-01-01T00:00:00.000Z";
|
|
40
|
-
const LEASE_MOCK_PREFIX = "lease-mock";
|
|
41
|
-
const DISPATCH_MOCK_PREFIX = "dispatch-mock";
|
|
42
|
-
const admissionRequest = (params) => {
|
|
43
|
-
const message = {
|
|
44
|
-
id: /* Safe because the surrounding invariant establishes this asserted shape. */ params.messageId,
|
|
45
|
-
conversationId:
|
|
46
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ params.conversationId,
|
|
47
|
-
senderId:
|
|
48
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ params.senderAgentId,
|
|
49
|
-
parts:
|
|
50
|
-
/* Safe because admission fixtures establish nonempty protocol message parts before this adapter runs. */ (params.parts ??
|
|
51
|
-
[]),
|
|
52
|
-
createdAt: params.receivedAt ?? FALLBACK_RECEIVED_AT,
|
|
53
|
-
};
|
|
54
|
-
return {
|
|
55
|
-
message,
|
|
56
|
-
conversationId: params.conversationId,
|
|
57
|
-
senderAgentId: params.senderAgentId,
|
|
58
|
-
attempt: params.attempt ?? 0,
|
|
59
|
-
receivedAt: params.receivedAt ?? FALLBACK_RECEIVED_AT,
|
|
60
|
-
pending:
|
|
61
|
-
/* Safe because the surrounding invariant establishes this asserted shape. */ (params.pending ??
|
|
62
|
-
[]),
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
const grantVerdict = (decision) => ({
|
|
66
|
-
decision: "grant",
|
|
67
|
-
...(decision.leaseId !== undefined ? { leaseId: decision.leaseId } : {}),
|
|
68
|
-
...(decision.leaseTimeoutMs !== undefined
|
|
69
|
-
? { leaseTimeoutMs: decision.leaseTimeoutMs }
|
|
70
|
-
: {}),
|
|
71
|
-
...(decision.dispatchMessageId !== undefined
|
|
72
|
-
? { dispatchMessageId: decision.dispatchMessageId }
|
|
73
|
-
: {}),
|
|
74
|
-
});
|
|
75
|
-
const holdOrDenyVerdict = (decision) => ({
|
|
76
|
-
decision: decision._tag,
|
|
77
|
-
...(decision.reason !== undefined ? { reason: decision.reason } : {}),
|
|
78
|
-
});
|
|
79
|
-
const releaseVerdict = (decision) => {
|
|
80
|
-
if (decision._tag === "grant") {
|
|
81
|
-
return grantVerdict(decision);
|
|
82
|
-
}
|
|
83
|
-
return holdOrDenyVerdict(decision);
|
|
84
|
-
};
|
|
85
|
-
const releaseFrame = (decision, leaseId, dispatchId) => ({
|
|
86
|
-
dispatchId,
|
|
87
|
-
leaseId,
|
|
88
|
-
verdict: releaseVerdict(decision),
|
|
89
|
-
...(decision._tag === "grant" && decision.leaseTimeoutMs !== undefined
|
|
90
|
-
? { leaseTimeoutMs: decision.leaseTimeoutMs }
|
|
91
|
-
: {}),
|
|
92
|
-
});
|
|
93
|
-
const leaseIdForDecision = (decision, counter) => decision._tag === "grant" && decision.leaseId !== undefined
|
|
94
|
-
? decision.leaseId
|
|
95
|
-
: testLeaseId(LEASE_MOCK_PREFIX + "-" + counter.toString());
|
|
96
|
-
const dispatchIdForCounter = (counter) => DISPATCH_MOCK_PREFIX + "-" + counter.toString();
|
|
97
|
-
/**
|
|
98
|
-
* Executes the install admission operation.
|
|
99
|
-
* @param fake Value supplied to the operation.
|
|
100
|
-
* @param decide Value supplied to the operation.
|
|
101
|
-
*/
|
|
102
|
-
export function installAdmission(fake, decide) {
|
|
103
|
-
let counter = 0;
|
|
104
|
-
fake.service.requestDispatch = (params) => decide(admissionRequest(params)).pipe(Effect.map((decision) => {
|
|
105
|
-
counter += 1;
|
|
106
|
-
const leaseId = leaseIdForDecision(decision, counter);
|
|
107
|
-
const dispatchId = dispatchIdForCounter(counter);
|
|
108
|
-
queueMicrotask(() => {
|
|
109
|
-
fake.emit.dispatchRelease(releaseFrame(decision, leaseId, dispatchId));
|
|
110
|
-
});
|
|
111
|
-
return { leaseId, dispatchId };
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
28
|
/** Provides the agent runtime value. */
|
|
115
29
|
export const agent = testAgentId;
|
|
116
30
|
/** Provides the conversation runtime value. */
|
|
117
31
|
export const conversation = testConversationId;
|
|
118
32
|
/** Provides the message runtime value. */
|
|
119
33
|
export const message = testMessageId;
|
|
120
|
-
/** Re-exports the public API from `current module`. */
|
|
121
|
-
export { testLeaseId };
|
|
122
34
|
/**
|
|
123
35
|
* Provides the participant runtime value.
|
|
124
36
|
* @param agentLabel Value supplied to the operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-core-test-support.js","sourceRoot":"","sources":["../src/channel-core-test-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"channel-core-test-support.js","sourceRoot":"","sources":["../src/channel-core-test-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EACL,kBAAkB,GAInB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EACxB,W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