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
package/dist/engine/llm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/engine/llm.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/engine/llm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAmC,MAAM,iBAAiB,CAAC;AA6B/F,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,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AAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE;KACtC,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,SAAS,CACtB,IAA8C,EAC9C,SAAiB;IAEjB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9C,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS;gBAAE,MAAM,GAAG,CAAC;YAC3C,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAC/C,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,+CAA+C;IAC/C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider registry — single source of truth for the LLM providers Last Light
|
|
3
|
+
* knows how to wire end-to-end.
|
|
4
|
+
*
|
|
5
|
+
* pi-ai (`@earendil-works/pi-ai`) is provider-agnostic and supports 15+
|
|
6
|
+
* providers out of the box. Of those, only a subset is "wizard-able" here:
|
|
7
|
+
* they authenticate with a single API-key env var and expose a stable
|
|
8
|
+
* endpoint reachable from the sandbox egress firewall. Excluded are the
|
|
9
|
+
* OAuth-only providers (`openai-codex`, `github-copilot`), the multi-env
|
|
10
|
+
* Ambient-cred ones (`amazon-bedrock`, `google-vertex`, `azure-openai-*`,
|
|
11
|
+
* `cloudflare-*`), and the regional-CN variants.
|
|
12
|
+
*
|
|
13
|
+
* This registry is consumed by:
|
|
14
|
+
* - `src/engine/llm.ts` — the cheap one-shot helper used by the
|
|
15
|
+
* prompt screener + intent classifier. It builds requests for the
|
|
16
|
+
* `openai-completions` family (which is most wizard-able providers —
|
|
17
|
+
* Google and Mistral are routed through their OpenAI-compatible
|
|
18
|
+
* endpoints) and the `anthropic-messages` family (Kimi for Coding,
|
|
19
|
+
* MiniMax, Anthropic itself).
|
|
20
|
+
* - `src/engine/agent-executor.ts` — forwards each provider's env var
|
|
21
|
+
* into the sandbox so agentic-pi can auth.
|
|
22
|
+
* - `src/sandbox/egress-allowlist.ts` — the SNI/firewall allowlist is
|
|
23
|
+
* seeded from each provider's `host`.
|
|
24
|
+
* - `src/cli/setup.ts` — the install wizard's step-4 provider picker.
|
|
25
|
+
*
|
|
26
|
+
* Keep this list aligned with pi-ai's provider registry. When pi-ai adds a
|
|
27
|
+
* new provider that we want to surface, add an entry here and everything
|
|
28
|
+
* else (forwarding, egress, wizard UI) follows automatically.
|
|
29
|
+
*/
|
|
30
|
+
/** API request/response family pi-ai uses to talk to a provider. */
|
|
31
|
+
export type ApiType =
|
|
32
|
+
/** Anthropic Messages API — `system` field, content-block response. */
|
|
33
|
+
"anthropic-messages"
|
|
34
|
+
/** OpenAI Chat Completions API — `messages`, `choices[0].message.content`. */
|
|
35
|
+
| "openai-completions";
|
|
36
|
+
/**
|
|
37
|
+
* Metadata for one wizard-able provider. The request-building differences
|
|
38
|
+
* between OpenAI-completions-family providers (maxTokensField name,
|
|
39
|
+
* extra headers, nested-model-id quirk) are small, so they live as optional
|
|
40
|
+
* fields here rather than separate adapter objects.
|
|
41
|
+
*/
|
|
42
|
+
export interface ProviderSpec {
|
|
43
|
+
/** pi-ai model-spec prefix — the part before `/` in `provider/model`. */
|
|
44
|
+
readonly prefix: string;
|
|
45
|
+
/** Display name (shown in the wizard). */
|
|
46
|
+
readonly displayName: string;
|
|
47
|
+
/** Env var that carries the API key (also the env var forwarded into the sandbox). */
|
|
48
|
+
readonly envKey: string;
|
|
49
|
+
/** API base URL — `chat/completions` or `messages` is appended per `api`. */
|
|
50
|
+
readonly baseUrl: string;
|
|
51
|
+
/** API request/response family. */
|
|
52
|
+
readonly api: ApiType;
|
|
53
|
+
/** Egress allowlist host — apex (matches all subdomains) or specific host. */
|
|
54
|
+
readonly host: string;
|
|
55
|
+
/** Small/fast model id used by the screener + classifier cheap helper. */
|
|
56
|
+
readonly fastModel: string;
|
|
57
|
+
/** Canonical primary model id (used as the wizard placeholder). */
|
|
58
|
+
readonly sampleModel: string;
|
|
59
|
+
/** OpenAI-completions only: body field for the token cap. Default `max_tokens`. */
|
|
60
|
+
readonly maxTokensField?: "max_tokens" | "max_completion_tokens";
|
|
61
|
+
/** OpenAI-completions only: keep the nested `vendor/model` tail verbatim (OpenRouter). */
|
|
62
|
+
readonly preserveNestedModelId?: boolean;
|
|
63
|
+
/** OpenAI-completions only: extra request headers (OpenRouter's referer/title). */
|
|
64
|
+
readonly extraHeaders?: Readonly<Record<string, string>>;
|
|
65
|
+
/** Optional wizard hint for the API-key prefix (used in placeholder + loose validation). */
|
|
66
|
+
readonly keyPrefix?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The registry. Order matters — `defaultFastModel()` in `llm.ts` selects
|
|
70
|
+
* a fast model by iterating this list and picking the first provider
|
|
71
|
+
* whose env var is present. Always keep Anthropic first (best raw-latency
|
|
72
|
+
* cheap helper) then OpenAI then OpenRouter, then the rest grouped by
|
|
73
|
+
* families so the array is easy to scan.
|
|
74
|
+
*/
|
|
75
|
+
export declare const PROVIDERS: readonly ProviderSpec[];
|
|
76
|
+
export declare function providerByPrefix(prefix: string): ProviderSpec | undefined;
|
|
77
|
+
export declare function providerByEnvKey(envKey: string): ProviderSpec | undefined;
|
|
78
|
+
/** All the env var names a harness must forward to reach every registered provider. */
|
|
79
|
+
export declare const PROVIDER_ENV_KEYS: readonly string[];
|
|
80
|
+
/** All the hosts the sandbox egress firewall must allowlist to reach these providers. */
|
|
81
|
+
export declare const PROVIDER_HOSTS: readonly string[];
|
|
82
|
+
/**
|
|
83
|
+
* Default model spec shipped with the harness. Keep aligned with the
|
|
84
|
+
* `OPENCODE_MODEL` default in `config/default.yaml` and the wizard's
|
|
85
|
+
* initial provider selection.
|
|
86
|
+
*/
|
|
87
|
+
export declare const DEFAULT_PROVIDER = "anthropic";
|
|
88
|
+
export declare const DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider registry — single source of truth for the LLM providers Last Light
|
|
3
|
+
* knows how to wire end-to-end.
|
|
4
|
+
*
|
|
5
|
+
* pi-ai (`@earendil-works/pi-ai`) is provider-agnostic and supports 15+
|
|
6
|
+
* providers out of the box. Of those, only a subset is "wizard-able" here:
|
|
7
|
+
* they authenticate with a single API-key env var and expose a stable
|
|
8
|
+
* endpoint reachable from the sandbox egress firewall. Excluded are the
|
|
9
|
+
* OAuth-only providers (`openai-codex`, `github-copilot`), the multi-env
|
|
10
|
+
* Ambient-cred ones (`amazon-bedrock`, `google-vertex`, `azure-openai-*`,
|
|
11
|
+
* `cloudflare-*`), and the regional-CN variants.
|
|
12
|
+
*
|
|
13
|
+
* This registry is consumed by:
|
|
14
|
+
* - `src/engine/llm.ts` — the cheap one-shot helper used by the
|
|
15
|
+
* prompt screener + intent classifier. It builds requests for the
|
|
16
|
+
* `openai-completions` family (which is most wizard-able providers —
|
|
17
|
+
* Google and Mistral are routed through their OpenAI-compatible
|
|
18
|
+
* endpoints) and the `anthropic-messages` family (Kimi for Coding,
|
|
19
|
+
* MiniMax, Anthropic itself).
|
|
20
|
+
* - `src/engine/agent-executor.ts` — forwards each provider's env var
|
|
21
|
+
* into the sandbox so agentic-pi can auth.
|
|
22
|
+
* - `src/sandbox/egress-allowlist.ts` — the SNI/firewall allowlist is
|
|
23
|
+
* seeded from each provider's `host`.
|
|
24
|
+
* - `src/cli/setup.ts` — the install wizard's step-4 provider picker.
|
|
25
|
+
*
|
|
26
|
+
* Keep this list aligned with pi-ai's provider registry. When pi-ai adds a
|
|
27
|
+
* new provider that we want to surface, add an entry here and everything
|
|
28
|
+
* else (forwarding, egress, wizard UI) follows automatically.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The registry. Order matters — `defaultFastModel()` in `llm.ts` selects
|
|
32
|
+
* a fast model by iterating this list and picking the first provider
|
|
33
|
+
* whose env var is present. Always keep Anthropic first (best raw-latency
|
|
34
|
+
* cheap helper) then OpenAI then OpenRouter, then the rest grouped by
|
|
35
|
+
* families so the array is easy to scan.
|
|
36
|
+
*/
|
|
37
|
+
export const PROVIDERS = [
|
|
38
|
+
// ── Anthropic-messages family ───────────────────────────────────────
|
|
39
|
+
{
|
|
40
|
+
prefix: "anthropic",
|
|
41
|
+
displayName: "Anthropic",
|
|
42
|
+
envKey: "ANTHROPIC_API_KEY",
|
|
43
|
+
baseUrl: "https://api.anthropic.com/v1",
|
|
44
|
+
api: "anthropic-messages",
|
|
45
|
+
host: "anthropic.com",
|
|
46
|
+
fastModel: "claude-haiku-4-5-20251001",
|
|
47
|
+
sampleModel: "claude-sonnet-4-6",
|
|
48
|
+
keyPrefix: "sk-ant-",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
prefix: "kimi-coding",
|
|
52
|
+
displayName: "Kimi for Coding (Moonshot)",
|
|
53
|
+
envKey: "KIMI_API_KEY",
|
|
54
|
+
baseUrl: "https://api.kimi.com/coding",
|
|
55
|
+
api: "anthropic-messages",
|
|
56
|
+
host: "kimi.com",
|
|
57
|
+
fastModel: "kimi-latest",
|
|
58
|
+
sampleModel: "kimi-latest",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
prefix: "minimax",
|
|
62
|
+
displayName: "MiniMax",
|
|
63
|
+
envKey: "MINIMAX_API_KEY",
|
|
64
|
+
baseUrl: "https://api.minimax.io/anthropic",
|
|
65
|
+
api: "anthropic-messages",
|
|
66
|
+
host: "minimax.io",
|
|
67
|
+
fastModel: "MiniMax-M1",
|
|
68
|
+
sampleModel: "MiniMax-M2",
|
|
69
|
+
},
|
|
70
|
+
// ── OpenAI-completions family — first-party OpenAI ──────────────────
|
|
71
|
+
{
|
|
72
|
+
prefix: "openai",
|
|
73
|
+
displayName: "OpenAI",
|
|
74
|
+
envKey: "OPENAI_API_KEY",
|
|
75
|
+
baseUrl: "https://api.openai.com/v1",
|
|
76
|
+
api: "openai-completions",
|
|
77
|
+
host: "openai.com",
|
|
78
|
+
fastModel: "gpt-5.4-mini",
|
|
79
|
+
sampleModel: "gpt-5.5",
|
|
80
|
+
maxTokensField: "max_completion_tokens",
|
|
81
|
+
keyPrefix: "sk-",
|
|
82
|
+
},
|
|
83
|
+
// ── Google Gemini — routed through Google's OpenAI-compatible endpoint ──
|
|
84
|
+
{
|
|
85
|
+
prefix: "google",
|
|
86
|
+
displayName: "Google AI Studio (Gemini)",
|
|
87
|
+
envKey: "GEMINI_API_KEY",
|
|
88
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
89
|
+
api: "openai-completions",
|
|
90
|
+
host: "generativelanguage.googleapis.com",
|
|
91
|
+
fastModel: "gemini-2.5-flash",
|
|
92
|
+
sampleModel: "gemini-2.5-pro",
|
|
93
|
+
keyPrefix: "AIza",
|
|
94
|
+
},
|
|
95
|
+
// ── Mistral — Mistral exposes an OpenAI-compatible path ──────────────
|
|
96
|
+
{
|
|
97
|
+
prefix: "mistral",
|
|
98
|
+
displayName: "Mistral",
|
|
99
|
+
envKey: "MISTRAL_API_KEY",
|
|
100
|
+
baseUrl: "https://api.mistral.ai/v1",
|
|
101
|
+
api: "openai-completions",
|
|
102
|
+
host: "mistral.ai",
|
|
103
|
+
fastModel: "mistral-small-latest",
|
|
104
|
+
sampleModel: "mistral-large-latest",
|
|
105
|
+
},
|
|
106
|
+
// ── OpenAI-compatible inference specialists ──────────────────────────
|
|
107
|
+
{
|
|
108
|
+
prefix: "groq",
|
|
109
|
+
displayName: "Groq",
|
|
110
|
+
envKey: "GROQ_API_KEY",
|
|
111
|
+
baseUrl: "https://api.groq.com/openai/v1",
|
|
112
|
+
api: "openai-completions",
|
|
113
|
+
host: "groq.com",
|
|
114
|
+
fastModel: "llama-3.3-70b-versatile",
|
|
115
|
+
sampleModel: "llama-3.3-70b-versatile",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
prefix: "cerebras",
|
|
119
|
+
displayName: "Cerebras",
|
|
120
|
+
envKey: "CEREBRAS_API_KEY",
|
|
121
|
+
baseUrl: "https://api.cerebras.ai/v1",
|
|
122
|
+
api: "openai-completions",
|
|
123
|
+
host: "cerebras.ai",
|
|
124
|
+
fastModel: "llama-3.3-70b",
|
|
125
|
+
sampleModel: "llama-3.3-70b",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
prefix: "xai",
|
|
129
|
+
displayName: "xAI (Grok)",
|
|
130
|
+
envKey: "XAI_API_KEY",
|
|
131
|
+
baseUrl: "https://api.x.ai/v1",
|
|
132
|
+
api: "openai-completions",
|
|
133
|
+
host: "x.ai",
|
|
134
|
+
fastModel: "grok-3-mini",
|
|
135
|
+
sampleModel: "grok-4",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
prefix: "huggingface",
|
|
139
|
+
displayName: "Hugging Face",
|
|
140
|
+
envKey: "HF_TOKEN",
|
|
141
|
+
baseUrl: "https://router.huggingface.co/v1",
|
|
142
|
+
api: "openai-completions",
|
|
143
|
+
host: "huggingface.co",
|
|
144
|
+
fastModel: "meta-llama/Llama-3.3-70B-Instruct",
|
|
145
|
+
sampleModel: "meta-llama/Llama-3.3-70B-Instruct",
|
|
146
|
+
keyPrefix: "hf_",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
prefix: "moonshotai",
|
|
150
|
+
displayName: "Moonshot AI",
|
|
151
|
+
envKey: "MOONSHOT_API_KEY",
|
|
152
|
+
baseUrl: "https://api.moonshot.ai/v1",
|
|
153
|
+
api: "openai-completions",
|
|
154
|
+
host: "moonshot.ai",
|
|
155
|
+
fastModel: "kimi-k2",
|
|
156
|
+
sampleModel: "kimi-k2",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
prefix: "nvidia",
|
|
160
|
+
displayName: "NVIDIA NIM",
|
|
161
|
+
envKey: "NVIDIA_API_KEY",
|
|
162
|
+
baseUrl: "https://integrate.api.nvidia.com/v1",
|
|
163
|
+
api: "openai-completions",
|
|
164
|
+
host: "integrate.api.nvidia.com",
|
|
165
|
+
fastModel: "meta/llama-3.3-70b-instruct",
|
|
166
|
+
sampleModel: "meta/llama-3.3-70b-instruct",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
prefix: "fireworks",
|
|
170
|
+
displayName: "Fireworks",
|
|
171
|
+
envKey: "FIREWORKS_API_KEY",
|
|
172
|
+
baseUrl: "https://api.fireworks.ai/inference/v1",
|
|
173
|
+
api: "openai-completions",
|
|
174
|
+
host: "fireworks.ai",
|
|
175
|
+
fastModel: "accounts/fireworks/models/llama-v3p3-70b-instruct",
|
|
176
|
+
sampleModel: "accounts/fireworks/models/llama-v3p3-70b-instruct",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
prefix: "together",
|
|
180
|
+
displayName: "Together",
|
|
181
|
+
envKey: "TOGETHER_API_KEY",
|
|
182
|
+
baseUrl: "https://api.together.ai/v1",
|
|
183
|
+
api: "openai-completions",
|
|
184
|
+
host: "together.ai",
|
|
185
|
+
fastModel: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
186
|
+
sampleModel: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
prefix: "deepseek",
|
|
190
|
+
displayName: "DeepSeek",
|
|
191
|
+
envKey: "DEEPSEEK_API_KEY",
|
|
192
|
+
baseUrl: "https://api.deepseek.com/v1",
|
|
193
|
+
api: "openai-completions",
|
|
194
|
+
host: "deepseek.com",
|
|
195
|
+
fastModel: "deepseek-chat",
|
|
196
|
+
sampleModel: "deepseek-chat",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
prefix: "zai",
|
|
200
|
+
displayName: "Z.AI (GLM)",
|
|
201
|
+
envKey: "ZAI_API_KEY",
|
|
202
|
+
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
|
203
|
+
api: "openai-completions",
|
|
204
|
+
host: "z.ai",
|
|
205
|
+
fastModel: "glm-4.6",
|
|
206
|
+
sampleModel: "glm-4.6",
|
|
207
|
+
},
|
|
208
|
+
// ── OpenRouter — aggregator (take any pi.dev-listed model via one key) ──
|
|
209
|
+
{
|
|
210
|
+
prefix: "openrouter",
|
|
211
|
+
displayName: "OpenRouter (aggregator — Anthropic, Google, xAI, …)",
|
|
212
|
+
envKey: "OPENROUTER_API_KEY",
|
|
213
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
214
|
+
api: "openai-completions",
|
|
215
|
+
host: "openrouter.ai",
|
|
216
|
+
fastModel: "google/gemini-2.5-flash",
|
|
217
|
+
sampleModel: "anthropic/claude-sonnet-4.5",
|
|
218
|
+
preserveNestedModelId: true,
|
|
219
|
+
extraHeaders: {
|
|
220
|
+
"HTTP-Referer": "https://github.com/nearform/lastlight",
|
|
221
|
+
"X-Title": "Last Light",
|
|
222
|
+
},
|
|
223
|
+
keyPrefix: "sk-or-",
|
|
224
|
+
},
|
|
225
|
+
];
|
|
226
|
+
const PREFIX_INDEX = new Map(PROVIDERS.map((p) => [p.prefix, p]));
|
|
227
|
+
const ENV_INDEX = new Map(PROVIDERS.map((p) => [p.envKey, p]));
|
|
228
|
+
export function providerByPrefix(prefix) {
|
|
229
|
+
return PREFIX_INDEX.get(prefix.toLowerCase());
|
|
230
|
+
}
|
|
231
|
+
export function providerByEnvKey(envKey) {
|
|
232
|
+
return ENV_INDEX.get(envKey);
|
|
233
|
+
}
|
|
234
|
+
/** All the env var names a harness must forward to reach every registered provider. */
|
|
235
|
+
export const PROVIDER_ENV_KEYS = PROVIDERS.map((p) => p.envKey);
|
|
236
|
+
/** All the hosts the sandbox egress firewall must allowlist to reach these providers. */
|
|
237
|
+
export const PROVIDER_HOSTS = PROVIDERS.map((p) => p.host);
|
|
238
|
+
/**
|
|
239
|
+
* Default model spec shipped with the harness. Keep aligned with the
|
|
240
|
+
* `OPENCODE_MODEL` default in `config/default.yaml` and the wizard's
|
|
241
|
+
* initial provider selection.
|
|
242
|
+
*/
|
|
243
|
+
export const DEFAULT_PROVIDER = "anthropic";
|
|
244
|
+
export const DEFAULT_MODEL = "anthropic/claude-sonnet-4-6";
|
|
245
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA0CH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAA4B;IAChD,uEAAuE;IACvE;QACE,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,WAAW;QACxB,MAAM,EAAE,mBAAmB;QAC3B,OAAO,EAAE,8BAA8B;QACvC,GAAG,EAAE,oBAAoB;QACzB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,2BAA2B;QACtC,WAAW,EAAE,mBAAmB;QAChC,SAAS,EAAE,SAAS;KACrB;IACD;QACE,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,4BAA4B;QACzC,MAAM,EAAE,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,CAC1B,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CACpC,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CACpC,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAsB,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAsB,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,6BAA6B,CAAC"}
|
|
@@ -43,6 +43,11 @@ export declare const GITHUB_HOSTS: readonly string[];
|
|
|
43
43
|
* so the call originates from the host and these hosts aren't strictly
|
|
44
44
|
* required inside the VM — they're kept here so a single allowlist can
|
|
45
45
|
* cover both paths without surprises.
|
|
46
|
+
*
|
|
47
|
+
* The list is derived from the provider registry (`src/providers.ts`) —
|
|
48
|
+
* every wizard-able provider has a `host` entry there, so adding a new
|
|
49
|
+
* provider automatically seeds this allowlist. Each entry matches the
|
|
50
|
+
* apex AND all subdomains (see `normalizeAllowlistHost`).
|
|
46
51
|
*/
|
|
47
52
|
export declare const PROVIDER_HOSTS: readonly string[];
|
|
48
53
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isIP } from "node:net";
|
|
2
|
+
import { PROVIDER_HOSTS as REGISTRY_PROVIDER_HOSTS } from "../providers.js";
|
|
2
3
|
/**
|
|
3
4
|
* Single source of truth for sandbox HTTP egress allowlists.
|
|
4
5
|
*
|
|
@@ -49,14 +50,13 @@ export const GITHUB_HOSTS = [
|
|
|
49
50
|
* so the call originates from the host and these hosts aren't strictly
|
|
50
51
|
* required inside the VM — they're kept here so a single allowlist can
|
|
51
52
|
* cover both paths without surprises.
|
|
53
|
+
*
|
|
54
|
+
* The list is derived from the provider registry (`src/providers.ts`) —
|
|
55
|
+
* every wizard-able provider has a `host` entry there, so adding a new
|
|
56
|
+
* provider automatically seeds this allowlist. Each entry matches the
|
|
57
|
+
* apex AND all subdomains (see `normalizeAllowlistHost`).
|
|
52
58
|
*/
|
|
53
|
-
export const PROVIDER_HOSTS =
|
|
54
|
-
"anthropic.com",
|
|
55
|
-
"openai.com",
|
|
56
|
-
"openrouter.ai",
|
|
57
|
-
// Fireworks — api.fireworks.ai is the inference endpoint.
|
|
58
|
-
"fireworks.ai",
|
|
59
|
-
];
|
|
59
|
+
export const PROVIDER_HOSTS = REGISTRY_PROVIDER_HOSTS;
|
|
60
60
|
/**
|
|
61
61
|
* Public package registries the executor may hit during `npm install`,
|
|
62
62
|
* etc. Apex-plus-subdomain matching covers auth / CDN / mirror
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"egress-allowlist.js","sourceRoot":"","sources":["../../src/sandbox/egress-allowlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"egress-allowlist.js","sourceRoot":"","sources":["../../src/sandbox/egress-allowlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA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AC;QAC5C,MAAM,IAAI,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lastlight",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "GitHub repository maintenance agent — Agent SDK harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/
|
|
33
|
+
"url": "git+https://github.com/nearform/lastlight.git"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|
|
36
36
|
"github",
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin.json",
|
|
3
3
|
"name": "lastlight",
|
|
4
4
|
"displayName": "Last Light",
|
|
5
|
-
"version": "0.10.
|
|
5
|
+
"version": "0.10.4",
|
|
6
6
|
"description": "Install, configure and operate Last Light (GitHub maintenance agent) — its server, CLI client, deployment overlay, and the Last Light Evals harness.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Clifton Cunningham"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://github.com/
|
|
11
|
-
"repository": "https://github.com/
|
|
10
|
+
"homepage": "https://github.com/nearform/lastlight",
|
|
11
|
+
"repository": "https://github.com/nearform/lastlight",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"lastlight",
|
|
@@ -34,7 +34,7 @@ lastlight skills install --scope project # → ./.claude/skills (this repo onl
|
|
|
34
34
|
**Via the Claude Code plugin marketplace** (from a checkout of this repo):
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
claude plugin marketplace add ./ # or:
|
|
37
|
+
claude plugin marketplace add ./ # or: nearform/lastlight if public
|
|
38
38
|
claude plugin install lastlight@lastlight-skills
|
|
39
39
|
```
|
|
40
40
|
|