pybao-xc-sdk 1.5.55 → 1.5.57

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/dist/index.d.mts CHANGED
@@ -2254,6 +2254,7 @@ interface SessionInfo {
2254
2254
  messageCount: number;
2255
2255
  createdAt: number;
2256
2256
  updatedAt: number;
2257
+ cwd?: string;
2257
2258
  config: {
2258
2259
  model: string;
2259
2260
  agent: string;
@@ -2316,14 +2317,49 @@ interface SetDefaultModelRequest {
2316
2317
  providerID: string;
2317
2318
  modelID: string;
2318
2319
  scope?: 'global' | 'workspace';
2320
+ workspaceRoot?: string;
2321
+ }
2322
+ interface GetDefaultModelRequest {
2323
+ workspaceRoot?: string;
2324
+ }
2325
+ interface GetDefaultModelResponse extends Partial<ModelRef> {
2326
+ scope: 'global' | 'workspace';
2327
+ requestedScope: 'global' | 'workspace';
2328
+ applied: boolean;
2329
+ fallbackReason: string | null;
2330
+ current: ModelRef | null;
2319
2331
  }
2320
2332
  interface SetDefaultModelResponse {
2321
- scope: 'global';
2333
+ scope: 'global' | 'workspace';
2322
2334
  requestedScope: 'global' | 'workspace';
2323
2335
  applied: boolean;
2324
2336
  fallbackReason: string | null;
2325
2337
  current: ModelRef;
2326
2338
  }
2339
+ interface ModelCatalogItem extends ModelRef {
2340
+ profileName: string;
2341
+ enabled: boolean;
2342
+ providerQualifiedModelID: string;
2343
+ sourceSummary: Array<'config' | 'env' | 'auth' | 'plugin' | 'cli'>;
2344
+ }
2345
+ interface ModelCatalogResponse {
2346
+ items: ModelCatalogItem[];
2347
+ default: ModelRef | null;
2348
+ }
2349
+ interface ResolveRuntimeModelRequest {
2350
+ providerID: string;
2351
+ modelID: string;
2352
+ }
2353
+ interface ResolveRuntimeModelResponse extends ModelRef {
2354
+ profileName: string;
2355
+ providerQualifiedModelID: string;
2356
+ authState: 'configured';
2357
+ credentialSource: 'auth' | 'env';
2358
+ credentialsMasked: true;
2359
+ adapterType: 'responses_api' | 'chat_completions';
2360
+ adapterClass: string;
2361
+ baseURL: string | null;
2362
+ }
2327
2363
  interface ModelPoolSourceRecord {
2328
2364
  pluginSpec: string;
2329
2365
  pluginID: string;
@@ -2344,6 +2380,7 @@ interface ModelPoolStatusResponse {
2344
2380
  }
2345
2381
  interface CreateSessionRequest {
2346
2382
  resumeFrom?: string;
2383
+ cwd?: string;
2347
2384
  config?: {
2348
2385
  model?: string;
2349
2386
  agent?: string;
@@ -2353,6 +2390,7 @@ interface CreateSessionRequest {
2353
2390
  interface CreateSessionResponse {
2354
2391
  sessionId: string;
2355
2392
  createdAt: number;
2393
+ cwd?: string;
2356
2394
  config: {
2357
2395
  model: string;
2358
2396
  agent: string;
@@ -2416,15 +2454,44 @@ interface APIError {
2416
2454
  details?: Record<string, unknown>;
2417
2455
  }
2418
2456
 
2457
+ type PybErrorCategory = 'config' | 'network' | 'api' | 'response_parse';
2458
+ type PybErrorDetails = Record<string, unknown> | undefined;
2459
+ type PybAPIErrorOptions = {
2460
+ category?: PybErrorCategory;
2461
+ recoverable?: boolean;
2462
+ details?: PybErrorDetails;
2463
+ cause?: unknown;
2464
+ name?: string;
2465
+ };
2466
+ declare class PybAPIError extends Error {
2467
+ readonly code: string;
2468
+ readonly category: PybErrorCategory;
2469
+ readonly recoverable: boolean;
2470
+ readonly details?: PybErrorDetails;
2471
+ readonly cause?: unknown;
2472
+ constructor(code: string, message: string, options?: PybAPIErrorOptions);
2473
+ }
2474
+ declare class PybConfigError extends PybAPIError {
2475
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2476
+ }
2477
+ declare class PybNetworkError extends PybAPIError {
2478
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2479
+ }
2480
+ declare class PybResponseParseError extends PybAPIError {
2481
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2482
+ }
2483
+
2419
2484
  interface PybClientConfig {
2420
2485
  baseUrl?: string;
2421
2486
  timeout?: number;
2422
2487
  headers?: Record<string, string>;
2488
+ directory?: string;
2423
2489
  }
2424
2490
  declare class PybClient {
2425
2491
  private baseUrl;
2426
2492
  private timeout;
2427
2493
  private headers;
2494
+ readonly directory: string | undefined;
2428
2495
  readonly session: {
2429
2496
  create: (request?: CreateSessionRequest) => Promise<CreateSessionResponse>;
2430
2497
  list: (params?: {
@@ -2491,9 +2558,13 @@ declare class PybClient {
2491
2558
  };
2492
2559
  };
2493
2560
  readonly model: {
2494
- getDefault: () => Promise<ModelRef | null>;
2561
+ getDefault: (request?: GetDefaultModelRequest) => Promise<GetDefaultModelResponse>;
2562
+ catalog: () => Promise<ModelCatalogResponse>;
2495
2563
  setDefault: (request: SetDefaultModelRequest) => Promise<SetDefaultModelResponse>;
2496
2564
  };
2565
+ readonly runtime: {
2566
+ resolveModel: (request: ResolveRuntimeModelRequest) => Promise<ResolveRuntimeModelResponse>;
2567
+ };
2497
2568
  readonly auth: {
2498
2569
  set: (providerID: string, request: AuthSetRequest) => Promise<AuthSetResponse>;
2499
2570
  remove: (providerID: string) => Promise<AuthRemoveResponse>;
@@ -2503,6 +2574,7 @@ declare class PybClient {
2503
2574
  };
2504
2575
  constructor(config?: PybClientConfig);
2505
2576
  getHealth(): Promise<HealthResponse>;
2577
+ withDirectory(directory: string): PybClient;
2506
2578
  private createSessionRequest;
2507
2579
  private listSessionsRequest;
2508
2580
  private getSessionRequest;
@@ -2526,14 +2598,20 @@ declare class PybClient {
2526
2598
  private callbackProviderOAuthRequest;
2527
2599
  private getDefaultModelRequest;
2528
2600
  private setDefaultModelRequest;
2601
+ private getModelCatalogRequest;
2602
+ private resolveRuntimeModelRequest;
2529
2603
  private setProviderAuthRequest;
2530
2604
  private removeProviderAuthRequest;
2531
2605
  private getModelPoolStatusRequest;
2532
2606
  private listMCPServersRequest;
2533
2607
  private connectMCPServerRequest;
2534
2608
  private disconnectMCPServerRequest;
2609
+ private parseJson;
2610
+ private parseData;
2611
+ private isRecoverableResponseStatus;
2535
2612
  private fetch;
2536
2613
  }
2614
+ declare function createPybClient(config?: PybClientConfig): PybClient;
2537
2615
 
2538
2616
  interface SSEClientOptions {
2539
2617
  baseUrl?: string;
@@ -3364,149 +3442,6 @@ declare function resolveDefaultBackendFromEnv(input?: {
3364
3442
  routeSource: SessionBackendRouteSource;
3365
3443
  };
3366
3444
 
3367
- type OpenworkFieldMapping = {
3368
- openworkField: string;
3369
- pybField: string;
3370
- };
3371
- type OpenworkEndpointMapping = {
3372
- openworkEndpoint: string;
3373
- pybEndpoint: string;
3374
- };
3375
- type OpenworkErrorMapping = {
3376
- openworkErrorCode: string;
3377
- pybErrorCode: string;
3378
- };
3379
- type OpenworkMigrationMap = {
3380
- fieldMappings: OpenworkFieldMapping[];
3381
- endpointMappings: OpenworkEndpointMapping[];
3382
- errorMappings: OpenworkErrorMapping[];
3383
- };
3384
- type OpenworkMigrationMapV2 = OpenworkMigrationMap & {
3385
- version: 'v2';
3386
- };
3387
- type OpenworkCompatibilitySampleInput = {
3388
- providerID: string;
3389
- modelID: string;
3390
- apiKey: string;
3391
- scope?: 'global' | 'workspace';
3392
- };
3393
- type OpenworkProviderPickerSample = {
3394
- providers: Array<{
3395
- id: string;
3396
- label: string;
3397
- connected: boolean;
3398
- isDefault: boolean;
3399
- }>;
3400
- };
3401
- type OpenworkAuthModalSample = {
3402
- providerID: string;
3403
- method: 'api';
3404
- connected: boolean;
3405
- };
3406
- type OpenworkModelSetSample = {
3407
- scope: 'global';
3408
- fallbackReason: string | null;
3409
- current: ModelRef;
3410
- };
3411
- type OpenworkGoNoGoResult = {
3412
- decision: 'go' | 'no-go';
3413
- reasons: string[];
3414
- rollbackPlan: string[];
3415
- };
3416
- type OpenworkCompatibilitySampleResult = {
3417
- providerPicker: OpenworkProviderPickerSample;
3418
- authModal: OpenworkAuthModalSample;
3419
- modelSet: OpenworkModelSetSample;
3420
- modelPoolStatus: ModelPoolStatusResponse;
3421
- compatibilityScore: number;
3422
- goNoGo: OpenworkGoNoGoResult;
3423
- };
3424
- type ProviderFacadeEnvironment = 'internal' | 'beta' | 'production';
3425
- type ProviderFacadeFeatureFlag = {
3426
- enabled: boolean;
3427
- environment: ProviderFacadeEnvironment;
3428
- workspaceAllowlist: string[];
3429
- };
3430
- type CompatibilityWindowPolicy = {
3431
- minorVersions: number;
3432
- deprecatedEndpoints: string[];
3433
- };
3434
- type ProviderFacadeReleaseState = {
3435
- featureFlag: ProviderFacadeFeatureFlag;
3436
- compatibilityWindow: CompatibilityWindowPolicy;
3437
- };
3438
- type ProviderFacadeRolloutInput = {
3439
- p0IncidentCount: number;
3440
- rollbackSwitchLatencyMs: number;
3441
- fallbackReasonDistribution: Record<string, number>;
3442
- authFailureRate: number;
3443
- compatibilityMinorVersions: number;
3444
- };
3445
- type ProviderFacadeRolloutResult = {
3446
- decision: 'go' | 'no-go';
3447
- reasons: string[];
3448
- };
3449
- type ProviderFacadeAccessInput = {
3450
- workspaceID: string;
3451
- };
3452
- type ProviderFacadeAccessResult = {
3453
- allowed: boolean;
3454
- reason?: 'feature_disabled' | 'workspace_not_allowlisted';
3455
- };
3456
- type ProviderFacadeDeprecationChecklist = {
3457
- compatibilityMinorVersions: number;
3458
- deprecatedEndpoints: string[];
3459
- readyForRetirement: boolean;
3460
- };
3461
- type ModelPlatformDebtSeverity = 'D0' | 'D1' | 'D2';
3462
- type ModelPlatformDebtStatus = 'open' | 'closed';
3463
- type ModelPlatformDebtItem = {
3464
- id: string;
3465
- title: string;
3466
- severity: ModelPlatformDebtSeverity;
3467
- owner: string;
3468
- batch: string;
3469
- status: ModelPlatformDebtStatus;
3470
- };
3471
- type ModelPlatformAuditEvidence = {
3472
- testsPassed: boolean;
3473
- lintPassed: boolean;
3474
- typecheckPassed: boolean;
3475
- rollbackDrillPassed: boolean;
3476
- };
3477
- type ModelPlatformDebtCloseoutInput = {
3478
- debts: ModelPlatformDebtItem[];
3479
- auditEvidence: ModelPlatformAuditEvidence;
3480
- };
3481
- type ModelPlatformDebtCloseoutSummary = {
3482
- openD0: number;
3483
- openD1: number;
3484
- openD2: number;
3485
- invalidBatchOwnershipCount: number;
3486
- evidenceCompleteness: number;
3487
- };
3488
- type ModelPlatformDebtCloseoutResult = {
3489
- decision: 'go' | 'no-go';
3490
- reasonCodes: string[];
3491
- summary: ModelPlatformDebtCloseoutSummary;
3492
- riskStatement: string;
3493
- };
3494
- declare function getProviderFacadeReleaseState(): ProviderFacadeReleaseState;
3495
- declare function setProviderFacadeReleaseState(input: Partial<ProviderFacadeReleaseState>): ProviderFacadeReleaseState;
3496
- declare function evaluateProviderFacadeRollout(input: ProviderFacadeRolloutInput): ProviderFacadeRolloutResult;
3497
- declare function evaluateProviderFacadeAccess(input: ProviderFacadeAccessInput): ProviderFacadeAccessResult;
3498
- declare function getProviderFacadeDeprecationChecklist(): ProviderFacadeDeprecationChecklist;
3499
- declare function evaluateModelPlatformDebtCloseout(input: ModelPlatformDebtCloseoutInput): ModelPlatformDebtCloseoutResult;
3500
- declare function getOpenworkMigrationMap(): OpenworkMigrationMap;
3501
- declare function getOpenworkMigrationMapV2(): OpenworkMigrationMapV2;
3502
- declare function runOpenworkCompatibilitySample(client: PybClient, input: OpenworkCompatibilitySampleInput): Promise<OpenworkCompatibilitySampleResult>;
3503
-
3504
- /**
3505
- * @pyb/sdk - PYB-CLI Server SDK
3506
- *
3507
- * Provides HTTP client and SSE event handling for PYB-CLI Web UI integration.
3508
- */
3509
-
3510
- declare const SDK_VERSION = "0.1.0";
3445
+ declare const SDK_VERSION = "1.5.57";
3511
3446
 
3512
- export { type APIError, type Attachment, type AuthRemoveResponse, type AuthSetRequest, type AuthSetResponse, type BackendKind, BackendKindSchema, type CanUseToolCallback, type CanUseToolDecision, type CompatibilityWindowPolicy, type ContentBlock, ContentBlockSchema, type CreateSessionRequest, type CreateSessionResponse, DEFAULT_SESSION_BACKEND_ROUTER_CONFIG, type DualTrackMetrics, DualTrackMetricsSchema, type DualTrackRawStats, DualTrackRawStatsSchema, type DualTrackThresholds, DualTrackThresholdsSchema, type ErrorEvent, ErrorEventSchema, type ErrorStreamEvent, ErrorStreamEventSchema, FALLBACK_TRIGGER_MATRIX, type FallbackTriggerReason, FallbackTriggerReasonSchema, type HealthResponse, type Message, type MessageCompletedEvent, MessageCompletedEventSchema, type MessageCreatedEvent, MessageCreatedEventSchema, MessageSchema, type MessageUpdatedEvent, MessageUpdatedEventSchema, type ModelPlatformAuditEvidence, type ModelPlatformDebtCloseoutInput, type ModelPlatformDebtCloseoutResult, type ModelPlatformDebtCloseoutSummary, type ModelPlatformDebtItem, type ModelPlatformDebtSeverity, type ModelPlatformDebtStatus, type ModelPoolSourceRecord, type ModelPoolStatusItem, type ModelPoolStatusResponse, type ModelRef, type OpenworkAuthModalSample, type OpenworkCompatibilitySampleInput, type OpenworkCompatibilitySampleResult, type OpenworkEndpointMapping, type OpenworkErrorMapping, type OpenworkFieldMapping, type OpenworkGoNoGoResult, type OpenworkMigrationMap, type OpenworkMigrationMapV2, type OpenworkModelSetSample, type OpenworkProviderPickerSample, PROTOCOL_ERROR_TO_RUNTIME_ERROR_TYPE, type PermissionEvaluator, type PermissionMode, type PermissionRequestedEvent, PermissionRequestedEventSchema, type PermissionRespondedEvent, PermissionRespondedEventSchema, type PermissionResponseRequest, type PermissionTimeoutEvent, PermissionTimeoutEventSchema, type PromptRequest, type PromptResponse, type ProtocolErrorCode, ProtocolErrorCodeSchema, type ProtocolErrorMapping, ProtocolErrorMappingSchema, type ProtocolSessionStreamBinding, ProtocolSessionStreamBindingManager, type ProviderAuthMethod, type ProviderFacadeAccessInput, type ProviderFacadeAccessResult, type ProviderFacadeDeprecationChecklist, type ProviderFacadeEnvironment, type ProviderFacadeFeatureFlag, type ProviderFacadeReleaseState, type ProviderFacadeRolloutInput, type ProviderFacadeRolloutResult, type ProviderListResponse, type ProviderOAuthAuthorizeRequest, type ProviderOAuthAuthorizeResponse, type ProviderOAuthCallbackRequest, type ProviderOAuthCallbackResponse, type ProviderRef, PybClient, type PybSSEEvent, PybSSEEventSchema, type QuerySessionExecutor, type RequestCompletedEvent, RequestCompletedEventSchema, type RequestStartedEvent, RequestStartedEventSchema, type ResolvePermissionDecisionInput, type RuntimeBackendErrorPhase, type RuntimeCompatibleLegacyEvent, type RuntimeEvent, type RuntimeEventDomain, RuntimeEventDomainSchema, type RuntimeEventErrorType, RuntimeEventErrorTypeSchema, RuntimeEventSchema, type RuntimePermissionPolicy, type RuntimeSession, type RuntimeSessionConfig, type RuntimeSessionEvent, RuntimeSessionEventSchema, type RuntimeSessionInput, RuntimeSessionInputSchema, type RuntimeSessionStatus, RuntimeSessionStatusSchema, S4_PROTOCOL_ERROR_TOP_CODES, S5_A0_EQUIVALENCE_SAMPLE_SET, SDK_VERSION, SESSION_BACKEND_CONFIG_CONTRACT_VERSION, SESSION_BACKEND_ENV_KEY, SESSION_BACKEND_OBSERVABILITY_SPEC, SSEClient, type SSEDedupEvent, SSEDedupEventSchema, type SSEEvent, type SSEReplayEvent, SSEReplayEventSchema, type SSEReplayGapEvent, SSEReplayGapEventSchema, type ServerConnectedEvent, ServerConnectedEventSchema, type ServerHeartbeatEvent, ServerHeartbeatEventSchema, type ServerStatusEvent, ServerStatusEventSchema, type SessionBackend, type SessionBackendRouteSource, type SessionBackendRouterConfig, SessionBackendRouterConfigSchema, type SessionBackendSession, type SessionBackendUserConfig, type SessionCreatedEvent, SessionCreatedEventSchema, type SessionDeletedEvent, SessionDeletedEventSchema, type SessionEventPublisher, type SessionInfo, type SessionUpdatedEvent, SessionUpdatedEventSchema, type SetDefaultModelRequest, type SetDefaultModelResponse, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolErrorEvent, ToolErrorEventSchema, type ToolInfo, type ToolPermissionContext, type ToolProgressEvent, ToolProgressEventSchema, type ToolResolver, type ToolStartedEvent, ToolStartedEventSchema, type V2Message, V2MessageSchema, V2RequestStatusSchema, type V2Session, V2SessionSchema, type V2SessionStatus, V2SessionStatusSchema, type V2ToolUseContext, V2ToolUseContextSchema, buildDefaultDualTrackThresholds, buildV2ToolUseContextFromPromptRequest, canTransitionV2SessionStatus, createDefaultToolPermissionContextForSdk, createProtocolSessionBackend, createRuntimePermissionContextForSession, createRuntimeSession, createRuntimeSessionBackend, createSSEClient, createSessionBackendRouter, emitBackendConfigWarning, evaluateDualTrackMetrics, evaluateModelPlatformDebtCloseout, evaluateProviderFacadeAccess, evaluateProviderFacadeRollout, evaluateV1DeprecationReadiness, getOpenworkMigrationMap, getOpenworkMigrationMapV2, getProviderFacadeDeprecationChecklist, getProviderFacadeReleaseState, getRuntimeEventMappingRules, isToolAutoExecutableInContext, mapProtocolErrorCodeToRuntimeErrorType, mapRuntimeBackendErrorToRuntimeEvent, mapRuntimeMessageToV2, mapRuntimeSessionStatusToV2, mapV1MessageToV2, mapV1SessionStatusToV2, projectLegacyEventToRuntimeEvent, projectRuntimeEventToLegacyEvent, resolveDefaultBackend, resolveDefaultBackendFromEnv, resolvePermissionDecision, resolvePermissionModeForSdk, resolveRouterBackendKind, runOpenworkCompatibilitySample, setProviderFacadeReleaseState, shouldTriggerFallback, validateV2Message, validateV2Session, validateV2ToolUseContext };
3447
+ export { type APIError, type Attachment, type AuthRemoveResponse, type AuthSetRequest, type AuthSetResponse, type BackendKind, BackendKindSchema, type CanUseToolCallback, type CanUseToolDecision, type ContentBlock, ContentBlockSchema, type CreateSessionRequest, type CreateSessionResponse, DEFAULT_SESSION_BACKEND_ROUTER_CONFIG, type DualTrackMetrics, DualTrackMetricsSchema, type DualTrackRawStats, DualTrackRawStatsSchema, type DualTrackThresholds, DualTrackThresholdsSchema, type ErrorEvent, ErrorEventSchema, type ErrorStreamEvent, ErrorStreamEventSchema, FALLBACK_TRIGGER_MATRIX, type FallbackTriggerReason, FallbackTriggerReasonSchema, type GetDefaultModelRequest, type GetDefaultModelResponse, type HealthResponse, type Message, type MessageCompletedEvent, MessageCompletedEventSchema, type MessageCreatedEvent, MessageCreatedEventSchema, MessageSchema, type MessageUpdatedEvent, MessageUpdatedEventSchema, type ModelCatalogItem, type ModelCatalogResponse, type ModelPoolSourceRecord, type ModelPoolStatusItem, type ModelPoolStatusResponse, type ModelRef, PROTOCOL_ERROR_TO_RUNTIME_ERROR_TYPE, type PermissionEvaluator, type PermissionMode, type PermissionRequestedEvent, PermissionRequestedEventSchema, type PermissionRespondedEvent, PermissionRespondedEventSchema, type PermissionResponseRequest, type PermissionTimeoutEvent, PermissionTimeoutEventSchema, type PromptRequest, type PromptResponse, type ProtocolErrorCode, ProtocolErrorCodeSchema, type ProtocolErrorMapping, ProtocolErrorMappingSchema, type ProtocolSessionStreamBinding, ProtocolSessionStreamBindingManager, type ProviderAuthMethod, type ProviderListResponse, type ProviderOAuthAuthorizeRequest, type ProviderOAuthAuthorizeResponse, type ProviderOAuthCallbackRequest, type ProviderOAuthCallbackResponse, type ProviderRef, PybAPIError, PybClient, PybConfigError, PybNetworkError, PybResponseParseError, type PybSSEEvent, PybSSEEventSchema, type QuerySessionExecutor, type RequestCompletedEvent, RequestCompletedEventSchema, type RequestStartedEvent, RequestStartedEventSchema, type ResolvePermissionDecisionInput, type ResolveRuntimeModelRequest, type ResolveRuntimeModelResponse, type RuntimeBackendErrorPhase, type RuntimeCompatibleLegacyEvent, type RuntimeEvent, type RuntimeEventDomain, RuntimeEventDomainSchema, type RuntimeEventErrorType, RuntimeEventErrorTypeSchema, RuntimeEventSchema, type RuntimePermissionPolicy, type RuntimeSession, type RuntimeSessionConfig, type RuntimeSessionEvent, RuntimeSessionEventSchema, type RuntimeSessionInput, RuntimeSessionInputSchema, type RuntimeSessionStatus, RuntimeSessionStatusSchema, S4_PROTOCOL_ERROR_TOP_CODES, S5_A0_EQUIVALENCE_SAMPLE_SET, SDK_VERSION, SESSION_BACKEND_CONFIG_CONTRACT_VERSION, SESSION_BACKEND_ENV_KEY, SESSION_BACKEND_OBSERVABILITY_SPEC, SSEClient, type SSEDedupEvent, SSEDedupEventSchema, type SSEEvent, type SSEReplayEvent, SSEReplayEventSchema, type SSEReplayGapEvent, SSEReplayGapEventSchema, type ServerConnectedEvent, ServerConnectedEventSchema, type ServerHeartbeatEvent, ServerHeartbeatEventSchema, type ServerStatusEvent, ServerStatusEventSchema, type SessionBackend, type SessionBackendRouteSource, type SessionBackendRouterConfig, SessionBackendRouterConfigSchema, type SessionBackendSession, type SessionBackendUserConfig, type SessionCreatedEvent, SessionCreatedEventSchema, type SessionDeletedEvent, SessionDeletedEventSchema, type SessionEventPublisher, type SessionInfo, type SessionUpdatedEvent, SessionUpdatedEventSchema, type SetDefaultModelRequest, type SetDefaultModelResponse, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolErrorEvent, ToolErrorEventSchema, type ToolInfo, type ToolPermissionContext, type ToolProgressEvent, ToolProgressEventSchema, type ToolResolver, type ToolStartedEvent, ToolStartedEventSchema, type V2Message, V2MessageSchema, V2RequestStatusSchema, type V2Session, V2SessionSchema, type V2SessionStatus, V2SessionStatusSchema, type V2ToolUseContext, V2ToolUseContextSchema, buildDefaultDualTrackThresholds, buildV2ToolUseContextFromPromptRequest, canTransitionV2SessionStatus, createDefaultToolPermissionContextForSdk, createProtocolSessionBackend, createPybClient, createRuntimePermissionContextForSession, createRuntimeSession, createRuntimeSessionBackend, createSSEClient, createSessionBackendRouter, emitBackendConfigWarning, evaluateDualTrackMetrics, evaluateV1DeprecationReadiness, getRuntimeEventMappingRules, isToolAutoExecutableInContext, mapProtocolErrorCodeToRuntimeErrorType, mapRuntimeBackendErrorToRuntimeEvent, mapRuntimeMessageToV2, mapRuntimeSessionStatusToV2, mapV1MessageToV2, mapV1SessionStatusToV2, projectLegacyEventToRuntimeEvent, projectRuntimeEventToLegacyEvent, resolveDefaultBackend, resolveDefaultBackendFromEnv, resolvePermissionDecision, resolvePermissionModeForSdk, resolveRouterBackendKind, shouldTriggerFallback, validateV2Message, validateV2Session, validateV2ToolUseContext };
package/dist/index.d.ts CHANGED
@@ -2254,6 +2254,7 @@ interface SessionInfo {
2254
2254
  messageCount: number;
2255
2255
  createdAt: number;
2256
2256
  updatedAt: number;
2257
+ cwd?: string;
2257
2258
  config: {
2258
2259
  model: string;
2259
2260
  agent: string;
@@ -2316,14 +2317,49 @@ interface SetDefaultModelRequest {
2316
2317
  providerID: string;
2317
2318
  modelID: string;
2318
2319
  scope?: 'global' | 'workspace';
2320
+ workspaceRoot?: string;
2321
+ }
2322
+ interface GetDefaultModelRequest {
2323
+ workspaceRoot?: string;
2324
+ }
2325
+ interface GetDefaultModelResponse extends Partial<ModelRef> {
2326
+ scope: 'global' | 'workspace';
2327
+ requestedScope: 'global' | 'workspace';
2328
+ applied: boolean;
2329
+ fallbackReason: string | null;
2330
+ current: ModelRef | null;
2319
2331
  }
2320
2332
  interface SetDefaultModelResponse {
2321
- scope: 'global';
2333
+ scope: 'global' | 'workspace';
2322
2334
  requestedScope: 'global' | 'workspace';
2323
2335
  applied: boolean;
2324
2336
  fallbackReason: string | null;
2325
2337
  current: ModelRef;
2326
2338
  }
2339
+ interface ModelCatalogItem extends ModelRef {
2340
+ profileName: string;
2341
+ enabled: boolean;
2342
+ providerQualifiedModelID: string;
2343
+ sourceSummary: Array<'config' | 'env' | 'auth' | 'plugin' | 'cli'>;
2344
+ }
2345
+ interface ModelCatalogResponse {
2346
+ items: ModelCatalogItem[];
2347
+ default: ModelRef | null;
2348
+ }
2349
+ interface ResolveRuntimeModelRequest {
2350
+ providerID: string;
2351
+ modelID: string;
2352
+ }
2353
+ interface ResolveRuntimeModelResponse extends ModelRef {
2354
+ profileName: string;
2355
+ providerQualifiedModelID: string;
2356
+ authState: 'configured';
2357
+ credentialSource: 'auth' | 'env';
2358
+ credentialsMasked: true;
2359
+ adapterType: 'responses_api' | 'chat_completions';
2360
+ adapterClass: string;
2361
+ baseURL: string | null;
2362
+ }
2327
2363
  interface ModelPoolSourceRecord {
2328
2364
  pluginSpec: string;
2329
2365
  pluginID: string;
@@ -2344,6 +2380,7 @@ interface ModelPoolStatusResponse {
2344
2380
  }
2345
2381
  interface CreateSessionRequest {
2346
2382
  resumeFrom?: string;
2383
+ cwd?: string;
2347
2384
  config?: {
2348
2385
  model?: string;
2349
2386
  agent?: string;
@@ -2353,6 +2390,7 @@ interface CreateSessionRequest {
2353
2390
  interface CreateSessionResponse {
2354
2391
  sessionId: string;
2355
2392
  createdAt: number;
2393
+ cwd?: string;
2356
2394
  config: {
2357
2395
  model: string;
2358
2396
  agent: string;
@@ -2416,15 +2454,44 @@ interface APIError {
2416
2454
  details?: Record<string, unknown>;
2417
2455
  }
2418
2456
 
2457
+ type PybErrorCategory = 'config' | 'network' | 'api' | 'response_parse';
2458
+ type PybErrorDetails = Record<string, unknown> | undefined;
2459
+ type PybAPIErrorOptions = {
2460
+ category?: PybErrorCategory;
2461
+ recoverable?: boolean;
2462
+ details?: PybErrorDetails;
2463
+ cause?: unknown;
2464
+ name?: string;
2465
+ };
2466
+ declare class PybAPIError extends Error {
2467
+ readonly code: string;
2468
+ readonly category: PybErrorCategory;
2469
+ readonly recoverable: boolean;
2470
+ readonly details?: PybErrorDetails;
2471
+ readonly cause?: unknown;
2472
+ constructor(code: string, message: string, options?: PybAPIErrorOptions);
2473
+ }
2474
+ declare class PybConfigError extends PybAPIError {
2475
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2476
+ }
2477
+ declare class PybNetworkError extends PybAPIError {
2478
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2479
+ }
2480
+ declare class PybResponseParseError extends PybAPIError {
2481
+ constructor(code: string, message: string, details?: PybErrorDetails, cause?: unknown);
2482
+ }
2483
+
2419
2484
  interface PybClientConfig {
2420
2485
  baseUrl?: string;
2421
2486
  timeout?: number;
2422
2487
  headers?: Record<string, string>;
2488
+ directory?: string;
2423
2489
  }
2424
2490
  declare class PybClient {
2425
2491
  private baseUrl;
2426
2492
  private timeout;
2427
2493
  private headers;
2494
+ readonly directory: string | undefined;
2428
2495
  readonly session: {
2429
2496
  create: (request?: CreateSessionRequest) => Promise<CreateSessionResponse>;
2430
2497
  list: (params?: {
@@ -2491,9 +2558,13 @@ declare class PybClient {
2491
2558
  };
2492
2559
  };
2493
2560
  readonly model: {
2494
- getDefault: () => Promise<ModelRef | null>;
2561
+ getDefault: (request?: GetDefaultModelRequest) => Promise<GetDefaultModelResponse>;
2562
+ catalog: () => Promise<ModelCatalogResponse>;
2495
2563
  setDefault: (request: SetDefaultModelRequest) => Promise<SetDefaultModelResponse>;
2496
2564
  };
2565
+ readonly runtime: {
2566
+ resolveModel: (request: ResolveRuntimeModelRequest) => Promise<ResolveRuntimeModelResponse>;
2567
+ };
2497
2568
  readonly auth: {
2498
2569
  set: (providerID: string, request: AuthSetRequest) => Promise<AuthSetResponse>;
2499
2570
  remove: (providerID: string) => Promise<AuthRemoveResponse>;
@@ -2503,6 +2574,7 @@ declare class PybClient {
2503
2574
  };
2504
2575
  constructor(config?: PybClientConfig);
2505
2576
  getHealth(): Promise<HealthResponse>;
2577
+ withDirectory(directory: string): PybClient;
2506
2578
  private createSessionRequest;
2507
2579
  private listSessionsRequest;
2508
2580
  private getSessionRequest;
@@ -2526,14 +2598,20 @@ declare class PybClient {
2526
2598
  private callbackProviderOAuthRequest;
2527
2599
  private getDefaultModelRequest;
2528
2600
  private setDefaultModelRequest;
2601
+ private getModelCatalogRequest;
2602
+ private resolveRuntimeModelRequest;
2529
2603
  private setProviderAuthRequest;
2530
2604
  private removeProviderAuthRequest;
2531
2605
  private getModelPoolStatusRequest;
2532
2606
  private listMCPServersRequest;
2533
2607
  private connectMCPServerRequest;
2534
2608
  private disconnectMCPServerRequest;
2609
+ private parseJson;
2610
+ private parseData;
2611
+ private isRecoverableResponseStatus;
2535
2612
  private fetch;
2536
2613
  }
2614
+ declare function createPybClient(config?: PybClientConfig): PybClient;
2537
2615
 
2538
2616
  interface SSEClientOptions {
2539
2617
  baseUrl?: string;
@@ -3364,149 +3442,6 @@ declare function resolveDefaultBackendFromEnv(input?: {
3364
3442
  routeSource: SessionBackendRouteSource;
3365
3443
  };
3366
3444
 
3367
- type OpenworkFieldMapping = {
3368
- openworkField: string;
3369
- pybField: string;
3370
- };
3371
- type OpenworkEndpointMapping = {
3372
- openworkEndpoint: string;
3373
- pybEndpoint: string;
3374
- };
3375
- type OpenworkErrorMapping = {
3376
- openworkErrorCode: string;
3377
- pybErrorCode: string;
3378
- };
3379
- type OpenworkMigrationMap = {
3380
- fieldMappings: OpenworkFieldMapping[];
3381
- endpointMappings: OpenworkEndpointMapping[];
3382
- errorMappings: OpenworkErrorMapping[];
3383
- };
3384
- type OpenworkMigrationMapV2 = OpenworkMigrationMap & {
3385
- version: 'v2';
3386
- };
3387
- type OpenworkCompatibilitySampleInput = {
3388
- providerID: string;
3389
- modelID: string;
3390
- apiKey: string;
3391
- scope?: 'global' | 'workspace';
3392
- };
3393
- type OpenworkProviderPickerSample = {
3394
- providers: Array<{
3395
- id: string;
3396
- label: string;
3397
- connected: boolean;
3398
- isDefault: boolean;
3399
- }>;
3400
- };
3401
- type OpenworkAuthModalSample = {
3402
- providerID: string;
3403
- method: 'api';
3404
- connected: boolean;
3405
- };
3406
- type OpenworkModelSetSample = {
3407
- scope: 'global';
3408
- fallbackReason: string | null;
3409
- current: ModelRef;
3410
- };
3411
- type OpenworkGoNoGoResult = {
3412
- decision: 'go' | 'no-go';
3413
- reasons: string[];
3414
- rollbackPlan: string[];
3415
- };
3416
- type OpenworkCompatibilitySampleResult = {
3417
- providerPicker: OpenworkProviderPickerSample;
3418
- authModal: OpenworkAuthModalSample;
3419
- modelSet: OpenworkModelSetSample;
3420
- modelPoolStatus: ModelPoolStatusResponse;
3421
- compatibilityScore: number;
3422
- goNoGo: OpenworkGoNoGoResult;
3423
- };
3424
- type ProviderFacadeEnvironment = 'internal' | 'beta' | 'production';
3425
- type ProviderFacadeFeatureFlag = {
3426
- enabled: boolean;
3427
- environment: ProviderFacadeEnvironment;
3428
- workspaceAllowlist: string[];
3429
- };
3430
- type CompatibilityWindowPolicy = {
3431
- minorVersions: number;
3432
- deprecatedEndpoints: string[];
3433
- };
3434
- type ProviderFacadeReleaseState = {
3435
- featureFlag: ProviderFacadeFeatureFlag;
3436
- compatibilityWindow: CompatibilityWindowPolicy;
3437
- };
3438
- type ProviderFacadeRolloutInput = {
3439
- p0IncidentCount: number;
3440
- rollbackSwitchLatencyMs: number;
3441
- fallbackReasonDistribution: Record<string, number>;
3442
- authFailureRate: number;
3443
- compatibilityMinorVersions: number;
3444
- };
3445
- type ProviderFacadeRolloutResult = {
3446
- decision: 'go' | 'no-go';
3447
- reasons: string[];
3448
- };
3449
- type ProviderFacadeAccessInput = {
3450
- workspaceID: string;
3451
- };
3452
- type ProviderFacadeAccessResult = {
3453
- allowed: boolean;
3454
- reason?: 'feature_disabled' | 'workspace_not_allowlisted';
3455
- };
3456
- type ProviderFacadeDeprecationChecklist = {
3457
- compatibilityMinorVersions: number;
3458
- deprecatedEndpoints: string[];
3459
- readyForRetirement: boolean;
3460
- };
3461
- type ModelPlatformDebtSeverity = 'D0' | 'D1' | 'D2';
3462
- type ModelPlatformDebtStatus = 'open' | 'closed';
3463
- type ModelPlatformDebtItem = {
3464
- id: string;
3465
- title: string;
3466
- severity: ModelPlatformDebtSeverity;
3467
- owner: string;
3468
- batch: string;
3469
- status: ModelPlatformDebtStatus;
3470
- };
3471
- type ModelPlatformAuditEvidence = {
3472
- testsPassed: boolean;
3473
- lintPassed: boolean;
3474
- typecheckPassed: boolean;
3475
- rollbackDrillPassed: boolean;
3476
- };
3477
- type ModelPlatformDebtCloseoutInput = {
3478
- debts: ModelPlatformDebtItem[];
3479
- auditEvidence: ModelPlatformAuditEvidence;
3480
- };
3481
- type ModelPlatformDebtCloseoutSummary = {
3482
- openD0: number;
3483
- openD1: number;
3484
- openD2: number;
3485
- invalidBatchOwnershipCount: number;
3486
- evidenceCompleteness: number;
3487
- };
3488
- type ModelPlatformDebtCloseoutResult = {
3489
- decision: 'go' | 'no-go';
3490
- reasonCodes: string[];
3491
- summary: ModelPlatformDebtCloseoutSummary;
3492
- riskStatement: string;
3493
- };
3494
- declare function getProviderFacadeReleaseState(): ProviderFacadeReleaseState;
3495
- declare function setProviderFacadeReleaseState(input: Partial<ProviderFacadeReleaseState>): ProviderFacadeReleaseState;
3496
- declare function evaluateProviderFacadeRollout(input: ProviderFacadeRolloutInput): ProviderFacadeRolloutResult;
3497
- declare function evaluateProviderFacadeAccess(input: ProviderFacadeAccessInput): ProviderFacadeAccessResult;
3498
- declare function getProviderFacadeDeprecationChecklist(): ProviderFacadeDeprecationChecklist;
3499
- declare function evaluateModelPlatformDebtCloseout(input: ModelPlatformDebtCloseoutInput): ModelPlatformDebtCloseoutResult;
3500
- declare function getOpenworkMigrationMap(): OpenworkMigrationMap;
3501
- declare function getOpenworkMigrationMapV2(): OpenworkMigrationMapV2;
3502
- declare function runOpenworkCompatibilitySample(client: PybClient, input: OpenworkCompatibilitySampleInput): Promise<OpenworkCompatibilitySampleResult>;
3503
-
3504
- /**
3505
- * @pyb/sdk - PYB-CLI Server SDK
3506
- *
3507
- * Provides HTTP client and SSE event handling for PYB-CLI Web UI integration.
3508
- */
3509
-
3510
- declare const SDK_VERSION = "0.1.0";
3445
+ declare const SDK_VERSION = "1.5.57";
3511
3446
 
3512
- export { type APIError, type Attachment, type AuthRemoveResponse, type AuthSetRequest, type AuthSetResponse, type BackendKind, BackendKindSchema, type CanUseToolCallback, type CanUseToolDecision, type CompatibilityWindowPolicy, type ContentBlock, ContentBlockSchema, type CreateSessionRequest, type CreateSessionResponse, DEFAULT_SESSION_BACKEND_ROUTER_CONFIG, type DualTrackMetrics, DualTrackMetricsSchema, type DualTrackRawStats, DualTrackRawStatsSchema, type DualTrackThresholds, DualTrackThresholdsSchema, type ErrorEvent, ErrorEventSchema, type ErrorStreamEvent, ErrorStreamEventSchema, FALLBACK_TRIGGER_MATRIX, type FallbackTriggerReason, FallbackTriggerReasonSchema, type HealthResponse, type Message, type MessageCompletedEvent, MessageCompletedEventSchema, type MessageCreatedEvent, MessageCreatedEventSchema, MessageSchema, type MessageUpdatedEvent, MessageUpdatedEventSchema, type ModelPlatformAuditEvidence, type ModelPlatformDebtCloseoutInput, type ModelPlatformDebtCloseoutResult, type ModelPlatformDebtCloseoutSummary, type ModelPlatformDebtItem, type ModelPlatformDebtSeverity, type ModelPlatformDebtStatus, type ModelPoolSourceRecord, type ModelPoolStatusItem, type ModelPoolStatusResponse, type ModelRef, type OpenworkAuthModalSample, type OpenworkCompatibilitySampleInput, type OpenworkCompatibilitySampleResult, type OpenworkEndpointMapping, type OpenworkErrorMapping, type OpenworkFieldMapping, type OpenworkGoNoGoResult, type OpenworkMigrationMap, type OpenworkMigrationMapV2, type OpenworkModelSetSample, type OpenworkProviderPickerSample, PROTOCOL_ERROR_TO_RUNTIME_ERROR_TYPE, type PermissionEvaluator, type PermissionMode, type PermissionRequestedEvent, PermissionRequestedEventSchema, type PermissionRespondedEvent, PermissionRespondedEventSchema, type PermissionResponseRequest, type PermissionTimeoutEvent, PermissionTimeoutEventSchema, type PromptRequest, type PromptResponse, type ProtocolErrorCode, ProtocolErrorCodeSchema, type ProtocolErrorMapping, ProtocolErrorMappingSchema, type ProtocolSessionStreamBinding, ProtocolSessionStreamBindingManager, type ProviderAuthMethod, type ProviderFacadeAccessInput, type ProviderFacadeAccessResult, type ProviderFacadeDeprecationChecklist, type ProviderFacadeEnvironment, type ProviderFacadeFeatureFlag, type ProviderFacadeReleaseState, type ProviderFacadeRolloutInput, type ProviderFacadeRolloutResult, type ProviderListResponse, type ProviderOAuthAuthorizeRequest, type ProviderOAuthAuthorizeResponse, type ProviderOAuthCallbackRequest, type ProviderOAuthCallbackResponse, type ProviderRef, PybClient, type PybSSEEvent, PybSSEEventSchema, type QuerySessionExecutor, type RequestCompletedEvent, RequestCompletedEventSchema, type RequestStartedEvent, RequestStartedEventSchema, type ResolvePermissionDecisionInput, type RuntimeBackendErrorPhase, type RuntimeCompatibleLegacyEvent, type RuntimeEvent, type RuntimeEventDomain, RuntimeEventDomainSchema, type RuntimeEventErrorType, RuntimeEventErrorTypeSchema, RuntimeEventSchema, type RuntimePermissionPolicy, type RuntimeSession, type RuntimeSessionConfig, type RuntimeSessionEvent, RuntimeSessionEventSchema, type RuntimeSessionInput, RuntimeSessionInputSchema, type RuntimeSessionStatus, RuntimeSessionStatusSchema, S4_PROTOCOL_ERROR_TOP_CODES, S5_A0_EQUIVALENCE_SAMPLE_SET, SDK_VERSION, SESSION_BACKEND_CONFIG_CONTRACT_VERSION, SESSION_BACKEND_ENV_KEY, SESSION_BACKEND_OBSERVABILITY_SPEC, SSEClient, type SSEDedupEvent, SSEDedupEventSchema, type SSEEvent, type SSEReplayEvent, SSEReplayEventSchema, type SSEReplayGapEvent, SSEReplayGapEventSchema, type ServerConnectedEvent, ServerConnectedEventSchema, type ServerHeartbeatEvent, ServerHeartbeatEventSchema, type ServerStatusEvent, ServerStatusEventSchema, type SessionBackend, type SessionBackendRouteSource, type SessionBackendRouterConfig, SessionBackendRouterConfigSchema, type SessionBackendSession, type SessionBackendUserConfig, type SessionCreatedEvent, SessionCreatedEventSchema, type SessionDeletedEvent, SessionDeletedEventSchema, type SessionEventPublisher, type SessionInfo, type SessionUpdatedEvent, SessionUpdatedEventSchema, type SetDefaultModelRequest, type SetDefaultModelResponse, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolErrorEvent, ToolErrorEventSchema, type ToolInfo, type ToolPermissionContext, type ToolProgressEvent, ToolProgressEventSchema, type ToolResolver, type ToolStartedEvent, ToolStartedEventSchema, type V2Message, V2MessageSchema, V2RequestStatusSchema, type V2Session, V2SessionSchema, type V2SessionStatus, V2SessionStatusSchema, type V2ToolUseContext, V2ToolUseContextSchema, buildDefaultDualTrackThresholds, buildV2ToolUseContextFromPromptRequest, canTransitionV2SessionStatus, createDefaultToolPermissionContextForSdk, createProtocolSessionBackend, createRuntimePermissionContextForSession, createRuntimeSession, createRuntimeSessionBackend, createSSEClient, createSessionBackendRouter, emitBackendConfigWarning, evaluateDualTrackMetrics, evaluateModelPlatformDebtCloseout, evaluateProviderFacadeAccess, evaluateProviderFacadeRollout, evaluateV1DeprecationReadiness, getOpenworkMigrationMap, getOpenworkMigrationMapV2, getProviderFacadeDeprecationChecklist, getProviderFacadeReleaseState, getRuntimeEventMappingRules, isToolAutoExecutableInContext, mapProtocolErrorCodeToRuntimeErrorType, mapRuntimeBackendErrorToRuntimeEvent, mapRuntimeMessageToV2, mapRuntimeSessionStatusToV2, mapV1MessageToV2, mapV1SessionStatusToV2, projectLegacyEventToRuntimeEvent, projectRuntimeEventToLegacyEvent, resolveDefaultBackend, resolveDefaultBackendFromEnv, resolvePermissionDecision, resolvePermissionModeForSdk, resolveRouterBackendKind, runOpenworkCompatibilitySample, setProviderFacadeReleaseState, shouldTriggerFallback, validateV2Message, validateV2Session, validateV2ToolUseContext };
3447
+ export { type APIError, type Attachment, type AuthRemoveResponse, type AuthSetRequest, type AuthSetResponse, type BackendKind, BackendKindSchema, type CanUseToolCallback, type CanUseToolDecision, type ContentBlock, ContentBlockSchema, type CreateSessionRequest, type CreateSessionResponse, DEFAULT_SESSION_BACKEND_ROUTER_CONFIG, type DualTrackMetrics, DualTrackMetricsSchema, type DualTrackRawStats, DualTrackRawStatsSchema, type DualTrackThresholds, DualTrackThresholdsSchema, type ErrorEvent, ErrorEventSchema, type ErrorStreamEvent, ErrorStreamEventSchema, FALLBACK_TRIGGER_MATRIX, type FallbackTriggerReason, FallbackTriggerReasonSchema, type GetDefaultModelRequest, type GetDefaultModelResponse, type HealthResponse, type Message, type MessageCompletedEvent, MessageCompletedEventSchema, type MessageCreatedEvent, MessageCreatedEventSchema, MessageSchema, type MessageUpdatedEvent, MessageUpdatedEventSchema, type ModelCatalogItem, type ModelCatalogResponse, type ModelPoolSourceRecord, type ModelPoolStatusItem, type ModelPoolStatusResponse, type ModelRef, PROTOCOL_ERROR_TO_RUNTIME_ERROR_TYPE, type PermissionEvaluator, type PermissionMode, type PermissionRequestedEvent, PermissionRequestedEventSchema, type PermissionRespondedEvent, PermissionRespondedEventSchema, type PermissionResponseRequest, type PermissionTimeoutEvent, PermissionTimeoutEventSchema, type PromptRequest, type PromptResponse, type ProtocolErrorCode, ProtocolErrorCodeSchema, type ProtocolErrorMapping, ProtocolErrorMappingSchema, type ProtocolSessionStreamBinding, ProtocolSessionStreamBindingManager, type ProviderAuthMethod, type ProviderListResponse, type ProviderOAuthAuthorizeRequest, type ProviderOAuthAuthorizeResponse, type ProviderOAuthCallbackRequest, type ProviderOAuthCallbackResponse, type ProviderRef, PybAPIError, PybClient, PybConfigError, PybNetworkError, PybResponseParseError, type PybSSEEvent, PybSSEEventSchema, type QuerySessionExecutor, type RequestCompletedEvent, RequestCompletedEventSchema, type RequestStartedEvent, RequestStartedEventSchema, type ResolvePermissionDecisionInput, type ResolveRuntimeModelRequest, type ResolveRuntimeModelResponse, type RuntimeBackendErrorPhase, type RuntimeCompatibleLegacyEvent, type RuntimeEvent, type RuntimeEventDomain, RuntimeEventDomainSchema, type RuntimeEventErrorType, RuntimeEventErrorTypeSchema, RuntimeEventSchema, type RuntimePermissionPolicy, type RuntimeSession, type RuntimeSessionConfig, type RuntimeSessionEvent, RuntimeSessionEventSchema, type RuntimeSessionInput, RuntimeSessionInputSchema, type RuntimeSessionStatus, RuntimeSessionStatusSchema, S4_PROTOCOL_ERROR_TOP_CODES, S5_A0_EQUIVALENCE_SAMPLE_SET, SDK_VERSION, SESSION_BACKEND_CONFIG_CONTRACT_VERSION, SESSION_BACKEND_ENV_KEY, SESSION_BACKEND_OBSERVABILITY_SPEC, SSEClient, type SSEDedupEvent, SSEDedupEventSchema, type SSEEvent, type SSEReplayEvent, SSEReplayEventSchema, type SSEReplayGapEvent, SSEReplayGapEventSchema, type ServerConnectedEvent, ServerConnectedEventSchema, type ServerHeartbeatEvent, ServerHeartbeatEventSchema, type ServerStatusEvent, ServerStatusEventSchema, type SessionBackend, type SessionBackendRouteSource, type SessionBackendRouterConfig, SessionBackendRouterConfigSchema, type SessionBackendSession, type SessionBackendUserConfig, type SessionCreatedEvent, SessionCreatedEventSchema, type SessionDeletedEvent, SessionDeletedEventSchema, type SessionEventPublisher, type SessionInfo, type SessionUpdatedEvent, SessionUpdatedEventSchema, type SetDefaultModelRequest, type SetDefaultModelResponse, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolErrorEvent, ToolErrorEventSchema, type ToolInfo, type ToolPermissionContext, type ToolProgressEvent, ToolProgressEventSchema, type ToolResolver, type ToolStartedEvent, ToolStartedEventSchema, type V2Message, V2MessageSchema, V2RequestStatusSchema, type V2Session, V2SessionSchema, type V2SessionStatus, V2SessionStatusSchema, type V2ToolUseContext, V2ToolUseContextSchema, buildDefaultDualTrackThresholds, buildV2ToolUseContextFromPromptRequest, canTransitionV2SessionStatus, createDefaultToolPermissionContextForSdk, createProtocolSessionBackend, createPybClient, createRuntimePermissionContextForSession, createRuntimeSession, createRuntimeSessionBackend, createSSEClient, createSessionBackendRouter, emitBackendConfigWarning, evaluateDualTrackMetrics, evaluateV1DeprecationReadiness, getRuntimeEventMappingRules, isToolAutoExecutableInContext, mapProtocolErrorCodeToRuntimeErrorType, mapRuntimeBackendErrorToRuntimeEvent, mapRuntimeMessageToV2, mapRuntimeSessionStatusToV2, mapV1MessageToV2, mapV1SessionStatusToV2, projectLegacyEventToRuntimeEvent, projectRuntimeEventToLegacyEvent, resolveDefaultBackend, resolveDefaultBackendFromEnv, resolvePermissionDecision, resolvePermissionModeForSdk, resolveRouterBackendKind, shouldTriggerFallback, validateV2Message, validateV2Session, validateV2ToolUseContext };