trantor 0.18.2 → 0.18.3

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "description": "Trantor \u2014 the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
5
5
  "mcpServers": {
6
6
  "relay": {
package/bin/doctor.mjs CHANGED
@@ -153,6 +153,24 @@ if (!installed) warn("no crew CLIs found", "install at least one of: codex, gemi
153
153
  // 3. ~/.token-scrooge/.env — the SCROOGE layer (cheap-model grunt routing)
154
154
  section("provider keys (who spends on what)");
155
155
  const KEY_VARS = ["DEEPSEEK_API_KEY", "OPENROUTER_API_KEY", "MOONSHOT_API_KEY", "ZAI_API_KEY", "OPENAI_API_KEY", "GEMINI_API_KEY", "XAI_API_KEY"];
156
+ // Only some of these are a CREW credential. A seat that authenticates through its own config never
157
+ // reads the env var at all, so a shared value there costs nothing and flagging it is noise:
158
+ // glm → opencode.json provider["zai-coding-plan"].options.apiKey (and a coding plan is flat
159
+ // rate, so there is no per-token bill to attribute even in principle)
160
+ // kimi → ~/.kimi/credentials codex → its own login gemini → retired
161
+ // The opencode-driven seats that DO take their key from the env layer are deepseek and openrouter,
162
+ // and even then only when opencode.json has not already given that provider its own key.
163
+ // Getting this wrong cries wolf: the first version flagged all seven and five were false positives,
164
+ // which is how a doctor becomes something you skip.
165
+ const OPENCODE_CFG = read(join(H, ".config", "opencode", "opencode.json")) || {};
166
+ const SEAT_ENV_VARS = { DEEPSEEK_API_KEY: "deepseek", OPENROUTER_API_KEY: "openrouter" };
167
+ const crewUsesVar = (v) => {
168
+ const provider = SEAT_ENV_VARS[v];
169
+ if (!provider) return false;
170
+ const configured = OPENCODE_CFG?.provider?.[provider]?.options?.apiKey;
171
+ if (typeof configured === "string" && configured.includes("{env:")) return true; // resolves from env at run time
172
+ return !configured; // a LITERAL key bypasses the env layer
173
+ };
156
174
  const CREW_ENV = join(H, ".agent-bus", ".env");
157
175
  const SCROOGE_ENV = join(H, ".token-scrooge", ".env");
158
176
  const readEnvFile = (f) => {
@@ -177,7 +195,9 @@ for (const v of KEY_VARS) {
177
195
  const crewSrc = process.env[v] ? "process env" : crewEnv[v] ? "~/.agent-bus/.env (crew)" : scroogeEnv[v] ? "~/.token-scrooge/.env (FALLBACK)" : "none";
178
196
  const crewKey = crew || scrooge;
179
197
  const scroogeFileKey = scroogeEnv[v] || "";
180
- if (crewKey && scroogeFileKey && crewKey === scroogeFileKey) {
198
+ if (!crewUsesVar(v)) {
199
+ ok(`${v}: Scrooge only ${mask(scroogeFileKey || crewKey)} — no crew seat reads this var`);
200
+ } else if (crewKey && scroogeFileKey && crewKey === scroogeFileKey) {
181
201
  shared++; sharedVars.push(v);
182
202
  note(`${v}: crew + Scrooge share ONE key ${mask(crewKey)} — spend is indistinguishable on the bill`);
183
203
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"