@alvin0/ai-agent-sdk-protocol-anthropic-messages 0.1.10 → 0.1.12
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/index.d.ts +3 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +431 -409
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -318,7 +318,7 @@ interface WireErrorResponse {
|
|
|
318
318
|
error?: WireErrorBody;
|
|
319
319
|
}
|
|
320
320
|
//#endregion
|
|
321
|
-
//#region src/serialize.d.ts
|
|
321
|
+
//#region src/serialize-types.d.ts
|
|
322
322
|
/**
|
|
323
323
|
* Adapter-private state kept on a {@link ReasoningBlock} so a thinking block can
|
|
324
324
|
* be echoed back exactly.
|
|
@@ -384,13 +384,8 @@ interface AnthropicSerializeOptions {
|
|
|
384
384
|
* entirely, unlike most others — see {@link serializeAnthropicRequest}.
|
|
385
385
|
*/
|
|
386
386
|
declare const DEFAULT_MAX_TOKENS = 8192;
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
* @param request - the resolved request, model, and connection.
|
|
390
|
-
* @param options - which field carries effort, its budget table, and the
|
|
391
|
-
* explicit-thinking switch.
|
|
392
|
-
* @returns the wire body, ready to serialize.
|
|
393
|
-
*/
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/serialize.d.ts
|
|
394
389
|
declare function serializeAnthropicRequest(request: ProtocolRequest, options: AnthropicSerializeOptions): WireRequest;
|
|
395
390
|
//#endregion
|
|
396
391
|
//#region src/protocol.d.ts
|
|
@@ -467,16 +462,6 @@ interface AnthropicMessagesProtocolDefinition {
|
|
|
467
462
|
declare const anthropicMessagesProtocol: ProtocolDefinition<AnthropicDialect> & AnthropicMessagesProtocolDefinition;
|
|
468
463
|
//#endregion
|
|
469
464
|
//#region src/translate.d.ts
|
|
470
|
-
/**
|
|
471
|
-
* Translate one Messages SSE stream.
|
|
472
|
-
*
|
|
473
|
-
* Owns termination. There is no `[DONE]` sentinel: the stream ends on
|
|
474
|
-
* `message_stop`, and a body that ends before that was truncated — a failure
|
|
475
|
-
* rather than a short answer.
|
|
476
|
-
* @param events - decoded SSE events.
|
|
477
|
-
* @param displayName - provider name, used in diagnostics.
|
|
478
|
-
* @returns the chunk stream.
|
|
479
|
-
*/
|
|
480
465
|
declare function translateAnthropicStream(events: AsyncIterable<ProtocolSseEvent>, displayName: string): AsyncGenerator<ProtocolStreamChunk>;
|
|
481
466
|
//#endregion
|
|
482
467
|
export { ANTHROPIC_MESSAGES_PROTOCOL_ID, ANTHROPIC_VERSION, type AnthropicDialect, type AnthropicMessagesProtocolDefinition, type AnthropicReasoningFormat, type AnthropicReasoningState, type AnthropicSerializeOptions, DEFAULT_MAX_TOKENS, DEFAULT_THINKING_BUDGETS, type ProtocolDefinition, type ProtocolRequest, type ProtocolSseEvent, type ProtocolStreamChunk, type ThinkingBudgets, type WireCacheControl, type WireCitation, type WireDelta, type WireDocumentSource, type WireErrorBody, type WireErrorResponse, type WireFunctionTool, type WireImageSource, type WireMessage, type WireOutputConfig, type WireRequest, type WireRequestBlock, type WireResponseBlock, type WireServerToolUseBlock, type WireStopReason, type WireStreamEvent, type WireSystemBlock, type WireThinking, type WireTool, type WireToolChoice, type WireToolResultContent, type WireUsage, type WireWebSearchTool, type WireWebSearchToolResultBlock, anthropicMessagesProtocol, serializeAnthropicRequest, translateAnthropicStream };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/contract.ts","../src/wire.ts","../src/serialize.ts","../src/protocol.ts","../src/translate.ts"],"mappings":";;;;UAGiB;WACN,SAAS;;WAET;;;UAIM;WACN;WACA;;;KAIC,sBACR,QAAQ;WAAwB;;WACrB;WAAwB,OAAO;;;UAG7B,mBAAmB;WACzB;WACA,gBAAgB;EACzB,aAAa,SAAS,iBAAiB,SAAS;EAChD,iBAAiB,SAAS,UA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IAAW;IAAa;IAAgB,QAAQ;;;EACvE;EAA6B;EAAe,eAAe;;EAC3D;EAA6B;EAAe,OAAO;;EACnD;EAA4B;;EAE9B;EACA;IAAS,cAAc;IAAuB;;EAC9C,QAAQ;;EAEN;;EACA;;EACA;EAAe,OAAO;;;UAGX;EACf;EACA;;;UAIe;EACf;EACA,QAAQ;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/contract.ts","../src/wire.ts","../src/serialize-types.ts","../src/serialize.ts","../src/protocol.ts","../src/translate.ts"],"mappings":";;;;UAGiB;WACN,SAAS;;WAET;;;UAIM;WACN;WACA;;;KAIC,sBACR,QAAQ;WAAwB;;WACrB;WAAwB,OAAO;;;UAG7B,mBAAmB;WACzB;WACA,gBAAgB;EACzB,aAAa,SAAS,iBAAiB,SAAS;EAChD,iBAAiB,SAAS,UAAU;EACpC,UAAU,SAAS,iBAAiB,SAAS,oBAAoB;EACjE,UACE,QAAQ,cAAc,mBACtB,SAAS,iBACT,sBACC,eAAe;;;;;;;;;;;;;;;KCnBR;EACN;EAAgB;EAAoB;;EACpC;EAAa;;;;;;;;KAQP;EACN;EAAgB;EAAoB;;EACpC;EAAa;;EACb;EAAc;;;;;;;;UAQH;EACf;;EAEA;;;KAIU;EACN;EAAc;EAAc,YAAY;;EACxC;EAAe,QAAQ;;EAEzB;EACA,QAAQ;EACR;EACA;EACA;IAAc;;;EAEZ;EAAkB;EAAY;EAAc;;EAE9C;EACA;EACA,SAAS;EACT;;;;;;;EAME;EAAkB;EAAkB;;EACpC;EAA2B;IAC7B,yBACA;EACE,gBAAgB;;UAEL;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;GACC;;;KAIS;EACN;EAAc;;EACd;EAAe,QAAQ;;;UAGZ;EACf;EACA,SAAS;;;UAIM;EACf;EACA;EACA,cAAc;;;UAIC;EACf;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;;;KA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