@get-bb/plugin-sdk 0.6.132 → 0.6.136

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.
@@ -607,9 +607,9 @@ declare const environmentSchema: z$1.ZodObject<{
607
607
  type Environment = z$1.infer<typeof environmentSchema>;
608
608
 
609
609
  declare const experimentsSchema: z$1.ZodRecord<z$1.ZodEnum<{
610
+ agentCpuPriority: "agentCpuPriority";
610
611
  compactExpiredCache: "compactExpiredCache";
611
612
  dismissReadNotifications: "dismissReadNotifications";
612
- narrowPluginCss: "narrowPluginCss";
613
613
  performanceDiagnostics: "performanceDiagnostics";
614
614
  pluginUpdates: "pluginUpdates";
615
615
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -617,14 +617,14 @@ declare const experimentsSchema: z$1.ZodRecord<z$1.ZodEnum<{
617
617
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
618
618
  threadContextCard: "threadContextCard";
619
619
  threadRowMetadata: "threadRowMetadata";
620
- timelinePush: "timelinePush";
621
620
  updateWhenIdle: "updateWhenIdle";
621
+ walCheckpointWorker: "walCheckpointWorker";
622
622
  }>, z$1.ZodBoolean>;
623
623
  type Experiments = z$1.infer<typeof experimentsSchema>;
624
624
  declare const experimentUpdatesSchema: z$1.ZodRecord<z$1.ZodEnum<{
625
+ agentCpuPriority: "agentCpuPriority";
625
626
  compactExpiredCache: "compactExpiredCache";
626
627
  dismissReadNotifications: "dismissReadNotifications";
627
- narrowPluginCss: "narrowPluginCss";
628
628
  performanceDiagnostics: "performanceDiagnostics";
629
629
  pluginUpdates: "pluginUpdates";
630
630
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -632,8 +632,8 @@ declare const experimentUpdatesSchema: z$1.ZodRecord<z$1.ZodEnum<{
632
632
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
633
633
  threadContextCard: "threadContextCard";
634
634
  threadRowMetadata: "threadRowMetadata";
635
- timelinePush: "timelinePush";
636
635
  updateWhenIdle: "updateWhenIdle";
636
+ walCheckpointWorker: "walCheckpointWorker";
637
637
  }> & z$1.core.$partial, z$1.ZodBoolean>;
638
638
  type ExperimentUpdates = z$1.infer<typeof experimentUpdatesSchema>;
639
639
 
@@ -8731,6 +8731,21 @@ declare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{
8731
8731
  pinned: "pinned";
8732
8732
  unavailable: "unavailable";
8733
8733
  }>;
8734
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
8735
+ basis: z$1.ZodEnum<{
8736
+ catalog: "catalog";
8737
+ release: "release";
8738
+ }>;
8739
+ breaking: z$1.ZodBoolean;
8740
+ candidate: z$1.ZodObject<{
8741
+ display: z$1.ZodString;
8742
+ label: z$1.ZodString;
8743
+ version: z$1.ZodString;
8744
+ }, z$1.core.$strip>;
8745
+ currentRange: z$1.ZodString;
8746
+ range: z$1.ZodString;
8747
+ reasons: z$1.ZodArray<z$1.ZodString>;
8748
+ }, z$1.core.$strip>>;
8734
8749
  }, z$1.core.$strip>;
8735
8750
  type PluginUpdateCheckEntry = z$1.infer<typeof pluginUpdateCheckEntrySchema>;
8736
8751
  declare const pluginApplyUpdateResultSchema: z$1.ZodObject<{
@@ -8940,6 +8955,21 @@ declare const installedPluginSchema: z$1.ZodObject<{
8940
8955
  pinned: "pinned";
8941
8956
  unavailable: "unavailable";
8942
8957
  }>>;
8958
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
8959
+ basis: z$1.ZodEnum<{
8960
+ catalog: "catalog";
8961
+ release: "release";
8962
+ }>;
8963
+ breaking: z$1.ZodBoolean;
8964
+ candidate: z$1.ZodObject<{
8965
+ display: z$1.ZodString;
8966
+ label: z$1.ZodString;
8967
+ version: z$1.ZodString;
8968
+ }, z$1.core.$strip>;
8969
+ currentRange: z$1.ZodString;
8970
+ range: z$1.ZodString;
8971
+ reasons: z$1.ZodArray<z$1.ZodString>;
8972
+ }, z$1.core.$strip>>;
8943
8973
  }, z$1.core.$strip>;
8944
8974
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
8945
8975
  version: z$1.ZodString;
@@ -9065,6 +9095,21 @@ declare const pluginListResponseSchema: z$1.ZodObject<{
9065
9095
  pinned: "pinned";
9066
9096
  unavailable: "unavailable";
9067
9097
  }>>;
9098
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9099
+ basis: z$1.ZodEnum<{
9100
+ catalog: "catalog";
9101
+ release: "release";
9102
+ }>;
9103
+ breaking: z$1.ZodBoolean;
9104
+ candidate: z$1.ZodObject<{
9105
+ display: z$1.ZodString;
9106
+ label: z$1.ZodString;
9107
+ version: z$1.ZodString;
9108
+ }, z$1.core.$strip>;
9109
+ currentRange: z$1.ZodString;
9110
+ range: z$1.ZodString;
9111
+ reasons: z$1.ZodArray<z$1.ZodString>;
9112
+ }, z$1.core.$strip>>;
9068
9113
  }, z$1.core.$strip>;
9069
9114
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9070
9115
  version: z$1.ZodString;
@@ -9256,6 +9301,21 @@ declare const pluginInstallJobSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
9256
9301
  pinned: "pinned";
9257
9302
  unavailable: "unavailable";
9258
9303
  }>>;
9304
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9305
+ basis: z$1.ZodEnum<{
9306
+ catalog: "catalog";
9307
+ release: "release";
9308
+ }>;
9309
+ breaking: z$1.ZodBoolean;
9310
+ candidate: z$1.ZodObject<{
9311
+ display: z$1.ZodString;
9312
+ label: z$1.ZodString;
9313
+ version: z$1.ZodString;
9314
+ }, z$1.core.$strip>;
9315
+ currentRange: z$1.ZodString;
9316
+ range: z$1.ZodString;
9317
+ reasons: z$1.ZodArray<z$1.ZodString>;
9318
+ }, z$1.core.$strip>>;
9259
9319
  }, z$1.core.$strip>;
9260
9320
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9261
9321
  version: z$1.ZodString;
@@ -9444,6 +9504,21 @@ declare const pluginReloadResponseSchema: z$1.ZodObject<{
9444
9504
  pinned: "pinned";
9445
9505
  unavailable: "unavailable";
9446
9506
  }>>;
9507
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9508
+ basis: z$1.ZodEnum<{
9509
+ catalog: "catalog";
9510
+ release: "release";
9511
+ }>;
9512
+ breaking: z$1.ZodBoolean;
9513
+ candidate: z$1.ZodObject<{
9514
+ display: z$1.ZodString;
9515
+ label: z$1.ZodString;
9516
+ version: z$1.ZodString;
9517
+ }, z$1.core.$strip>;
9518
+ currentRange: z$1.ZodString;
9519
+ range: z$1.ZodString;
9520
+ reasons: z$1.ZodArray<z$1.ZodString>;
9521
+ }, z$1.core.$strip>>;
9447
9522
  }, z$1.core.$strip>;
9448
9523
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9449
9524
  version: z$1.ZodString;
@@ -10517,9 +10592,9 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10517
10592
  }, z$1.core.$strict>;
10518
10593
  }, z$1.core.$strict>>;
10519
10594
  experiments: z$1.ZodRecord<z$1.ZodEnum<{
10595
+ agentCpuPriority: "agentCpuPriority";
10520
10596
  compactExpiredCache: "compactExpiredCache";
10521
10597
  dismissReadNotifications: "dismissReadNotifications";
10522
- narrowPluginCss: "narrowPluginCss";
10523
10598
  performanceDiagnostics: "performanceDiagnostics";
10524
10599
  pluginUpdates: "pluginUpdates";
10525
10600
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -10527,8 +10602,8 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10527
10602
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
10528
10603
  threadContextCard: "threadContextCard";
10529
10604
  threadRowMetadata: "threadRowMetadata";
10530
- timelinePush: "timelinePush";
10531
10605
  updateWhenIdle: "updateWhenIdle";
10606
+ walCheckpointWorker: "walCheckpointWorker";
10532
10607
  }>, z$1.ZodBoolean>;
10533
10608
  featureFlags: z$1.ZodObject<{
10534
10609
  initiatorTelemetry: z$1.ZodDefault<z$1.ZodBoolean>;
@@ -15208,10 +15283,6 @@ declare const threadTimelineQuerySchema: z$1.ZodObject<{
15208
15283
  true: "true";
15209
15284
  }>>;
15210
15285
  segmentLimit: z$1.ZodOptional<z$1.ZodString>;
15211
- summaryOnly: z$1.ZodOptional<z$1.ZodEnum<{
15212
- false: "false";
15213
- true: "true";
15214
- }>>;
15215
15286
  }, z$1.core.$strip>;
15216
15287
  type ThreadTimelineQuery = z$1.infer<typeof threadTimelineQuerySchema>;
15217
15288
  declare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{
@@ -16822,6 +16893,112 @@ declare const threadTimelineReadResponseSchema: z$1.ZodUnion<readonly [z$1.ZodOb
16822
16893
  }, z$1.core.$strict>;
16823
16894
  }, z$1.core.$strip>]>;
16824
16895
  type ThreadTimelineReadResponse = z$1.infer<typeof threadTimelineReadResponseSchema>;
16896
+ declare const threadHeadStateResponseSchema: z$1.ZodObject<{
16897
+ activePromptMode: z$1.ZodNullable<z$1.ZodObject<{
16898
+ mode: z$1.ZodLiteral<"plan">;
16899
+ prompt: z$1.ZodString;
16900
+ providerId: z$1.ZodString;
16901
+ }, z$1.core.$strict>>;
16902
+ contextWindowUsage: z$1.ZodNullable<z$1.ZodObject<{
16903
+ compactionOfferAt: z$1.ZodOptional<z$1.ZodISODateTime>;
16904
+ cost: z$1.ZodOptional<z$1.ZodObject<{
16905
+ amount: z$1.ZodNumber;
16906
+ currency: z$1.ZodString;
16907
+ }, z$1.core.$strip>>;
16908
+ estimated: z$1.ZodBoolean;
16909
+ modelContextWindow: z$1.ZodNumber;
16910
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
16911
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
16912
+ capturedAt: z$1.ZodISODateTime;
16913
+ categories: z$1.ZodArray<z$1.ZodObject<{
16914
+ entries: z$1.ZodArray<z$1.ZodObject<{
16915
+ id: z$1.ZodString;
16916
+ label: z$1.ZodString;
16917
+ tokens: z$1.ZodNumber;
16918
+ }, z$1.core.$strip>>;
16919
+ id: z$1.ZodString;
16920
+ kind: z$1.ZodEnum<{
16921
+ deferred: "deferred";
16922
+ free: "free";
16923
+ reserved: "reserved";
16924
+ used: "used";
16925
+ }>;
16926
+ label: z$1.ZodString;
16927
+ tokens: z$1.ZodNumber;
16928
+ }, z$1.core.$strip>>;
16929
+ contextWindowTokens: z$1.ZodNumber;
16930
+ estimated: z$1.ZodBoolean;
16931
+ model: z$1.ZodString;
16932
+ providerSessionId: z$1.ZodString;
16933
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
16934
+ usedTokens: z$1.ZodNumber;
16935
+ }, z$1.core.$strip>>;
16936
+ usedTokens: z$1.ZodNumber;
16937
+ }, z$1.core.$strip>>;
16938
+ extensionStates: z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue, unknown, z$1.core.$ZodTypeInternals<JsonValue, unknown>>>;
16939
+ modelFallback: z$1.ZodNullable<z$1.ZodObject<{
16940
+ detectedAt: z$1.ZodNumber;
16941
+ fallbackModel: z$1.ZodString;
16942
+ message: z$1.ZodString;
16943
+ originalModel: z$1.ZodString;
16944
+ reason: z$1.ZodEnum<{
16945
+ provider: "provider";
16946
+ refusal: "refusal";
16947
+ }>;
16948
+ sourceSeq: z$1.ZodNumber;
16949
+ }, z$1.core.$strip>>;
16950
+ pendingTodos: z$1.ZodNullable<z$1.ZodObject<{
16951
+ items: z$1.ZodArray<z$1.ZodObject<{
16952
+ id: z$1.ZodString;
16953
+ status: z$1.ZodEnum<{
16954
+ completed: "completed";
16955
+ in_progress: "in_progress";
16956
+ pending: "pending";
16957
+ }>;
16958
+ text: z$1.ZodString;
16959
+ }, z$1.core.$strip>>;
16960
+ sourceSeq: z$1.ZodNumber;
16961
+ updatedAt: z$1.ZodNumber;
16962
+ }, z$1.core.$strip>>;
16963
+ providerCommands: z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
16964
+ argumentHint: z$1.ZodNullable<z$1.ZodString>;
16965
+ description: z$1.ZodNullable<z$1.ZodString>;
16966
+ name: z$1.ZodString;
16967
+ origin: z$1.ZodEnum<{
16968
+ builtin: "builtin";
16969
+ project: "project";
16970
+ user: "user";
16971
+ }>;
16972
+ source: z$1.ZodEnum<{
16973
+ command: "command";
16974
+ skill: "skill";
16975
+ }>;
16976
+ }, z$1.core.$strip>>>;
16977
+ sessionOptions: z$1.ZodNullable<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
16978
+ category: z$1.ZodNullable<z$1.ZodString>;
16979
+ description: z$1.ZodNullable<z$1.ZodString>;
16980
+ id: z$1.ZodString;
16981
+ label: z$1.ZodString;
16982
+ pendingValue: z$1.ZodNullable<z$1.ZodString>;
16983
+ type: z$1.ZodLiteral<"select">;
16984
+ value: z$1.ZodString;
16985
+ values: z$1.ZodArray<z$1.ZodObject<{
16986
+ description: z$1.ZodNullable<z$1.ZodString>;
16987
+ group: z$1.ZodNullable<z$1.ZodString>;
16988
+ id: z$1.ZodString;
16989
+ label: z$1.ZodString;
16990
+ }, z$1.core.$strip>>;
16991
+ }, z$1.core.$strip>, z$1.ZodObject<{
16992
+ category: z$1.ZodNullable<z$1.ZodString>;
16993
+ description: z$1.ZodNullable<z$1.ZodString>;
16994
+ id: z$1.ZodString;
16995
+ label: z$1.ZodString;
16996
+ pendingValue: z$1.ZodNullable<z$1.ZodBoolean>;
16997
+ type: z$1.ZodLiteral<"boolean">;
16998
+ value: z$1.ZodBoolean;
16999
+ }, z$1.core.$strip>], "type">>>;
17000
+ }, z$1.core.$strip>;
17001
+ type ThreadHeadStateResponse = z$1.infer<typeof threadHeadStateResponseSchema>;
16825
17002
  declare const threadConversationOutlineQuerySchema: z$1.ZodObject<{
16826
17003
  role: z$1.ZodOptional<z$1.ZodEnum<{
16827
17004
  assistant: "assistant";
@@ -18004,6 +18181,10 @@ interface ProvidersArea {
18004
18181
  interface PluginIdArgs {
18005
18182
  pluginId: string;
18006
18183
  }
18184
+ interface PluginApplyUpdateArgs extends PluginIdArgs {
18185
+ range?: string;
18186
+ expectedVersion?: string;
18187
+ }
18007
18188
  interface PluginInstallArgs {
18008
18189
  source: string;
18009
18190
  subdirectory?: string;
@@ -18146,8 +18327,8 @@ interface PluginsArea {
18146
18327
  experimental_getSafeMode(args?: PluginGetSafeModeArgs): Promise<PluginSafeModeResult>;
18147
18328
  experimental_setSafeMode(args: PluginSetSafeModeArgs): Promise<PluginSetSafeModeResult>;
18148
18329
  experimental_pruneCache(args?: PluginPruneCacheArgs): Promise<PluginPruneCacheResult>;
18149
- applyUpdate(args: PluginIdArgs): Promise<PluginApplyUpdateResult>;
18150
- experimental_startUpdate(args: PluginIdArgs): Promise<PluginUpdateJob>;
18330
+ applyUpdate(args: PluginApplyUpdateArgs): Promise<PluginApplyUpdateResult>;
18331
+ experimental_startUpdate(args: PluginApplyUpdateArgs): Promise<PluginUpdateJob>;
18151
18332
  experimental_updateJobs: PluginUpdateJobsArea;
18152
18333
  callRpc<TOutput>(args: PluginRpcArgs<TOutput>): Promise<TOutput>;
18153
18334
  checkUpdates(args?: PluginCheckUpdatesArgs): Promise<PluginCheckUpdatesResult>;
@@ -18686,6 +18867,7 @@ type ThreadInteractionCancelResult = PendingInteraction;
18686
18867
  type ThreadEventsListResult = ThreadEventRow[];
18687
18868
  type ThreadEventWaitResult = ThreadEventRow | null;
18688
18869
  type ThreadContextResult = ThreadContextResponse;
18870
+ type ThreadHeadStateResult = ThreadHeadStateResponse;
18689
18871
  type ThreadTimelineResult = ThreadTimelineResponse;
18690
18872
  type ThreadTimelineReadResult = ThreadTimelineReadResponse;
18691
18873
  type ThreadArchiveResult = ThreadArchiveAllResponse;
@@ -19106,6 +19288,15 @@ interface ThreadsArea {
19106
19288
  stop(args: ThreadActionArgs): Promise<ThreadStopResult>;
19107
19289
  tabs: ThreadTabsArea;
19108
19290
  context(args: ThreadStatusArgs): Promise<ThreadContextResult>;
19291
+ /**
19292
+ * The thread's head state: to-dos, provider slash commands, session options,
19293
+ * extension states, plan prompt mode, model fallback, and context usage, as
19294
+ * of its latest event. Read from the latest stored state events without
19295
+ * building a timeline window; the latest timeline page embeds the same
19296
+ * values. `pendingTodos` and `activePromptMode` are null unless the thread
19297
+ * is active. Experimental: see docs/api_to_audit.md.
19298
+ */
19299
+ experimental_headState(args: ThreadStatusArgs): Promise<ThreadHeadStateResult>;
19109
19300
  timeline(args: ThreadTimelineArgs & {
19110
19301
  afterTag?: undefined;
19111
19302
  }): Promise<ThreadTimelineResult>;
@@ -506,11 +506,17 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
506
506
  }
507
507
  /** Host-originated inputs a slot test can drive deterministically. */
508
508
  interface RenderedSlotBehaviorDrivers {
509
+ /**
510
+ * Invalidate the plugin's cached `useRpc` reads carrying any of `tags`, as a
511
+ * backend `bb.rpc.experimental_invalidate` does, wrapped in act. `null`
512
+ * invalidates every read, like `experimental_invalidateAll`. `pluginId`
513
+ * defaults to the rendered plugin.
514
+ */
515
+ experimental_invalidateRpc(tags: readonly string[] | null, pluginId?: string): Promise<void>;
509
516
  /**
510
517
  * Push a realtime event to `useRealtime(channel, …)` subscribers, wrapped
511
518
  * in act. The payload is JSON-round-tripped like `bb.realtime.publish`.
512
519
  */
513
- experimental_invalidateRpc(tags: readonly string[] | null, pluginId?: string): Promise<void>;
514
520
  emitRealtime(channel: string, payload: unknown): Promise<void>;
515
521
  /** Drive the lifecycle of the same connection used by realtime events. */
516
522
  setRealtimeConnectionState(state: PluginRealtimeConnectionState): Promise<void>;
@@ -1270,9 +1270,17 @@ interface FakePluginInspectionState {
1270
1270
  readonly pluginId: string;
1271
1271
  /** Every `bb.log` line, in order. */
1272
1272
  readonly logEntries: FakeLogEntry[];
1273
- /** Every `bb.realtime.publish`, payload normalized like the wire. */
1273
+ /**
1274
+ * Call `listener` on every `bb.rpc.experimental_invalidate` and
1275
+ * `experimental_invalidateAll`; returns the unsubscribe function.
1276
+ */
1274
1277
  experimental_onRpcInvalidation(listener: () => void): () => void;
1278
+ /**
1279
+ * The tags of every `bb.rpc.experimental_invalidate`, in order; `null`
1280
+ * records an `experimental_invalidateAll`.
1281
+ */
1275
1282
  readonly experimental_rpcInvalidations: (readonly string[] | null)[];
1283
+ /** Every `bb.realtime.publish`, payload normalized like the wire. */
1276
1284
  readonly realtimeSignals: FakeRealtimeSignal[];
1277
1285
  /** Every `bb.status.needsConfiguration` message, in order. */
1278
1286
  readonly needsConfigurationMessages: string[];
@@ -698,9 +698,9 @@ declare const environmentSchema: z$1.ZodObject<{
698
698
  type Environment = z$1.infer<typeof environmentSchema>;
699
699
 
700
700
  declare const experimentsSchema: z$1.ZodRecord<z$1.ZodEnum<{
701
+ agentCpuPriority: "agentCpuPriority";
701
702
  compactExpiredCache: "compactExpiredCache";
702
703
  dismissReadNotifications: "dismissReadNotifications";
703
- narrowPluginCss: "narrowPluginCss";
704
704
  performanceDiagnostics: "performanceDiagnostics";
705
705
  pluginUpdates: "pluginUpdates";
706
706
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -708,14 +708,14 @@ declare const experimentsSchema: z$1.ZodRecord<z$1.ZodEnum<{
708
708
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
709
709
  threadContextCard: "threadContextCard";
710
710
  threadRowMetadata: "threadRowMetadata";
711
- timelinePush: "timelinePush";
712
711
  updateWhenIdle: "updateWhenIdle";
712
+ walCheckpointWorker: "walCheckpointWorker";
713
713
  }>, z$1.ZodBoolean>;
714
714
  type Experiments = z$1.infer<typeof experimentsSchema>;
715
715
  declare const experimentUpdatesSchema: z$1.ZodRecord<z$1.ZodEnum<{
716
+ agentCpuPriority: "agentCpuPriority";
716
717
  compactExpiredCache: "compactExpiredCache";
717
718
  dismissReadNotifications: "dismissReadNotifications";
718
- narrowPluginCss: "narrowPluginCss";
719
719
  performanceDiagnostics: "performanceDiagnostics";
720
720
  pluginUpdates: "pluginUpdates";
721
721
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -723,8 +723,8 @@ declare const experimentUpdatesSchema: z$1.ZodRecord<z$1.ZodEnum<{
723
723
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
724
724
  threadContextCard: "threadContextCard";
725
725
  threadRowMetadata: "threadRowMetadata";
726
- timelinePush: "timelinePush";
727
726
  updateWhenIdle: "updateWhenIdle";
727
+ walCheckpointWorker: "walCheckpointWorker";
728
728
  }> & z$1.core.$partial, z$1.ZodBoolean>;
729
729
  type ExperimentUpdates = z$1.infer<typeof experimentUpdatesSchema>;
730
730
 
@@ -8946,6 +8946,21 @@ declare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{
8946
8946
  pinned: "pinned";
8947
8947
  unavailable: "unavailable";
8948
8948
  }>;
8949
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
8950
+ basis: z$1.ZodEnum<{
8951
+ catalog: "catalog";
8952
+ release: "release";
8953
+ }>;
8954
+ breaking: z$1.ZodBoolean;
8955
+ candidate: z$1.ZodObject<{
8956
+ display: z$1.ZodString;
8957
+ label: z$1.ZodString;
8958
+ version: z$1.ZodString;
8959
+ }, z$1.core.$strip>;
8960
+ currentRange: z$1.ZodString;
8961
+ range: z$1.ZodString;
8962
+ reasons: z$1.ZodArray<z$1.ZodString>;
8963
+ }, z$1.core.$strip>>;
8949
8964
  }, z$1.core.$strip>;
8950
8965
  type PluginUpdateCheckEntry = z$1.infer<typeof pluginUpdateCheckEntrySchema>;
8951
8966
  declare const pluginApplyUpdateResultSchema: z$1.ZodObject<{
@@ -9155,6 +9170,21 @@ declare const installedPluginSchema: z$1.ZodObject<{
9155
9170
  pinned: "pinned";
9156
9171
  unavailable: "unavailable";
9157
9172
  }>>;
9173
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9174
+ basis: z$1.ZodEnum<{
9175
+ catalog: "catalog";
9176
+ release: "release";
9177
+ }>;
9178
+ breaking: z$1.ZodBoolean;
9179
+ candidate: z$1.ZodObject<{
9180
+ display: z$1.ZodString;
9181
+ label: z$1.ZodString;
9182
+ version: z$1.ZodString;
9183
+ }, z$1.core.$strip>;
9184
+ currentRange: z$1.ZodString;
9185
+ range: z$1.ZodString;
9186
+ reasons: z$1.ZodArray<z$1.ZodString>;
9187
+ }, z$1.core.$strip>>;
9158
9188
  }, z$1.core.$strip>;
9159
9189
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9160
9190
  version: z$1.ZodString;
@@ -9280,6 +9310,21 @@ declare const pluginListResponseSchema: z$1.ZodObject<{
9280
9310
  pinned: "pinned";
9281
9311
  unavailable: "unavailable";
9282
9312
  }>>;
9313
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9314
+ basis: z$1.ZodEnum<{
9315
+ catalog: "catalog";
9316
+ release: "release";
9317
+ }>;
9318
+ breaking: z$1.ZodBoolean;
9319
+ candidate: z$1.ZodObject<{
9320
+ display: z$1.ZodString;
9321
+ label: z$1.ZodString;
9322
+ version: z$1.ZodString;
9323
+ }, z$1.core.$strip>;
9324
+ currentRange: z$1.ZodString;
9325
+ range: z$1.ZodString;
9326
+ reasons: z$1.ZodArray<z$1.ZodString>;
9327
+ }, z$1.core.$strip>>;
9283
9328
  }, z$1.core.$strip>;
9284
9329
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9285
9330
  version: z$1.ZodString;
@@ -9471,6 +9516,21 @@ declare const pluginInstallJobSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
9471
9516
  pinned: "pinned";
9472
9517
  unavailable: "unavailable";
9473
9518
  }>>;
9519
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9520
+ basis: z$1.ZodEnum<{
9521
+ catalog: "catalog";
9522
+ release: "release";
9523
+ }>;
9524
+ breaking: z$1.ZodBoolean;
9525
+ candidate: z$1.ZodObject<{
9526
+ display: z$1.ZodString;
9527
+ label: z$1.ZodString;
9528
+ version: z$1.ZodString;
9529
+ }, z$1.core.$strip>;
9530
+ currentRange: z$1.ZodString;
9531
+ range: z$1.ZodString;
9532
+ reasons: z$1.ZodArray<z$1.ZodString>;
9533
+ }, z$1.core.$strip>>;
9474
9534
  }, z$1.core.$strip>;
9475
9535
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9476
9536
  version: z$1.ZodString;
@@ -9659,6 +9719,21 @@ declare const pluginReloadResponseSchema: z$1.ZodObject<{
9659
9719
  pinned: "pinned";
9660
9720
  unavailable: "unavailable";
9661
9721
  }>>;
9722
+ rangeUpgrade: z$1.ZodOptional<z$1.ZodObject<{
9723
+ basis: z$1.ZodEnum<{
9724
+ catalog: "catalog";
9725
+ release: "release";
9726
+ }>;
9727
+ breaking: z$1.ZodBoolean;
9728
+ candidate: z$1.ZodObject<{
9729
+ display: z$1.ZodString;
9730
+ label: z$1.ZodString;
9731
+ version: z$1.ZodString;
9732
+ }, z$1.core.$strip>;
9733
+ currentRange: z$1.ZodString;
9734
+ range: z$1.ZodString;
9735
+ reasons: z$1.ZodArray<z$1.ZodString>;
9736
+ }, z$1.core.$strip>>;
9662
9737
  }, z$1.core.$strip>;
9663
9738
  updatedAt: z$1.ZodOptional<z$1.ZodISODateTime>;
9664
9739
  version: z$1.ZodString;
@@ -10732,9 +10807,9 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10732
10807
  }, z$1.core.$strict>;
10733
10808
  }, z$1.core.$strict>>;
10734
10809
  experiments: z$1.ZodRecord<z$1.ZodEnum<{
10810
+ agentCpuPriority: "agentCpuPriority";
10735
10811
  compactExpiredCache: "compactExpiredCache";
10736
10812
  dismissReadNotifications: "dismissReadNotifications";
10737
- narrowPluginCss: "narrowPluginCss";
10738
10813
  performanceDiagnostics: "performanceDiagnostics";
10739
10814
  pluginUpdates: "pluginUpdates";
10740
10815
  resumeThreadsAfterRestart: "resumeThreadsAfterRestart";
@@ -10742,8 +10817,8 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10742
10817
  skipFocusedThreadNotifications: "skipFocusedThreadNotifications";
10743
10818
  threadContextCard: "threadContextCard";
10744
10819
  threadRowMetadata: "threadRowMetadata";
10745
- timelinePush: "timelinePush";
10746
10820
  updateWhenIdle: "updateWhenIdle";
10821
+ walCheckpointWorker: "walCheckpointWorker";
10747
10822
  }>, z$1.ZodBoolean>;
10748
10823
  featureFlags: z$1.ZodObject<{
10749
10824
  initiatorTelemetry: z$1.ZodDefault<z$1.ZodBoolean>;
@@ -15424,10 +15499,6 @@ declare const threadTimelineQuerySchema: z$1.ZodObject<{
15424
15499
  true: "true";
15425
15500
  }>>;
15426
15501
  segmentLimit: z$1.ZodOptional<z$1.ZodString>;
15427
- summaryOnly: z$1.ZodOptional<z$1.ZodEnum<{
15428
- false: "false";
15429
- true: "true";
15430
- }>>;
15431
15502
  }, z$1.core.$strip>;
15432
15503
  type ThreadTimelineQuery = z$1.infer<typeof threadTimelineQuerySchema>;
15433
15504
  declare const timelineTurnSummaryDetailsQuerySchema: z$1.ZodObject<{
@@ -17038,6 +17109,112 @@ declare const threadTimelineReadResponseSchema: z$1.ZodUnion<readonly [z$1.ZodOb
17038
17109
  }, z$1.core.$strict>;
17039
17110
  }, z$1.core.$strip>]>;
17040
17111
  type ThreadTimelineReadResponse = z$1.infer<typeof threadTimelineReadResponseSchema>;
17112
+ declare const threadHeadStateResponseSchema: z$1.ZodObject<{
17113
+ activePromptMode: z$1.ZodNullable<z$1.ZodObject<{
17114
+ mode: z$1.ZodLiteral<"plan">;
17115
+ prompt: z$1.ZodString;
17116
+ providerId: z$1.ZodString;
17117
+ }, z$1.core.$strict>>;
17118
+ contextWindowUsage: z$1.ZodNullable<z$1.ZodObject<{
17119
+ compactionOfferAt: z$1.ZodOptional<z$1.ZodISODateTime>;
17120
+ cost: z$1.ZodOptional<z$1.ZodObject<{
17121
+ amount: z$1.ZodNumber;
17122
+ currency: z$1.ZodString;
17123
+ }, z$1.core.$strip>>;
17124
+ estimated: z$1.ZodBoolean;
17125
+ modelContextWindow: z$1.ZodNumber;
17126
+ snapshot: z$1.ZodOptional<z$1.ZodObject<{
17127
+ autoCompactAtTokens: z$1.ZodNullable<z$1.ZodNumber>;
17128
+ capturedAt: z$1.ZodISODateTime;
17129
+ categories: z$1.ZodArray<z$1.ZodObject<{
17130
+ entries: z$1.ZodArray<z$1.ZodObject<{
17131
+ id: z$1.ZodString;
17132
+ label: z$1.ZodString;
17133
+ tokens: z$1.ZodNumber;
17134
+ }, z$1.core.$strip>>;
17135
+ id: z$1.ZodString;
17136
+ kind: z$1.ZodEnum<{
17137
+ deferred: "deferred";
17138
+ free: "free";
17139
+ reserved: "reserved";
17140
+ used: "used";
17141
+ }>;
17142
+ label: z$1.ZodString;
17143
+ tokens: z$1.ZodNumber;
17144
+ }, z$1.core.$strip>>;
17145
+ contextWindowTokens: z$1.ZodNumber;
17146
+ estimated: z$1.ZodBoolean;
17147
+ model: z$1.ZodString;
17148
+ providerSessionId: z$1.ZodString;
17149
+ providerTurnId: z$1.ZodNullable<z$1.ZodString>;
17150
+ usedTokens: z$1.ZodNumber;
17151
+ }, z$1.core.$strip>>;
17152
+ usedTokens: z$1.ZodNumber;
17153
+ }, z$1.core.$strip>>;
17154
+ extensionStates: z$1.ZodRecord<z$1.ZodString, z$1.ZodType<JsonValue$1, unknown, z$1.core.$ZodTypeInternals<JsonValue$1, unknown>>>;
17155
+ modelFallback: z$1.ZodNullable<z$1.ZodObject<{
17156
+ detectedAt: z$1.ZodNumber;
17157
+ fallbackModel: z$1.ZodString;
17158
+ message: z$1.ZodString;
17159
+ originalModel: z$1.ZodString;
17160
+ reason: z$1.ZodEnum<{
17161
+ provider: "provider";
17162
+ refusal: "refusal";
17163
+ }>;
17164
+ sourceSeq: z$1.ZodNumber;
17165
+ }, z$1.core.$strip>>;
17166
+ pendingTodos: z$1.ZodNullable<z$1.ZodObject<{
17167
+ items: z$1.ZodArray<z$1.ZodObject<{
17168
+ id: z$1.ZodString;
17169
+ status: z$1.ZodEnum<{
17170
+ completed: "completed";
17171
+ in_progress: "in_progress";
17172
+ pending: "pending";
17173
+ }>;
17174
+ text: z$1.ZodString;
17175
+ }, z$1.core.$strip>>;
17176
+ sourceSeq: z$1.ZodNumber;
17177
+ updatedAt: z$1.ZodNumber;
17178
+ }, z$1.core.$strip>>;
17179
+ providerCommands: z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
17180
+ argumentHint: z$1.ZodNullable<z$1.ZodString>;
17181
+ description: z$1.ZodNullable<z$1.ZodString>;
17182
+ name: z$1.ZodString;
17183
+ origin: z$1.ZodEnum<{
17184
+ builtin: "builtin";
17185
+ project: "project";
17186
+ user: "user";
17187
+ }>;
17188
+ source: z$1.ZodEnum<{
17189
+ command: "command";
17190
+ skill: "skill";
17191
+ }>;
17192
+ }, z$1.core.$strip>>>;
17193
+ sessionOptions: z$1.ZodNullable<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
17194
+ category: z$1.ZodNullable<z$1.ZodString>;
17195
+ description: z$1.ZodNullable<z$1.ZodString>;
17196
+ id: z$1.ZodString;
17197
+ label: z$1.ZodString;
17198
+ pendingValue: z$1.ZodNullable<z$1.ZodString>;
17199
+ type: z$1.ZodLiteral<"select">;
17200
+ value: z$1.ZodString;
17201
+ values: z$1.ZodArray<z$1.ZodObject<{
17202
+ description: z$1.ZodNullable<z$1.ZodString>;
17203
+ group: z$1.ZodNullable<z$1.ZodString>;
17204
+ id: z$1.ZodString;
17205
+ label: z$1.ZodString;
17206
+ }, z$1.core.$strip>>;
17207
+ }, z$1.core.$strip>, z$1.ZodObject<{
17208
+ category: z$1.ZodNullable<z$1.ZodString>;
17209
+ description: z$1.ZodNullable<z$1.ZodString>;
17210
+ id: z$1.ZodString;
17211
+ label: z$1.ZodString;
17212
+ pendingValue: z$1.ZodNullable<z$1.ZodBoolean>;
17213
+ type: z$1.ZodLiteral<"boolean">;
17214
+ value: z$1.ZodBoolean;
17215
+ }, z$1.core.$strip>], "type">>>;
17216
+ }, z$1.core.$strip>;
17217
+ type ThreadHeadStateResponse = z$1.infer<typeof threadHeadStateResponseSchema>;
17041
17218
  declare const threadConversationOutlineQuerySchema: z$1.ZodObject<{
17042
17219
  role: z$1.ZodOptional<z$1.ZodEnum<{
17043
17220
  assistant: "assistant";
@@ -18231,6 +18408,10 @@ interface ProvidersArea {
18231
18408
  interface PluginIdArgs {
18232
18409
  pluginId: string;
18233
18410
  }
18411
+ interface PluginApplyUpdateArgs extends PluginIdArgs {
18412
+ range?: string;
18413
+ expectedVersion?: string;
18414
+ }
18234
18415
  interface PluginInstallArgs {
18235
18416
  source: string;
18236
18417
  subdirectory?: string;
@@ -18373,8 +18554,8 @@ interface PluginsArea {
18373
18554
  experimental_getSafeMode(args?: PluginGetSafeModeArgs): Promise<PluginSafeModeResult>;
18374
18555
  experimental_setSafeMode(args: PluginSetSafeModeArgs): Promise<PluginSetSafeModeResult>;
18375
18556
  experimental_pruneCache(args?: PluginPruneCacheArgs): Promise<PluginPruneCacheResult>;
18376
- applyUpdate(args: PluginIdArgs): Promise<PluginApplyUpdateResult>;
18377
- experimental_startUpdate(args: PluginIdArgs): Promise<PluginUpdateJob>;
18557
+ applyUpdate(args: PluginApplyUpdateArgs): Promise<PluginApplyUpdateResult>;
18558
+ experimental_startUpdate(args: PluginApplyUpdateArgs): Promise<PluginUpdateJob>;
18378
18559
  experimental_updateJobs: PluginUpdateJobsArea;
18379
18560
  callRpc<TOutput>(args: PluginRpcArgs<TOutput>): Promise<TOutput>;
18380
18561
  checkUpdates(args?: PluginCheckUpdatesArgs): Promise<PluginCheckUpdatesResult>;
@@ -18913,6 +19094,7 @@ type ThreadInteractionCancelResult = PendingInteraction;
18913
19094
  type ThreadEventsListResult = ThreadEventRow[];
18914
19095
  type ThreadEventWaitResult = ThreadEventRow | null;
18915
19096
  type ThreadContextResult = ThreadContextResponse;
19097
+ type ThreadHeadStateResult = ThreadHeadStateResponse;
18916
19098
  type ThreadTimelineResult = ThreadTimelineResponse;
18917
19099
  type ThreadTimelineReadResult = ThreadTimelineReadResponse;
18918
19100
  type ThreadArchiveResult = ThreadArchiveAllResponse;
@@ -19333,6 +19515,15 @@ interface ThreadsArea {
19333
19515
  stop(args: ThreadActionArgs): Promise<ThreadStopResult>;
19334
19516
  tabs: ThreadTabsArea;
19335
19517
  context(args: ThreadStatusArgs): Promise<ThreadContextResult>;
19518
+ /**
19519
+ * The thread's head state: to-dos, provider slash commands, session options,
19520
+ * extension states, plan prompt mode, model fallback, and context usage, as
19521
+ * of its latest event. Read from the latest stored state events without
19522
+ * building a timeline window; the latest timeline page embeds the same
19523
+ * values. `pendingTodos` and `activePromptMode` are null unless the thread
19524
+ * is active. Experimental: see docs/api_to_audit.md.
19525
+ */
19526
+ experimental_headState(args: ThreadStatusArgs): Promise<ThreadHeadStateResult>;
19336
19527
  timeline(args: ThreadTimelineArgs & {
19337
19528
  afterTag?: undefined;
19338
19529
  }): Promise<ThreadTimelineResult>;
@@ -2774,59 +2774,61 @@ async function validateRpcValue(schema, value, phase, fail) {
2774
2774
  }
2775
2775
  function normalizeRpcJsonResult(value, fail) {
2776
2776
  const ancestors = /* @__PURE__ */ new Set();
2777
- function visit(current, path) {
2777
+ const pathSegments = [];
2778
+ function failAt(problem) {
2779
+ let path = "$result";
2780
+ for (const segment of pathSegments) {
2781
+ path += typeof segment === "number" ? `[${segment}]` : `.${segment}`;
2782
+ }
2783
+ return fail({
2784
+ code: "non_json_result",
2785
+ message: `rpc result at ${path} ${problem}`
2786
+ });
2787
+ }
2788
+ function visit(current) {
2778
2789
  if (current === null || typeof current === "string" || typeof current === "boolean") {
2779
2790
  return current;
2780
2791
  }
2781
2792
  if (typeof current === "number") {
2782
2793
  if (!Number.isFinite(current)) {
2783
- return fail({
2784
- code: "non_json_result",
2785
- message: `rpc result at ${path} contains a non-finite number`
2786
- });
2794
+ return failAt("contains a non-finite number");
2787
2795
  }
2788
2796
  return current;
2789
2797
  }
2790
2798
  if (typeof current !== "object") {
2791
- return fail({
2792
- code: "non_json_result",
2793
- message: `rpc result at ${path} is not a JSON value (${typeof current})`
2794
- });
2799
+ return failAt(`is not a JSON value (${typeof current})`);
2795
2800
  }
2796
2801
  if (ancestors.has(current)) {
2797
- return fail({
2798
- code: "non_json_result",
2799
- message: `rpc result at ${path} is cyclic`
2800
- });
2802
+ return failAt("is cyclic");
2801
2803
  }
2802
2804
  ancestors.add(current);
2803
- try {
2804
- if (Array.isArray(current)) {
2805
- return current.map((item, index) => visit(item, `${path}[${index}]`));
2806
- }
2807
- const prototype = Object.getPrototypeOf(current);
2808
- if (prototype !== Object.prototype && prototype !== null) {
2809
- return fail({
2810
- code: "non_json_result",
2811
- message: `rpc result at ${path} must be a plain JSON object`
2812
- });
2813
- }
2814
- if (Reflect.ownKeys(current).some((key) => typeof key === "symbol")) {
2815
- return fail({
2816
- code: "non_json_result",
2817
- message: `rpc result at ${path} contains a symbol key`
2818
- });
2819
- }
2820
- const normalized = {};
2821
- for (const [key, child] of Object.entries(current)) {
2822
- normalized[key] = visit(child, `${path}.${key}`);
2823
- }
2824
- return normalized;
2825
- } finally {
2805
+ if (Array.isArray(current)) {
2806
+ const normalized2 = current.map((item, index) => {
2807
+ pathSegments.push(index);
2808
+ const child = visit(item);
2809
+ pathSegments.pop();
2810
+ return child;
2811
+ });
2826
2812
  ancestors.delete(current);
2813
+ return normalized2;
2814
+ }
2815
+ const prototype = Object.getPrototypeOf(current);
2816
+ if (prototype !== Object.prototype && prototype !== null) {
2817
+ return failAt("must be a plain JSON object");
2818
+ }
2819
+ if (Object.getOwnPropertySymbols(current).length > 0) {
2820
+ return failAt("contains a symbol key");
2821
+ }
2822
+ const normalized = {};
2823
+ for (const key of Object.keys(current)) {
2824
+ pathSegments.push(key);
2825
+ normalized[key] = visit(Reflect.get(current, key));
2826
+ pathSegments.pop();
2827
2827
  }
2828
+ ancestors.delete(current);
2829
+ return normalized;
2828
2830
  }
2829
- return visit(value, "$result");
2831
+ return visit(value);
2830
2832
  }
2831
2833
  export {
2832
2834
  ENVIRONMENT_PROVIDER_DESCRIPTION_MAX_CHARS,
@@ -2895,59 +2895,61 @@ async function validateRpcValue(schema, value, phase, fail) {
2895
2895
  }
2896
2896
  function normalizeRpcJsonResult(value, fail) {
2897
2897
  const ancestors = /* @__PURE__ */ new Set();
2898
- function visit(current, path) {
2898
+ const pathSegments = [];
2899
+ function failAt(problem) {
2900
+ let path = "$result";
2901
+ for (const segment of pathSegments) {
2902
+ path += typeof segment === "number" ? `[${segment}]` : `.${segment}`;
2903
+ }
2904
+ return fail({
2905
+ code: "non_json_result",
2906
+ message: `rpc result at ${path} ${problem}`
2907
+ });
2908
+ }
2909
+ function visit(current) {
2899
2910
  if (current === null || typeof current === "string" || typeof current === "boolean") {
2900
2911
  return current;
2901
2912
  }
2902
2913
  if (typeof current === "number") {
2903
2914
  if (!Number.isFinite(current)) {
2904
- return fail({
2905
- code: "non_json_result",
2906
- message: `rpc result at ${path} contains a non-finite number`
2907
- });
2915
+ return failAt("contains a non-finite number");
2908
2916
  }
2909
2917
  return current;
2910
2918
  }
2911
2919
  if (typeof current !== "object") {
2912
- return fail({
2913
- code: "non_json_result",
2914
- message: `rpc result at ${path} is not a JSON value (${typeof current})`
2915
- });
2920
+ return failAt(`is not a JSON value (${typeof current})`);
2916
2921
  }
2917
2922
  if (ancestors.has(current)) {
2918
- return fail({
2919
- code: "non_json_result",
2920
- message: `rpc result at ${path} is cyclic`
2921
- });
2923
+ return failAt("is cyclic");
2922
2924
  }
2923
2925
  ancestors.add(current);
2924
- try {
2925
- if (Array.isArray(current)) {
2926
- return current.map((item, index) => visit(item, `${path}[${index}]`));
2927
- }
2928
- const prototype = Object.getPrototypeOf(current);
2929
- if (prototype !== Object.prototype && prototype !== null) {
2930
- return fail({
2931
- code: "non_json_result",
2932
- message: `rpc result at ${path} must be a plain JSON object`
2933
- });
2934
- }
2935
- if (Reflect.ownKeys(current).some((key) => typeof key === "symbol")) {
2936
- return fail({
2937
- code: "non_json_result",
2938
- message: `rpc result at ${path} contains a symbol key`
2939
- });
2940
- }
2941
- const normalized = {};
2942
- for (const [key, child] of Object.entries(current)) {
2943
- normalized[key] = visit(child, `${path}.${key}`);
2944
- }
2945
- return normalized;
2946
- } finally {
2926
+ if (Array.isArray(current)) {
2927
+ const normalized2 = current.map((item, index) => {
2928
+ pathSegments.push(index);
2929
+ const child = visit(item);
2930
+ pathSegments.pop();
2931
+ return child;
2932
+ });
2947
2933
  ancestors.delete(current);
2934
+ return normalized2;
2935
+ }
2936
+ const prototype = Object.getPrototypeOf(current);
2937
+ if (prototype !== Object.prototype && prototype !== null) {
2938
+ return failAt("must be a plain JSON object");
2939
+ }
2940
+ if (Object.getOwnPropertySymbols(current).length > 0) {
2941
+ return failAt("contains a symbol key");
2942
+ }
2943
+ const normalized = {};
2944
+ for (const key of Object.keys(current)) {
2945
+ pathSegments.push(key);
2946
+ normalized[key] = visit(Reflect.get(current, key));
2947
+ pathSegments.pop();
2948
2948
  }
2949
+ ancestors.delete(current);
2950
+ return normalized;
2949
2951
  }
2950
- return visit(value, "$result");
2952
+ return visit(value);
2951
2953
  }
2952
2954
 
2953
2955
  // src/testing/fake-plugin-host.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.132",
3
+ "version": "0.6.136",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"