@thinkai/tai-api-contract 2.190.0 → 2.192.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/dist/generated/openapi.d.ts +319 -3
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/openapi/openapi.yaml +321 -5
- package/package.json +1 -1
- package/src/generated/openapi.ts +319 -3
- package/src/index.ts +39 -0
package/src/generated/openapi.ts
CHANGED
|
@@ -834,6 +834,30 @@ export interface paths {
|
|
|
834
834
|
patch?: never;
|
|
835
835
|
trace?: never;
|
|
836
836
|
};
|
|
837
|
+
"/workspaces/{workspaceId}/ai-model-policy": {
|
|
838
|
+
parameters: {
|
|
839
|
+
query?: never;
|
|
840
|
+
header?: never;
|
|
841
|
+
path?: never;
|
|
842
|
+
cookie?: never;
|
|
843
|
+
};
|
|
844
|
+
/**
|
|
845
|
+
* Get workspace AI model right-sizing policy and per-person overrides
|
|
846
|
+
* @description Returns the workspace default model-mix right-sizing policy plus optional per-person overrides used by Key Insights `model_right_sizing` (Cost-to-Value #2). `policy: null` means the server applies Phase A constants (40% threshold, fixed premium allowlist, sample gates). Member-level read access. Overrides affect coaching eligibility/copy only — they never rewrite spend rollups.
|
|
847
|
+
*/
|
|
848
|
+
get: operations["getWorkspaceAiModelPolicy"];
|
|
849
|
+
/**
|
|
850
|
+
* Set workspace AI model right-sizing policy and per-person overrides
|
|
851
|
+
* @description Full-replace workspace model-mix policy and person overrides. `policy: null` clears the workspace default (Phase A constants). `overrides: {}` clears all person overrides. Max **200** override entries. Thresholds must be 1–100. Requires workspace **admin** (`403` `workspace_admin_required` for editors). On success the server writes activity `ai_model_policy.changed` with secret-free metadata (threshold, override count / modes). Does not mutate `model_daily` or spend KPIs.
|
|
852
|
+
*/
|
|
853
|
+
put: operations["putWorkspaceAiModelPolicy"];
|
|
854
|
+
post?: never;
|
|
855
|
+
delete?: never;
|
|
856
|
+
options?: never;
|
|
857
|
+
head?: never;
|
|
858
|
+
patch?: never;
|
|
859
|
+
trace?: never;
|
|
860
|
+
};
|
|
837
861
|
"/workspaces/{workspaceId}/productivity-targets": {
|
|
838
862
|
parameters: {
|
|
839
863
|
query?: never;
|
|
@@ -2340,6 +2364,46 @@ export interface paths {
|
|
|
2340
2364
|
patch?: never;
|
|
2341
2365
|
trace?: never;
|
|
2342
2366
|
};
|
|
2367
|
+
"/workspaces/{workspaceId}/integrations/sentry": {
|
|
2368
|
+
parameters: {
|
|
2369
|
+
query?: never;
|
|
2370
|
+
header?: never;
|
|
2371
|
+
path?: never;
|
|
2372
|
+
cookie?: never;
|
|
2373
|
+
};
|
|
2374
|
+
/**
|
|
2375
|
+
* Sentry monitoring integration status
|
|
2376
|
+
* @description Returns whether Sentry is connected for the workspace (org slug + auth token) and the last monitoring ingest sync outcome (incidents/deployments pulled into Quality and DORA metrics).
|
|
2377
|
+
*/
|
|
2378
|
+
get: operations["getWorkspaceSentryIntegrationStatus"];
|
|
2379
|
+
put?: never;
|
|
2380
|
+
post?: never;
|
|
2381
|
+
delete?: never;
|
|
2382
|
+
options?: never;
|
|
2383
|
+
head?: never;
|
|
2384
|
+
patch?: never;
|
|
2385
|
+
trace?: never;
|
|
2386
|
+
};
|
|
2387
|
+
"/workspaces/{workspaceId}/integrations/sentry/sync": {
|
|
2388
|
+
parameters: {
|
|
2389
|
+
query?: never;
|
|
2390
|
+
header?: never;
|
|
2391
|
+
path?: never;
|
|
2392
|
+
cookie?: never;
|
|
2393
|
+
};
|
|
2394
|
+
get?: never;
|
|
2395
|
+
put?: never;
|
|
2396
|
+
/**
|
|
2397
|
+
* Trigger Sentry monitoring ingest now
|
|
2398
|
+
* @description Manually polls Sentry for issues (incidents) and releases (deployments), persists canonical monitoring events, and refreshes org-level Quality/DORA dashboard buckets. Requires editor role.
|
|
2399
|
+
*/
|
|
2400
|
+
post: operations["postWorkspaceSentryIntegrationSync"];
|
|
2401
|
+
delete?: never;
|
|
2402
|
+
options?: never;
|
|
2403
|
+
head?: never;
|
|
2404
|
+
patch?: never;
|
|
2405
|
+
trace?: never;
|
|
2406
|
+
};
|
|
2343
2407
|
"/integrations/github/webhook": {
|
|
2344
2408
|
parameters: {
|
|
2345
2409
|
query?: never;
|
|
@@ -6376,6 +6440,43 @@ export interface components {
|
|
|
6376
6440
|
[key: string]: components["schemas"]["RepoDeliveryOverrideDto"];
|
|
6377
6441
|
};
|
|
6378
6442
|
};
|
|
6443
|
+
/** @description Workspace default model-mix right-sizing policy (Cost-to-Value insight #2 Phase B). When the parent `policy` field is null, the server uses Phase A constants instead. */
|
|
6444
|
+
AiModelPolicyConfigDto: {
|
|
6445
|
+
/** @description Premium share of model spend threshold (%). Phase A default is 40. */
|
|
6446
|
+
premiumShareThresholdPct: number;
|
|
6447
|
+
/** @description Optional case-insensitive model-name globs that extend the Phase A premium allowlist (`*` wildcards). Unmatched names remain non-premium. */
|
|
6448
|
+
premiumModelPatterns?: string[];
|
|
6449
|
+
/** @description Min total model spend (cents) before the workspace card emits. Phase A default 5000. */
|
|
6450
|
+
minWorkspaceSpendCents?: number;
|
|
6451
|
+
/** @description Min distinct active model-spend days for a person card. Phase A default 5. */
|
|
6452
|
+
minPersonActiveDays?: number;
|
|
6453
|
+
/** @description Min personal model spend (cents) before a person card emits. Phase A default 1000. */
|
|
6454
|
+
minPersonSpendCents?: number;
|
|
6455
|
+
/** @description Optional coaching copy used for recommendedAction on model_right_sizing cards. */
|
|
6456
|
+
defaultGuidance?: string;
|
|
6457
|
+
};
|
|
6458
|
+
/** @description Per-person coaching override. `allow_premium` suppresses the person card; `coach_downgrade` flags at `thresholdPct` (default 25 when omitted). */
|
|
6459
|
+
AiModelPolicyPersonOverrideDto: {
|
|
6460
|
+
/** @enum {string} */
|
|
6461
|
+
mode: "allow_premium" | "coach_downgrade";
|
|
6462
|
+
/** @description Effective threshold for coach_downgrade (ignored for allow_premium). */
|
|
6463
|
+
thresholdPct?: number;
|
|
6464
|
+
/** @description Optional admin note (not shown as Key Insight evidence numbers). */
|
|
6465
|
+
note?: string;
|
|
6466
|
+
/** Format: date-time */
|
|
6467
|
+
updatedAt: string;
|
|
6468
|
+
/** Format: uuid */
|
|
6469
|
+
updatedByUserId: string;
|
|
6470
|
+
};
|
|
6471
|
+
/** @description Workspace AI model policy + per-person overrides for Key Insights model right-sizing. Overrides affect recommendation eligibility/copy only; spend KPIs and model_daily are unchanged. */
|
|
6472
|
+
AiModelPolicyDto: {
|
|
6473
|
+
/** @description Null clears / means Phase A constants on the key-insights engine. */
|
|
6474
|
+
policy: components["schemas"]["AiModelPolicyConfigDto"] | null;
|
|
6475
|
+
/** @description Map keyed by person_id (max 200 entries). Empty object clears all overrides. */
|
|
6476
|
+
overrides: {
|
|
6477
|
+
[key: string]: components["schemas"]["AiModelPolicyPersonOverrideDto"];
|
|
6478
|
+
};
|
|
6479
|
+
};
|
|
6379
6480
|
/** @description Optional weekly per-engineer targets for Productivity Insights. Omitted or null fields mean no target for that metric. Additional properties are rejected. */
|
|
6380
6481
|
ProductivityTargetsDto: {
|
|
6381
6482
|
/** @description Floor — meet or exceed this many merged PRs per engineer per week. */
|
|
@@ -8193,6 +8294,47 @@ export interface components {
|
|
|
8193
8294
|
/** @description Error message when status is error. */
|
|
8194
8295
|
error?: string;
|
|
8195
8296
|
};
|
|
8297
|
+
SentryIntegrationStatusDto: {
|
|
8298
|
+
/** @description True when a type:sentry workspace source is configured. */
|
|
8299
|
+
connected: boolean;
|
|
8300
|
+
/** @description Configured Sentry organization slug when connected. */
|
|
8301
|
+
orgSlug?: string;
|
|
8302
|
+
/** @description Org display name when known from the last successful verify. */
|
|
8303
|
+
orgName?: string;
|
|
8304
|
+
/**
|
|
8305
|
+
* Format: date-time
|
|
8306
|
+
* @description Timestamp of the last monitoring ingest attempt (success or failure).
|
|
8307
|
+
*/
|
|
8308
|
+
lastSyncAt?: string | null;
|
|
8309
|
+
/**
|
|
8310
|
+
* @description Outcome of the most recent sync (`never` when not yet synced).
|
|
8311
|
+
* @enum {string}
|
|
8312
|
+
*/
|
|
8313
|
+
status: "ok" | "error" | "never";
|
|
8314
|
+
lastError?: string | null;
|
|
8315
|
+
/** @description Issues (incidents) fetched on the last successful sync (30d lookback). */
|
|
8316
|
+
issueCount?: number | null;
|
|
8317
|
+
/** @description Releases (deployments) fetched on the last successful sync (30d lookback). */
|
|
8318
|
+
deploymentCount?: number | null;
|
|
8319
|
+
/** @description Canonical monitoring events upserted on the last successful sync. */
|
|
8320
|
+
eventCount?: number | null;
|
|
8321
|
+
};
|
|
8322
|
+
SentryTriggerSyncResultDto: {
|
|
8323
|
+
/** @enum {string} */
|
|
8324
|
+
status: "ok" | "skipped" | "error";
|
|
8325
|
+
/** @description Stable machine-readable code (e.g. `sentry_not_connected`). */
|
|
8326
|
+
code?: string;
|
|
8327
|
+
/** @description Human-readable skip reason when status is skipped. */
|
|
8328
|
+
reason?: string;
|
|
8329
|
+
issueCount?: number;
|
|
8330
|
+
deploymentCount?: number;
|
|
8331
|
+
eventCount?: number;
|
|
8332
|
+
/** @description Weekly dashboard metric buckets updated from monitoring events. */
|
|
8333
|
+
bucketsWritten?: number;
|
|
8334
|
+
durationMs?: number;
|
|
8335
|
+
/** @description Error message when status is error. */
|
|
8336
|
+
error?: string;
|
|
8337
|
+
};
|
|
8196
8338
|
GithubActionsEnableResponseDto: {
|
|
8197
8339
|
/** @enum {string} */
|
|
8198
8340
|
outcome: "enabled" | "needs_github" | "permissions_missing" | "error";
|
|
@@ -9985,7 +10127,7 @@ export interface components {
|
|
|
9985
10127
|
* @description Type of workspace lifecycle event.
|
|
9986
10128
|
* @enum {string}
|
|
9987
10129
|
*/
|
|
9988
|
-
ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.suspended" | "integration.github.unsuspended" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "code_insights.design_run_started" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "rules_skills.soft_quality.override" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.hibob.sync_started" | "hris.hibob.sync_completed" | "hris.hibob.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "integrations.code_intelligence.settings_changed" | "integrations.code_intelligence.execution_key.added" | "integrations.code_intelligence.execution_key.updated" | "integrations.code_intelligence.execution_key.removed" | "integrations.code_intelligence.execution_key.check_failed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.datadog.added" | "integrations.datadog.removed" | "integrations.datadog.sync_completed" | "integrations.datadog.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed" | "report.exported" | "report.assessment_stored" | "report.assessment_link_sent" | "report.assessment_link_revoked" | "report.assessment_downloaded" | "report.assessment_hidden" | "report.assessment_restored" | "workspace.aggregate_use.changed" | "workspace.assessment_rollout.changed";
|
|
10130
|
+
ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.suspended" | "integration.github.unsuspended" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "code_insights.design_run_started" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "rules_skills.soft_quality.override" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.hibob.sync_started" | "hris.hibob.sync_completed" | "hris.hibob.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "integrations.code_intelligence.settings_changed" | "integrations.code_intelligence.execution_key.added" | "integrations.code_intelligence.execution_key.updated" | "integrations.code_intelligence.execution_key.removed" | "integrations.code_intelligence.execution_key.check_failed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.datadog.added" | "integrations.datadog.removed" | "integrations.datadog.sync_completed" | "integrations.datadog.sync_failed" | "integrations.sentry.added" | "integrations.sentry.removed" | "integrations.sentry.sync_completed" | "integrations.sentry.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed" | "report.exported" | "report.assessment_stored" | "report.assessment_link_sent" | "report.assessment_link_revoked" | "report.assessment_downloaded" | "report.assessment_hidden" | "report.assessment_restored" | "workspace.aggregate_use.changed" | "workspace.assessment_rollout.changed";
|
|
9989
10131
|
/** @description Current legal-approved opt-in notice, or `unset` while opt-in is unavailable. */
|
|
9990
10132
|
AggregateUseNoticeStatusDto: {
|
|
9991
10133
|
/** @enum {string} */
|
|
@@ -10148,7 +10290,7 @@ export interface components {
|
|
|
10148
10290
|
};
|
|
10149
10291
|
AssessmentDictionaryDto: {
|
|
10150
10292
|
/** @enum {string} */
|
|
10151
|
-
version: "2026-10-
|
|
10293
|
+
version: "2026-10-26.1";
|
|
10152
10294
|
/** @enum {integer} */
|
|
10153
10295
|
periodDays: 90;
|
|
10154
10296
|
/** @enum {integer} */
|
|
@@ -10184,7 +10326,7 @@ export interface components {
|
|
|
10184
10326
|
aiProviders: ("cursor" | "claude" | "copilot")[];
|
|
10185
10327
|
optionalProviders: {
|
|
10186
10328
|
roadmap: "jira"[];
|
|
10187
|
-
incident: ("pagerduty" | "opsgenie" | "goalert" | "newrelic" | "prometheus" | "grafana" | "datadog")[];
|
|
10329
|
+
incident: ("pagerduty" | "opsgenie" | "goalert" | "newrelic" | "prometheus" | "grafana" | "datadog" | "sentry")[];
|
|
10188
10330
|
};
|
|
10189
10331
|
selfManagedGit: {
|
|
10190
10332
|
/** @enum {string} */
|
|
@@ -13082,6 +13224,9 @@ export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
|
|
|
13082
13224
|
export type DeliveryRoleConfigDto = components['schemas']['DeliveryRoleConfigDto'];
|
|
13083
13225
|
export type RepoDeliveryOverrideDto = components['schemas']['RepoDeliveryOverrideDto'];
|
|
13084
13226
|
export type DeliveryTopologyDto = components['schemas']['DeliveryTopologyDto'];
|
|
13227
|
+
export type AiModelPolicyConfigDto = components['schemas']['AiModelPolicyConfigDto'];
|
|
13228
|
+
export type AiModelPolicyPersonOverrideDto = components['schemas']['AiModelPolicyPersonOverrideDto'];
|
|
13229
|
+
export type AiModelPolicyDto = components['schemas']['AiModelPolicyDto'];
|
|
13085
13230
|
export type ProductivityTargetsDto = components['schemas']['ProductivityTargetsDto'];
|
|
13086
13231
|
export type AiEmailAliasEntryDto = components['schemas']['AiEmailAliasEntryDto'];
|
|
13087
13232
|
export type AiEmailAliasesDto = components['schemas']['AiEmailAliasesDto'];
|
|
@@ -13219,6 +13364,8 @@ export type GrafanaIntegrationStatusDto = components['schemas']['GrafanaIntegrat
|
|
|
13219
13364
|
export type GrafanaTriggerSyncResultDto = components['schemas']['GrafanaTriggerSyncResultDto'];
|
|
13220
13365
|
export type DatadogIntegrationStatusDto = components['schemas']['DatadogIntegrationStatusDto'];
|
|
13221
13366
|
export type DatadogTriggerSyncResultDto = components['schemas']['DatadogTriggerSyncResultDto'];
|
|
13367
|
+
export type SentryIntegrationStatusDto = components['schemas']['SentryIntegrationStatusDto'];
|
|
13368
|
+
export type SentryTriggerSyncResultDto = components['schemas']['SentryTriggerSyncResultDto'];
|
|
13222
13369
|
export type GithubActionsEnableResponseDto = components['schemas']['GithubActionsEnableResponseDto'];
|
|
13223
13370
|
export type GithubInstallationStatusDto = components['schemas']['GithubInstallationStatusDto'];
|
|
13224
13371
|
export type GithubInstallUrlRequestDto = components['schemas']['GithubInstallUrlRequestDto'];
|
|
@@ -16310,6 +16457,91 @@ export interface operations {
|
|
|
16310
16457
|
};
|
|
16311
16458
|
};
|
|
16312
16459
|
};
|
|
16460
|
+
getWorkspaceAiModelPolicy: {
|
|
16461
|
+
parameters: {
|
|
16462
|
+
query?: never;
|
|
16463
|
+
header?: never;
|
|
16464
|
+
path: {
|
|
16465
|
+
workspaceId: components["parameters"]["WorkspaceId"];
|
|
16466
|
+
};
|
|
16467
|
+
cookie?: never;
|
|
16468
|
+
};
|
|
16469
|
+
requestBody?: never;
|
|
16470
|
+
responses: {
|
|
16471
|
+
/** @description Current policy (policy may be null; overrides may be empty) */
|
|
16472
|
+
200: {
|
|
16473
|
+
headers: {
|
|
16474
|
+
[name: string]: unknown;
|
|
16475
|
+
};
|
|
16476
|
+
content: {
|
|
16477
|
+
"application/json": components["schemas"]["AiModelPolicyDto"];
|
|
16478
|
+
};
|
|
16479
|
+
};
|
|
16480
|
+
401: components["responses"]["Unauthorized"];
|
|
16481
|
+
403: components["responses"]["Forbidden"];
|
|
16482
|
+
/** @description Workspace does not exist or malformed workspaceId */
|
|
16483
|
+
404: {
|
|
16484
|
+
headers: {
|
|
16485
|
+
[name: string]: unknown;
|
|
16486
|
+
};
|
|
16487
|
+
content: {
|
|
16488
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
16489
|
+
};
|
|
16490
|
+
};
|
|
16491
|
+
};
|
|
16492
|
+
};
|
|
16493
|
+
putWorkspaceAiModelPolicy: {
|
|
16494
|
+
parameters: {
|
|
16495
|
+
query?: never;
|
|
16496
|
+
header?: never;
|
|
16497
|
+
path: {
|
|
16498
|
+
workspaceId: components["parameters"]["WorkspaceId"];
|
|
16499
|
+
};
|
|
16500
|
+
cookie?: never;
|
|
16501
|
+
};
|
|
16502
|
+
requestBody: {
|
|
16503
|
+
content: {
|
|
16504
|
+
"application/json": components["schemas"]["AiModelPolicyDto"];
|
|
16505
|
+
};
|
|
16506
|
+
};
|
|
16507
|
+
responses: {
|
|
16508
|
+
/** @description Policy persisted (or cleared). */
|
|
16509
|
+
204: {
|
|
16510
|
+
headers: {
|
|
16511
|
+
[name: string]: unknown;
|
|
16512
|
+
};
|
|
16513
|
+
content?: never;
|
|
16514
|
+
};
|
|
16515
|
+
/** @description Invalid payload (unknown keys, out-of-range, or >200 overrides) */
|
|
16516
|
+
400: {
|
|
16517
|
+
headers: {
|
|
16518
|
+
[name: string]: unknown;
|
|
16519
|
+
};
|
|
16520
|
+
content: {
|
|
16521
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
16522
|
+
};
|
|
16523
|
+
};
|
|
16524
|
+
401: components["responses"]["Unauthorized"];
|
|
16525
|
+
/** @description Forbidden — workspace admin required */
|
|
16526
|
+
403: {
|
|
16527
|
+
headers: {
|
|
16528
|
+
[name: string]: unknown;
|
|
16529
|
+
};
|
|
16530
|
+
content: {
|
|
16531
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
16532
|
+
};
|
|
16533
|
+
};
|
|
16534
|
+
/** @description Workspace does not exist or malformed workspaceId */
|
|
16535
|
+
404: {
|
|
16536
|
+
headers: {
|
|
16537
|
+
[name: string]: unknown;
|
|
16538
|
+
};
|
|
16539
|
+
content: {
|
|
16540
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
16541
|
+
};
|
|
16542
|
+
};
|
|
16543
|
+
};
|
|
16544
|
+
};
|
|
16313
16545
|
getWorkspaceProductivityTargets: {
|
|
16314
16546
|
parameters: {
|
|
16315
16547
|
query?: never;
|
|
@@ -20301,6 +20533,90 @@ export interface operations {
|
|
|
20301
20533
|
};
|
|
20302
20534
|
};
|
|
20303
20535
|
};
|
|
20536
|
+
getWorkspaceSentryIntegrationStatus: {
|
|
20537
|
+
parameters: {
|
|
20538
|
+
query?: never;
|
|
20539
|
+
header?: never;
|
|
20540
|
+
path: {
|
|
20541
|
+
workspaceId: components["parameters"]["WorkspaceId"];
|
|
20542
|
+
};
|
|
20543
|
+
cookie?: never;
|
|
20544
|
+
};
|
|
20545
|
+
requestBody?: never;
|
|
20546
|
+
responses: {
|
|
20547
|
+
/** @description Sentry integration status */
|
|
20548
|
+
200: {
|
|
20549
|
+
headers: {
|
|
20550
|
+
[name: string]: unknown;
|
|
20551
|
+
};
|
|
20552
|
+
content: {
|
|
20553
|
+
"application/json": components["schemas"]["SentryIntegrationStatusDto"];
|
|
20554
|
+
};
|
|
20555
|
+
};
|
|
20556
|
+
401: components["responses"]["Unauthorized"];
|
|
20557
|
+
403: components["responses"]["Forbidden"];
|
|
20558
|
+
/** @description Workspace does not exist or malformed workspaceId */
|
|
20559
|
+
404: {
|
|
20560
|
+
headers: {
|
|
20561
|
+
[name: string]: unknown;
|
|
20562
|
+
};
|
|
20563
|
+
content: {
|
|
20564
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
20565
|
+
};
|
|
20566
|
+
};
|
|
20567
|
+
};
|
|
20568
|
+
};
|
|
20569
|
+
postWorkspaceSentryIntegrationSync: {
|
|
20570
|
+
parameters: {
|
|
20571
|
+
query?: never;
|
|
20572
|
+
header?: never;
|
|
20573
|
+
path: {
|
|
20574
|
+
workspaceId: components["parameters"]["WorkspaceId"];
|
|
20575
|
+
};
|
|
20576
|
+
cookie?: never;
|
|
20577
|
+
};
|
|
20578
|
+
requestBody?: never;
|
|
20579
|
+
responses: {
|
|
20580
|
+
/** @description Sync completed */
|
|
20581
|
+
200: {
|
|
20582
|
+
headers: {
|
|
20583
|
+
[name: string]: unknown;
|
|
20584
|
+
};
|
|
20585
|
+
content: {
|
|
20586
|
+
"application/json": components["schemas"]["SentryTriggerSyncResultDto"];
|
|
20587
|
+
};
|
|
20588
|
+
};
|
|
20589
|
+
401: components["responses"]["Unauthorized"];
|
|
20590
|
+
403: components["responses"]["Forbidden"];
|
|
20591
|
+
/** @description Workspace does not exist or malformed workspaceId */
|
|
20592
|
+
404: {
|
|
20593
|
+
headers: {
|
|
20594
|
+
[name: string]: unknown;
|
|
20595
|
+
};
|
|
20596
|
+
content: {
|
|
20597
|
+
"application/json": components["schemas"]["ErrorMessageDto"];
|
|
20598
|
+
};
|
|
20599
|
+
};
|
|
20600
|
+
/** @description Sentry is not connected on this workspace */
|
|
20601
|
+
422: {
|
|
20602
|
+
headers: {
|
|
20603
|
+
[name: string]: unknown;
|
|
20604
|
+
};
|
|
20605
|
+
content: {
|
|
20606
|
+
"application/json": components["schemas"]["SentryTriggerSyncResultDto"];
|
|
20607
|
+
};
|
|
20608
|
+
};
|
|
20609
|
+
/** @description Sync failed (Sentry API or persistence error) */
|
|
20610
|
+
503: {
|
|
20611
|
+
headers: {
|
|
20612
|
+
[name: string]: unknown;
|
|
20613
|
+
};
|
|
20614
|
+
content: {
|
|
20615
|
+
"application/json": components["schemas"]["SentryTriggerSyncResultDto"];
|
|
20616
|
+
};
|
|
20617
|
+
};
|
|
20618
|
+
};
|
|
20619
|
+
};
|
|
20304
20620
|
postGithubWebhook: {
|
|
20305
20621
|
parameters: {
|
|
20306
20622
|
query?: never;
|
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
|
|