lastlight 0.10.2 → 0.10.4
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 +37 -12
- package/deploy/.env.production.example +9 -1
- package/deploy/native/README.md +1 -1
- package/deploy/native/lastlight.service +1 -1
- package/dist/admin/version.js +1 -1
- package/dist/cli/cli-server.d.ts +1 -1
- package/dist/cli/cli-server.js +1 -1
- package/dist/cli/setup.d.ts +13 -14
- package/dist/cli/setup.js +87 -95
- package/dist/cli/setup.js.map +1 -1
- package/dist/config/overlay-bootstrap.js +5 -2
- package/dist/config/overlay-bootstrap.js.map +1 -1
- package/dist/engine/agent-executor.js +10 -9
- package/dist/engine/agent-executor.js.map +1 -1
- package/dist/engine/llm.d.ts +44 -21
- package/dist/engine/llm.js +199 -164
- package/dist/engine/llm.js.map +1 -1
- package/dist/providers.d.ts +88 -0
- package/dist/providers.js +245 -0
- package/dist/providers.js.map +1 -0
- package/dist/sandbox/egress-allowlist.d.ts +5 -0
- package/dist/sandbox/egress-allowlist.js +7 -7
- package/dist/sandbox/egress-allowlist.js.map +1 -1
- package/package.json +2 -2
- package/plugins/lastlight/.claude-plugin/plugin.json +3 -3
- package/plugins/lastlight/README.md +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-bootstrap.js","sourceRoot":"","sources":["../../src/config/overlay-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;AACtB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAElC,gFAAgF;AAEhF;mFACmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,0EAA0E;IAC1E,wBAAwB;IACxB,WAAW;IACX,uBAAuB;IACvB,MAAM;IACN,OAAO;IACP,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,4EAA4E;AAC5E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,kDAAkD;IAClD,0EAA0E;IAC1E,mEAAmE;IACnE,wEAAwE;IACxE,EAAE;IACF,eAAe;IACf,wEAAwE;IACxE,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;yEACyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oEAAoE;IACpE,2EAA2E;IAC3E,iEAAiE;IACjE,iEAAiE;IACjE,EAAE;IACF,6DAA6D;IAC7D,qCAAqC;IACrC,EAAE;IACF,6DAA6D;IAC7D,gBAAgB;IAChB,sFAAsF;IACtF,uCAAuC;IACvC,6BAA6B;IAC7B,EAAE;IACF,uEAAuE;IACvE,iBAAiB;IACjB,EAAE;IACF,6DAA6D;IAC7D,kBAAkB;IAClB,EAAE;IACF,6DAA6D;IAC7D,6CAA6C;IAC7C,
|
|
1
|
+
{"version":3,"file":"overlay-bootstrap.js","sourceRoot":"","sources":["../../src/config/overlay-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,CAAC,MAAM,gBA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AAO,GAAG,EAAE,CAAC;oBACb,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,0BAA2B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC/D,kCAAkC;gBACpC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,eAAe,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { refreshGitAuth } from "./github/git-auth.js";
|
|
|
4
4
|
import { GITHUB_PERMISSION_PROFILES, } from "./github/profiles.js";
|
|
5
5
|
import { getDockerSandboxOtelEnv, getOtelEnvForSandbox, safeSpanAttributes, withSpan } from "../telemetry/index.js";
|
|
6
6
|
import { DEFAULT_MODEL } from "./executors/shared.js";
|
|
7
|
+
import { PROVIDER_ENV_KEYS } from "../providers.js";
|
|
7
8
|
import { runSandboxedAgent, runSandboxedCommand, } from "./executors/orchestrator.js";
|
|
8
9
|
// Re-exported for back-compat with existing importers (tests, dashboards,
|
|
9
10
|
// workflow phase executor).
|
|
@@ -91,15 +92,15 @@ async function prepareRun(config, opts) {
|
|
|
91
92
|
ghEnv.GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
|
92
93
|
ghEnv.GIT_TOKEN = process.env.GITHUB_TOKEN;
|
|
93
94
|
}
|
|
94
|
-
// Provider API keys.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
// Provider API keys. Forwarded in registry order — see `src/providers.ts`
|
|
96
|
+
// (the single source of truth for wizard-able providers). Every entry a
|
|
97
|
+
// user can pick in the setup wizard is reachable from the sandbox because
|
|
98
|
+
// the egress firewall list is also derived from the same registry's hosts.
|
|
99
|
+
for (const envKey of PROVIDER_ENV_KEYS) {
|
|
100
|
+
const v = process.env[envKey];
|
|
101
|
+
if (v)
|
|
102
|
+
ghEnv[envKey] = v;
|
|
103
|
+
}
|
|
103
104
|
// Web-search provider keys. Forwarded only when the workflow opted into
|
|
104
105
|
// web search (scoped to explore today; see webSearchEnabledForWorkflow
|
|
105
106
|
// in workflows/runner.ts). agentic-pi auto-detects the provider from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-executor.js","sourceRoot":"","sources":["../../src/engine/agent-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,0BAA0B,GAI3B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAGpB,MAAM,6BAA6B,CAAC;AACrC,0EAA0E;AAC1E,4BAA4B;AAC5B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGnH;;;;;;;GAOG;AACH,KAAK,UAAU,UAAU,CACvB,MAAsB,EACtB,IAA2D;IAS3D,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,QAAQ,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,OAAO,GAAmB,MAAM,CAAC,OAAO,IAAI,UAAU,CAAC;IAE7D,qEAAqE;IACrE,qEAAqE;IACrE,wCAAwC;IACxC,EAAE;IACF,2EAA2E;IAC3E,4EAA4E;IAC5E,0EAA0E;IAC1E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ACP,GAAG,EAAE,KAAK;QACV,WAAW;QACX,MAAM;QACN,WAAW,EAAE,IAAI,EAAE,WAAW;QAC9B,cAAc,EAAE,IAAI,EAAE,cAAc;KACrC,CAAC;IACF,OAAO,QAAQ,CAAC,2BAA2B,EAAE,SAAS,EAAE,GAAG,EAAE,CAC3D,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE;QAC7B,cAAc,EAAE,IAAI,EAAE,cAAc;QACpC,UAAU,EAAE,IAAI,EAAE,UAAU;QAC5B,YAAY,EAAE,IAAI,EAAE,YAAY;KACjC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/engine/llm.d.ts
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Thin one-shot LLM chat helper used by the prompt-injection screener and the
|
|
3
|
-
* intent classifier.
|
|
4
|
-
*
|
|
3
|
+
* intent classifier. Powered by `src/providers.ts` — that registry is the
|
|
4
|
+
* single source of truth for which providers this helper can call.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The screener + classifier are deliberately small and explicit. They need a
|
|
7
|
+
* cheap/fast model on the SAME provider the user picked (or any registered
|
|
8
|
+
* provider whose key is present) so the agent's primary model and the cheap
|
|
9
|
+
* helper share one footprint. We support two request families:
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* `openai-completions` — body `{ model, messages, <maxTokensField> }`,
|
|
12
|
+
* response `choices[0].message.content`. Covers
|
|
13
|
+
* OpenAI, OpenRouter, Groq, Cerebras, xAI,
|
|
14
|
+
* Hugging Face, Moonshot, NVIDIA, Fireworks,
|
|
15
|
+
* Together, DeepSeek, Z.AI, and Google/Mistral
|
|
16
|
+
* via their OpenAI-compatible endpoints.
|
|
17
|
+
* `anthropic-messages` — `system` field + content-block response.
|
|
18
|
+
* Covers Anthropic, Kimi for Coding, MiniMax.
|
|
19
|
+
*
|
|
20
|
+
* Scope: this helper supports the providers listed in `src/providers.ts`.
|
|
21
|
+
* Workflow phases themselves are provider-agnostic (whatever pi-ai
|
|
22
|
+
* supports); only the screener/classifier path is constrained here.
|
|
13
23
|
*/
|
|
24
|
+
import { type ApiType } from "../providers.js";
|
|
14
25
|
export type ChatRole = "system" | "user" | "assistant";
|
|
15
26
|
export interface ChatMessage {
|
|
16
27
|
role: ChatRole;
|
|
@@ -24,24 +35,36 @@ export interface ChatOptions {
|
|
|
24
35
|
}
|
|
25
36
|
export type CallLlmOptions = ChatOptions;
|
|
26
37
|
export type ChatFunction = (model: string, messages: ChatMessage[], opts?: ChatOptions) => Promise<string>;
|
|
27
|
-
|
|
38
|
+
/** Resolved routing for a `provider/model` spec. */
|
|
39
|
+
export interface ResolvedProvider {
|
|
40
|
+
/** Pi-ai-style provider prefix (`anthropic`, `openai`, `openrouter`, …). */
|
|
41
|
+
provider: string;
|
|
42
|
+
/** Model id the upstream API expects (prefix stripped, nested tail preserved if applicable). */
|
|
43
|
+
modelId: string;
|
|
44
|
+
/** Which request family to use. */
|
|
45
|
+
api: ApiType;
|
|
46
|
+
}
|
|
28
47
|
/**
|
|
29
|
-
*
|
|
48
|
+
* Resolve a `provider/model` spec (or a bare model id) into a routing
|
|
49
|
+
* decision. Prefers an explicit `<prefix>/<model>` over name-inference.
|
|
30
50
|
*
|
|
31
|
-
* @throws if the
|
|
51
|
+
* @throws if the prefix is present but not registered — silently
|
|
52
|
+
* mis-routing a `xai/grok-4` to OpenAI would bill the wrong account and
|
|
53
|
+
* fail at request time with a confusing error, so we surface it early.
|
|
32
54
|
*/
|
|
33
|
-
export declare function
|
|
34
|
-
/** Compatibility wrapper for older single-turn call sites. */
|
|
35
|
-
export declare function callLlm(model: string, systemPrompt: string, userPrompt: string, opts?: CallLlmOptions): Promise<string>;
|
|
55
|
+
export declare function resolveProvider(model: string): ResolvedProvider;
|
|
36
56
|
/**
|
|
37
57
|
* Resolve the model id for a tiny one-shot helper call (classifier / screener).
|
|
38
58
|
* Prefers explicit per-task overrides from OPENCODE_MODELS, then the first
|
|
39
|
-
* configured provider in PROVIDERS order
|
|
40
|
-
*
|
|
59
|
+
* configured provider in `PROVIDERS` order (registry order: Anthropic first,
|
|
60
|
+
* then OpenAI, OpenRouter, then the rest — see `src/providers.ts`).
|
|
41
61
|
*/
|
|
42
62
|
export declare function defaultFastModel(taskType?: string): string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Make a provider-agnostic chat call and return the final assistant text.
|
|
65
|
+
*
|
|
66
|
+
* @throws if the relevant API key isn't set or the upstream returns non-2xx
|
|
67
|
+
*/
|
|
68
|
+
export declare function chat(model: string, messages: ChatMessage[], opts?: ChatOptions): Promise<string>;
|
|
69
|
+
/** Compatibility wrapper for older single-turn call sites. */
|
|
70
|
+
export declare function callLlm(model: string, systemPrompt: string, userPrompt: string, opts?: CallLlmOptions): Promise<string>;
|
package/dist/engine/llm.js
CHANGED
|
@@ -1,126 +1,223 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Thin one-shot LLM chat helper used by the prompt-injection screener and the
|
|
3
|
-
* intent classifier.
|
|
4
|
-
*
|
|
3
|
+
* intent classifier. Powered by `src/providers.ts` — that registry is the
|
|
4
|
+
* single source of truth for which providers this helper can call.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The screener + classifier are deliberately small and explicit. They need a
|
|
7
|
+
* cheap/fast model on the SAME provider the user picked (or any registered
|
|
8
|
+
* provider whose key is present) so the agent's primary model and the cheap
|
|
9
|
+
* helper share one footprint. We support two request families:
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* `openai-completions` — body `{ model, messages, <maxTokensField> }`,
|
|
12
|
+
* response `choices[0].message.content`. Covers
|
|
13
|
+
* OpenAI, OpenRouter, Groq, Cerebras, xAI,
|
|
14
|
+
* Hugging Face, Moonshot, NVIDIA, Fireworks,
|
|
15
|
+
* Together, DeepSeek, Z.AI, and Google/Mistral
|
|
16
|
+
* via their OpenAI-compatible endpoints.
|
|
17
|
+
* `anthropic-messages` — `system` field + content-block response.
|
|
18
|
+
* Covers Anthropic, Kimi for Coding, MiniMax.
|
|
19
|
+
*
|
|
20
|
+
* Scope: this helper supports the providers listed in `src/providers.ts`.
|
|
21
|
+
* Workflow phases themselves are provider-agnostic (whatever pi-ai
|
|
22
|
+
* supports); only the screener/classifier path is constrained here.
|
|
23
|
+
*/
|
|
24
|
+
import { PROVIDERS, providerByPrefix } from "../providers.js";
|
|
25
|
+
// ── Resolvers (exported for unit tests) ──────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a `provider/model` spec (or a bare model id) into a routing
|
|
28
|
+
* decision. Prefers an explicit `<prefix>/<model>` over name-inference.
|
|
29
|
+
*
|
|
30
|
+
* @throws if the prefix is present but not registered — silently
|
|
31
|
+
* mis-routing a `xai/grok-4` to OpenAI would bill the wrong account and
|
|
32
|
+
* fail at request time with a confusing error, so we surface it early.
|
|
13
33
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
prefix
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
buildRequest: ({ modelId, messages, opts, apiKey, signal }) => {
|
|
22
|
-
const system = messages
|
|
23
|
-
.filter((message) => message.role === "system")
|
|
24
|
-
.map((message) => message.content)
|
|
25
|
-
.join("\n");
|
|
34
|
+
export function resolveProvider(model) {
|
|
35
|
+
const slash = model.indexOf("/");
|
|
36
|
+
if (slash > 0) {
|
|
37
|
+
const prefix = model.slice(0, slash).toLowerCase();
|
|
38
|
+
const tail = model.slice(slash + 1);
|
|
39
|
+
const spec = providerByPrefix(prefix);
|
|
40
|
+
if (spec) {
|
|
26
41
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
signal,
|
|
31
|
-
headers: {
|
|
32
|
-
"content-type": "application/json",
|
|
33
|
-
"x-api-key": apiKey,
|
|
34
|
-
"anthropic-version": "2023-06-01",
|
|
35
|
-
},
|
|
36
|
-
body: JSON.stringify({
|
|
37
|
-
model: modelId,
|
|
38
|
-
max_tokens: opts.maxTokens ?? 256,
|
|
39
|
-
...(system ? { system } : {}),
|
|
40
|
-
messages: messages
|
|
41
|
-
.filter((message) => message.role !== "system")
|
|
42
|
-
.map((message) => ({ role: message.role, content: message.content })),
|
|
43
|
-
}),
|
|
44
|
-
},
|
|
42
|
+
provider: spec.prefix,
|
|
43
|
+
modelId: tail,
|
|
44
|
+
api: spec.api,
|
|
45
45
|
};
|
|
46
|
+
}
|
|
47
|
+
throw new Error(`llm helper: unsupported provider prefix "${prefix}" ` +
|
|
48
|
+
`(registered: ${PROVIDERS.map((p) => p.prefix).join(", ")})`);
|
|
49
|
+
}
|
|
50
|
+
// Bare model id — fall back to inference by name. OpenRouter's nested
|
|
51
|
+
// `vendor/model` ids are handled above (its prefix is "openrouter").
|
|
52
|
+
if (/^claude/i.test(model)) {
|
|
53
|
+
return { provider: "anthropic", modelId: model, api: "anthropic-messages" };
|
|
54
|
+
}
|
|
55
|
+
if (/^gpt/i.test(model) || /^o\d/.test(model)) {
|
|
56
|
+
return { provider: "openai", modelId: model, api: "openai-completions" };
|
|
57
|
+
}
|
|
58
|
+
// Anything else: assume OpenAI-completions shape against an OpenAI endpoint.
|
|
59
|
+
return { provider: "openai", modelId: model, api: "openai-completions" };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the model id for a tiny one-shot helper call (classifier / screener).
|
|
63
|
+
* Prefers explicit per-task overrides from OPENCODE_MODELS, then the first
|
|
64
|
+
* configured provider in `PROVIDERS` order (registry order: Anthropic first,
|
|
65
|
+
* then OpenAI, OpenRouter, then the rest — see `src/providers.ts`).
|
|
66
|
+
*/
|
|
67
|
+
export function defaultFastModel(taskType) {
|
|
68
|
+
if (taskType) {
|
|
69
|
+
const override = readOpencodeModelOverride(taskType);
|
|
70
|
+
if (override)
|
|
71
|
+
return override;
|
|
72
|
+
}
|
|
73
|
+
for (const spec of PROVIDERS) {
|
|
74
|
+
if (process.env[spec.envKey])
|
|
75
|
+
return `${spec.prefix}/${spec.fastModel}`;
|
|
76
|
+
}
|
|
77
|
+
// No keys set — fall back to the OpenAI default; chat() will then throw a
|
|
78
|
+
// clear "OPENAI_API_KEY not set" error at call time.
|
|
79
|
+
const openaiSpec = providerByPrefix("openai");
|
|
80
|
+
return `${openaiSpec.prefix}/${openaiSpec.fastModel}`;
|
|
81
|
+
}
|
|
82
|
+
function readOpencodeModelOverride(taskType) {
|
|
83
|
+
const raw = process.env.OPENCODE_MODELS;
|
|
84
|
+
if (!raw)
|
|
85
|
+
return undefined;
|
|
86
|
+
try {
|
|
87
|
+
const parsed = JSON.parse(raw);
|
|
88
|
+
const v = parsed?.[taskType];
|
|
89
|
+
return typeof v === "string" ? v : undefined;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ── Request builders ────────────────────────────────────────────────────────
|
|
96
|
+
function apiKeyFor(spec) {
|
|
97
|
+
const apiKey = process.env[spec.envKey];
|
|
98
|
+
if (!apiKey)
|
|
99
|
+
throw new Error(`${spec.envKey} not set`);
|
|
100
|
+
return apiKey;
|
|
101
|
+
}
|
|
102
|
+
/** Append `/messages` (Anthropic-style) taking baseUrl shape into account. */
|
|
103
|
+
function anthropicUrl(spec) {
|
|
104
|
+
return spec.baseUrl.endsWith("/v1")
|
|
105
|
+
? `${spec.baseUrl}/messages`
|
|
106
|
+
: `${spec.baseUrl}/v1/messages`;
|
|
107
|
+
}
|
|
108
|
+
/** Append `/chat/completions` (OpenAI-style). */
|
|
109
|
+
function openaiUrl(spec) {
|
|
110
|
+
return `${spec.baseUrl}/chat/completions`;
|
|
111
|
+
}
|
|
112
|
+
function buildRequest(spec, modelId, messages, opts, apiKey, signal) {
|
|
113
|
+
if (spec.api === "anthropic-messages") {
|
|
114
|
+
return buildAnthropicMessages({ spec, modelId, messages, opts, apiKey, signal });
|
|
115
|
+
}
|
|
116
|
+
return buildOpenaiCompletions({ spec, modelId, messages, opts, apiKey, signal });
|
|
117
|
+
}
|
|
118
|
+
function buildAnthropicMessages(args) {
|
|
119
|
+
const { spec, modelId, messages, opts, apiKey, signal } = args;
|
|
120
|
+
const system = messages
|
|
121
|
+
.filter((m) => m.role === "system")
|
|
122
|
+
.map((m) => m.content)
|
|
123
|
+
.join("\n");
|
|
124
|
+
return {
|
|
125
|
+
url: anthropicUrl(spec),
|
|
126
|
+
init: {
|
|
127
|
+
method: "POST",
|
|
128
|
+
signal,
|
|
129
|
+
headers: {
|
|
130
|
+
"content-type": "application/json",
|
|
131
|
+
"x-api-key": apiKey,
|
|
132
|
+
"anthropic-version": "2023-06-01",
|
|
133
|
+
},
|
|
134
|
+
body: JSON.stringify({
|
|
135
|
+
model: modelId,
|
|
136
|
+
max_tokens: opts.maxTokens ?? 256,
|
|
137
|
+
...(system ? { system } : {}),
|
|
138
|
+
messages: messages
|
|
139
|
+
.filter((m) => m.role !== "system")
|
|
140
|
+
.map((m) => ({ role: m.role, content: m.content })),
|
|
141
|
+
}),
|
|
46
142
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function buildOpenaiCompletions(args) {
|
|
146
|
+
const { spec, modelId, messages, opts, apiKey, signal } = args;
|
|
147
|
+
// OpenAI's `max_completion_tokens` (newer family) vs. the cross-provider
|
|
148
|
+
// `max_tokens`. Almost every OpenAI-completions provider accepts `max_tokens`;
|
|
149
|
+
// OpenAI itself prefers `max_completion_tokens` so we surface that as a
|
|
150
|
+
// per-provider override in the registry.
|
|
151
|
+
const maxField = spec.maxTokensField ?? "max_tokens";
|
|
152
|
+
const headers = {
|
|
153
|
+
"content-type": "application/json",
|
|
154
|
+
authorization: `Bearer ${apiKey}`,
|
|
155
|
+
};
|
|
156
|
+
if (spec.extraHeaders) {
|
|
157
|
+
for (const [k, v] of Object.entries(spec.extraHeaders))
|
|
158
|
+
headers[k] = v;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
url: openaiUrl(spec),
|
|
162
|
+
init: {
|
|
163
|
+
method: "POST",
|
|
164
|
+
signal,
|
|
165
|
+
headers,
|
|
166
|
+
body: JSON.stringify({
|
|
167
|
+
model: modelId,
|
|
168
|
+
[maxField]: opts.maxTokens ?? 256,
|
|
169
|
+
messages,
|
|
170
|
+
}),
|
|
53
171
|
},
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
max_completion_tokens: opts.maxTokens ?? 256,
|
|
73
|
-
messages,
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
}),
|
|
77
|
-
extractText: (data) => data.choices?.[0]?.message?.content ?? "",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "openrouter",
|
|
81
|
-
prefix: "openrouter",
|
|
82
|
-
envKey: "OPENROUTER_API_KEY",
|
|
83
|
-
defaultModel: "openrouter/google/gemini-2.5-flash",
|
|
84
|
-
resolveModelId: () => undefined,
|
|
85
|
-
buildRequest: ({ modelId, messages, opts, apiKey, signal }) => ({
|
|
86
|
-
url: "https://openrouter.ai/api/v1/chat/completions",
|
|
87
|
-
init: {
|
|
88
|
-
method: "POST",
|
|
89
|
-
signal,
|
|
90
|
-
headers: {
|
|
91
|
-
"content-type": "application/json",
|
|
92
|
-
authorization: `Bearer ${apiKey}`,
|
|
93
|
-
"HTTP-Referer": "https://github.com/cliftonc/lastlight",
|
|
94
|
-
"X-Title": "Last Light",
|
|
95
|
-
},
|
|
96
|
-
body: JSON.stringify({
|
|
97
|
-
model: modelId,
|
|
98
|
-
max_tokens: opts.maxTokens ?? 256,
|
|
99
|
-
messages,
|
|
100
|
-
}),
|
|
101
|
-
},
|
|
102
|
-
}),
|
|
103
|
-
extractText: (data) => data.choices?.[0]?.message?.content ?? "",
|
|
104
|
-
},
|
|
105
|
-
];
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
// ── Response extractors ─────────────────────────────────────────────────────
|
|
175
|
+
function extractAnthropicText(data) {
|
|
176
|
+
const content = data.content ?? [];
|
|
177
|
+
return content
|
|
178
|
+
.filter((block) => block.type === "text" && typeof block.text === "string")
|
|
179
|
+
.map((block) => block.text)
|
|
180
|
+
.join("");
|
|
181
|
+
}
|
|
182
|
+
function extractOpenaiText(data) {
|
|
183
|
+
return (data.choices?.[0]?.message?.content ??
|
|
184
|
+
"");
|
|
185
|
+
}
|
|
186
|
+
function extractText(spec, data) {
|
|
187
|
+
return spec.api === "anthropic-messages" ? extractAnthropicText(data) : extractOpenaiText(data);
|
|
188
|
+
}
|
|
189
|
+
// ── Public API ───────────────────────────────────────────────────────────────
|
|
106
190
|
/**
|
|
107
191
|
* Make a provider-agnostic chat call and return the final assistant text.
|
|
108
192
|
*
|
|
109
193
|
* @throws if the relevant API key isn't set or the upstream returns non-2xx
|
|
110
194
|
*/
|
|
111
195
|
export async function chat(model, messages, opts = {}) {
|
|
112
|
-
const { provider, modelId } = resolveProvider(model);
|
|
113
|
-
const
|
|
196
|
+
const { provider, modelId, api } = resolveProvider(model);
|
|
197
|
+
const spec = providerByPrefix(provider);
|
|
198
|
+
// For bare-id inference where the prefix isn't in the registry (the
|
|
199
|
+
// generic "assume OpenAI" fallback), synthesize a pseudo-spec so the
|
|
200
|
+
// OpenAI-completions builder still runs.
|
|
201
|
+
const resolvedSpec = spec ?? {
|
|
202
|
+
prefix: provider,
|
|
203
|
+
displayName: provider,
|
|
204
|
+
envKey: "OPENAI_API_KEY",
|
|
205
|
+
baseUrl: "https://api.openai.com/v1",
|
|
206
|
+
api,
|
|
207
|
+
host: "openai.com",
|
|
208
|
+
fastModel: modelId,
|
|
209
|
+
sampleModel: modelId,
|
|
210
|
+
};
|
|
114
211
|
return withRetry(async (signal) => {
|
|
115
|
-
const apiKey = apiKeyFor(
|
|
116
|
-
const { url, init } =
|
|
212
|
+
const apiKey = apiKeyFor(resolvedSpec);
|
|
213
|
+
const { url, init } = buildRequest(resolvedSpec, modelId, messages, opts, apiKey, signal);
|
|
117
214
|
const res = await fetch(url, init);
|
|
118
215
|
if (!res.ok) {
|
|
119
216
|
const text = await res.text().catch(() => "");
|
|
120
|
-
throw new Error(`${
|
|
217
|
+
throw new Error(`${resolvedSpec.prefix} api ${res.status}: ${text}`);
|
|
121
218
|
}
|
|
122
219
|
const data = await res.json();
|
|
123
|
-
return
|
|
220
|
+
return extractText(resolvedSpec, data);
|
|
124
221
|
}, opts.timeoutMs ?? 30_000);
|
|
125
222
|
}
|
|
126
223
|
/** Compatibility wrapper for older single-turn call sites. */
|
|
@@ -156,66 +253,4 @@ async function withRetry(call, timeoutMs) {
|
|
|
156
253
|
// Unreachable — loop either returns or throws.
|
|
157
254
|
throw new Error("chat: retry loop fell through");
|
|
158
255
|
}
|
|
159
|
-
/**
|
|
160
|
-
* Resolve the model id for a tiny one-shot helper call (classifier / screener).
|
|
161
|
-
* Prefers explicit per-task overrides from OPENCODE_MODELS, then the first
|
|
162
|
-
* configured provider in PROVIDERS order. That registry is the single source
|
|
163
|
-
* of precedence (currently anthropic > openai > openrouter).
|
|
164
|
-
*/
|
|
165
|
-
export function defaultFastModel(taskType) {
|
|
166
|
-
if (taskType) {
|
|
167
|
-
const override = readOpencodeModelOverride(taskType);
|
|
168
|
-
if (override)
|
|
169
|
-
return override;
|
|
170
|
-
}
|
|
171
|
-
for (const adapter of PROVIDERS) {
|
|
172
|
-
if (process.env[adapter.envKey])
|
|
173
|
-
return adapter.defaultModel;
|
|
174
|
-
}
|
|
175
|
-
// No keys set — fall back to the OpenAI default; chat() will then throw a
|
|
176
|
-
// clear "OPENAI_API_KEY not set" error at call time.
|
|
177
|
-
return adapterFor("openai").defaultModel;
|
|
178
|
-
}
|
|
179
|
-
function readOpencodeModelOverride(taskType) {
|
|
180
|
-
const raw = process.env.OPENCODE_MODELS;
|
|
181
|
-
if (!raw)
|
|
182
|
-
return undefined;
|
|
183
|
-
try {
|
|
184
|
-
const parsed = JSON.parse(raw);
|
|
185
|
-
const v = parsed?.[taskType];
|
|
186
|
-
return typeof v === "string" ? v : undefined;
|
|
187
|
-
}
|
|
188
|
-
catch {
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
export function resolveProvider(model) {
|
|
193
|
-
const slash = model.indexOf("/");
|
|
194
|
-
if (slash > 0) {
|
|
195
|
-
const head = model.slice(0, slash).toLowerCase();
|
|
196
|
-
const tail = model.slice(slash + 1);
|
|
197
|
-
const adapter = PROVIDERS.find((candidate) => candidate.prefix === head);
|
|
198
|
-
if (adapter)
|
|
199
|
-
return { provider: adapter.name, modelId: tail };
|
|
200
|
-
throw new Error(`llm helper: unsupported provider prefix "${head}" (only "anthropic", "openai", and "openrouter" are supported)`);
|
|
201
|
-
}
|
|
202
|
-
for (const adapter of PROVIDERS) {
|
|
203
|
-
const modelId = adapter.resolveModelId(model);
|
|
204
|
-
if (modelId)
|
|
205
|
-
return { provider: adapter.name, modelId };
|
|
206
|
-
}
|
|
207
|
-
return { provider: "openai", modelId: model };
|
|
208
|
-
}
|
|
209
|
-
function adapterFor(provider) {
|
|
210
|
-
const adapter = PROVIDERS.find((candidate) => candidate.name === provider);
|
|
211
|
-
if (!adapter)
|
|
212
|
-
throw new Error(`llm helper: unsupported provider "${provider}"`);
|
|
213
|
-
return adapter;
|
|
214
|
-
}
|
|
215
|
-
function apiKeyFor(adapter) {
|
|
216
|
-
const apiKey = process.env[adapter.envKey];
|
|
217
|
-
if (!apiKey)
|
|
218
|
-
throw new Error(`${adapter.envKey} not set`);
|
|
219
|
-
return apiKey;
|
|
220
|
-
}
|
|
221
256
|
//# sourceMappingURL=llm.js.map
|