@aexol/spectral 0.9.59 → 0.9.60

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 +1 @@
1
- {"version":3,"file":"kanban-bridge.d.ts","sourceRoot":"","sources":["../../src/extensions/kanban-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoC,MAAM,8BAA8B,CAAC;AA09BnG,wBAA8B,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpF"}
1
+ {"version":3,"file":"kanban-bridge.d.ts","sourceRoot":"","sources":["../../src/extensions/kanban-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoC,MAAM,8BAA8B,CAAC;AAg/BnG,wBAA8B,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCpF"}
@@ -188,6 +188,8 @@ async function deleteKanbanTask(opts, taskId) {
188
188
  import { getApiUrl, getConfigFile, readConfig } from "../config.js";
189
189
  import { readStudioBinding } from "../studio-binding.js";
190
190
  import { ensureAuthenticated, runOAuthFlow } from "../auth-helper.js";
191
+ import { loadMachine } from "../relay/machine-store.js";
192
+ import { isJwtExpired } from "../relay/registration.js";
191
193
  import { stat } from "node:fs/promises";
192
194
  import { join } from "node:path";
193
195
  // Track whether we've already attempted reauth in this session to avoid loops
@@ -245,7 +247,25 @@ async function resolveKanbanConfig(explicitProjectId, cwd) {
245
247
  }
246
248
  process.stderr.write(`[kanban-bridge] OAuth failed: ${oauthResult.reason}. Kanban calls will likely fail.\n`);
247
249
  }
248
- const token = cfg.userJwt || cfg.teamApiKey || "";
250
+ // Prefer machine JWT (long-lived, no browser OAuth needed)
251
+ // Falls back to user JWT / team API key for non-serve contexts
252
+ let token = "";
253
+ let tokenSource = "";
254
+ const machine = await loadMachine();
255
+ if (machine?.machineJwt && !isJwtExpired(machine.machineJwt)) {
256
+ token = machine.machineJwt;
257
+ tokenSource = "machine-jwt";
258
+ process.stderr.write(`[kanban-bridge] Using machine JWT (machine: ${machine.machineName}, team: ${machine.teamId ?? "unknown"}).\n`);
259
+ }
260
+ else {
261
+ token = cfg.userJwt || cfg.teamApiKey || "";
262
+ if (cfg.userJwt) {
263
+ tokenSource = "user-jwt";
264
+ }
265
+ else if (cfg.teamApiKey) {
266
+ tokenSource = "team-api-key";
267
+ }
268
+ }
249
269
  if (!token) {
250
270
  if (!_reauthAttempted) {
251
271
  _reauthAttempted = true;
@@ -181,7 +181,7 @@ export function generateObservationContent(rng) {
181
181
  () => `User requested ${rng.pick(VERBS)}ing the ${rng.pick(NOUNS)} to support ${rng.pick(TECH_TERMS)} integration.`,
182
182
  () => `Assistant identified ${rng.pick(["a bug", "a performance issue", "a type error", "a race condition", "a memory leak"])} in ${rng.pick(FILE_NAMES)}.`,
183
183
  () => `Codebase uses ${rng.pick(TECH_TERMS)} for ${rng.pick(["caching", "state management", "data fetching", "authentication", "logging"])}.`,
184
- () => `Configuration for ${rng.pick(NOUNS)} is stored in ${rng.pick([".env", "config.ts", "settings.json", "deno.json", "tsconfig.json"])}.`,
184
+ () => `Configuration for ${rng.pick(NOUNS)} is stored in ${rng.pick([".env.local", "config.ts", "settings.json", "deno.json", "tsconfig.json"])}.`,
185
185
  () => `Test suite for ${rng.pick(FILE_NAMES)} covers ${rng.pick(["unit", "integration", "e2e", "snapshot", "performance"])} scenarios.`,
186
186
  () => `Migration from ${rng.pick(TECH_TERMS)} to ${rng.pick(TECH_TERMS)} ${rng.pick(["is in progress", "was completed", "is planned", "was discussed"])}.`,
187
187
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/spectral",
3
- "version": "0.9.59",
3
+ "version": "0.9.60",
4
4
  "description": "AI coding agent for Aexol with relay-based browser access.",
5
5
  "type": "module",
6
6
  "private": false,