@byok-sdk/client 0.2.0 → 0.3.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.
@@ -2,15 +2,37 @@ import type { TaskOfferPayload } from '@byok-sdk/protocol';
2
2
  import { type RuntimeAdapter, type RuntimeCapabilities, type RuntimeDetectResult, type RuntimeEnvironmentRequirements, type Session, type TaskContext } from '../../types';
3
3
  import { type ResolvedBin } from './resolve-bin';
4
4
  import { type SpawnFn } from './rpc-client';
5
+ /**
6
+ * Known provider credential env var *names* (never values) — see the
7
+ * credential-isolation rule on `RuntimeAdapter`. `detect()` only checks
8
+ * whether one of these names is set; it never reads pi's own auth storage
9
+ * (`~/.pi/...`) or any file contents. Not exhaustive (pi supports ~30
10
+ * providers); covers the common ones for a useful `authPresent` signal.
11
+ */
5
12
  export interface PiAdapterOptions {
6
13
  /** Override bin resolution — tests substitute the fake-pi fixture script. */
7
14
  resolveBin?: () => ResolvedBin;
8
15
  /** Override process spawning — tests substitute a fake spawn. */
9
16
  spawnFn?: SpawnFn;
17
+ /**
18
+ * Separate-process BYOK credential boundary. The launcher receives only
19
+ * non-secret selection/config paths, resolves the OS credential itself,
20
+ * and transparently proxies the pinned Pi RPC process.
21
+ */
22
+ byokLauncher?: PiByokLauncherConfig;
23
+ }
24
+ export interface PiByokLauncherConfig {
25
+ command: string;
26
+ /** Optional fixed launcher arguments, before BYOK's required arguments. */
27
+ args?: string[];
28
+ profileDbPath: string;
29
+ sessionDir: string;
30
+ secretServicePrefix?: string;
10
31
  }
11
32
  export declare class PiAdapter implements RuntimeAdapter {
12
33
  private readonly options;
13
34
  readonly id = "pi";
35
+ readonly supportsDispatchSelection = true;
14
36
  constructor(options?: PiAdapterOptions);
15
37
  detect(): Promise<RuntimeDetectResult>;
16
38
  capabilities(): RuntimeCapabilities;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Provider credential names that the daemon may explicitly admit for the
3
+ * legacy direct-Pi path. Subscription runtimes and the BYOK custody launcher
4
+ * must not inherit them.
5
+ *
6
+ * This list contains names only. Credential values remain owned by the
7
+ * caller's environment or by the separate keys launcher.
8
+ */
9
+ export declare const PROVIDER_CREDENTIAL_ENV_NAMES: readonly ['ANTHROPIC_API_KEY', 'ANTHROPIC_OAUTH_TOKEN', 'OPENAI_API_KEY', 'GEMINI_API_KEY', 'AZURE_OPENAI_API_KEY', 'DEEPSEEK_API_KEY', 'GROQ_API_KEY', 'MISTRAL_API_KEY', 'OPENROUTER_API_KEY', 'XAI_API_KEY', 'ZAI_API_KEY'];
10
+ /**
11
+ * Credential-shaped names stripped at subscription/BYOK custody boundaries.
12
+ * This is intentionally a superset of the small legacy-Pi allowlist above:
13
+ * denying a credential is safe, while allowing every cloud credential Pi
14
+ * could consume would regress the daemon's ambient-environment isolation.
15
+ */
16
+ export declare const PROVIDER_CREDENTIAL_ENV_DENY_NAMES: readonly ["ANTHROPIC_API_KEY", "ANTHROPIC_OAUTH_TOKEN", "OPENAI_API_KEY", "GEMINI_API_KEY", "AZURE_OPENAI_API_KEY", "DEEPSEEK_API_KEY", "GROQ_API_KEY", "MISTRAL_API_KEY", "OPENROUTER_API_KEY", "XAI_API_KEY", "ZAI_API_KEY", "ANT_LING_API_KEY", "NVIDIA_API_KEY", "CEREBRAS_API_KEY", "CLOUDFLARE_API_KEY", "AI_GATEWAY_API_KEY", "ZAI_CODING_CN_API_KEY", "OPENCODE_API_KEY", "RADIUS_API_KEY", "FIREWORKS_API_KEY", "TOGETHER_API_KEY", "BASETEN_API_KEY", "KIMI_API_KEY", "MINIMAX_API_KEY", "MINIMAX_CN_API_KEY", "QWEN_TOKEN_PLAN_API_KEY", "QWEN_TOKEN_PLAN_CN_API_KEY", "XIAOMI_API_KEY", "XIAOMI_TOKEN_PLAN_CN_API_KEY", "XIAOMI_TOKEN_PLAN_AMS_API_KEY", "XIAOMI_TOKEN_PLAN_SGP_API_KEY", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "GOOGLE_APPLICATION_CREDENTIALS", "PI_PROVIDER_API_KEY"];
17
+ /** Return a copy that cannot pass ambient provider credentials to a child. */
18
+ export declare function withoutProviderCredentials(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;