MCPcopy
hub / github.com/di-sukharev/opencommit / __classPrivateFieldSet6

Function __classPrivateFieldSet6

out/cli.cjs:70142–70147  ·  view source on GitHub ↗
(receiver, state2, value, kind3, f4)

Source from the content-addressed store, hash-verified

70140 stream: body.stream ?? false
70141 });
70142 }
70143};
70144/* @__PURE__ */ (function(Completions5) {
70145})(Completions || (Completions = {}));
70146
70147// node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs
70148var __classPrivateFieldSet6 = function(receiver, state2, value, kind3, f4) {
70149 if (kind3 === "m") throw new TypeError("Private method is not writable");
70150 if (kind3 === "a" && !f4) throw new TypeError("Private accessor was defined without a setter");

Callers 5

constructorMethod · 0.85
emittedMethod · 0.85
doneMethod · 0.85
_emitMethod · 0.85
[(_MessageStream_currentMessageSnapshot = /* @__PURE__ */ new WeakMap(), _MessageStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectConnectedPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_endPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_resolveEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_rejectEndPromise = /* @__PURE__ */ new WeakMap(), _MessageStream_listeners = /* @__PURE__ */ new WeakMap(), _MessageStream_ended = /* @__PURE__ */ new WeakMap(), _MessageStream_errored = /* @__PURE__ */ new WeakMap(), _MessageStream_aborted = /* @__PURE__ */ new WeakMap(), _MessageStream_catchingPromiseCreated = /* @__PURE__ */ new WeakMap(), _MessageStream_handleError = /* @__PURE__ */ new WeakMap(), _MessageStream_instances = /* @__PURE__ */ new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage2() { if (this.receivedMessages.length === 0) { throw new AnthropicError("stream ended without producing a Message with role=assistant"); } return this.receivedMessages.at(-1); }, _MessageStream_getFinalText = function _MessageStream_getFinalText2() { if (this.receivedMessages.length === 0) { throw new AnthropicError("stream ended without producing a Message with role=assistant"); } const textBlocks = this.receivedMessages.at(-1).content.filter((block) => block.type === "text").map((block) => block.text); if (textBlocks.length === 0) { throw new AnthropicError("stream ended without producing a content block with type=text"); } return textBlocks.join(" "); }, _MessageStream_beginRequest = function _MessageStream_beginRequest2() { if (this.ended) return; __classPrivateFieldSet6(this, _MessageStream_currentMessageSnapshot, void 0, "f"); }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent2(event) { if (this.ended) return; const messageSnapshot = __classPrivateFieldGet7(this, _MessageStream_instances, "m", _MessageStream_accumulateMessage).call(this, event); this._emit("streamEvent", event, messageSnapshot); switch (event.type) { case "content_block_delta": { if (event.delta.type === "text_delta") { this._emit("text", event.delta.text, messageSnapshot.content.at(-1).text || ""); } break; } case "message_stop": { this._addMessageParam(messageSnapshot); this._addMessage(messageSnapshot, true); break; } case "content_block_stop": { this._emit("contentBlock", messageSnapshot.content.at(-1)); break; } case "message_start": { __classPrivateFieldSet6(this, _MessageStream_currentMessageSnapshot, messageSnapshot, "f"); break; } case "content_block_start": case "message_delta": break; } }, _MessageStream_endRequest = function _MessageStream_endRequest2() { if (this.ended) { throw new AnthropicError(`stream has ended, this shouldn't happen`); } const snapshot = __classPrivateFieldGet7(this, _MessageStream_currentMessageSnapshot, "f"); if (!snapshot) { throw new AnthropicError(`request ended without sending any chunks`); } __classPrivateFieldSet6(this, _MessageStream_currentMessageSnapshot, void 0, "f"); return snapshot; }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage2(event) { let snapshot = __classPrivateFieldGet7(this, _MessageStream_currentMessageSnapshot, "f"); if (event.type === "message_start") { if (snapshot) { throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving "message_stop"`); } return event.message; } if (!snapshot) { throw new AnthropicError(`Unexpected event order, got ${event.type} before "message_start"`); } switch (event.type) { case "message_stop": return snapshot; case "message_delta": snapshot.stop_reason = event.delta.stop_reason; snapshot.stop_sequence = event.delta.stop_sequence; snapshot.usage.output_tokens = event.usage.output_tokens; return snapshot; case "content_block_start": snapshot.content.push(event.content_block); return snapshot; case "content_block_delta": { const snapshotContent = snapshot.content.at(event.index); if (snapshotContent?.type === "text" && event.delta.type === "text_delta") { snapshotContent.text += event.delta.text; } return snapshot; } case "content_block_stop": return snapshot; } }, Symbol.asyncIterator)]Method · 0.85

Calls 2

hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…