@moltzap/client 2026.1001.2 → 2026.1002.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/README.md +9 -4
- package/dist/contract.d.ts +41 -41
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +48 -58
- package/dist/contract.js.map +1 -1
- package/dist/contract.types-check.d.ts +14 -15
- package/dist/contract.types-check.d.ts.map +1 -1
- package/dist/contract.types-check.js +3 -1
- package/dist/contract.types-check.js.map +1 -1
- package/dist/daemon/runtime/controller.d.ts.map +1 -1
- package/dist/daemon/runtime/controller.js +1 -3
- package/dist/daemon/runtime/controller.js.map +1 -1
- package/dist/endpoint/collective/operation.d.ts +13 -10
- package/dist/endpoint/collective/operation.d.ts.map +1 -1
- package/dist/endpoint/collective/operation.js +121 -101
- package/dist/endpoint/collective/operation.js.map +1 -1
- package/dist/endpoint/collective/received-request.d.ts +40 -0
- package/dist/endpoint/collective/received-request.d.ts.map +1 -0
- package/dist/endpoint/collective/received-request.js +56 -0
- package/dist/endpoint/collective/received-request.js.map +1 -0
- package/dist/endpoint/collective/request-sends.d.ts +41 -0
- package/dist/endpoint/collective/request-sends.d.ts.map +1 -0
- package/dist/endpoint/collective/request-sends.js +46 -0
- package/dist/endpoint/collective/request-sends.js.map +1 -0
- package/dist/endpoint/collective/validation.d.ts.map +1 -1
- package/dist/endpoint/collective/validation.js +0 -2
- package/dist/endpoint/collective/validation.js.map +1 -1
- package/dist/endpoint/collective/wire.d.ts +4 -4
- package/dist/endpoint/collective/wire.d.ts.map +1 -1
- package/dist/endpoint/collective/wire.js +74 -5
- package/dist/endpoint/collective/wire.js.map +1 -1
- package/dist/harness-mcp-contract.d.ts +3 -6
- package/dist/harness-mcp-contract.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/message-text.d.ts +51 -0
- package/dist/message-text.d.ts.map +1 -0
- package/dist/message-text.js +120 -0
- package/dist/message-text.js.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-mcp-contract.d.ts","sourceRoot":"","sources":["../src/harness-mcp-contract.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,WAAW,EAChB,MAAM,EAEP,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,uBAAuB,EAGxB,MAAM,eAAe,CAAC;AAGvB,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAEhE,4DAA4D;AAC5D,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE,6DAA6D;AAC7D,eAAO,MAAM,kCAAkC,4CACJ,CAAC;AAE5C,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,yBAAyB,CAAC;AAexE,QAAA,MAAM,uCAAuC,2DAAmB,CAAC;AACjE,QAAA,MAAM,uCAAuC;;EAE3C,CAAC;AACH,QAAA,MAAM,wBAAwB,2DAAmB,CAAC;AAClD;;;;;GAKG;AACH,QAAA,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"harness-mcp-contract.d.ts","sourceRoot":"","sources":["../src/harness-mcp-contract.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,WAAW,EAChB,MAAM,EAEP,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,YAAY,EACZ,uBAAuB,EAGxB,MAAM,eAAe,CAAC;AAGvB,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAEhE,4DAA4D;AAC5D,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AAEvE,6DAA6D;AAC7D,eAAO,MAAM,kCAAkC,4CACJ,CAAC;AAE5C,6D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E,6DAA6D;AAC7D,MAAM,MAAM,wBAAwB,GAClC,OAAO,8BAA8B,CAAC,IAAI,CAAC;AAE7C,wEAAwE;AACxE,eAAO,MAAM,2CAA2C,4BAGvD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,4BAA4B,4BAGxC,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,2BAA2B,4BAGvC,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,4BAA4B,4BAGxC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,iCAAiC,EAAE,WAAW,CAAC,UAAU,CAAC,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,iCAAiC,EAAE,WAAW,CAAC,UAAU,CAAC,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,WAAW,CAAC,UAAU,CAAC,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,WAAW,CAAC,UAAU,CAAC,CAW7D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC,UAAU,CAAC,CAE1D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @file Public barrel for the final endpoint runtime capability. */
|
|
2
|
-
export { AgentAddress, CollectiveError,
|
|
2
|
+
export { AgentAddress, CollectiveError, ConnectError, Content, ContentPart, DeliveryAcknowledgeError, type DirectMessage, GroupAddress, type GroupMessage, type HarnessEndpoint, HistoryExportRecord, type InboundDelivery, InboundItem, InboundMessage, JsonValue, ListenError, MessageAddressInput, PostId, SendError, SendInput, type SendResult, } from "./contract.js";
|
|
3
|
+
/** Read the operation a model's message text states; every adapter uses it. */
|
|
4
|
+
export { MessageTextError, parseMessageText } from "./message-text.js";
|
|
3
5
|
/** Acquire the structural endpoint for one loopback daemon endpoint. */
|
|
4
6
|
export { acquireHarnessEndpoint } from "./client-runtime.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAGrE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAGrE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,OAAO,EACP,WAAW,EACX,wBAAwB,EACxB,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,eAAe,EACpB,WAAW,EACX,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,UAAU,GAChB,MAAM,eAAe,CAAC;AACvB,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,wEAAwE;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** @file Public barrel for the final endpoint runtime capability. */
|
|
2
2
|
// safer-arch-ignore no-large-public-surface: The root is the one adapter-facing boundary, and each operation and inbound item is a closed schema its adapters decode; splitting them behind narrower entrypoints would give adapters a second import path for one contract.
|
|
3
3
|
// safer-arch-ignore no-folder-cycle: The root owns the public and loopback contracts consumed by endpoint internals while its server subpath composes daemon and endpoint capabilities into the one Client process boundary.
|
|
4
|
-
export { AgentAddress, CollectiveError,
|
|
4
|
+
export { AgentAddress, CollectiveError, ConnectError, Content, ContentPart, DeliveryAcknowledgeError, GroupAddress, HistoryExportRecord, InboundItem, InboundMessage, JsonValue, ListenError, MessageAddressInput, PostId, SendError, SendInput, } from "./contract.js";
|
|
5
|
+
/** Read the operation a model's message text states; every adapter uses it. */
|
|
6
|
+
export { MessageTextError, parseMessageText } from "./message-text.js";
|
|
5
7
|
/** Acquire the structural endpoint for one loopback daemon endpoint. */
|
|
6
8
|
// safer-arch-ignore no-public-vendor-type-leak: URL is the platform-standard endpoint locator required by the public acquisition contract.
|
|
7
9
|
export { acquireHarnessEndpoint } from "./client-runtime.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,4QAA4Q;AAC5Q,6NAA6N;AAC7N,OAAO,EACL,YAAY,EACZ,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,4QAA4Q;AAC5Q,6NAA6N;AAC7N,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,OAAO,EACP,WAAW,EACX,wBAAwB,EAExB,YAAY,EAGZ,mBAAmB,EAEnB,WAAW,EACX,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,SAAS,EACT,SAAS,GAEV,MAAM,eAAe,CAAC;AACvB,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,wEAAwE;AACxE,2IAA2I;AAC3I,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Reads the operation a message's text states.
|
|
3
|
+
*
|
|
4
|
+
* A model reaches every operation through its host's ordinary message tool,
|
|
5
|
+
* as message text, and every adapter reads that text with
|
|
6
|
+
* {@link parseMessageText}, so both hosts accept the same text:
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* plain text multicast
|
|
10
|
+
* {"gather": "Which day?", "deadline": 600, "requestedSchema": {...}}
|
|
11
|
+
* {"all_gather": "Which day?", "deadline": 600, "requestedSchema": {...}}
|
|
12
|
+
* {"action": "accept", "content": {...}} answer
|
|
13
|
+
* {"action": "decline"} answer
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Only a whole text that is a JSON object with a `gather`, `all_gather` or
|
|
17
|
+
* `action` key states an operation; any other text, JSON-looking prose
|
|
18
|
+
* included, is a multicast of that text. A text that states an operation but
|
|
19
|
+
* fails validation is refused, never sent as text, because the model meant
|
|
20
|
+
* the operation and the error names the field to fix.
|
|
21
|
+
*/
|
|
22
|
+
import { Either } from "effect";
|
|
23
|
+
import { type MessageAddressInput, SendInput } from "./contract.js";
|
|
24
|
+
/** Which operation a refused text stated. */
|
|
25
|
+
type StatedOperation = "message" | "gather" | "all_gather" | "answer";
|
|
26
|
+
declare const MessageTextError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
27
|
+
readonly _tag: "MessageTextError";
|
|
28
|
+
} & Readonly<A>;
|
|
29
|
+
/**
|
|
30
|
+
* A message text states an operation it does not validly carry, or is plain
|
|
31
|
+
* text that is not well-formed Unicode. The message names each failing field
|
|
32
|
+
* so a host can hand it to its model as the tool error.
|
|
33
|
+
*/
|
|
34
|
+
export declare class MessageTextError extends MessageTextError_base<{
|
|
35
|
+
readonly operation: StatedOperation;
|
|
36
|
+
readonly detail: string;
|
|
37
|
+
}> {
|
|
38
|
+
get message(): string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read one message text as the send it states.
|
|
42
|
+
* @param to The address the host's tool call names: the recipients of a
|
|
43
|
+
* multicast, gather or all_gather, or for an answer the conversation whose
|
|
44
|
+
* open request it answers.
|
|
45
|
+
* @param text The whole text of the message.
|
|
46
|
+
* @returns The send input, or an error naming each field a stated operation
|
|
47
|
+
* gets wrong.
|
|
48
|
+
*/
|
|
49
|
+
export declare const parseMessageText: (to: MessageAddressInput, text: string) => Either.Either<SendInput, MessageTextError>;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=message-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-text.d.ts","sourceRoot":"","sources":["../src/message-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAQ,MAAM,EAA0C,MAAM,QAAQ,CAAC;AAC9E,OAAO,EAIL,KAAK,mBAAmB,EAExB,SAAS,EACV,MAAM,eAAe,CAAC;AAIvB,6CAA6C;AAC7C,KAAK,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC;;;;AAEtE;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,sBAAqC;IACzE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAyCD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,OACvB,mBAAmB,QACjB,MAAM,KACX,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,gBAAgB,CAKxC,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Reads the operation a message's text states.
|
|
3
|
+
*
|
|
4
|
+
* A model reaches every operation through its host's ordinary message tool,
|
|
5
|
+
* as message text, and every adapter reads that text with
|
|
6
|
+
* {@link parseMessageText}, so both hosts accept the same text:
|
|
7
|
+
*
|
|
8
|
+
* ```
|
|
9
|
+
* plain text multicast
|
|
10
|
+
* {"gather": "Which day?", "deadline": 600, "requestedSchema": {...}}
|
|
11
|
+
* {"all_gather": "Which day?", "deadline": 600, "requestedSchema": {...}}
|
|
12
|
+
* {"action": "accept", "content": {...}} answer
|
|
13
|
+
* {"action": "decline"} answer
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Only a whole text that is a JSON object with a `gather`, `all_gather` or
|
|
17
|
+
* `action` key states an operation; any other text, JSON-looking prose
|
|
18
|
+
* included, is a multicast of that text. A text that states an operation but
|
|
19
|
+
* fails validation is refused, never sent as text, because the model meant
|
|
20
|
+
* the operation and the error names the field to fix.
|
|
21
|
+
*/
|
|
22
|
+
import { Data, Either, Option, ParseResult, Predicate, Schema } from "effect";
|
|
23
|
+
import { AnswerContent, DeadlineSeconds, RequestedSchema, SendInput, } from "./contract.js";
|
|
24
|
+
/**
|
|
25
|
+
* A message text states an operation it does not validly carry, or is plain
|
|
26
|
+
* text that is not well-formed Unicode. The message names each failing field
|
|
27
|
+
* so a host can hand it to its model as the tool error.
|
|
28
|
+
*/
|
|
29
|
+
export class MessageTextError extends Data.TaggedError("MessageTextError") {
|
|
30
|
+
get message() {
|
|
31
|
+
return `${this.operation} not sent: ${this.detail}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const exactStruct = (fields) => Schema.Struct(fields).annotations({
|
|
35
|
+
parseOptions: { exact: true, onExcessProperty: "error" },
|
|
36
|
+
});
|
|
37
|
+
const GatherText = exactStruct({
|
|
38
|
+
gather: Schema.String,
|
|
39
|
+
deadline: DeadlineSeconds,
|
|
40
|
+
requestedSchema: RequestedSchema,
|
|
41
|
+
});
|
|
42
|
+
const AllGatherText = exactStruct({
|
|
43
|
+
all_gather: Schema.String,
|
|
44
|
+
deadline: DeadlineSeconds,
|
|
45
|
+
requestedSchema: RequestedSchema,
|
|
46
|
+
});
|
|
47
|
+
const AcceptText = exactStruct({
|
|
48
|
+
action: Schema.Literal("accept"),
|
|
49
|
+
content: AnswerContent,
|
|
50
|
+
});
|
|
51
|
+
const DeclineText = exactStruct({
|
|
52
|
+
action: Schema.Literal("decline"),
|
|
53
|
+
});
|
|
54
|
+
/** The `action` key alone, so an unknown action is named as that field. */
|
|
55
|
+
const AnswerAction = Schema.Struct({
|
|
56
|
+
action: Schema.Literal("accept", "decline"),
|
|
57
|
+
});
|
|
58
|
+
const decodeJsonText = Schema.decodeUnknownOption(Schema.parseJson(Schema.Unknown));
|
|
59
|
+
/** The JSON object a whole text is, if it is one. */
|
|
60
|
+
const jsonObject = (text) => decodeJsonText(text).pipe(Option.filter(Predicate.isRecord));
|
|
61
|
+
/**
|
|
62
|
+
* Read one message text as the send it states.
|
|
63
|
+
* @param to The address the host's tool call names: the recipients of a
|
|
64
|
+
* multicast, gather or all_gather, or for an answer the conversation whose
|
|
65
|
+
* open request it answers.
|
|
66
|
+
* @param text The whole text of the message.
|
|
67
|
+
* @returns The send input, or an error naming each field a stated operation
|
|
68
|
+
* gets wrong.
|
|
69
|
+
*/
|
|
70
|
+
export const parseMessageText = (to, text) => Option.match(jsonObject(text), {
|
|
71
|
+
onNone: () => sendInput("message", { to, text }),
|
|
72
|
+
onSome: (value) => statedOperation(to, value) ?? sendInput("message", { to, text }),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* The operation a JSON object states by its key, or undefined when it has
|
|
76
|
+
* none of `gather`, `all_gather` and `action` and so is plain text.
|
|
77
|
+
*/
|
|
78
|
+
function statedOperation(to, value) {
|
|
79
|
+
if (Object.hasOwn(value, "gather")) {
|
|
80
|
+
return decodeText("gather", GatherText, value).pipe(Either.flatMap((stated) => sendInput("gather", {
|
|
81
|
+
to,
|
|
82
|
+
text: stated.gather,
|
|
83
|
+
collective: { ...collecting(stated), op: "gather" },
|
|
84
|
+
})));
|
|
85
|
+
}
|
|
86
|
+
if (Object.hasOwn(value, "all_gather")) {
|
|
87
|
+
return decodeText("all_gather", AllGatherText, value).pipe(Either.flatMap((stated) => sendInput("all_gather", {
|
|
88
|
+
to,
|
|
89
|
+
text: stated.all_gather,
|
|
90
|
+
collective: { ...collecting(stated), op: "all_gather" },
|
|
91
|
+
})));
|
|
92
|
+
}
|
|
93
|
+
return Object.hasOwn(value, "action") ? answer(to, value) : undefined;
|
|
94
|
+
}
|
|
95
|
+
function collecting(stated) {
|
|
96
|
+
return { deadline: stated.deadline, requestedSchema: stated.requestedSchema };
|
|
97
|
+
}
|
|
98
|
+
/** An answer: `action` decides which shape the rest must have. */
|
|
99
|
+
function answer(to, value) {
|
|
100
|
+
return decodeText("answer", AnswerAction, value).pipe(Either.flatMap(({ action }) => action === "accept"
|
|
101
|
+
? decodeText("answer", AcceptText, value)
|
|
102
|
+
: decodeText("answer", DeclineText, value)), Either.flatMap((collectiveResponse) => sendInput("answer", { to, collectiveResponse })));
|
|
103
|
+
}
|
|
104
|
+
function sendInput(operation, value) {
|
|
105
|
+
return decodeText(operation, SendInput, value);
|
|
106
|
+
}
|
|
107
|
+
function decodeText(operation, schema, value) {
|
|
108
|
+
return Schema.decodeUnknownEither(schema, { errors: "all" })(value).pipe(Either.mapLeft((error) => new MessageTextError({ operation, detail: describeIssues(error) })));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One line per issue, each led by its field path, such as
|
|
112
|
+
* `requestedSchema.type: Expected "object", actual "obj"`.
|
|
113
|
+
*/
|
|
114
|
+
function describeIssues(error) {
|
|
115
|
+
return ParseResult.ArrayFormatter.formatErrorSync(error)
|
|
116
|
+
.map(({ path, message }) => path.length === 0 ? message : `${path.map(String).join(".")}: ${message}`)
|
|
117
|
+
.join("; ");
|
|
118
|
+
}
|
|
119
|
+
/* eslint-enable @typescript-eslint/naming-convention -- Restore the package naming rules after the text Schemas. */
|
|
120
|
+
//# sourceMappingURL=message-text.js.map
|
|
@@ -0,0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EAAE,EAAE,EAAE,EAAE,kBAAkB,EAAE,CAAC,CAChD,CACF,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAChB,SAA0B,EAC1B,KAAc;IAEd,OAAO,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CACjB,SAA0B,EAC1B,MAA2B,EAC3B,KAAc;IAEd,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CACtE,MAAM,CAAC,OAAO,CACZ,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,gBAAgB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CACrE,CACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,KAA6B;IACnD,OAAO,WAAW,CAAC,cAAc,CAAC,eAAe,CAAC,KAAK,CAAC;SACrD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CACzB,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAC1E;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,oHAAoH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moltzap/client",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1002.0",
|
|
4
4
|
"description": "MoltZap endpoint runtime and harness boundary",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
87
87
|
"canonicalize": "3.0.0",
|
|
88
88
|
"effect": "^3.22.0",
|
|
89
|
-
"@moltzap/identity": "2026.
|
|
90
|
-
"@moltzap/router": "2026.
|
|
89
|
+
"@moltzap/identity": "2026.1002.0",
|
|
90
|
+
"@moltzap/router": "2026.1002.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@typescript/native": "npm:typescript@7.0.2",
|