@thinkai/tai-api-contract 2.190.0 → 2.191.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -934,6 +934,45 @@ export interface AiUsageSpendKeyInsightsDto {
934
934
  items: AiUsageSpendKeyInsightItemDto[];
935
935
  }
936
936
 
937
+ /** Workspace default model-mix right-sizing policy (Phase B). Null on GET → Phase A constants. */
938
+ export interface AiModelPolicyConfigDto {
939
+ /** Premium share of model spend threshold (%); 1–100. */
940
+ premiumShareThresholdPct: number;
941
+ /** Optional extra premium model-name globs (case-insensitive); extends Phase A allowlist. */
942
+ premiumModelPatterns?: string[];
943
+ /** Min total model spend (cents) before workspace card emits. */
944
+ minWorkspaceSpendCents?: number;
945
+ /** Min distinct active model-spend days for a person card. */
946
+ minPersonActiveDays?: number;
947
+ /** Min personal model spend (cents) before a person card emits. */
948
+ minPersonSpendCents?: number;
949
+ /** Optional coaching copy override for recommendedAction. */
950
+ defaultGuidance?: string;
951
+ }
952
+
953
+ /** Per-person override for model-mix coaching (keyed by person_id). */
954
+ export type AiModelPolicyOverrideMode = "allow_premium" | "coach_downgrade";
955
+
956
+ export interface AiModelPolicyPersonOverrideDto {
957
+ mode: AiModelPolicyOverrideMode;
958
+ /** Effective threshold for coach_downgrade (default 25 when omitted). */
959
+ thresholdPct?: number;
960
+ note?: string;
961
+ updatedAt: string;
962
+ updatedByUserId: string;
963
+ }
964
+
965
+ /**
966
+ * GET/PUT /workspaces/:workspaceId/ai-model-policy body/response.
967
+ * Overrides must not change spend rollups — read-path coaching only.
968
+ */
969
+ export interface AiModelPolicyDto {
970
+ /** Null clears / means Phase A constants on the key-insights engine. */
971
+ policy: AiModelPolicyConfigDto | null;
972
+ /** Map keyed by person_id; max 200 entries. */
973
+ overrides: Record<string, AiModelPolicyPersonOverrideDto>;
974
+ }
975
+
937
976
  /** Whether AI-assisted code % is from ingest or token heuristics. */
938
977
  export type AiAssistedCodeDataQuality = "estimated" | "measured";
939
978