@coreplane/switchboard 1.232.0 → 1.233.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.
@@ -5,6 +5,8 @@ SLACK_APP_TOKEN=xapp-...
5
5
  # Providers (referenced by apiKeyEnv in config.yaml)
6
6
  ANTHROPIC_API_KEY=sk-ant-...
7
7
  OPENAI_API_KEY=sk-...
8
+ # OpenRouter (optional): the key behind the example's `openrouter` provider block; `init --openrouter-key` fills it.
9
+ # OPENROUTER_API_KEY=sk-or-...
8
10
 
9
11
  # Sandboxed execution (execution.type: e2b in config.yaml)
10
12
  E2B_API_KEY=e2b_...
@@ -20,18 +20,20 @@ providers:
20
20
  # type: openai-compatible
21
21
  # baseUrl: https://api.groq.com/openai/v1
22
22
  # apiKeyEnv: GROQ_API_KEY
23
- # OpenRouter: one key, many vendors' models. Its model ids already carry the
24
- # vendor, so a model is named openrouter/anthropic/claude-sonnet-4 (the first
25
- # slash separates the provider; the rest is passed through). The compatible
26
- # adapter sends no effort tier, turns document inputs into a text note and
27
- # asks for no provider-side prompt caching. The request router and memory
28
- # reflection reach it through pi's model library instead (the same block,
29
- # the same key), which applies its own OpenRouter rules there, prompt-cache
30
- # markers included.
31
- # openrouter:
32
- # type: openai-compatible
33
- # baseUrl: https://openrouter.ai/api/v1
34
- # apiKeyEnv: OPENROUTER_API_KEY
23
+ # OpenRouter: one key, many vendors' models, on the same compatible adapter.
24
+ # Its model ids already carry the vendor, so any preset's model may be
25
+ # openrouter/<vendor>/<model> — e.g. openrouter/anthropic/claude-sonnet-4:
26
+ # the first slash names this block, the rest is the model id passed through.
27
+ # OPENROUTER_API_KEY is read at the first model call, never at load, so
28
+ # without it every other block runs as today and only a run on this one
29
+ # fails, by that name. Effort tiers, documents and prompt caching ride the
30
+ # compatible adapter as far as it carries them: pi applies its OpenRouter
31
+ # rules (prompt-cache markers included); a document becomes a text note.
32
+ # `switchboard init` keeps this block only with --openrouter-key.
33
+ openrouter:
34
+ type: openai-compatible
35
+ baseUrl: https://openrouter.ai/api/v1
36
+ apiKeyEnv: OPENROUTER_API_KEY
35
37
  # local:
36
38
  # type: openai-compatible
37
39
  # baseUrl: http://localhost:11434/v1 # Ollama
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "switchboard",
3
- "version": "1.232.0",
3
+ "version": "1.233.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "switchboard",
9
- "version": "1.232.0",
9
+ "version": "1.233.0",
10
10
  "license": "Apache-2.0",
11
11
  "workspaces": [
12
12
  "web",
@@ -20032,7 +20032,7 @@
20032
20032
  },
20033
20033
  "packages/switchboard": {
20034
20034
  "name": "@coreplane/switchboard",
20035
- "version": "1.232.0",
20035
+ "version": "1.233.0",
20036
20036
  "license": "Apache-2.0",
20037
20037
  "dependencies": {
20038
20038
  "@earendil-works/pi-ai": "0.85.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchboard",
3
- "version": "1.232.0",
3
+ "version": "1.233.0",
4
4
  "private": true,
5
5
  "description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
6
6
  "license": "Apache-2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.232.0",
3
- "commit": "d61cfe3bf51e3ff2a69387412add020b4182875d",
4
- "builtAt": "2026-09-16T15:02:34.038Z"
2
+ "version": "1.233.0",
3
+ "commit": "4c96f69d476e76e2bc768a9eb6d505b683fddd36",
4
+ "builtAt": "2026-09-16T15:18:25.322Z"
5
5
  }
package/dist/cli.js CHANGED
@@ -22479,6 +22479,10 @@ function answerProblems(a) {
22479
22479
  problems.push(
22480
22480
  "a model provider is needed: --anthropic-key <key>, or --openai-compatible <baseUrl> --model <name> [--model-key <key>]"
22481
22481
  );
22482
+ if (!anthropic && !endpoint3 && a.openrouterKey !== void 0)
22483
+ problems.push(
22484
+ "--openrouter-key keeps the example's openrouter block beside the provider the default models run on; alone it names no default model \u2014 add --anthropic-key <key>, or run every agent on OpenRouter with --openai-compatible https://openrouter.ai/api/v1 --model <vendor>/<model> --model-key <key>"
22485
+ );
22482
22486
  if (endpoint3 && !anthropic && a.model === void 0)
22483
22487
  problems.push("--openai-compatible needs --model <name>: the model every agent runs on at that endpoint");
22484
22488
  if (!endpoint3 && a.model !== void 0) problems.push("--model only means something with --openai-compatible");
@@ -22502,6 +22506,7 @@ function envFile(a, template) {
22502
22506
  if (a.slackAppToken !== void 0) values.SLACK_APP_TOKEN = a.slackAppToken;
22503
22507
  if (a.anthropicKey !== void 0) values.ANTHROPIC_API_KEY = a.anthropicKey;
22504
22508
  if (a.modelKey !== void 0) values[OPENAI_KEY_ENV] = a.modelKey;
22509
+ if (a.openrouterKey !== void 0) values[OPENROUTER_KEY_ENV] = a.openrouterKey;
22505
22510
  if (a.githubAppId !== void 0) values.GITHUB_APP_ID = a.githubAppId;
22506
22511
  if (a.githubInstallationId !== void 0) values.GITHUB_APP_INSTALLATION_ID = a.githubInstallationId;
22507
22512
  if (a.githubPrivateKey !== void 0) values.GITHUB_APP_PRIVATE_KEY = a.githubPrivateKey;
@@ -22545,6 +22550,7 @@ function configFile(a, template) {
22545
22550
  const doc = YAML2.parseDocument(template);
22546
22551
  doc.set("organization", a.organization);
22547
22552
  if (a.anthropicKey === void 0) doc.deleteIn(["providers", "anthropic"]);
22553
+ if (a.openrouterKey === void 0) doc.deleteIn(["providers", OPENROUTER_PROVIDER]);
22548
22554
  if (a.openaiCompatible === void 0) doc.deleteIn(["providers", OPENAI_PROVIDER]);
22549
22555
  else {
22550
22556
  doc.setIn(["providers", OPENAI_PROVIDER, "baseUrl"], a.openaiCompatible);
@@ -22611,7 +22617,7 @@ function nextCommands(world, profile) {
22611
22617
  function definedOnly(env) {
22612
22618
  return Object.fromEntries(Object.entries(env).filter((e) => e[1] !== void 0));
22613
22619
  }
22614
- var ENV_PATH, CONFIG_PATH, PROFILE_PATH2, SECRET_ENV_NAMES, OPENAI_PROVIDER, OPENAI_KEY_ENV, DEFAULT_MODEL_AGENTS, ENV_LINE;
22620
+ var ENV_PATH, CONFIG_PATH, PROFILE_PATH2, SECRET_ENV_NAMES, OPENAI_PROVIDER, OPENAI_KEY_ENV, OPENROUTER_PROVIDER, OPENROUTER_KEY_ENV, DEFAULT_MODEL_AGENTS, ENV_LINE;
22615
22621
  var init_plan2 = __esm({
22616
22622
  "../../src/setup/plan.ts"() {
22617
22623
  "use strict";
@@ -22627,10 +22633,13 @@ var init_plan2 = __esm({
22627
22633
  "SLACK_APP_TOKEN",
22628
22634
  "ANTHROPIC_API_KEY",
22629
22635
  "OPENAI_API_KEY",
22636
+ "OPENROUTER_API_KEY",
22630
22637
  "GITHUB_APP_PRIVATE_KEY"
22631
22638
  ];
22632
22639
  OPENAI_PROVIDER = "openai";
22633
22640
  OPENAI_KEY_ENV = "OPENAI_API_KEY";
22641
+ OPENROUTER_PROVIDER = "openrouter";
22642
+ OPENROUTER_KEY_ENV = "OPENROUTER_API_KEY";
22634
22643
  DEFAULT_MODEL_AGENTS = ["general", "coding", "review", "explore"];
22635
22644
  ENV_LINE = /^(#\s*)?([A-Z][A-Z0-9_]*)=(.*)$/;
22636
22645
  }
@@ -22679,6 +22688,7 @@ async function gatherAnswers(o, setup) {
22679
22688
  ...given(openaiCompatible) ? { openaiCompatible } : {},
22680
22689
  ...given(model) ? { model } : {},
22681
22690
  ...given(modelKey) ? { modelKey } : {},
22691
+ ...given(o.openrouterKey) ? { openrouterKey: o.openrouterKey } : {},
22682
22692
  ...given(slackAppToken) ? { slackAppToken } : {},
22683
22693
  ...given(slackBotToken) ? { slackBotToken } : {},
22684
22694
  ...given(o.githubAppId) ? { githubAppId: o.githubAppId } : {},
@@ -22729,6 +22739,9 @@ var init_setup = __esm({
22729
22739
  ),
22730
22740
  model: z19.string().min(1).optional().describe("with --openai-compatible: the model every agent runs on at that endpoint (openai/<model>)"),
22731
22741
  modelKey: secret.optional().describe("with --openai-compatible: the endpoint's key \u2192 OPENAI_API_KEY (a local endpoint needs none)"),
22742
+ openrouterKey: secret.optional().describe(
22743
+ "an OpenRouter API key \u2192 OPENROUTER_API_KEY; keeps the example's `openrouter` provider beside the one the default models run on (a preset's model is then openrouter/<vendor>/<model>)"
22744
+ ),
22732
22745
  slackAppToken: secret.optional().describe("the Slack app-level token (xapp-\u2026) \u2192 SLACK_APP_TOKEN"),
22733
22746
  slackBotToken: secret.optional().describe("the Slack bot token (xoxb-\u2026) \u2192 SLACK_BOT_TOKEN"),
22734
22747
  githubAppId: digits.optional().describe("the GitHub App's id \u2192 GITHUB_APP_ID"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreplane/switchboard",
3
- "version": "1.232.0",
3
+ "version": "1.233.0",
4
4
  "description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://openswitchboard.dev",