@soba-so/react 0.0.17 → 0.0.18

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.
@@ -0,0 +1,31 @@
1
+ import { type UseModelOptions } from "./useModel.js";
2
+ export interface ModelPickerProps extends UseModelOptions {
3
+ /** A word before the value. Left out: in a composer there is no room for a
4
+ * caption, and "Opus ⌄" already says what it is. */
5
+ caption?: string;
6
+ disabled?: boolean;
7
+ className?: string;
8
+ }
9
+ /**
10
+ * WHICH MODEL ANSWERS, AS ONE PILL THAT GOES BESIDE A SEND BUTTON.
11
+ *
12
+ * ```jsx
13
+ * const { run } = useSoba()
14
+ * const model = useModel()
15
+ *
16
+ * <ModelPicker />
17
+ * <button onClick={() => run({ prompt, ...model.run })}>Send</button>
18
+ * ```
19
+ *
20
+ * Mount it and read `useModel().run` where you start the run — the two share
21
+ * the provider's state, so the pill and the run cannot disagree about which
22
+ * model was chosen. Or pass `value` and `onChange` and keep the pick wherever
23
+ * the rest of your composer's state lives.
24
+ *
25
+ * IT DRAWS NOTHING WITH NOTHING CONNECTED, which is most apps on their first
26
+ * day. The options are read off the person's own machines, so before they pair
27
+ * anything the only one is Automatic — and a menu with one row in it is a
28
+ * label that looks pressable. `<ConnectNudge />` is the component whose job is
29
+ * that case; this one stays out of its way and appears when there is a choice.
30
+ */
31
+ export declare function ModelPicker({ caption, disabled, className, ...options }: ModelPickerProps): import("react").JSX.Element | null;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { ConnectModal, type ConnectModalProps } from "./ConnectModal.js";
5
5
  export { ConnectNudge, type ConnectNudgeProps } from "./ConnectNudge.js";
6
6
  export { type ComputeState, type ConnectReason, type ConnectState, type PlanState, type RunRequest, type SobaContextValue, useSoba, } from "./context.js";
7
7
  export { collectText, parseEvent, readEvents } from "./events.js";
8
- export { type RunStream, type WatchOptions, watchRun } from "./watch.js";
8
+ export { ModelPicker, type ModelPickerProps } from "./ModelPicker.js";
9
9
  export { RunError, type RunErrorProps, runErrorMessage } from "./RunError.js";
10
10
  export { RunLimit, type RunLimitProps } from "./RunLimit.js";
11
11
  export { SobaBilling, type SobaBillingProps } from "./SobaBilling.js";
@@ -14,7 +14,15 @@ export { SobaCurrentPlan, type SobaCurrentPlanProps } from "./SobaCurrentPlan.js
14
14
  export { SobaPlans, type SobaPlansProps } from "./SobaPlans.js";
15
15
  export { SobaProvider, type SobaProviderProps } from "./SobaProvider.js";
16
16
  export { injectStyles } from "./styles.js";
17
- export type { AgentEvent, AgentEventType, ConnectApi, ConnectContext, CostClass, CurrentPlan, Machine, MachineState, Message, PendingCode, Plan, Runtime, RunUsage, } from "./types.js";
17
+ export { tierLabel } from "./tier.js";
18
+ export type { AgentEvent, AgentEventType, ConnectApi, ConnectContext, CostClass, CurrentPlan, Launch, Machine, MachineState, Message, ModelGroup, ModelOption, ModelOptionKind, PendingCode, Plan, Runtime, RunUsage, } from "./types.js";
19
+ export { type CheckoutView, type UseCheckoutOptions, useCheckout } from "./useCheckout.js";
20
+ export { type ComputeMachine, type ComputeRuntime, type ComputeView, useCompute, } from "./useCompute.js";
21
+ export { type ConnectButtonView, connectSays, useConnectButton } from "./useConnectButton.js";
22
+ export { type NudgeReason, type NudgeStalled, type NudgeStep, type NudgeView, type UseConnectNudgeOptions, useConnectNudge, } from "./useConnectNudge.js";
18
23
  export { type AllowanceState, type CurrentPlanReward, type CurrentPlanView, useCurrentPlan, } from "./useCurrentPlan.js";
24
+ export { type ModelView, type UseModelOptions, useModel } from "./useModel.js";
25
+ export { useOpenSobaConnect } from "./useOpenSobaConnect.js";
19
26
  export { type PlanCompute, type PlanConnect, type PlanCta, type PlanOffer, type PlanPrice, type PlansOptions, type PlansView, usePlans, } from "./usePlans.js";
20
27
  export { type LimitReason, type Offer, sobaErrorCode, useRunLimit } from "./useRunLimit.js";
28
+ export { type RunStream, type WatchOptions, watchRun } from "./watch.js";