privateer-agent 0.12.2 → 0.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "privateer-agent",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Privacy-first terminal coding agent — bring your own model across 20 providers (Anthropic, OpenAI, OpenRouter, Google, local Ollama…). Safe-by-default permissions, MCP, sub-agents, workflows, and verifiable TEE inference. Built on the Pi toolkit.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -451,8 +451,14 @@ export async function runDeviceLogin(opts: {
451
451
  // Pass the server's own message through so the user learns what to actually do.
452
452
  async function spawnFailure(res: Response): Promise<Error> {
453
453
  if (res.status === 401) {
454
- clearCredentials();
455
- notifySessionExpired();
454
+ // Announce only the signed-in → signed-out transition: concurrent launch-time
455
+ // spawns (warmSession + the account-channel seed) can both 401 on the same dead
456
+ // login, and whichever lands second must stay silent. Same guard as
457
+ // handleServerRevoke.
458
+ if (hasCredentials()) {
459
+ clearCredentials();
460
+ notifySessionExpired();
461
+ }
456
462
  return new Error("Your Privateer session expired. Run /login to sign in again.");
457
463
  }
458
464
  let message: string | undefined;
@@ -56,6 +56,10 @@ const DEFAULT_MODELS = [
56
56
  "anthropic/claude-sonnet-5",
57
57
  "openai/gpt-5.6-sol",
58
58
  "deepseek/deepseek-v4-flash",
59
+ // 2026-08 releases, confirmed live on OpenRouter (ZDR-covered ids reach the
60
+ // account catalog automatically; these seeds just make them resolve at launch).
61
+ "moonshotai/kimi-k3",
62
+ "z-ai/glm-5.2",
59
63
  ];
60
64
 
61
65
  function seedModel(id: string) {
@@ -816,7 +820,10 @@ export async function armAccountCredential(
816
820
  // so staying silent leaves the user to discover it as a bare "No API key found for
817
821
  // privateer" on their first prompt.
818
822
  const c = ctx as SeedContext;
819
- if (opts.notify !== false && c?.hasUI) {
823
+ // If the credentials vanished during the call, the spawn hit a 401 and
824
+ // onSessionExpired already announced the sign-out — a second line here would
825
+ // just repeat it (we returned early above if we STARTED signed out).
826
+ if (opts.notify !== false && c?.hasUI && hasCredentials()) {
820
827
  c.ui?.notify?.(`Privateer account channel unavailable — ${(e as Error).message}`, "error");
821
828
  }
822
829
  return false;
@@ -59,7 +59,7 @@ export const PROVIDERS: ProviderEntry[] = [
59
59
  api: "openai-completions",
60
60
  keyEnv: "${DASHSCOPE_API_KEY}",
61
61
  compat: { thinkingFormat: "qwen" },
62
- seedModels: ["qwen3-max", "qwen3-coder-plus", "qwen-max-latest"],
62
+ seedModels: ["qwen3.8-max-preview", "qwen3-max", "qwen3-coder-plus", "qwen-max-latest"],
63
63
  },
64
64
  { id: "ollama", source: "pi-privacy" },
65
65
  { id: "nearai", source: "pi-privacy" },
@@ -36,6 +36,13 @@ export interface ModelsJson {
36
36
  providers: Record<string, ModelsJsonProvider>;
37
37
  }
38
38
 
39
+ // Per-id context-window overrides for seeds whose real window is far from the
40
+ // Appendix A.4 default (kept until the live listing refines them). Qwen3.8-Max
41
+ // serves ~1M tokens (983,616 advertised at launch, 2026-08-03).
42
+ const SEED_CONTEXT: Record<string, number> = {
43
+ "qwen3.8-max-preview": 1_000_000,
44
+ };
45
+
39
46
  function seedModel(id: string, compat?: Record<string, unknown>): ModelsJsonModel {
40
47
  return {
41
48
  id,
@@ -43,7 +50,7 @@ function seedModel(id: string, compat?: Record<string, unknown>): ModelsJsonMode
43
50
  reasoning: false,
44
51
  input: ["text"],
45
52
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
46
- contextWindow: 128000,
53
+ contextWindow: SEED_CONTEXT[id] ?? 128000,
47
54
  maxTokens: 16384,
48
55
  ...(compat ? { compat } : {}),
49
56
  };