@codelia/core 0.1.23 → 0.1.26
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.cjs +923 -22
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +923 -22
- package/package.json +4 -4
- package/prompts/system.md +2 -0
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,8 @@ export { AgentEvent, FinalResponseEvent, ReasoningEvent, StepCompleteEvent, Step
|
|
|
6
6
|
import Anthropic from '@anthropic-ai/sdk';
|
|
7
7
|
import { MessageCreateParamsNonStreaming } from '@anthropic-ai/sdk/resources/messages/messages';
|
|
8
8
|
import OpenAI, { ClientOptions } from 'openai';
|
|
9
|
-
import { ResponseCreateParamsBase, ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
9
|
+
import { ResponsesClientEvent, ResponseCreateParamsBase, ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
10
|
+
import { ResponsesWS } from 'openai/resources/responses/ws';
|
|
10
11
|
import { ReasoningEffort } from 'openai/resources/shared';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -638,18 +639,34 @@ declare class ChatAnthropic implements BaseChatModel<typeof PROVIDER_NAME$2, Ant
|
|
|
638
639
|
private debugResponseIfEnabled;
|
|
639
640
|
}
|
|
640
641
|
|
|
642
|
+
type OpenAiWebsocketMode = "off" | "auto" | "on";
|
|
643
|
+
type OpenAiWebsocketApiVersion = "v1" | "v2";
|
|
644
|
+
type OpenAiResponsesWsLike = {
|
|
645
|
+
on(event: string, listener: (event: unknown) => void): OpenAiResponsesWsLike;
|
|
646
|
+
off?: (event: string, listener: (event: unknown) => void) => OpenAiResponsesWsLike;
|
|
647
|
+
send(event: ResponsesClientEvent): void;
|
|
648
|
+
close(props?: {
|
|
649
|
+
code: number;
|
|
650
|
+
reason: string;
|
|
651
|
+
}): void;
|
|
652
|
+
};
|
|
653
|
+
|
|
641
654
|
declare const PROVIDER_NAME$1: "openai";
|
|
642
655
|
type OpenAITextVerbosity = Exclude<ResponseTextConfig["verbosity"], null>;
|
|
643
656
|
type OpenAIInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input" | "tools" | "tool_choice" | "stream"> & {
|
|
644
657
|
reasoningEffort?: ReasoningEffort;
|
|
645
658
|
textVerbosity?: OpenAITextVerbosity;
|
|
646
659
|
};
|
|
660
|
+
|
|
647
661
|
type ChatOpenAIOptions = {
|
|
648
662
|
client?: OpenAI;
|
|
649
663
|
clientOptions?: ClientOptions;
|
|
650
664
|
model?: string;
|
|
651
665
|
reasoningEffort?: ReasoningEffort;
|
|
652
666
|
textVerbosity?: OpenAITextVerbosity;
|
|
667
|
+
websocketMode?: OpenAiWebsocketMode;
|
|
668
|
+
websocketApiVersion?: OpenAiWebsocketApiVersion;
|
|
669
|
+
createResponsesWs?: (client: OpenAI, options?: ConstructorParameters<typeof ResponsesWS>[1]) => OpenAiResponsesWsLike;
|
|
653
670
|
};
|
|
654
671
|
declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAIInvokeOptions> {
|
|
655
672
|
readonly provider: typeof PROVIDER_NAME$1;
|
|
@@ -657,12 +674,34 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
657
674
|
private readonly client;
|
|
658
675
|
private readonly defaultReasoningEffort?;
|
|
659
676
|
private readonly defaultTextVerbosity?;
|
|
677
|
+
private readonly websocketMode;
|
|
678
|
+
private readonly websocketApiVersion;
|
|
679
|
+
private readonly wsTransport;
|
|
660
680
|
private debugInvokeSeq;
|
|
661
681
|
private lastDebugRequestPayload;
|
|
682
|
+
private readonly wsStateBySessionKey;
|
|
683
|
+
private readonly wsDisabledUntilBySessionKey;
|
|
684
|
+
private wsReconnectCount;
|
|
662
685
|
constructor(options?: ChatOpenAIOptions);
|
|
663
686
|
ainvoke(input: ChatInvokeInput & {
|
|
664
687
|
options?: OpenAIInvokeOptions;
|
|
665
688
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
689
|
+
private invokeWithTransport;
|
|
690
|
+
private invokeHttpTransportWithDebug;
|
|
691
|
+
private persistWsSessionState;
|
|
692
|
+
private invokeViaWs;
|
|
693
|
+
private closeWsSafely;
|
|
694
|
+
private closeWsWithoutMaskingPrimaryError;
|
|
695
|
+
private isWsConnectionReuseExpired;
|
|
696
|
+
private isWsReconnectRetryableError;
|
|
697
|
+
private getWsReconnectRetryDelayMs;
|
|
698
|
+
private waitForWsReconnectRetryDelay;
|
|
699
|
+
private isWsConnectionReusable;
|
|
700
|
+
private extractWsErrorCode;
|
|
701
|
+
private clearWsSessionState;
|
|
702
|
+
private evictIdleWsSessionState;
|
|
703
|
+
private isWsSessionDisabled;
|
|
704
|
+
private getIncrementalInput;
|
|
666
705
|
private nextDebugInvokeSeq;
|
|
667
706
|
private debugRequestIfEnabled;
|
|
668
707
|
private debugResponseIfEnabled;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export { AgentEvent, FinalResponseEvent, ReasoningEvent, StepCompleteEvent, Step
|
|
|
6
6
|
import Anthropic from '@anthropic-ai/sdk';
|
|
7
7
|
import { MessageCreateParamsNonStreaming } from '@anthropic-ai/sdk/resources/messages/messages';
|
|
8
8
|
import OpenAI, { ClientOptions } from 'openai';
|
|
9
|
-
import { ResponseCreateParamsBase, ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
9
|
+
import { ResponsesClientEvent, ResponseCreateParamsBase, ResponseTextConfig } from 'openai/resources/responses/responses';
|
|
10
|
+
import { ResponsesWS } from 'openai/resources/responses/ws';
|
|
10
11
|
import { ReasoningEffort } from 'openai/resources/shared';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -638,18 +639,34 @@ declare class ChatAnthropic implements BaseChatModel<typeof PROVIDER_NAME$2, Ant
|
|
|
638
639
|
private debugResponseIfEnabled;
|
|
639
640
|
}
|
|
640
641
|
|
|
642
|
+
type OpenAiWebsocketMode = "off" | "auto" | "on";
|
|
643
|
+
type OpenAiWebsocketApiVersion = "v1" | "v2";
|
|
644
|
+
type OpenAiResponsesWsLike = {
|
|
645
|
+
on(event: string, listener: (event: unknown) => void): OpenAiResponsesWsLike;
|
|
646
|
+
off?: (event: string, listener: (event: unknown) => void) => OpenAiResponsesWsLike;
|
|
647
|
+
send(event: ResponsesClientEvent): void;
|
|
648
|
+
close(props?: {
|
|
649
|
+
code: number;
|
|
650
|
+
reason: string;
|
|
651
|
+
}): void;
|
|
652
|
+
};
|
|
653
|
+
|
|
641
654
|
declare const PROVIDER_NAME$1: "openai";
|
|
642
655
|
type OpenAITextVerbosity = Exclude<ResponseTextConfig["verbosity"], null>;
|
|
643
656
|
type OpenAIInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input" | "tools" | "tool_choice" | "stream"> & {
|
|
644
657
|
reasoningEffort?: ReasoningEffort;
|
|
645
658
|
textVerbosity?: OpenAITextVerbosity;
|
|
646
659
|
};
|
|
660
|
+
|
|
647
661
|
type ChatOpenAIOptions = {
|
|
648
662
|
client?: OpenAI;
|
|
649
663
|
clientOptions?: ClientOptions;
|
|
650
664
|
model?: string;
|
|
651
665
|
reasoningEffort?: ReasoningEffort;
|
|
652
666
|
textVerbosity?: OpenAITextVerbosity;
|
|
667
|
+
websocketMode?: OpenAiWebsocketMode;
|
|
668
|
+
websocketApiVersion?: OpenAiWebsocketApiVersion;
|
|
669
|
+
createResponsesWs?: (client: OpenAI, options?: ConstructorParameters<typeof ResponsesWS>[1]) => OpenAiResponsesWsLike;
|
|
653
670
|
};
|
|
654
671
|
declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAIInvokeOptions> {
|
|
655
672
|
readonly provider: typeof PROVIDER_NAME$1;
|
|
@@ -657,12 +674,34 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
657
674
|
private readonly client;
|
|
658
675
|
private readonly defaultReasoningEffort?;
|
|
659
676
|
private readonly defaultTextVerbosity?;
|
|
677
|
+
private readonly websocketMode;
|
|
678
|
+
private readonly websocketApiVersion;
|
|
679
|
+
private readonly wsTransport;
|
|
660
680
|
private debugInvokeSeq;
|
|
661
681
|
private lastDebugRequestPayload;
|
|
682
|
+
private readonly wsStateBySessionKey;
|
|
683
|
+
private readonly wsDisabledUntilBySessionKey;
|
|
684
|
+
private wsReconnectCount;
|
|
662
685
|
constructor(options?: ChatOpenAIOptions);
|
|
663
686
|
ainvoke(input: ChatInvokeInput & {
|
|
664
687
|
options?: OpenAIInvokeOptions;
|
|
665
688
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
689
|
+
private invokeWithTransport;
|
|
690
|
+
private invokeHttpTransportWithDebug;
|
|
691
|
+
private persistWsSessionState;
|
|
692
|
+
private invokeViaWs;
|
|
693
|
+
private closeWsSafely;
|
|
694
|
+
private closeWsWithoutMaskingPrimaryError;
|
|
695
|
+
private isWsConnectionReuseExpired;
|
|
696
|
+
private isWsReconnectRetryableError;
|
|
697
|
+
private getWsReconnectRetryDelayMs;
|
|
698
|
+
private waitForWsReconnectRetryDelay;
|
|
699
|
+
private isWsConnectionReusable;
|
|
700
|
+
private extractWsErrorCode;
|
|
701
|
+
private clearWsSessionState;
|
|
702
|
+
private evictIdleWsSessionState;
|
|
703
|
+
private isWsSessionDisabled;
|
|
704
|
+
private getIncrementalInput;
|
|
666
705
|
private nextDebugInvokeSeq;
|
|
667
706
|
private debugRequestIfEnabled;
|
|
668
707
|
private debugResponseIfEnabled;
|