@get-bb/plugin-sdk 0.4.84 → 0.4.87

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>;
@@ -2565,6 +2568,32 @@ declare const threadEventSchema: z$1.ZodPipe<z$1.ZodUnknown, z$1.ZodUnion<readon
2565
2568
  contextWindowUsage: z$1.ZodObject<{
2566
2569
  estimated: z$1.ZodBoolean;
2567
2570
  modelContextWindow: z$1.ZodNullable<z$1.ZodNumber>;
2571
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
2572
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
2573
+ capturedAt: z$1.ZodISODateTime;
2574
+ categories: z$1.ZodArray<z$1.ZodObject<{
2575
+ entries: z$1.ZodArray<z$1.ZodObject<{
2576
+ id: z$1.ZodString;
2577
+ label: z$1.ZodString;
2578
+ tokens: z$1.ZodNumber;
2579
+ }, z$1.core.$strip>>;
2580
+ id: z$1.ZodString;
2581
+ kind: z$1.ZodEnum<{
2582
+ deferred: "deferred";
2583
+ free: "free";
2584
+ reserved: "reserved";
2585
+ used: "used";
2586
+ }>;
2587
+ label: z$1.ZodString;
2588
+ tokens: z$1.ZodNumber;
2589
+ }, z$1.core.$strip>>;
2590
+ contextWindowTokens: z$1.ZodNumber;
2591
+ estimated: z$1.ZodBoolean;
2592
+ model: z$1.ZodString;
2593
+ providerSessionId: z$1.ZodString;
2594
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
2595
+ usedTokens: z$1.ZodNumber;
2596
+ }, z$1.core.$strip>>;
2568
2597
  usedTokens: z$1.ZodNullable<z$1.ZodNumber>;
2569
2598
  }, z$1.core.$strip>;
2570
2599
  providerThreadId: z$1.ZodString;
@@ -3702,6 +3731,8 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{
3702
3731
  type PluginPendingInteraction = z$1.infer<typeof pluginPendingInteractionSchema>;
3703
3732
  type PendingInteraction = ProviderPendingInteraction | PluginPendingInteraction;
3704
3733
 
3734
+ declare const pluginMetadataSchema: z.ZodType<JsonObject, unknown, zod_v4_core.$ZodTypeInternals<JsonObject, unknown>>;
3735
+
3705
3736
  declare const projectSchema: z$1.ZodObject<{
3706
3737
  createdAt: z$1.ZodNumber;
3707
3738
  gitRemoteUrl: z$1.ZodNullable<z$1.ZodString>;
@@ -4189,6 +4220,41 @@ declare const threadQueuedMessageSchema: z$1.ZodObject<{
4189
4220
  }, z$1.core.$strip>;
4190
4221
  type ThreadQueuedMessage = z$1.infer<typeof threadQueuedMessageSchema>;
4191
4222
 
4223
+ declare const threadContextResponseSchema: z$1.ZodObject<{
4224
+ usage: z$1.ZodNullable<z$1.ZodObject<{
4225
+ estimated: z$1.ZodBoolean;
4226
+ modelContextWindow: z$1.ZodNumber;
4227
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
4228
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
4229
+ capturedAt: z$1.ZodISODateTime;
4230
+ categories: z$1.ZodArray<z$1.ZodObject<{
4231
+ entries: z$1.ZodArray<z$1.ZodObject<{
4232
+ id: z$1.ZodString;
4233
+ label: z$1.ZodString;
4234
+ tokens: z$1.ZodNumber;
4235
+ }, z$1.core.$strip>>;
4236
+ id: z$1.ZodString;
4237
+ kind: z$1.ZodEnum<{
4238
+ deferred: "deferred";
4239
+ free: "free";
4240
+ reserved: "reserved";
4241
+ used: "used";
4242
+ }>;
4243
+ label: z$1.ZodString;
4244
+ tokens: z$1.ZodNumber;
4245
+ }, z$1.core.$strip>>;
4246
+ contextWindowTokens: z$1.ZodNumber;
4247
+ estimated: z$1.ZodBoolean;
4248
+ model: z$1.ZodString;
4249
+ providerSessionId: z$1.ZodString;
4250
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
4251
+ usedTokens: z$1.ZodNumber;
4252
+ }, z$1.core.$strip>>;
4253
+ usedTokens: z$1.ZodNumber;
4254
+ }, z$1.core.$strip>>;
4255
+ }, z$1.core.$strip>;
4256
+ type ThreadContextResponse = z$1.infer<typeof threadContextResponseSchema>;
4257
+
4192
4258
  declare const createThreadEnvironmentArgsSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4193
4259
  environmentId: z$1.ZodString;
4194
4260
  type: z$1.ZodLiteral<"reuse">;
@@ -6938,6 +7004,21 @@ declare const hostDaemonCommandRegistry: {
6938
7004
  type: z$1.ZodLiteral<"interactive.resolve">;
6939
7005
  }, z$1.core.$strict>, z$1.ZodObject<{}, z$1.core.$strip>, "settled", false>;
6940
7006
  "environment.attach": HostDaemonCommandDescriptor<"environment.attach", z$1.ZodObject<{
7007
+ contributedEnv: z$1.ZodArray<z$1.ZodObject<{
7008
+ name: z$1.ZodString;
7009
+ reason: z$1.ZodString;
7010
+ source: z$1.ZodUnion<readonly [z$1.ZodObject<{
7011
+ plugin: z$1.ZodString;
7012
+ }, z$1.core.$strict>, z$1.ZodObject<{
7013
+ core: z$1.ZodEnum<{
7014
+ "machine-environment": "machine-environment";
7015
+ "machine-git": "machine-git";
7016
+ }>;
7017
+ }, z$1.core.$strict>]>;
7018
+ value: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
7019
+ serverPath: z$1.ZodString;
7020
+ }, z$1.core.$strict>]>;
7021
+ }, z$1.core.$strict>>;
6941
7022
  environmentId: z$1.ZodString;
6942
7023
  initiator: z$1.ZodNullable<z$1.ZodObject<{
6943
7024
  provisioningId: z$1.ZodString;
@@ -11409,6 +11490,7 @@ declare const createThreadRequestSchema: z$1.ZodObject<{
11409
11490
  auto: "auto";
11410
11491
  full: "full";
11411
11492
  }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>;
11493
+ pluginMetadata: z$1.ZodOptional<z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>>;
11412
11494
  projectId: z$1.ZodString;
11413
11495
  providerId: z$1.ZodOptional<z$1.ZodString>;
11414
11496
  reasoningLevel: z$1.ZodOptional<z$1.ZodEnum<{
@@ -11662,6 +11744,7 @@ declare const forkThreadRequestSchema: z$1.ZodObject<{
11662
11744
  auto: "auto";
11663
11745
  full: "full";
11664
11746
  }>, z$1.ZodLiteral<"workspace-write">]>, z$1.ZodTransform<"accept-edits" | "auto" | "full", "accept-edits" | "auto" | "full" | "workspace-write">>>;
11747
+ pluginMetadata: z$1.ZodOptional<z$1.ZodType<JsonObject, unknown, z$1.core.$ZodTypeInternals<JsonObject, unknown>>>;
11665
11748
  sourceSeqEnd: z$1.ZodOptional<z$1.ZodNumber>;
11666
11749
  sourceThreadId: z$1.ZodString;
11667
11750
  title: z$1.ZodOptional<z$1.ZodString>;
@@ -12834,6 +12917,7 @@ declare const threadGetQuerySchema: z$1.ZodObject<{
12834
12917
  include: z$1.ZodOptional<z$1.ZodString>;
12835
12918
  }, z$1.core.$strip>;
12836
12919
  type ThreadGetQuery = z$1.infer<typeof threadGetQuerySchema>;
12920
+ type ThreadPluginMetadataResponse = z$1.infer<typeof pluginMetadataSchema>;
12837
12921
  declare const threadWithIncludesResponseSchema: z$1.ZodObject<{
12838
12922
  activeBackgroundAgentCount: z$1.ZodNumber;
12839
12923
  archivedAt: z$1.ZodNullable<z$1.ZodNumber>;
@@ -13792,6 +13876,32 @@ declare const threadTimelineResponseSchema: z$1.ZodObject<{
13792
13876
  contextWindowUsage: z$1.ZodOptional<z$1.ZodObject<{
13793
13877
  estimated: z$1.ZodBoolean;
13794
13878
  modelContextWindow: z$1.ZodNumber;
13879
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
13880
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
13881
+ capturedAt: z$1.ZodISODateTime;
13882
+ categories: z$1.ZodArray<z$1.ZodObject<{
13883
+ entries: z$1.ZodArray<z$1.ZodObject<{
13884
+ id: z$1.ZodString;
13885
+ label: z$1.ZodString;
13886
+ tokens: z$1.ZodNumber;
13887
+ }, z$1.core.$strip>>;
13888
+ id: z$1.ZodString;
13889
+ kind: z$1.ZodEnum<{
13890
+ deferred: "deferred";
13891
+ free: "free";
13892
+ reserved: "reserved";
13893
+ used: "used";
13894
+ }>;
13895
+ label: z$1.ZodString;
13896
+ tokens: z$1.ZodNumber;
13897
+ }, z$1.core.$strip>>;
13898
+ contextWindowTokens: z$1.ZodNumber;
13899
+ estimated: z$1.ZodBoolean;
13900
+ model: z$1.ZodString;
13901
+ providerSessionId: z$1.ZodString;
13902
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
13903
+ usedTokens: z$1.ZodNumber;
13904
+ }, z$1.core.$strip>>;
13795
13905
  usedTokens: z$1.ZodNumber;
13796
13906
  }, z$1.core.$strip>>;
13797
13907
  delta: z$1.ZodOptional<z$1.ZodObject<{
@@ -14312,6 +14422,14 @@ type MachineEnvironmentList = z$1.infer<typeof machineEnvironmentListSchema>;
14312
14422
  type JsonValue = string | number | boolean | null | JsonValue[] | {
14313
14423
  [key: string]: JsonValue;
14314
14424
  };
14425
+ /**
14426
+ * A `JsonValue` that is read-only at every depth. BB uses it for JSON
14427
+ * snapshots it deep-freezes before handing them to a plugin, where any write
14428
+ * throws at runtime.
14429
+ */
14430
+ type ReadonlyJsonValue = string | number | boolean | null | readonly ReadonlyJsonValue[] | {
14431
+ readonly [key: string]: ReadonlyJsonValue;
14432
+ };
14315
14433
 
14316
14434
  /** A JSON-safe path segment reported by a Standard Schema validation issue. */
14317
14435
  type PluginRpcIssuePathSegment = string | number;
@@ -18046,6 +18164,7 @@ interface ThreadOutputResponse {
18046
18164
  output: string | null;
18047
18165
  }
18048
18166
  type ThreadMutationResult = ThreadResponse;
18167
+ type ThreadPluginMetadataResult = ThreadPluginMetadataResponse;
18049
18168
  type ThreadSpawnResult = ThreadResponse;
18050
18169
  type ThreadForkResult = ThreadResponse;
18051
18170
  type ThreadInteractionGetResult = PendingInteraction;
@@ -18055,6 +18174,7 @@ type ThreadInteractionRespondResult = PendingInteraction;
18055
18174
  type ThreadInteractionCancelResult = PendingInteraction;
18056
18175
  type ThreadEventsListResult = ThreadEventRow[];
18057
18176
  type ThreadEventWaitResult = ThreadEventRow | null;
18177
+ type ThreadContextResult = ThreadContextResponse;
18058
18178
  type ThreadTimelineResult = ThreadTimelineResponse;
18059
18179
  type ThreadArchiveResult = ThreadArchiveAllResponse;
18060
18180
  type ThreadOpenResult = ThreadOpenResponse;
@@ -18119,6 +18239,18 @@ interface ThreadForkArgs extends Omit<ForkThreadRequest, "origin" | "visibility"
18119
18239
  interface ThreadUpdateArgs extends UpdateThreadRequest {
18120
18240
  threadId: string;
18121
18241
  }
18242
+ interface ThreadPluginMetadataArgs {
18243
+ pluginId: string;
18244
+ signal?: AbortSignal;
18245
+ threadId: string;
18246
+ }
18247
+ interface ThreadPluginMetadataUpdateArgs {
18248
+ threadId: string;
18249
+ pluginId: string;
18250
+ set?: JsonObject;
18251
+ remove?: string[];
18252
+ signal?: AbortSignal;
18253
+ }
18122
18254
  interface ThreadDeleteArgs extends DeleteThreadRequest {
18123
18255
  threadId: string;
18124
18256
  }
@@ -18145,6 +18277,7 @@ interface ThreadRetryArgs {
18145
18277
  reason?: string;
18146
18278
  }
18147
18279
  interface ThreadActionArgs {
18280
+ signal?: AbortSignal;
18148
18281
  threadId: string;
18149
18282
  }
18150
18283
  interface ThreadStatusArgs extends ThreadActionArgs {
@@ -18335,6 +18468,8 @@ interface ThreadsArea {
18335
18468
  events: ThreadEventsArea;
18336
18469
  fork(args: ThreadForkArgs): Promise<ThreadForkResult>;
18337
18470
  get(args: ThreadGetArgs): Promise<ThreadGetResult>;
18471
+ getPluginMetadata(args: ThreadPluginMetadataArgs): Promise<ThreadPluginMetadataResult>;
18472
+ updatePluginMetadata(args: ThreadPluginMetadataUpdateArgs): Promise<ThreadPluginMetadataResult>;
18338
18473
  queue: ThreadQueueArea;
18339
18474
  interactions: ThreadInteractionsArea;
18340
18475
  list(args?: ThreadListArgs): Promise<ThreadListResult>;
@@ -18362,6 +18497,7 @@ interface ThreadsArea {
18362
18497
  spawn(args: ThreadSpawnArgs): Promise<ThreadSpawnResult>;
18363
18498
  stop(args: ThreadActionArgs): Promise<ThreadStopResult>;
18364
18499
  tabs: ThreadTabsArea;
18500
+ context(args: ThreadStatusArgs): Promise<ThreadContextResult>;
18365
18501
  timeline(args: ThreadTimelineArgs): Promise<ThreadTimelineResult>;
18366
18502
  timelineTurnSummaryDetails(args: ThreadTimelineTurnSummaryDetailsArgs): Promise<ThreadTimelineTurnSummaryDetailsResult>;
18367
18503
  storageFiles(args: ThreadStorageFilesArgs): Promise<ThreadStorageFilesResult>;
@@ -19388,6 +19524,15 @@ interface PluginAgentToolRegistrationBase {
19388
19524
  }
19389
19525
  /** Stable, plain-data context resolved by the server for one agent session. */
19390
19526
  interface PluginAgentConfigurationContext {
19527
+ /**
19528
+ * The thread's metadata stored under this plugin's id, or `{}` when absent,
19529
+ * as a deep-frozen snapshot for this configure call. Any API client, another
19530
+ * plugin, or the thread's own agent can write it; treat values as untrusted,
19531
+ * and quote or escape any value you put into returned instructions.
19532
+ */
19533
+ readonly pluginMetadata: {
19534
+ readonly [key: string]: ReadonlyJsonValue;
19535
+ };
19391
19536
  thread: {
19392
19537
  id: string;
19393
19538
  title: string | null;
@@ -20073,6 +20218,25 @@ interface PluginStatusApi {
20073
20218
  */
20074
20219
  needsConfiguration(message: string): void;
20075
20220
  }
20221
+ /**
20222
+ * The BB SDK bound to one plugin (`bb.sdk`). `threads.getPluginMetadata` and
20223
+ * `threads.updatePluginMetadata` default `pluginId` to that plugin's id. An
20224
+ * explicit `pluginId` must be a plugin id (lowercase letters, digits, and
20225
+ * dashes) or the request fails with HTTP 400. A `pluginMetadata` seed or a
20226
+ * `set` that is over 256 KiB on its own rejects before any request is sent. A
20227
+ * patch whose merged namespace would exceed 256 KiB fails with HTTP 413 and
20228
+ * leaves the namespace unchanged.
20229
+ */
20230
+ type PluginBbSdk = Omit<BbSdk, "threads"> & {
20231
+ threads: Omit<BbSdk["threads"], "getPluginMetadata" | "updatePluginMetadata"> & {
20232
+ getPluginMetadata(args: Omit<ThreadPluginMetadataArgs, "pluginId"> & {
20233
+ pluginId?: string;
20234
+ }): Promise<ThreadPluginMetadataResult>;
20235
+ updatePluginMetadata(args: Omit<ThreadPluginMetadataUpdateArgs, "pluginId"> & {
20236
+ pluginId?: string;
20237
+ }): Promise<ThreadPluginMetadataResult>;
20238
+ };
20239
+ };
20076
20240
  /**
20077
20241
  * The API object handed to a plugin's factory (design §4). Implemented by
20078
20242
  * the BB server; this contract is what plugin `server.ts` files compile
@@ -20141,10 +20305,12 @@ interface BbPluginApi {
20141
20305
  * server binds it before loading plugins, so it is available from the
20142
20306
  * moment factories run there — but isolated harnesses may not, so prefer
20143
20307
  * 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.
20308
+ * `threads.spawn` and `threads.fork` default `origin` to "plugin" and, for
20309
+ * that origin, `originPluginId` to this plugin's id unless you set them.
20310
+ * Seeding `pluginMetadata` always attributes the new thread to this plugin,
20311
+ * overriding an explicit `origin` or `originPluginId`.
20146
20312
  */
20147
- readonly sdk: BbSdk;
20313
+ readonly sdk: PluginBbSdk;
20148
20314
  /**
20149
20315
  * Register cleanup to run on reload/disable/shutdown. Hooks run LIFO.
20150
20316
  * The sanctioned place to clear timers and close connections.
@@ -20153,4 +20319,4 @@ interface BbPluginApi {
20153
20319
  }
20154
20320
 
20155
20321
  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 };
20322
+ 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,