@llm4ts/core 3.3.0 → 3.4.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/ConnectorConfig.d.ts +3 -1
- package/dist/ConnectorConfig.d.ts.map +1 -1
- package/dist/ConnectorConfig.js +4 -17
- package/dist/ConnectorConfig.js.map +1 -1
- package/dist/Models.d.ts +177 -20
- package/dist/Models.d.ts.map +1 -1
- package/dist/Models.js +151 -98
- package/dist/Models.js.map +1 -1
- package/dist/eval/Eval.d.ts +4 -1
- package/dist/eval/Eval.d.ts.map +1 -1
- package/dist/eval/Eval.js.map +1 -1
- package/dist/eval/Evaluator.d.ts +2 -6
- package/dist/eval/Evaluator.d.ts.map +1 -1
- package/dist/eval/Evaluator.js.map +1 -1
- package/dist/providers/AntigravityConnector.d.ts.map +1 -1
- package/dist/providers/AntigravityConnector.js +5 -4
- package/dist/providers/AntigravityConnector.js.map +1 -1
- package/dist/providers/ClaudeAgentSession.d.ts.map +1 -1
- package/dist/providers/ClaudeAgentSession.js +3 -2
- package/dist/providers/ClaudeAgentSession.js.map +1 -1
- package/dist/providers/ClaudeCliConnector.d.ts.map +1 -1
- package/dist/providers/ClaudeCliConnector.js +7 -6
- package/dist/providers/ClaudeCliConnector.js.map +1 -1
- package/dist/providers/CodexConnector.d.ts.map +1 -1
- package/dist/providers/CodexConnector.js +8 -7
- package/dist/providers/CodexConnector.js.map +1 -1
- package/dist/providers/ConnectorFactories.d.ts.map +1 -1
- package/dist/providers/ConnectorFactories.js +26 -20
- package/dist/providers/ConnectorFactories.js.map +1 -1
- package/dist/providers/CopilotConnector.d.ts.map +1 -1
- package/dist/providers/CopilotConnector.js +5 -4
- package/dist/providers/CopilotConnector.js.map +1 -1
- package/dist/providers/CursorConnector.d.ts.map +1 -1
- package/dist/providers/CursorConnector.js +6 -5
- package/dist/providers/CursorConnector.js.map +1 -1
- package/dist/providers/GeminiAcpSession.d.ts.map +1 -1
- package/dist/providers/GeminiAcpSession.js +3 -1
- package/dist/providers/GeminiAcpSession.js.map +1 -1
- package/dist/providers/GeminiCliProvider.d.ts.map +1 -1
- package/dist/providers/GeminiCliProvider.js +4 -3
- package/dist/providers/GeminiCliProvider.js.map +1 -1
- package/dist/providers/GrokCliConnector.d.ts.map +1 -1
- package/dist/providers/GrokCliConnector.js +11 -5
- package/dist/providers/GrokCliConnector.js.map +1 -1
- package/dist/providers/OpenCodeCliConnector.d.ts.map +1 -1
- package/dist/providers/OpenCodeCliConnector.js +6 -5
- package/dist/providers/OpenCodeCliConnector.js.map +1 -1
- package/dist/providers/PiConnector.d.ts.map +1 -1
- package/dist/providers/PiConnector.js +8 -7
- package/dist/providers/PiConnector.js.map +1 -1
- package/package.json +1 -1
- package/src/ConnectorConfig.ts +18 -17
- package/src/Models.ts +245 -100
- package/src/eval/Eval.ts +4 -1
- package/src/eval/Evaluator.ts +2 -5
- package/src/providers/AntigravityConnector.ts +12 -4
- package/src/providers/ClaudeAgentSession.ts +4 -2
- package/src/providers/ClaudeCliConnector.ts +9 -6
- package/src/providers/CodexConnector.ts +10 -7
- package/src/providers/ConnectorFactories.ts +53 -51
- package/src/providers/CopilotConnector.ts +6 -4
- package/src/providers/CursorConnector.ts +7 -5
- package/src/providers/GeminiAcpSession.ts +4 -1
- package/src/providers/GeminiCliProvider.ts +6 -3
- package/src/providers/GrokCliConnector.ts +12 -5
- package/src/providers/OpenCodeCliConnector.ts +7 -5
- package/src/providers/PiConnector.ts +15 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
import { ConnectorId, LlmConfig } from "./Models.ts";
|
|
2
|
+
import { ConnectorId, LlmConfig, type CliConnectorName, type ConnectorName } from "./Models.ts";
|
|
3
3
|
declare const DockerSandbox_base: Schema.Class<DockerSandbox, Schema.TaggedStruct<"Docker", {
|
|
4
4
|
readonly image: Schema.String;
|
|
5
5
|
readonly mount: Schema.withConstructorDefault<Schema.Boolean>;
|
|
@@ -73,6 +73,8 @@ export declare class CliConnectorConfig extends CliConnectorConfig_base {
|
|
|
73
73
|
}
|
|
74
74
|
export declare const ConnectorConfig: Schema.Union<readonly [typeof ApiConnectorConfig, typeof CliConnectorConfig]>;
|
|
75
75
|
export type ConnectorConfig = typeof ConnectorConfig.Type;
|
|
76
|
+
/** The config class the connector named `K` takes, by its kind in `connectorTable`. */
|
|
77
|
+
export type ConnectorConfigOf<K extends ConnectorName> = K extends CliConnectorName ? CliConnectorConfig : ApiConnectorConfig;
|
|
76
78
|
export declare const toLlmConfig: (config: ApiConnectorConfig) => LlmConfig;
|
|
77
79
|
declare const FallbackChain_base: Schema.Class<FallbackChain, Schema.Struct<{
|
|
78
80
|
readonly connectors: Schema.withConstructorDefault<Schema.$Array<Schema.Union<readonly [typeof ApiConnectorConfig, typeof CliConnectorConfig]>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorConfig.d.ts","sourceRoot":"","sources":["../src/ConnectorConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ConnectorConfig.d.ts","sourceRoot":"","sources":["../src/ConnectorConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,WAAW,EAGX,SAAS,EAET,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAA;;;;;;AAEpB,qBAAa,aAAc,SAAQ,kBAIjC;CAAG;;AAEL,qBAAa,aAAc,SAAQ,kBAAiD;CAAG;;AACvF,qBAAa,oBAAqB,SAAQ,yBAGzC;CAAG;;AACJ,qBAAa,YAAa,SAAQ,iBAA+C;CAAG;;AACpF,qBAAa,UAAW,SAAQ,eAA2C;CAAG;AAE9E,eAAO,MAAM,UAAU,0IAMrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;IA0B3C,mFAAmF;;IAEnF,gFAAgF;;;AAxBpF,qBAAa,kBAAmB,SAAQ,uBA2BvC;CAAG;;;;;;;;;;;;;IA8BA,mFAAmF;;IAEnF;;;;OAIG;;IAEH;;;;;;OAMG;;;AA1CP,qBAAa,kBAAmB,SAAQ,uBA6CvC;CAAG;AAEJ,eAAO,MAAM,eAAe,+EAAyD,CAAA;AACrF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI,CAAC,SAAS,gBAAgB,GAC/E,kBAAkB,GAClB,kBAAkB,CAAA;AAQtB,eAAO,MAAM,WAAW,GAAI,QAAQ,kBAAkB,KAAG,SAerD,CAAA;;;;AAIJ,qBAAa,aAAc,SAAQ,kBAIjC;IACA,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACF;AAED,eAAO,MAAM,kBAAkB,eAAsB,CAAA;AAErD,eAAO,MAAM,0BAA0B;;;EAGrC,CAAA;AAEF,eAAO,MAAM,sBAAsB,GACjC,OAAO,eAAe,EACtB,WAAW,eAAe,KACzB,eAOF,CAAA"}
|
package/dist/ConnectorConfig.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Duration from "effect/Duration";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
|
-
import { ConnectorId, ConnectorIds, Effort, LlmConfig } from "./Models.js";
|
|
4
|
+
import { ConnectorId, ConnectorIds, Effort, LlmConfig, connectorRow } from "./Models.js";
|
|
5
5
|
export class DockerSandbox extends Schema.TaggedClass()("Docker", {
|
|
6
6
|
image: Schema.String,
|
|
7
7
|
mount: Schema.Boolean.pipe(Schema.withConstructorDefault(Effect.succeed(true))),
|
|
@@ -83,23 +83,10 @@ export class CliConnectorConfig extends Schema.TaggedClass()("CliConnectorConfig
|
|
|
83
83
|
}) {
|
|
84
84
|
}
|
|
85
85
|
export const ConnectorConfig = Schema.Union([ApiConnectorConfig, CliConnectorConfig]);
|
|
86
|
+
// An id that names no API connector reads as OpenAI, the wire most servers speak.
|
|
86
87
|
const providerForConnector = (connectorId) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return "Anthropic";
|
|
90
|
-
case "gemini-api":
|
|
91
|
-
return "GeminiApi";
|
|
92
|
-
case "lm-studio":
|
|
93
|
-
return "LmStudio";
|
|
94
|
-
case "ollama":
|
|
95
|
-
return "Ollama";
|
|
96
|
-
case "mlx-lm":
|
|
97
|
-
return "MlxLm";
|
|
98
|
-
case "mock":
|
|
99
|
-
return "Mock";
|
|
100
|
-
default:
|
|
101
|
-
return "OpenAI";
|
|
102
|
-
}
|
|
88
|
+
const row = connectorRow(connectorId);
|
|
89
|
+
return row?.kind === "Api" ? (row.provider ?? "OpenAI") : "OpenAI";
|
|
103
90
|
};
|
|
104
91
|
export const toLlmConfig = (config) => new LlmConfig({
|
|
105
92
|
provider: providerForConnector(config.connectorId),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorConfig.js","sourceRoot":"","sources":["../src/ConnectorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"ConnectorConfig.js","sourceRoot":"","sources":["../src/ConnectorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,MAAM,EACN,SAAS,EACT,YAAY,E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AAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,aAAa,EAAE,CAAA;AAErD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,IAAI,kBAAkB,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC;IACvE,KAAK,EAAE,IAAI,kBAAkB,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,EAAE,CAAC;CACnE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAsB,EACtB,QAA0B,EACT,EAAE;IACnB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,KAAK,YAAY,kBAAkB;QACxC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvD,CAAC,CAAC,KAAK,CAAA;AACX,CAAC,CAAA"}
|
package/dist/Models.d.ts
CHANGED
|
@@ -6,33 +6,190 @@ declare const ConnectorId_base: Schema.Class<ConnectorId, Schema.Struct<{
|
|
|
6
6
|
}>, {}>;
|
|
7
7
|
export declare class ConnectorId extends ConnectorId_base {
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
export declare const ConnectorKind: Schema.Literals<readonly ["Api", "Cli"]>;
|
|
10
|
+
export type ConnectorKind = typeof ConnectorKind.Type;
|
|
11
|
+
interface ConnectorIdentity {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** The `LlmConfig` provider it serves. Such a row sits under the provider's own name. */
|
|
14
|
+
readonly provider?: LlmProvider;
|
|
15
|
+
readonly baseUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* What an operator may write for it: a coder name on a CLI row
|
|
18
|
+
* (`LLM4TS_CODER`, `LLM4TS_REASONER`), a provider name on an API row
|
|
19
|
+
* (`LLM4TS_PROVIDER`). The first is the one help and menus show. Empty
|
|
20
|
+
* means it is not offered under any name.
|
|
21
|
+
*/
|
|
22
|
+
readonly names: ReadonlyArray<string>;
|
|
23
|
+
}
|
|
24
|
+
export interface ApiConnectorRow extends ConnectorIdentity {
|
|
25
|
+
readonly kind: "Api";
|
|
26
|
+
/** Environment variables that may hold its key; the first one set wins. */
|
|
27
|
+
readonly credentialVariables: ReadonlyArray<string>;
|
|
28
|
+
/** Answers without a backend, so it is no part of `apiConnectorIds`. */
|
|
29
|
+
readonly simulated?: true;
|
|
30
|
+
}
|
|
31
|
+
export interface CliConnectorRow extends ConnectorIdentity {
|
|
32
|
+
readonly kind: "Cli";
|
|
33
|
+
/** The program it spawns, and the one looked for on `PATH`. */
|
|
34
|
+
readonly executable: string;
|
|
35
|
+
}
|
|
36
|
+
export type ConnectorRow = ApiConnectorRow | CliConnectorRow;
|
|
37
|
+
/**
|
|
38
|
+
* Every connector's identity, one row each. The id lists, the provider
|
|
39
|
+
* mappings and the names an operator may write are all read from here; the
|
|
40
|
+
* factories (`providers/ConnectorFactories.ts`) and the runner's presets are
|
|
41
|
+
* records keyed by these names, so a row without either does not compile.
|
|
42
|
+
*/
|
|
43
|
+
export declare const connectorTable: {
|
|
44
|
+
readonly OpenAI: {
|
|
45
|
+
readonly id: "openai";
|
|
46
|
+
readonly kind: "Api";
|
|
47
|
+
readonly provider: "OpenAI";
|
|
48
|
+
readonly baseUrl: "https://api.openai.com/v1";
|
|
49
|
+
readonly credentialVariables: readonly ["OPENAI_API_KEY"];
|
|
50
|
+
readonly names: readonly ["openai"];
|
|
51
|
+
};
|
|
52
|
+
readonly Anthropic: {
|
|
53
|
+
readonly id: "anthropic";
|
|
54
|
+
readonly kind: "Api";
|
|
55
|
+
readonly provider: "Anthropic";
|
|
56
|
+
readonly baseUrl: "https://api.anthropic.com";
|
|
57
|
+
readonly credentialVariables: readonly ["ANTHROPIC_API_KEY"];
|
|
58
|
+
readonly names: readonly ["anthropic"];
|
|
59
|
+
};
|
|
60
|
+
readonly GeminiApi: {
|
|
61
|
+
readonly id: "gemini-api";
|
|
62
|
+
readonly kind: "Api";
|
|
63
|
+
readonly provider: "GeminiApi";
|
|
64
|
+
readonly baseUrl: "https://generativelanguage.googleapis.com";
|
|
65
|
+
readonly credentialVariables: readonly ["GEMINI_API_KEY", "GOOGLE_API_KEY"];
|
|
66
|
+
readonly names: readonly ["gemini", "gemini-api"];
|
|
67
|
+
};
|
|
68
|
+
readonly LmStudio: {
|
|
69
|
+
readonly id: "lm-studio";
|
|
70
|
+
readonly kind: "Api";
|
|
71
|
+
readonly provider: "LmStudio";
|
|
72
|
+
readonly baseUrl: "http://localhost:1234/v1";
|
|
73
|
+
readonly credentialVariables: readonly [];
|
|
74
|
+
readonly names: readonly ["lm-studio", "lmstudio"];
|
|
75
|
+
};
|
|
76
|
+
readonly Ollama: {
|
|
77
|
+
readonly id: "ollama";
|
|
78
|
+
readonly kind: "Api";
|
|
79
|
+
readonly provider: "Ollama";
|
|
80
|
+
readonly baseUrl: "http://localhost:11434";
|
|
81
|
+
readonly credentialVariables: readonly [];
|
|
82
|
+
readonly names: readonly ["ollama"];
|
|
83
|
+
};
|
|
84
|
+
readonly MlxLm: {
|
|
85
|
+
readonly id: "mlx-lm";
|
|
86
|
+
readonly kind: "Api";
|
|
87
|
+
readonly provider: "MlxLm";
|
|
88
|
+
readonly baseUrl: "http://localhost:8080";
|
|
89
|
+
readonly credentialVariables: readonly [];
|
|
90
|
+
readonly names: readonly ["mlx-lm", "mlxlm", "mlx"];
|
|
91
|
+
};
|
|
92
|
+
readonly ClaudeCli: {
|
|
93
|
+
readonly id: "claude-cli";
|
|
94
|
+
readonly kind: "Cli";
|
|
95
|
+
readonly executable: "claude";
|
|
96
|
+
readonly names: readonly ["claude", "claude-cli"];
|
|
97
|
+
};
|
|
98
|
+
readonly GeminiCli: {
|
|
99
|
+
readonly id: "gemini-cli";
|
|
100
|
+
readonly kind: "Cli";
|
|
101
|
+
readonly provider: "GeminiCli";
|
|
102
|
+
readonly executable: "gemini";
|
|
103
|
+
readonly names: readonly ["gemini", "gemini-cli"];
|
|
104
|
+
};
|
|
105
|
+
readonly OpenCode: {
|
|
106
|
+
readonly id: "opencode";
|
|
107
|
+
readonly kind: "Cli";
|
|
108
|
+
readonly provider: "OpenCode";
|
|
109
|
+
readonly baseUrl: "http://localhost:4096";
|
|
110
|
+
readonly executable: "opencode";
|
|
111
|
+
readonly names: readonly ["opencode"];
|
|
112
|
+
};
|
|
113
|
+
readonly Codex: {
|
|
114
|
+
readonly id: "codex";
|
|
115
|
+
readonly kind: "Cli";
|
|
116
|
+
readonly executable: "codex";
|
|
117
|
+
readonly names: readonly ["codex"];
|
|
118
|
+
};
|
|
119
|
+
readonly Copilot: {
|
|
120
|
+
readonly id: "copilot";
|
|
121
|
+
readonly kind: "Cli";
|
|
122
|
+
readonly executable: "gh";
|
|
123
|
+
readonly names: readonly [];
|
|
124
|
+
};
|
|
125
|
+
readonly Pi: {
|
|
126
|
+
readonly id: "pi";
|
|
127
|
+
readonly kind: "Cli";
|
|
128
|
+
readonly executable: "pi";
|
|
129
|
+
readonly names: readonly ["pi"];
|
|
130
|
+
};
|
|
131
|
+
readonly AntigravityCli: {
|
|
132
|
+
readonly id: "antigravity-cli";
|
|
133
|
+
readonly kind: "Cli";
|
|
134
|
+
readonly executable: "agy";
|
|
135
|
+
readonly names: readonly ["agy", "antigravity", "antigravity-cli"];
|
|
136
|
+
};
|
|
137
|
+
readonly Grok: {
|
|
138
|
+
readonly id: "grok";
|
|
139
|
+
readonly kind: "Cli";
|
|
140
|
+
readonly executable: "grok";
|
|
141
|
+
readonly names: readonly ["grok"];
|
|
142
|
+
};
|
|
143
|
+
readonly Cursor: {
|
|
144
|
+
readonly id: "cursor";
|
|
145
|
+
readonly kind: "Cli";
|
|
146
|
+
readonly executable: "cursor-agent";
|
|
147
|
+
readonly names: readonly ["cursor"];
|
|
148
|
+
};
|
|
149
|
+
readonly Mock: {
|
|
150
|
+
readonly id: "mock";
|
|
151
|
+
readonly kind: "Api";
|
|
152
|
+
readonly provider: "Mock";
|
|
153
|
+
readonly credentialVariables: readonly [];
|
|
154
|
+
readonly simulated: true;
|
|
155
|
+
readonly names: readonly ["mock"];
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export type ConnectorName = keyof typeof connectorTable;
|
|
159
|
+
type RowOf<K extends ConnectorName> = (typeof connectorTable)[K];
|
|
160
|
+
export type CliConnectorName = {
|
|
161
|
+
[K in ConnectorName]: RowOf<K>["kind"] extends "Cli" ? K : never;
|
|
162
|
+
}[ConnectorName];
|
|
163
|
+
export type ApiConnectorName = Exclude<ConnectorName, CliConnectorName>;
|
|
164
|
+
/** Every name `LLM4TS_CODER` and `LLM4TS_REASONER` read. */
|
|
165
|
+
export type CoderName = RowOf<CliConnectorName>["names"][number];
|
|
166
|
+
/** Every name `LLM4TS_PROVIDER` and `LLM4TS_JUDGMENT_PROVIDER` read. */
|
|
167
|
+
export type ApiProviderName = RowOf<ApiConnectorName>["names"][number];
|
|
168
|
+
export declare const isCliConnectorName: (name: ConnectorName) => name is CliConnectorName;
|
|
169
|
+
export declare const ConnectorIds: Readonly<Record<ConnectorName, ConnectorId>>;
|
|
27
170
|
export declare const apiConnectorIds: ReadonlyArray<ConnectorId>;
|
|
28
171
|
export declare const cliConnectorIds: ReadonlyArray<ConnectorId>;
|
|
29
172
|
export declare const connectorIds: ReadonlyArray<ConnectorId>;
|
|
173
|
+
export declare const connectorRow: (id: ConnectorId) => ConnectorRow | undefined;
|
|
30
174
|
export declare const defaultBaseUrl: (provider: LlmProvider) => string | undefined;
|
|
31
175
|
export declare const connectorProvider: (id: ConnectorId) => LlmProvider | undefined;
|
|
32
176
|
export declare const connectorDefaultBaseUrl: (id: ConnectorId) => string | undefined;
|
|
33
177
|
export declare const providerConnectorId: (provider: LlmProvider) => ConnectorId;
|
|
34
|
-
|
|
35
|
-
export
|
|
178
|
+
/** The CLI connector a coder name stands for; the name as written, lower case. */
|
|
179
|
+
export declare const coderConnector: (name: string) => CliConnectorName | undefined;
|
|
180
|
+
/** The API connector a provider name stands for; the name as written, lower case. */
|
|
181
|
+
export declare const apiProviderConnector: (name: string) => ApiConnectorName | undefined;
|
|
182
|
+
export declare const coderNames: ReadonlyArray<CoderName>;
|
|
183
|
+
export declare const apiProviderNames: ReadonlyArray<ApiProviderName>;
|
|
184
|
+
/** Every variable an API connector reads its key from. Names only, never a value. */
|
|
185
|
+
export declare const credentialVariables: ReadonlyArray<string>;
|
|
186
|
+
export declare const cliExecutable: <K extends CliConnectorName>(name: K) => RowOf<K>["executable"];
|
|
187
|
+
/** The coding agents help and menus offer, in the order they show them. */
|
|
188
|
+
export declare const offeredCoders: readonly ["ClaudeCli", "Codex", "GeminiCli", "Pi", "AntigravityCli", "Grok", "Cursor", "OpenCode"];
|
|
189
|
+
/** The API providers help and errors offer, in the order they show them. */
|
|
190
|
+
export declare const offeredApiProviders: readonly ["Mock", "OpenAI", "Anthropic", "GeminiApi", "LmStudio", "Ollama", "MlxLm"];
|
|
191
|
+
export declare const offeredCoderNames: ("gemini" | "claude" | "opencode" | "codex" | "pi" | "agy" | "grok" | "cursor")[];
|
|
192
|
+
export declare const offeredApiProviderNames: ("openai" | "anthropic" | "gemini" | "lm-studio" | "ollama" | "mlx-lm" | "mock")[];
|
|
36
193
|
export declare const MessageRole: Schema.Literals<readonly ["System", "User", "Assistant", "Tool"]>;
|
|
37
194
|
export type MessageRole = typeof MessageRole.Type;
|
|
38
195
|
declare const Message_base: Schema.Class<Message, Schema.Struct<{
|
package/dist/Models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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OG;AACH,eAAO,MAAM,kBAAkB,8DAAsD,CAAA;AACrF,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAE/D,oFAAoF;AACpF,eAAO,MAAM,WAAW,iEAAyD,CAAA;AACjF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;;;;;;;;AAEjD;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,sBAMrC;CAAG;;;;;;;;;;;;;;;AAEL,qBAAa,qBAAsB,SAAQ,0BAyBzC;CAAG"}
|
package/dist/Models.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Duration from "effect/Duration";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Record from "effect/Record";
|
|
3
4
|
import * as Schema from "effect/Schema";
|
|
4
5
|
export const LlmProvider = Schema.Literals([
|
|
5
6
|
"GeminiCli",
|
|
@@ -16,108 +17,160 @@ export class ConnectorId extends Schema.Class("ConnectorId")({
|
|
|
16
17
|
value: Schema.String
|
|
17
18
|
}) {
|
|
18
19
|
}
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
20
|
+
export const ConnectorKind = Schema.Literals(["Api", "Cli"]);
|
|
21
|
+
/**
|
|
22
|
+
* Every connector's identity, one row each. The id lists, the provider
|
|
23
|
+
* mappings and the names an operator may write are all read from here; the
|
|
24
|
+
* factories (`providers/ConnectorFactories.ts`) and the runner's presets are
|
|
25
|
+
* records keyed by these names, so a row without either does not compile.
|
|
26
|
+
*/
|
|
27
|
+
export const connectorTable = {
|
|
28
|
+
OpenAI: {
|
|
29
|
+
id: "openai",
|
|
30
|
+
kind: "Api",
|
|
31
|
+
provider: "OpenAI",
|
|
32
|
+
baseUrl: "https://api.openai.com/v1",
|
|
33
|
+
credentialVariables: ["OPENAI_API_KEY"],
|
|
34
|
+
names: ["openai"]
|
|
35
|
+
},
|
|
36
|
+
Anthropic: {
|
|
37
|
+
id: "anthropic",
|
|
38
|
+
kind: "Api",
|
|
39
|
+
provider: "Anthropic",
|
|
40
|
+
baseUrl: "https://api.anthropic.com",
|
|
41
|
+
credentialVariables: ["ANTHROPIC_API_KEY"],
|
|
42
|
+
names: ["anthropic"]
|
|
43
|
+
},
|
|
44
|
+
GeminiApi: {
|
|
45
|
+
id: "gemini-api",
|
|
46
|
+
kind: "Api",
|
|
47
|
+
provider: "GeminiApi",
|
|
48
|
+
baseUrl: "https://generativelanguage.googleapis.com",
|
|
49
|
+
credentialVariables: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
|
|
50
|
+
names: ["gemini", "gemini-api"]
|
|
51
|
+
},
|
|
52
|
+
LmStudio: {
|
|
53
|
+
id: "lm-studio",
|
|
54
|
+
kind: "Api",
|
|
55
|
+
provider: "LmStudio",
|
|
56
|
+
baseUrl: "http://localhost:1234/v1",
|
|
57
|
+
credentialVariables: [],
|
|
58
|
+
names: ["lm-studio", "lmstudio"]
|
|
59
|
+
},
|
|
60
|
+
Ollama: {
|
|
61
|
+
id: "ollama",
|
|
62
|
+
kind: "Api",
|
|
63
|
+
provider: "Ollama",
|
|
64
|
+
baseUrl: "http://localhost:11434",
|
|
65
|
+
credentialVariables: [],
|
|
66
|
+
names: ["ollama"]
|
|
67
|
+
},
|
|
68
|
+
MlxLm: {
|
|
69
|
+
id: "mlx-lm",
|
|
70
|
+
kind: "Api",
|
|
71
|
+
provider: "MlxLm",
|
|
72
|
+
baseUrl: "http://localhost:8080",
|
|
73
|
+
credentialVariables: [],
|
|
74
|
+
names: ["mlx-lm", "mlxlm", "mlx"]
|
|
75
|
+
},
|
|
76
|
+
ClaudeCli: {
|
|
77
|
+
id: "claude-cli",
|
|
78
|
+
kind: "Cli",
|
|
79
|
+
executable: "claude",
|
|
80
|
+
names: ["claude", "claude-cli"]
|
|
81
|
+
},
|
|
82
|
+
GeminiCli: {
|
|
83
|
+
id: "gemini-cli",
|
|
84
|
+
kind: "Cli",
|
|
85
|
+
provider: "GeminiCli",
|
|
86
|
+
executable: "gemini",
|
|
87
|
+
names: ["gemini", "gemini-cli"]
|
|
88
|
+
},
|
|
89
|
+
OpenCode: {
|
|
90
|
+
id: "opencode",
|
|
91
|
+
kind: "Cli",
|
|
92
|
+
provider: "OpenCode",
|
|
93
|
+
baseUrl: "http://localhost:4096",
|
|
94
|
+
executable: "opencode",
|
|
95
|
+
names: ["opencode"]
|
|
96
|
+
},
|
|
97
|
+
Codex: { id: "codex", kind: "Cli", executable: "codex", names: ["codex"] },
|
|
98
|
+
Copilot: { id: "copilot", kind: "Cli", executable: "gh", names: [] },
|
|
99
|
+
Pi: { id: "pi", kind: "Cli", executable: "pi", names: ["pi"] },
|
|
100
|
+
AntigravityCli: {
|
|
101
|
+
id: "antigravity-cli",
|
|
102
|
+
kind: "Cli",
|
|
103
|
+
executable: "agy",
|
|
104
|
+
names: ["agy", "antigravity", "antigravity-cli"]
|
|
105
|
+
},
|
|
106
|
+
Grok: { id: "grok", kind: "Cli", executable: "grok", names: ["grok"] },
|
|
107
|
+
Cursor: { id: "cursor", kind: "Cli", executable: "cursor-agent", names: ["cursor"] },
|
|
108
|
+
Mock: {
|
|
109
|
+
id: "mock",
|
|
110
|
+
kind: "Api",
|
|
111
|
+
provider: "Mock",
|
|
112
|
+
credentialVariables: [],
|
|
113
|
+
simulated: true,
|
|
114
|
+
names: ["mock"]
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const rows = connectorTable;
|
|
118
|
+
const providerRows = connectorTable;
|
|
119
|
+
const names = Record.keys(connectorTable);
|
|
120
|
+
export const isCliConnectorName = (name) => rows[name].kind === "Cli";
|
|
121
|
+
export const ConnectorIds = Object.freeze(Record.map(connectorTable, (row) => new ConnectorId({ value: row.id })));
|
|
122
|
+
const idsWhere = (keep) => Object.freeze(names.filter((name) => keep(rows[name])).map((name) => ConnectorIds[name]));
|
|
123
|
+
export const apiConnectorIds = idsWhere((row) => row.kind === "Api" && row.simulated !== true);
|
|
124
|
+
export const cliConnectorIds = idsWhere((row) => row.kind === "Cli");
|
|
56
125
|
export const connectorIds = Object.freeze([
|
|
57
126
|
...apiConnectorIds,
|
|
58
127
|
...cliConnectorIds,
|
|
59
|
-
|
|
128
|
+
...idsWhere((row) => row.kind === "Api" && row.simulated === true)
|
|
60
129
|
]);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return ConnectorIds.OpenAI;
|
|
106
|
-
case "Anthropic":
|
|
107
|
-
return ConnectorIds.Anthropic;
|
|
108
|
-
case "LmStudio":
|
|
109
|
-
return ConnectorIds.LmStudio;
|
|
110
|
-
case "Ollama":
|
|
111
|
-
return ConnectorIds.Ollama;
|
|
112
|
-
case "MlxLm":
|
|
113
|
-
return ConnectorIds.MlxLm;
|
|
114
|
-
case "OpenCode":
|
|
115
|
-
return ConnectorIds.OpenCode;
|
|
116
|
-
case "Mock":
|
|
117
|
-
return ConnectorIds.Mock;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
export const ConnectorKind = Schema.Literals(["Api", "Cli"]);
|
|
130
|
+
const rowsById = new Map(names.map((name) => [rows[name].id, rows[name]]));
|
|
131
|
+
export const connectorRow = (id) => rowsById.get(id.value);
|
|
132
|
+
export const defaultBaseUrl = (provider) => providerRows[provider].baseUrl;
|
|
133
|
+
export const connectorProvider = (id) => connectorRow(id)?.provider;
|
|
134
|
+
export const connectorDefaultBaseUrl = (id) => connectorRow(id)?.baseUrl;
|
|
135
|
+
export const providerConnectorId = (provider) => ConnectorIds[provider];
|
|
136
|
+
const namedConnectors = (keys) => new Map(keys.flatMap((key) => rows[key].names.map((name) => [name, key])));
|
|
137
|
+
const cliNames = names.filter(isCliConnectorName);
|
|
138
|
+
const apiNames = names.filter((name) => !isCliConnectorName(name));
|
|
139
|
+
const coderConnectors = namedConnectors(cliNames);
|
|
140
|
+
const apiProviderConnectors = namedConnectors(apiNames);
|
|
141
|
+
/** The CLI connector a coder name stands for; the name as written, lower case. */
|
|
142
|
+
export const coderConnector = (name) => coderConnectors.get(name);
|
|
143
|
+
/** The API connector a provider name stands for; the name as written, lower case. */
|
|
144
|
+
export const apiProviderConnector = (name) => apiProviderConnectors.get(name);
|
|
145
|
+
export const coderNames = cliNames.flatMap((name) => connectorTable[name].names);
|
|
146
|
+
export const apiProviderNames = apiNames.flatMap((name) => connectorTable[name].names);
|
|
147
|
+
/** Every variable an API connector reads its key from. Names only, never a value. */
|
|
148
|
+
export const credentialVariables = apiNames.flatMap((name) => connectorTable[name].credentialVariables);
|
|
149
|
+
export const cliExecutable = (name) => connectorTable[name].executable;
|
|
150
|
+
const inOrder = () => (list, ..._missing) => list;
|
|
151
|
+
/** The coding agents help and menus offer, in the order they show them. */
|
|
152
|
+
export const offeredCoders = inOrder()([
|
|
153
|
+
"ClaudeCli",
|
|
154
|
+
"Codex",
|
|
155
|
+
"GeminiCli",
|
|
156
|
+
"Pi",
|
|
157
|
+
"AntigravityCli",
|
|
158
|
+
"Grok",
|
|
159
|
+
"Cursor",
|
|
160
|
+
"OpenCode"
|
|
161
|
+
]);
|
|
162
|
+
/** The API providers help and errors offer, in the order they show them. */
|
|
163
|
+
export const offeredApiProviders = inOrder()([
|
|
164
|
+
"Mock",
|
|
165
|
+
"OpenAI",
|
|
166
|
+
"Anthropic",
|
|
167
|
+
"GeminiApi",
|
|
168
|
+
"LmStudio",
|
|
169
|
+
"Ollama",
|
|
170
|
+
"MlxLm"
|
|
171
|
+
]);
|
|
172
|
+
export const offeredCoderNames = offeredCoders.map((name) => connectorTable[name].names[0]);
|
|
173
|
+
export const offeredApiProviderNames = offeredApiProviders.map((name) => connectorTable[name].names[0]);
|
|
121
174
|
export const MessageRole = Schema.Literals(["System", "User", "Assistant", "Tool"]);
|
|
122
175
|
export class Message extends Schema.Class("Message")({
|
|
123
176
|
role: MessageRole,
|