@get-bb/plugin-sdk 0.4.84 → 0.4.88

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.
@@ -8,6 +8,57 @@
8
8
  import { z } from 'zod';
9
9
  import { Writable, Readable } from 'node:stream';
10
10
 
11
+ declare const contextEntrySchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ label: z.ZodString;
14
+ tokens: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ type ContextEntry = z.infer<typeof contextEntrySchema>;
17
+ declare const contextCategorySchema: z.ZodObject<{
18
+ entries: z.ZodArray<z.ZodObject<{
19
+ id: z.ZodString;
20
+ label: z.ZodString;
21
+ tokens: z.ZodNumber;
22
+ }, z.core.$strip>>;
23
+ id: z.ZodString;
24
+ kind: z.ZodEnum<{
25
+ deferred: "deferred";
26
+ free: "free";
27
+ reserved: "reserved";
28
+ used: "used";
29
+ }>;
30
+ label: z.ZodString;
31
+ tokens: z.ZodNumber;
32
+ }, z.core.$strip>;
33
+ type ContextCategory = z.infer<typeof contextCategorySchema>;
34
+ declare const contextSnapshotSchema: z.ZodObject<{
35
+ autoCompactAtTokens: z.ZodNullable<z.ZodNumber>;
36
+ capturedAt: z.ZodISODateTime;
37
+ categories: z.ZodArray<z.ZodObject<{
38
+ entries: z.ZodArray<z.ZodObject<{
39
+ id: z.ZodString;
40
+ label: z.ZodString;
41
+ tokens: z.ZodNumber;
42
+ }, z.core.$strip>>;
43
+ id: z.ZodString;
44
+ kind: z.ZodEnum<{
45
+ deferred: "deferred";
46
+ free: "free";
47
+ reserved: "reserved";
48
+ used: "used";
49
+ }>;
50
+ label: z.ZodString;
51
+ tokens: z.ZodNumber;
52
+ }, z.core.$strip>>;
53
+ contextWindowTokens: z.ZodNumber;
54
+ estimated: z.ZodBoolean;
55
+ model: z.ZodString;
56
+ providerSessionId: z.ZodString;
57
+ providerTurnId: z.ZodNullable<z.ZodString>;
58
+ usedTokens: z.ZodNumber;
59
+ }, z.core.$strip>;
60
+ type ContextSnapshot = z.infer<typeof contextSnapshotSchema>;
61
+
11
62
  declare const acpReasoningCliSchema: z.ZodObject<{
12
63
  defaultLevel: z.ZodOptional<z.ZodEnum<{
13
64
  high: "high";
@@ -373,6 +424,32 @@ type ThreadEventTokenUsageBreakdown = z.infer<typeof threadEventTokenUsageBreakd
373
424
  declare const threadEventContextWindowUsageSchema: z.ZodObject<{
374
425
  estimated: z.ZodBoolean;
375
426
  modelContextWindow: z.ZodNullable<z.ZodNumber>;
427
+ snapshot: z.ZodOptional<z.ZodObject<{
428
+ autoCompactAtTokens: z.ZodNullable<z.ZodNumber>;
429
+ capturedAt: z.ZodISODateTime;
430
+ categories: z.ZodArray<z.ZodObject<{
431
+ entries: z.ZodArray<z.ZodObject<{
432
+ id: z.ZodString;
433
+ label: z.ZodString;
434
+ tokens: z.ZodNumber;
435
+ }, z.core.$strip>>;
436
+ id: z.ZodString;
437
+ kind: z.ZodEnum<{
438
+ deferred: "deferred";
439
+ free: "free";
440
+ reserved: "reserved";
441
+ used: "used";
442
+ }>;
443
+ label: z.ZodString;
444
+ tokens: z.ZodNumber;
445
+ }, z.core.$strip>>;
446
+ contextWindowTokens: z.ZodNumber;
447
+ estimated: z.ZodBoolean;
448
+ model: z.ZodString;
449
+ providerSessionId: z.ZodString;
450
+ providerTurnId: z.ZodNullable<z.ZodString>;
451
+ usedTokens: z.ZodNumber;
452
+ }, z.core.$strip>>;
376
453
  usedTokens: z.ZodNullable<z.ZodNumber>;
377
454
  }, z.core.$strip>;
378
455
  type ThreadEventContextWindowUsage = z.infer<typeof threadEventContextWindowUsageSchema>;
@@ -2859,6 +2936,32 @@ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2859
2936
  kind: z.ZodLiteral<"contextWindow">;
2860
2937
  providerTurnId: z.ZodOptional<z.ZodString>;
2861
2938
  size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2939
+ snapshot: z.ZodOptional<z.ZodObject<{
2940
+ autoCompactAtTokens: z.ZodNullable<z.ZodNumber>;
2941
+ capturedAt: z.ZodISODateTime;
2942
+ categories: z.ZodArray<z.ZodObject<{
2943
+ entries: z.ZodArray<z.ZodObject<{
2944
+ id: z.ZodString;
2945
+ label: z.ZodString;
2946
+ tokens: z.ZodNumber;
2947
+ }, z.core.$strip>>;
2948
+ id: z.ZodString;
2949
+ kind: z.ZodEnum<{
2950
+ deferred: "deferred";
2951
+ free: "free";
2952
+ reserved: "reserved";
2953
+ used: "used";
2954
+ }>;
2955
+ label: z.ZodString;
2956
+ tokens: z.ZodNumber;
2957
+ }, z.core.$strip>>;
2958
+ contextWindowTokens: z.ZodNumber;
2959
+ estimated: z.ZodBoolean;
2960
+ model: z.ZodString;
2961
+ providerSessionId: z.ZodString;
2962
+ providerTurnId: z.ZodNullable<z.ZodString>;
2963
+ usedTokens: z.ZodNumber;
2964
+ }, z.core.$strip>>;
2862
2965
  used: z.ZodNullable<z.ZodNumber>;
2863
2966
  }, z.core.$strip>, z.ZodObject<{
2864
2967
  kind: z.ZodLiteral<"context.compacted">;
@@ -3674,6 +3777,32 @@ declare const threadDeltaNotificationParamsSchema: z.ZodObject<{
3674
3777
  kind: z.ZodLiteral<"contextWindow">;
3675
3778
  providerTurnId: z.ZodOptional<z.ZodString>;
3676
3779
  size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3780
+ snapshot: z.ZodOptional<z.ZodObject<{
3781
+ autoCompactAtTokens: z.ZodNullable<z.ZodNumber>;
3782
+ capturedAt: z.ZodISODateTime;
3783
+ categories: z.ZodArray<z.ZodObject<{
3784
+ entries: z.ZodArray<z.ZodObject<{
3785
+ id: z.ZodString;
3786
+ label: z.ZodString;
3787
+ tokens: z.ZodNumber;
3788
+ }, z.core.$strip>>;
3789
+ id: z.ZodString;
3790
+ kind: z.ZodEnum<{
3791
+ deferred: "deferred";
3792
+ free: "free";
3793
+ reserved: "reserved";
3794
+ used: "used";
3795
+ }>;
3796
+ label: z.ZodString;
3797
+ tokens: z.ZodNumber;
3798
+ }, z.core.$strip>>;
3799
+ contextWindowTokens: z.ZodNumber;
3800
+ estimated: z.ZodBoolean;
3801
+ model: z.ZodString;
3802
+ providerSessionId: z.ZodString;
3803
+ providerTurnId: z.ZodNullable<z.ZodString>;
3804
+ usedTokens: z.ZodNumber;
3805
+ }, z.core.$strip>>;
3677
3806
  used: z.ZodNullable<z.ZodNumber>;
3678
3807
  }, z.core.$strip>, z.ZodObject<{
3679
3808
  kind: z.ZodLiteral<"context.compacted">;
@@ -5129,5 +5258,5 @@ declare const claudeTaskToolOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
5129
5258
  }, z.core.$loose>]>;
5130
5259
  type ClaudeTaskToolOutput = z.infer<typeof claudeTaskToolOutputSchema>;
5131
5260
 
5132
- export { BRIDGE_INBOUND_REQUEST_METHODS, BRIDGE_JSON_RPC_ERRORS, BRIDGE_NOTIFICATION_METHODS, BRIDGE_REQUEST_METHODS, HIGH_REASONING_EFFORT, LOCAL_BASH_TASK_TYPE, LOCAL_WORKFLOW_TASK_TYPE, LOW_REASONING_EFFORT, MAX_REASONING_EFFORT, MEDIUM_REASONING_EFFORT, PROVIDER_BRIDGE_EXPORT_NAME, PROVIDER_BRIDGE_PROTOCOL_VERSION, ProviderRequestDecodeError, ProviderResponseEncodeError, THREAD_DELTA_GRAMMAR_V2, THREAD_DELTA_GRAMMAR_V3, THREAD_DELTA_NOTIFICATION_METHOD, ULTRACODE_REASONING_EFFORT, USER_QUESTION_MAX_OPTIONS, USER_QUESTION_MAX_QUESTIONS, XHIGH_REASONING_EFFORT, ZERO_TOKEN_USAGE, acpNativeReasoningSchema, acpPermissionCliSchema, acpReasoningCliSchema, addTokenUsage, approvalInteractionOutcomeSchema, backgroundTaskItemStatus, bashArgsSchema, bridgeCapabilitiesSchema, bridgeErrorDataSchema, bridgeGrammarVersionsSchema, bridgeRequestEnvelopeSchema, bridgeSteerModeSchema, buildShellEnvOverrides, claudeTaskToolNameSchema, claudeTaskToolOutputSchema, createBridgeIo, createBridgeLineHandler, createPendingToolCallTracker, createProviderVisibilityMetadata, decodeBridgeJsonRpcResponse, decodeToolCallResponsePayload, deltaBackgroundTaskShapeSchema, deltaDelegationShapeSchema, deltaExtensionShapeSchema, deltaFileChangeSchema, deltaFileReadShapeSchema, deltaItemKeySchema, deltaItemShapeSchema, deltaNoTurnFallbackSchema, deltaOutputChannelSchema, deltaPlanStepsShapeSchema, deltaPresentationSchema, deltaProgressSnapshotSchema, deltaSearchShapeSchema, deltaTextChannelSchema, dynamicToolSchema, errorEnvelopeSchema, BridgeRecoveryError as experimental_BridgeRecoveryError, COMPACTION_PRESENTATION as experimental_COMPACTION_PRESENTATION, REASONING_PRESENTATION as experimental_REASONING_PRESENTATION, buildBridgeToolCallContent as experimental_buildBridgeToolCallContent, clampPercent as experimental_clampPercent, commandOutput as experimental_commandOutput, compareVersions as experimental_compareVersions, experimental_defineProviderBridge, downloadedInstallerCommand as experimental_downloadedInstallerCommand, fileReadPresentation as experimental_fileReadPresentation, formatCommand as experimental_formatCommand, installationVerification as experimental_installationVerification, experimental_isProviderBridgeRecording, npmCommand as experimental_npmCommand, npmGlobalInstallCommand as experimental_npmGlobalInstallCommand, npmGlobalInstallSource as experimental_npmGlobalInstallSource, npmLatestVersion as experimental_npmLatestVersion, planStepsPresentation as experimental_planStepsPresentation, presentationDetail as experimental_presentationDetail, presentationFileName as experimental_presentationFileName, presentationTitle as experimental_presentationTitle, probeNpmGlobalPackage as experimental_probeNpmGlobalPackage, readBoundedLines as experimental_readBoundedLines, readCliVersion as experimental_readCliVersion, experimental_recordProviderChildIo, resolveExecutablePath as experimental_resolveExecutablePath, searchPresentation as experimental_searchPresentation, toolPresentation as experimental_toolPresentation, versionFrom as experimental_versionFrom, webFetchPresentation as experimental_webFetchPresentation, webSearchPresentation as experimental_webSearchPresentation, withTitle as experimental_withTitle, extensionKindSchema, extractResultText, getRawSdkMessage, getRecordProperty, getStringProperty, acpLaunchSpecSchema as hostDaemonAcpLaunchSpecSchema, initializeParamsSchema, instructionModeValues, interactionRequestPayloadSchema, isApprovalInteractionOutcome, isApprovalPendingInteractionPayload, isApprovalPendingInteractionResolution, isBackgroundAgentTaskType, isExtensionKind, isRecord, isSettledBackgroundTaskStatus, isStandaloneBuiltinCompactCommand, isUserQuestionPendingInteractionPayload, isUserQuestionPendingInteractionResolution, jsonRpcEnvelopeSchema, jsonValueSchema, mimeTypeFromExtension, modelListParamsSchema, normalizeAcpLaunchSpec as normalizeHostDaemonAcpLaunchSpec, normalizeProviderCommandOutput, pendingInteractionCommandActionSchema, pendingInteractionFileSystemPermissionsSchema, pendingInteractionMacOsPermissionsSchema, pendingInteractionNetworkPermissionsSchema, pendingInteractionRequestedPermissionProfileSchema, pendingInteractionResolutionSchema, permissionEscalationValues, providerHealthResultSchema, providerHealthSchema, providerInstallationActionKindSchema, providerInstallationActionSchema, providerInstallationCommandSchema, providerInstallationRequirementSchema, providerInstallationRunParamsSchema, providerInstallationRunResultSchema, providerInstallationSourceSchema, providerInstallationStatusParamsSchema, providerInstallationStatusSchema, providerInstallationVerificationSchema, providerInteractionOutcomeSchema, providerMaintenanceParamsSchema, providerRawEventSchema, providerRecoveryHintSchema, providerRecoveryKindSchema, providerRecoveryKindValues, providerRecoveryNotificationSchema, providerUsageResultSchema, providerUsageSchema, providerUsageWindowSchema, reasoningEffortsForLevels, reasoningLevelSchema, reasoningLevelValues, removeCommandMentionsFromPromptInput, runBridgeRequest, runtimePermissionScopeValues, sanitizeInheritedChildProcessEnv, sdkMessageEnvelopeSchema, shouldAutoDenyInteractiveRequest, skillsConfigureParamsSchema, textBlockSchema, threadArchiveParamsSchema, threadContextWindowUsageEnvelopeSchema, threadDeltaNotificationParamsSchema, threadDeltaSchema, threadDiscardParamsSchema, threadEventItemPresentationSchema, threadEventSearchModeSchema, threadForkParamsSchema, threadGoalClearParamsSchema, threadIdentityEnvelopeSchema, threadNameSetParamsSchema, threadResumeParamsSchema, threadStartParamsSchema, threadStopParamsSchema, threadUnarchiveParamsSchema, toNonNegativeNumber, toOptionalRecord, toOptionalString, toPositiveNumber, turnStartParamsSchema, turnSteerParamsSchema, userQuestionInteractionOutcomeSchema, withoutBridgeRuntimeEnv };
5133
- export type { ApprovalInteractionOutcome, ApprovalPendingInteractionPayload, AvailableModel, BackgroundTaskStatus, BackgroundTaskUsage, BoundedLineReaderArgs, BridgeCapabilities, BridgeErrorData, BridgeExecutionOptions, BridgeGrammarVersions, BridgeJsonRpcResponse, BridgeSendError, BridgeSteerMode, BridgeToolCallRequest, BuildInteractiveResponseArgs, ClaudeTaskToolOutput, ClientTurnRequestId, DecodedInteractiveRequest, DeltaBackgroundTaskShape, DeltaDelegationShape, DeltaExtensionShape, DeltaFileChange, DeltaFileReadShape, DeltaItemKey, DeltaItemShape, DeltaItemShapeType, DeltaNoTurnFallback, DeltaOutputChannel, DeltaPlanStepsShape, DeltaPresentation, DeltaProgressSnapshot, DeltaSearchShape, DeltaTextChannel, DynamicTool, ExtensionKind, AcpLaunchSpec as HostDaemonAcpLaunchSpec, InitializeResult, InstructionMode, InteractionRequestPayload, JsonObject, JsonRpcMessage, JsonValue, ModelReasoningEffort, NpmGlobalPackageProbe, PendingInteractionApprovalDecision, PendingInteractionApprovalSubject, PendingInteractionCommandAction, PendingInteractionGrantablePermissionProfile, PendingInteractionGrantedPermissionProfile, PendingInteractionPayload, PendingInteractionRequestedPermissionProfile, PendingInteractionResolution, PendingInteractionUserQuestionQuestion, PermissionEscalation, PermissionMode, PreparedProviderCommandDispatch, PromptInput, ProviderBridgeContext, ProviderBridgeDefinition, ProviderBridgeEntry, ProviderErrorCategory, ProviderErrorInfo, ProviderHealth, ProviderHealthResult, ProviderInboundRequest, ProviderInstallationAction, ProviderInstallationActionKind, ProviderInstallationCommand, ProviderInstallationRequirement, ProviderInstallationRunParams, ProviderInstallationRunResult, ProviderInstallationSource, ProviderInstallationStatus, ProviderInstallationStatusParams, ProviderInstallationVerification, ProviderInteractionOutcome, ProviderMaintenanceParams, ProviderPostInitializeRequest, ProviderRateLimitState, ProviderRateLimitStatus, ProviderRateLimitWindow, ProviderRawEvent, ProviderRawEventCoverage, ProviderRawEventDescription, ProviderRecoveryHint, ProviderRecoveryKind, ProviderRecoveryNotification, ProviderRuntimeEvent, ProviderUsage, ProviderUsageResult, ProviderUsageWindow, ProviderVisibilityMetadata, ReasoningLevel, RuntimePermissionPolicy, RuntimePermissionScope, ServiceTier, ThreadDelta, ThreadDeltaKind, ThreadDeltaNotificationParams, ThreadEventContextWindowUsage, ThreadEventItemPresentation, ThreadEventItemStatus, ThreadEventPlanStep, ThreadEventSearchMode, ThreadEventTokenUsageBreakdown, ThreadEventTurnStatus, ThreadEventUserContent, UserQuestionInteractionOutcome, UserQuestionPendingInteractionPayload, UserQuestionPendingInteractionResolution, WorkflowAgentSnapshot, WorkflowAgentState, WorkflowPhaseSnapshot, WorkflowProgressSnapshot };
5261
+ export { BRIDGE_INBOUND_REQUEST_METHODS, BRIDGE_JSON_RPC_ERRORS, BRIDGE_NOTIFICATION_METHODS, BRIDGE_REQUEST_METHODS, HIGH_REASONING_EFFORT, LOCAL_BASH_TASK_TYPE, LOCAL_WORKFLOW_TASK_TYPE, LOW_REASONING_EFFORT, MAX_REASONING_EFFORT, MEDIUM_REASONING_EFFORT, PROVIDER_BRIDGE_EXPORT_NAME, PROVIDER_BRIDGE_PROTOCOL_VERSION, ProviderRequestDecodeError, ProviderResponseEncodeError, THREAD_DELTA_GRAMMAR_V2, THREAD_DELTA_GRAMMAR_V3, THREAD_DELTA_NOTIFICATION_METHOD, ULTRACODE_REASONING_EFFORT, USER_QUESTION_MAX_OPTIONS, USER_QUESTION_MAX_QUESTIONS, XHIGH_REASONING_EFFORT, ZERO_TOKEN_USAGE, acpNativeReasoningSchema, acpPermissionCliSchema, acpReasoningCliSchema, addTokenUsage, approvalInteractionOutcomeSchema, backgroundTaskItemStatus, bashArgsSchema, bridgeCapabilitiesSchema, bridgeErrorDataSchema, bridgeGrammarVersionsSchema, bridgeRequestEnvelopeSchema, bridgeSteerModeSchema, buildShellEnvOverrides, claudeTaskToolNameSchema, claudeTaskToolOutputSchema, contextSnapshotSchema, createBridgeIo, createBridgeLineHandler, createPendingToolCallTracker, createProviderVisibilityMetadata, decodeBridgeJsonRpcResponse, decodeToolCallResponsePayload, deltaBackgroundTaskShapeSchema, deltaDelegationShapeSchema, deltaExtensionShapeSchema, deltaFileChangeSchema, deltaFileReadShapeSchema, deltaItemKeySchema, deltaItemShapeSchema, deltaNoTurnFallbackSchema, deltaOutputChannelSchema, deltaPlanStepsShapeSchema, deltaPresentationSchema, deltaProgressSnapshotSchema, deltaSearchShapeSchema, deltaTextChannelSchema, dynamicToolSchema, errorEnvelopeSchema, BridgeRecoveryError as experimental_BridgeRecoveryError, COMPACTION_PRESENTATION as experimental_COMPACTION_PRESENTATION, REASONING_PRESENTATION as experimental_REASONING_PRESENTATION, buildBridgeToolCallContent as experimental_buildBridgeToolCallContent, clampPercent as experimental_clampPercent, commandOutput as experimental_commandOutput, compareVersions as experimental_compareVersions, experimental_defineProviderBridge, downloadedInstallerCommand as experimental_downloadedInstallerCommand, fileReadPresentation as experimental_fileReadPresentation, formatCommand as experimental_formatCommand, installationVerification as experimental_installationVerification, experimental_isProviderBridgeRecording, npmCommand as experimental_npmCommand, npmGlobalInstallCommand as experimental_npmGlobalInstallCommand, npmGlobalInstallSource as experimental_npmGlobalInstallSource, npmLatestVersion as experimental_npmLatestVersion, planStepsPresentation as experimental_planStepsPresentation, presentationDetail as experimental_presentationDetail, presentationFileName as experimental_presentationFileName, presentationTitle as experimental_presentationTitle, probeNpmGlobalPackage as experimental_probeNpmGlobalPackage, readBoundedLines as experimental_readBoundedLines, readCliVersion as experimental_readCliVersion, experimental_recordProviderChildIo, resolveExecutablePath as experimental_resolveExecutablePath, searchPresentation as experimental_searchPresentation, toolPresentation as experimental_toolPresentation, versionFrom as experimental_versionFrom, webFetchPresentation as experimental_webFetchPresentation, webSearchPresentation as experimental_webSearchPresentation, withTitle as experimental_withTitle, extensionKindSchema, extractResultText, getRawSdkMessage, getRecordProperty, getStringProperty, acpLaunchSpecSchema as hostDaemonAcpLaunchSpecSchema, initializeParamsSchema, instructionModeValues, interactionRequestPayloadSchema, isApprovalInteractionOutcome, isApprovalPendingInteractionPayload, isApprovalPendingInteractionResolution, isBackgroundAgentTaskType, isExtensionKind, isRecord, isSettledBackgroundTaskStatus, isStandaloneBuiltinCompactCommand, isUserQuestionPendingInteractionPayload, isUserQuestionPendingInteractionResolution, jsonRpcEnvelopeSchema, jsonValueSchema, mimeTypeFromExtension, modelListParamsSchema, normalizeAcpLaunchSpec as normalizeHostDaemonAcpLaunchSpec, normalizeProviderCommandOutput, pendingInteractionCommandActionSchema, pendingInteractionFileSystemPermissionsSchema, pendingInteractionMacOsPermissionsSchema, pendingInteractionNetworkPermissionsSchema, pendingInteractionRequestedPermissionProfileSchema, pendingInteractionResolutionSchema, permissionEscalationValues, providerHealthResultSchema, providerHealthSchema, providerInstallationActionKindSchema, providerInstallationActionSchema, providerInstallationCommandSchema, providerInstallationRequirementSchema, providerInstallationRunParamsSchema, providerInstallationRunResultSchema, providerInstallationSourceSchema, providerInstallationStatusParamsSchema, providerInstallationStatusSchema, providerInstallationVerificationSchema, providerInteractionOutcomeSchema, providerMaintenanceParamsSchema, providerRawEventSchema, providerRecoveryHintSchema, providerRecoveryKindSchema, providerRecoveryKindValues, providerRecoveryNotificationSchema, providerUsageResultSchema, providerUsageSchema, providerUsageWindowSchema, reasoningEffortsForLevels, reasoningLevelSchema, reasoningLevelValues, removeCommandMentionsFromPromptInput, runBridgeRequest, runtimePermissionScopeValues, sanitizeInheritedChildProcessEnv, sdkMessageEnvelopeSchema, shouldAutoDenyInteractiveRequest, skillsConfigureParamsSchema, textBlockSchema, threadArchiveParamsSchema, threadContextWindowUsageEnvelopeSchema, threadDeltaNotificationParamsSchema, threadDeltaSchema, threadDiscardParamsSchema, threadEventItemPresentationSchema, threadEventSearchModeSchema, threadForkParamsSchema, threadGoalClearParamsSchema, threadIdentityEnvelopeSchema, threadNameSetParamsSchema, threadResumeParamsSchema, threadStartParamsSchema, threadStopParamsSchema, threadUnarchiveParamsSchema, toNonNegativeNumber, toOptionalRecord, toOptionalString, toPositiveNumber, turnStartParamsSchema, turnSteerParamsSchema, userQuestionInteractionOutcomeSchema, withoutBridgeRuntimeEnv };
5262
+ export type { ApprovalInteractionOutcome, ApprovalPendingInteractionPayload, AvailableModel, BackgroundTaskStatus, BackgroundTaskUsage, BoundedLineReaderArgs, BridgeCapabilities, BridgeErrorData, BridgeExecutionOptions, BridgeGrammarVersions, BridgeJsonRpcResponse, BridgeSendError, BridgeSteerMode, BridgeToolCallRequest, BuildInteractiveResponseArgs, ClaudeTaskToolOutput, ClientTurnRequestId, ContextCategory, ContextEntry, ContextSnapshot, DecodedInteractiveRequest, DeltaBackgroundTaskShape, DeltaDelegationShape, DeltaExtensionShape, DeltaFileChange, DeltaFileReadShape, DeltaItemKey, DeltaItemShape, DeltaItemShapeType, DeltaNoTurnFallback, DeltaOutputChannel, DeltaPlanStepsShape, DeltaPresentation, DeltaProgressSnapshot, DeltaSearchShape, DeltaTextChannel, DynamicTool, ExtensionKind, AcpLaunchSpec as HostDaemonAcpLaunchSpec, InitializeResult, InstructionMode, InteractionRequestPayload, JsonObject, JsonRpcMessage, JsonValue, ModelReasoningEffort, NpmGlobalPackageProbe, PendingInteractionApprovalDecision, PendingInteractionApprovalSubject, PendingInteractionCommandAction, PendingInteractionGrantablePermissionProfile, PendingInteractionGrantedPermissionProfile, PendingInteractionPayload, PendingInteractionRequestedPermissionProfile, PendingInteractionResolution, PendingInteractionUserQuestionQuestion, PermissionEscalation, PermissionMode, PreparedProviderCommandDispatch, PromptInput, ProviderBridgeContext, ProviderBridgeDefinition, ProviderBridgeEntry, ProviderErrorCategory, ProviderErrorInfo, ProviderHealth, ProviderHealthResult, ProviderInboundRequest, ProviderInstallationAction, ProviderInstallationActionKind, ProviderInstallationCommand, ProviderInstallationRequirement, ProviderInstallationRunParams, ProviderInstallationRunResult, ProviderInstallationSource, ProviderInstallationStatus, ProviderInstallationStatusParams, ProviderInstallationVerification, ProviderInteractionOutcome, ProviderMaintenanceParams, ProviderPostInitializeRequest, ProviderRateLimitState, ProviderRateLimitStatus, ProviderRateLimitWindow, ProviderRawEvent, ProviderRawEventCoverage, ProviderRawEventDescription, ProviderRecoveryHint, ProviderRecoveryKind, ProviderRecoveryNotification, ProviderRuntimeEvent, ProviderUsage, ProviderUsageResult, ProviderUsageWindow, ProviderVisibilityMetadata, ReasoningLevel, RuntimePermissionPolicy, RuntimePermissionScope, ServiceTier, ThreadDelta, ThreadDeltaKind, ThreadDeltaNotificationParams, ThreadEventContextWindowUsage, ThreadEventItemPresentation, ThreadEventItemStatus, ThreadEventPlanStep, ThreadEventSearchMode, ThreadEventTokenUsageBreakdown, ThreadEventTurnStatus, ThreadEventUserContent, UserQuestionInteractionOutcome, UserQuestionPendingInteractionPayload, UserQuestionPendingInteractionResolution, WorkflowAgentSnapshot, WorkflowAgentState, WorkflowPhaseSnapshot, WorkflowProgressSnapshot };
@@ -962,12 +962,6 @@ interface NormalizedPluginMachineProvider {
962
962
  }
963
963
 
964
964
  type BbSdk = BbPluginApi["sdk"];
965
- /**
966
- * Recordable `bb.sdk` stand-in for {@link createFakePluginHost}. Every call
967
- * through the fake is recorded (post plugin-attribution defaulting, so
968
- * assertions see what the server would receive); calls without a stubbed
969
- * implementation throw with a message naming the exact path to stub.
970
- */
971
965
  /** One recorded `bb.sdk` call. `path` is dot-joined, e.g. "threads.spawn". */
972
966
  interface FakeSdkCall {
973
967
  path: string;
@@ -988,13 +982,24 @@ type FakeSdkOverrideTree<T> = {
988
982
  };
989
983
  type FakeSdkOverrides = FakeSdkOverrideTree<BbSdk>;
990
984
  interface FakeSdkHarness {
991
- /** Every `bb.sdk` call in order, including ones whose stub threw. */
985
+ /**
986
+ * Every `bb.sdk` call in order, including ones whose stub threw. Calls
987
+ * rejected by argument validation are not recorded.
988
+ */
992
989
  readonly calls: FakeSdkCall[];
993
990
  /** Argument lists of the calls to one dot-joined path. */
994
991
  callsTo(path: string): unknown[][];
995
992
  /** Add or replace one method's implementation after creation. */
996
993
  stub(path: string, implementation: (...args: never[]) => unknown): void;
997
994
  }
995
+ /**
996
+ * Recordable `bb.sdk` stand-in for {@link createFakePluginHost}. Calls are
997
+ * recorded after the plugin-bound normalization the server applies, so
998
+ * assertions see what the server would receive. Arguments the real SDK
999
+ * rejects before sending, such as invalid `pluginMetadata`, return a rejected
1000
+ * promise and are not recorded. Calls without a stubbed implementation throw
1001
+ * with a message naming the exact path to stub.
1002
+ */
998
1003
  declare function createFakeSdk(options: {
999
1004
  pluginId: string;
1000
1005
  overrides?: FakeSdkOverrides;
@@ -1249,7 +1254,10 @@ interface FakePluginBehaviorDrivers {
1249
1254
  callAgentTool(name: string, input: unknown, ctx?: Partial<PluginAgentToolContext>): Promise<PluginAgentToolResult>;
1250
1255
  /** Evaluate `bb.agents.configure` with production validation/fail-closed
1251
1256
  * semantics. With no callback, every registered tool/declared test skill is
1252
- * selected. Callback failures are logged and return empty selections. */
1257
+ * selected. The callback receives a copy of `context` whose `pluginMetadata`
1258
+ * is a validated, deep-frozen clone; invalid metadata rejects instead of
1259
+ * reaching the callback. Callback failures are logged and return empty
1260
+ * selections. */
1253
1261
  resolveAgentConfiguration(context: PluginAgentConfigurationContext): Promise<{
1254
1262
  tools: FakeAgentToolRecord[];
1255
1263
  skills: string[];
@@ -1347,6 +1355,7 @@ type ThreadResponse = PluginThreadEventPayloads["thread.created"]["thread"];
1347
1355
  type QueueEntry = PluginThreadEventPayloads["message.queued"]["entry"];
1348
1356
  type TurnFailedEvent = PluginThreadEventPayloads["turn.failed"];
1349
1357
  type PluginAgentConfigurationContextOverrides = {
1358
+ pluginMetadata?: PluginAgentConfigurationContext["pluginMetadata"];
1350
1359
  thread?: Partial<PluginAgentConfigurationContext["thread"]>;
1351
1360
  project?: Partial<PluginAgentConfigurationContext["project"]>;
1352
1361
  environment?: Partial<PluginAgentConfigurationContext["environment"]>;
@@ -9,6 +9,7 @@ import * as react from 'react';
9
9
  import { ComponentType, ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
10
10
  import * as z from 'zod';
11
11
  import { z as z$1 } from 'zod';
12
+ import * as zod_v4_core from 'zod/v4/core';
12
13
  import { StandardSchemaV1 as StandardSchemaV1$1, StandardSchemaV1InferOutput as StandardSchemaV1InferOutput$1, PluginMachineValidateDecision as PluginMachineValidateDecision$1, JsonValue as JsonValue$2, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, PluginEnvironmentValidateDecision as PluginEnvironmentValidateDecision$1 } from '@get-bb/plugin-sdk';
13
14
  import Database from 'better-sqlite3';
14
15
  import { Context } from 'hono';
@@ -82,7 +83,7 @@ declare const appSettingsUpdateSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{
82
83
  }, z$1.core.$strict>]>;
83
84
  type AppSettingsUpdate = z$1.infer<typeof appSettingsUpdateSchema>;
84
85
 
85
- declare const UI_PREFERENCE_KEYS: readonly ["sidebar.organizationMode", "sidebar.chronologicalSort", "sidebar.sortDirection", "sidebar.sectionOrder", "sidebar.manualSectionOrder", "sidebar.machineSectionOrder", "sidebar.collapsedSections", "sidebar.collapsedProjects", "sidebar.collapsedThreads", "sidebar.collapsedEnvironments", "sidebar.collapsedThreadSections", "sidebar.collapsedMachines", "sidebar.pluginPanelOrder", "sidebar.visiblePluginPanels", "sidebar.navigationProvider", "sidebar.threadListProvider"];
86
+ declare const UI_PREFERENCE_KEYS: readonly ["sidebar.organizationMode", "sidebar.chronologicalSort", "sidebar.sortDirection", "sidebar.sectionOrder", "sidebar.manualSectionOrder", "sidebar.machineSectionOrder", "sidebar.collapsedSections", "sidebar.collapsedProjects", "sidebar.collapsedThreads", "sidebar.collapsedEnvironments", "sidebar.collapsedThreadSections", "sidebar.collapsedMachines", "sidebar.footerOrder", "sidebar.hiddenFooterItems", "sidebar.pluginPanelOrder", "sidebar.visiblePluginPanels", "sidebar.navigationProvider", "sidebar.threadListProvider"];
86
87
  type UiPreferenceKey = (typeof UI_PREFERENCE_KEYS)[number];
87
88
  interface UiPreferenceDefinition<Schema extends z$1.ZodTypeAny = z$1.ZodTypeAny> {
88
89
  schema: Schema;
@@ -118,6 +119,8 @@ declare const uiPreferenceDefinitions: {
118
119
  readonly "sidebar.collapsedEnvironments": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
119
120
  readonly "sidebar.collapsedThreadSections": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
120
121
  readonly "sidebar.collapsedMachines": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
122
+ readonly "sidebar.footerOrder": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
123
+ readonly "sidebar.hiddenFooterItems": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
121
124
  readonly "sidebar.pluginPanelOrder": UiPreferenceDefinition<z$1.ZodArray<z$1.ZodString>>;
122
125
  readonly "sidebar.visiblePluginPanels": UiPreferenceDefinition<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>;
123
126
  readonly "sidebar.navigationProvider": UiPreferenceDefinition<z$1.ZodString>;
@@ -341,6 +344,7 @@ declare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
341
344
  changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{
342
345
  "host-connected": "host-connected";
343
346
  "host-disconnected": "host-disconnected";
347
+ "provider-model-catalog-changed": "provider-model-catalog-changed";
344
348
  }>>>;
345
349
  entity: z$1.ZodLiteral<"host">;
346
350
  id: z$1.ZodOptional<z$1.ZodString>;
@@ -2565,6 +2569,32 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
2565
2569
  contextWindowUsage: z$1.ZodObject<{
2566
2570
  estimated: z$1.ZodBoolean;
2567
2571
  modelContextWindow: z$1.ZodNullable<z$1.ZodNumber>;
2572
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
2573
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
2574
+ capturedAt: z$1.ZodISODateTime;
2575
+ categories: z$1.ZodArray<z$1.ZodObject<{
2576
+ entries: z$1.ZodArray<z$1.ZodObject<{
2577
+ id: z$1.ZodString;
2578
+ label: z$1.ZodString;
2579
+ tokens: z$1.ZodNumber;
2580
+ }, z$1.core.$strip>>;
2581
+ id: z$1.ZodString;
2582
+ kind: z$1.ZodEnum<{
2583
+ deferred: "deferred";
2584
+ free: "free";
2585
+ reserved: "reserved";
2586
+ used: "used";
2587
+ }>;
2588
+ label: z$1.ZodString;
2589
+ tokens: z$1.ZodNumber;
2590
+ }, z$1.core.$strip>>;
2591
+ contextWindowTokens: z$1.ZodNumber;
2592
+ estimated: z$1.ZodBoolean;
2593
+ model: z$1.ZodString;
2594
+ providerSessionId: z$1.ZodString;
2595
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
2596
+ usedTokens: z$1.ZodNumber;
2597
+ }, z$1.core.$strip>>;
2568
2598
  usedTokens: z$1.ZodNullable<z$1.ZodNumber>;
2569
2599
  }, z$1.core.$strip>;
2570
2600
  providerThreadId: z$1.ZodString;
@@ -3702,6 +3732,8 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{
3702
3732
  type PluginPendingInteraction = z$1.infer<typeof pluginPendingInteractionSchema>;
3703
3733
  type PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;
3704
3734
 
3735
+ declare const pluginMetadataSchema: z.ZodType<JsonObject, unknown, zod_v4_core.$ZodTypeInternals<JsonObject, unknown>>;
3736
+
3705
3737
  declare const projectSchema: z$1.ZodObject<{
3706
3738
  createdAt: z$1.ZodNumber;
3707
3739
  gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>;
@@ -4189,6 +4221,41 @@ declare const threadQueuedMessageSchema: z$1.ZodObject<{
4189
4221
  }, z$1.core.$strip>;
4190
4222
  type ThreadQueuedMessage = z$1.infer<typeof threadQueuedMessageSchema>;
4191
4223
 
4224
+ declare const threadContextResponseSchema: z$1.ZodObject<{
4225
+ usage: z$1.ZodNullable<z$1.ZodObject<{
4226
+ estimated: z$1.ZodBoolean;
4227
+ modelContextWindow: z$1.ZodNumber;
4228
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
4229
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
4230
+ capturedAt: z$1.ZodISODateTime;
4231
+ categories: z$1.ZodArray<z$1.ZodObject<{
4232
+ entries: z$1.ZodArray<z$1.ZodObject<{
4233
+ id: z$1.ZodString;
4234
+ label: z$1.ZodString;
4235
+ tokens: z$1.ZodNumber;
4236
+ }, z$1.core.$strip>>;
4237
+ id: z$1.ZodString;
4238
+ kind: z$1.ZodEnum<{
4239
+ deferred: "deferred";
4240
+ free: "free";
4241
+ reserved: "reserved";
4242
+ used: "used";
4243
+ }>;
4244
+ label: z$1.ZodString;
4245
+ tokens: z$1.ZodNumber;
4246
+ }, z$1.core.$strip>>;
4247
+ contextWindowTokens: z$1.ZodNumber;
4248
+ estimated: z$1.ZodBoolean;
4249
+ model: z$1.ZodString;
4250
+ providerSessionId: z$1.ZodString;
4251
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
4252
+ usedTokens: z$1.ZodNumber;
4253
+ }, z$1.core.$strip>>;
4254
+ usedTokens: z$1.ZodNumber;
4255
+ }, z$1.core.$strip>>;
4256
+ }, z$1.core.$strip>;
4257
+ type ThreadContextResponse = z$1.infer<typeof threadContextResponseSchema>;
4258
+
4192
4259
  declare const createThreadEnvironmentArgsSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4193
4260
  environmentId: z$1.ZodString;
4194
4261
  type: z$1.ZodLiteral<"reuse">;
@@ -6938,6 +7005,21 @@ declare const hostDaemonCommandRegistry: {
6938
7005
  type: z$1.ZodLiteral<"interactive.resolve">;
6939
7006
  }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, "settled", false>;
6940
7007
  "environment.attach": HostDaemonCommandDescriptor<"environment.attach", z$1.ZodObject<{
7008
+ contributedEnv: z$1.ZodArray<z$1.ZodObject<{
7009
+ name: z$1.ZodString;
7010
+ reason: z$1.ZodString;
7011
+ source: z$1.ZodUnion<readonly [z$1.ZodObject<{
7012
+ plugin: z$1.ZodString;
7013
+ }, z$1.core.$strict>, z$1.ZodObject<{
7014
+ core: z$1.ZodEnum<{
7015
+ "machine-environment": "machine-environment";
7016
+ "machine-git": "machine-git";
7017
+ }>;
7018
+ }, z$1.core.$strict>]>;
7019
+ value: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
7020
+ serverPath: z$1.ZodString;
7021
+ }, z$1.core.$strict>]>;
7022
+ }, z$1.core.$strict>>;
6941
7023
  environmentId: z$1.ZodString;
6942
7024
  initiator: z$1.ZodNullable<z$1.ZodObject<{
6943
7025
  provisioningId: z$1.ZodString;
@@ -11409,6 +11491,7 @@ declare const createThreadRequestSchema: z$1.ZodObject<{
11409
11491
  auto: "auto";
11410
11492
  full: "full";
11411
11493
  }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>;
11494
+ pluginMetadata: z$1.ZodOptional<z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>>;
11412
11495
  projectId: z$1.ZodString;
11413
11496
  providerId: z$1.ZodOptional<z$1.ZodString>;
11414
11497
  reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{
@@ -11662,6 +11745,7 @@ declare const forkThreadRequestSchema: z$1.ZodObject<{
11662
11745
  auto: "auto";
11663
11746
  full: "full";
11664
11747
  }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>;
11748
+ pluginMetadata: z$1.ZodOptional<z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>>;
11665
11749
  sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;
11666
11750
  sourceThreadId: z$1.ZodString;
11667
11751
  title: z$1.ZodOptional<z$1.ZodString>;
@@ -12834,6 +12918,7 @@ declare const threadGetQuerySchema: z$1.ZodObject<{
12834
12918
  include: z$1.ZodOptional<z$1.ZodString>;
12835
12919
  }, z$1.core.$strip>;
12836
12920
  type ThreadGetQuery = z$1.infer<typeof threadGetQuerySchema>;
12921
+ type ThreadPluginMetadataResponse = z$1.infer<typeof pluginMetadataSchema>;
12837
12922
  declare const threadWithIncludesResponseSchema: z$1.ZodObject<{
12838
12923
  activeBackgroundAgentCount: z$1.ZodNumber;
12839
12924
  archivedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -13792,6 +13877,32 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{
13792
13877
  contextWindowUsage: z$1.ZodOptional<z$1.ZodObject<{
13793
13878
  estimated: z$1.ZodBoolean;
13794
13879
  modelContextWindow: z$1.ZodNumber;
13880
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
13881
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
13882
+ capturedAt: z$1.ZodISODateTime;
13883
+ categories: z$1.ZodArray<z$1.ZodObject<{
13884
+ entries: z$1.ZodArray<z$1.ZodObject<{
13885
+ id: z$1.ZodString;
13886
+ label: z$1.ZodString;
13887
+ tokens: z$1.ZodNumber;
13888
+ }, z$1.core.$strip>>;
13889
+ id: z$1.ZodString;
13890
+ kind: z$1.ZodEnum<{
13891
+ deferred: "deferred";
13892
+ free: "free";
13893
+ reserved: "reserved";
13894
+ used: "used";
13895
+ }>;
13896
+ label: z$1.ZodString;
13897
+ tokens: z$1.ZodNumber;
13898
+ }, z$1.core.$strip>>;
13899
+ contextWindowTokens: z$1.ZodNumber;
13900
+ estimated: z$1.ZodBoolean;
13901
+ model: z$1.ZodString;
13902
+ providerSessionId: z$1.ZodString;
13903
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
13904
+ usedTokens: z$1.ZodNumber;
13905
+ }, z$1.core.$strip>>;
13795
13906
  usedTokens: z$1.ZodNumber;
13796
13907
  }, z$1.core.$strip>>;
13797
13908
  delta: z$1.ZodOptional<z$1.ZodObject<{
@@ -14312,6 +14423,14 @@ type MachineEnvironmentList = z$1.infer<typeof machineEnvironmentListSchema>;
14312
14423
  type JsonValue = string | number | boolean | null | JsonValue[] | {
14313
14424
  [key: string]: JsonValue;
14314
14425
  };
14426
+ /**
14427
+ * A `JsonValue` that is read-only at every depth. BB uses it for JSON
14428
+ * snapshots it deep-freezes before handing them to a plugin, where any write
14429
+ * throws at runtime.
14430
+ */
14431
+ type ReadonlyJsonValue = string | number | boolean | null | readonly ReadonlyJsonValue[] | {
14432
+ readonly [key: string]: ReadonlyJsonValue;
14433
+ };
14315
14434
 
14316
14435
  /** A JSON-safe path segment reported by a Standard Schema validation issue. */
14317
14436
  type PluginRpcIssuePathSegment = string | number;
@@ -18046,6 +18165,7 @@ interface ThreadOutputResponse {
18046
18165
  output: string | null;
18047
18166
  }
18048
18167
  type ThreadMutationResult = ThreadResponse;
18168
+ type ThreadPluginMetadataResult = ThreadPluginMetadataResponse;
18049
18169
  type ThreadSpawnResult = ThreadResponse;
18050
18170
  type ThreadForkResult = ThreadResponse;
18051
18171
  type ThreadInteractionGetResult = PendingInteraction;
@@ -18055,6 +18175,7 @@ type ThreadInteractionRespondResult = PendingInteraction;
18055
18175
  type ThreadInteractionCancelResult = PendingInteraction;
18056
18176
  type ThreadEventsListResult = ThreadEventRow[];
18057
18177
  type ThreadEventWaitResult = ThreadEventRow | null;
18178
+ type ThreadContextResult = ThreadContextResponse;
18058
18179
  type ThreadTimelineResult = ThreadTimelineResponse;
18059
18180
  type ThreadArchiveResult = ThreadArchiveAllResponse;
18060
18181
  type ThreadOpenResult = ThreadOpenResponse;
@@ -18119,6 +18240,18 @@ interface ThreadForkArgs extends Omit<ForkThreadRequest, "origin" | "visibility"
18119
18240
  interface ThreadUpdateArgs extends UpdateThreadRequest {
18120
18241
  threadId: string;
18121
18242
  }
18243
+ interface ThreadPluginMetadataArgs {
18244
+ pluginId: string;
18245
+ signal?: AbortSignal;
18246
+ threadId: string;
18247
+ }
18248
+ interface ThreadPluginMetadataUpdateArgs {
18249
+ threadId: string;
18250
+ pluginId: string;
18251
+ set?: JsonObject;
18252
+ remove?: string[];
18253
+ signal?: AbortSignal;
18254
+ }
18122
18255
  interface ThreadDeleteArgs extends DeleteThreadRequest {
18123
18256
  threadId: string;
18124
18257
  }
@@ -18145,6 +18278,7 @@ interface ThreadRetryArgs {
18145
18278
  reason?: string;
18146
18279
  }
18147
18280
  interface ThreadActionArgs {
18281
+ signal?: AbortSignal;
18148
18282
  threadId: string;
18149
18283
  }
18150
18284
  interface ThreadStatusArgs extends ThreadActionArgs {
@@ -18335,6 +18469,8 @@ interface ThreadsArea {
18335
18469
  events: ThreadEventsArea;
18336
18470
  fork(args: ThreadForkArgs): Promise<ThreadForkResult>;
18337
18471
  get(args: ThreadGetArgs): Promise<ThreadGetResult>;
18472
+ getPluginMetadata(args: ThreadPluginMetadataArgs): Promise<ThreadPluginMetadataResult>;
18473
+ updatePluginMetadata(args: ThreadPluginMetadataUpdateArgs): Promise<ThreadPluginMetadataResult>;
18338
18474
  queue: ThreadQueueArea;
18339
18475
  interactions: ThreadInteractionsArea;
18340
18476
  list(args?: ThreadListArgs): Promise<ThreadListResult>;
@@ -18362,6 +18498,7 @@ interface ThreadsArea {
18362
18498
  spawn(args: ThreadSpawnArgs): Promise<ThreadSpawnResult>;
18363
18499
  stop(args: ThreadActionArgs): Promise<ThreadStopResult>;
18364
18500
  tabs: ThreadTabsArea;
18501
+ context(args: ThreadStatusArgs): Promise<ThreadContextResult>;
18365
18502
  timeline(args: ThreadTimelineArgs): Promise<ThreadTimelineResult>;
18366
18503
  timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise<ThreadTimelineTurnSummaryDetailsResult>;
18367
18504
  storageFiles(args: ThreadStorageFilesArgs): Promise<ThreadStorageFilesResult>;
@@ -19388,6 +19525,15 @@ interface PluginAgentToolRegistrationBase {
19388
19525
  }
19389
19526
  /** Stable, plain-data context resolved by the server for one agent session. */
19390
19527
  interface PluginAgentConfigurationContext {
19528
+ /**
19529
+ * The thread's metadata stored under this plugin's id, or `{}` when absent,
19530
+ * as a deep-frozen snapshot for this configure call. Any API client, another
19531
+ * plugin, or the thread's own agent can write it; treat values as untrusted,
19532
+ * and quote or escape any value you put into returned instructions.
19533
+ */
19534
+ readonly pluginMetadata: {
19535
+ readonly [key: string]: ReadonlyJsonValue;
19536
+ };
19391
19537
  thread: {
19392
19538
  id: string;
19393
19539
  title: string | null;
@@ -20073,6 +20219,25 @@ interface PluginStatusApi {
20073
20219
  */
20074
20220
  needsConfiguration(message: string): void;
20075
20221
  }
20222
+ /**
20223
+ * The BB SDK bound to one plugin (`bb.sdk`). `threads.getPluginMetadata` and
20224
+ * `threads.updatePluginMetadata` default `pluginId` to that plugin's id. An
20225
+ * explicit `pluginId` must be a plugin id (lowercase letters, digits, and
20226
+ * dashes) or the request fails with HTTP 400. A `pluginMetadata` seed or a
20227
+ * `set` that is over 256 KiB on its own rejects before any request is sent. A
20228
+ * patch whose merged namespace would exceed 256 KiB fails with HTTP 413 and
20229
+ * leaves the namespace unchanged.
20230
+ */
20231
+ type PluginBbSdk = Omit<BbSdk, "threads"> & {
20232
+ threads: Omit<BbSdk["threads"], "getPluginMetadata" | "updatePluginMetadata"> & {
20233
+ getPluginMetadata(args: Omit<ThreadPluginMetadataArgs, "pluginId"> & {
20234
+ pluginId?: string;
20235
+ }): Promise<ThreadPluginMetadataResult>;
20236
+ updatePluginMetadata(args: Omit<ThreadPluginMetadataUpdateArgs, "pluginId"> & {
20237
+ pluginId?: string;
20238
+ }): Promise<ThreadPluginMetadataResult>;
20239
+ };
20240
+ };
20076
20241
  /**
20077
20242
  * The API object handed to a plugin's factory (design §4). Implemented by
20078
20243
  * the BB server; this contract is what plugin `server.ts` files compile
@@ -20141,10 +20306,12 @@ interface BbPluginApi {
20141
20306
  * server binds it before loading plugins, so it is available from the
20142
20307
  * moment factories run there — but isolated harnesses may not, so prefer
20143
20308
  * using it from handlers, services, and timers for portability.
20144
- * `threads.spawn` defaults `origin` to "plugin" and `originPluginId` to
20145
- * this plugin's id so spawned threads are attributed automatically.
20309
+ * `threads.spawn` and `threads.fork` default `origin` to "plugin" and, for
20310
+ * that origin, `originPluginId` to this plugin's id unless you set them.
20311
+ * Seeding `pluginMetadata` always attributes the new thread to this plugin,
20312
+ * overriding an explicit `origin` or `originPluginId`.
20146
20313
  */
20147
- readonly sdk: BbSdk;
20314
+ readonly sdk: PluginBbSdk;
20148
20315
  /**
20149
20316
  * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.
20150
20317
  * The sanctioned place to clear timers and close connections.
@@ -20153,4 +20320,4 @@ interface BbPluginApi {
20153
20320
  }
20154
20321
 
20155
20322
  export { PLUGIN_CLI_OUTPUT_MAX_BYTES, defineRpcContract, experimental_defineHostEntry };
20156
- export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolLabels, PluginAgentToolPresentation, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiServiceDeclaration, PluginAiServiceKind, PluginAiServices, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
20323
+ export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerCustomization, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerStructuredDraft, ComposerView, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerSubmitOptions, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginFixedTabReference, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolLabels, PluginAgentToolPresentation, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiServiceDeclaration, PluginAiServiceKind, PluginAiServices, PluginAppBuilder, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginCli, PluginCliCommandInfo, PluginCliContext, PluginCliExecutionResult, PluginCliOutputLimitError, PluginCliRegistration, PluginCliResult, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandPaletteActionContext, PluginCommandPaletteActionRegistration, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
package/dist/host.js CHANGED
@@ -15082,7 +15082,7 @@ async function experimental_resolveClaudePluginRoots(args) {
15082
15082
 
15083
15083
  // ../process-utils/src/index.ts
15084
15084
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
15085
- import { lstat, readdir, readlink, realpath } from "node:fs/promises";
15085
+ import { access, lstat, readdir, readlink, realpath } from "node:fs/promises";
15086
15086
  import {
15087
15087
  basename,
15088
15088
  dirname,