# Models: I

> API models starting with I.

## `IdentityProviderCollectionPage`

- `data: list[Annotated[kindgi.client.OidcIdentityProviderConfig | kindgi.client.SamlIdentityProviderConfig | kindgi.client.IdentityProviderConfigUnrecognized, <kindgi.client._open.OpenUnion object at 0x108038e50>]]`
- `has_more: bool | None` (`hasMore` on the wire) (optional)
- `changes: Optional[Annotated[Union[Literal['tenant', 'operator'], str], <kindgi.client._open.OpenEnum object at 0x1073beed0>]]` (optional)

## `IdentityProviderConfigUnrecognized`

A `kind` this client doesn't know yet, from a newer runtime: the object as it came, every field kept.

- `kind: str`

## `IdentityProviderSignIn1`

What to give the identity provider so it can send people back: set by the deployment on what it returns, ignored on registration. OIDC: `redirectUri`. SAML: `spEntityId`, `acsUrl`, `spMetadataUrl`.

- `redirect_uri: AnyUrl` (`redirectUri` on the wire)

## `IdentityProviderSignIn2`

What to give the identity provider so it can send people back: set by the deployment on what it returns, ignored on registration. OIDC: `redirectUri`. SAML: `spEntityId`, `acsUrl`, `spMetadataUrl`.

- `sp_entity_id: str` (`spEntityId` on the wire)
- `acs_url: AnyUrl` (`acsUrl` on the wire)
- `sp_metadata_url: AnyUrl` (`spMetadataUrl` on the wire)

## `IdentityProviderSignInUrls`

What to give the identity provider so it can send people back, for a provider under this `providerId`: the same before it's registered, after, and after an unregister and a new registration, so the identity provider's side can be set up first. Not secrets: they're in every sign-in's browser redirects.

- `provider_id: str` (`providerId` on the wire)
- `kind: Union[Literal['oidc', 'saml'], str]`
- `sign_in: kindgi.client.IdentityProviderSignIn1 | kindgi.client.IdentityProviderSignIn2` (`signIn` on the wire)
- `registered: bool`

## `IdentitySessionCollectionPage`

- `data: list[kindgi.client.IdentitySessionSummary]`
- `has_more: bool` (`hasMore` on the wire)
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)

## `IdentitySessionSummary`

Wire-safe subset of a session. Excludes provider access-token / refresh-token — those never cross the wire, even to admins.

- `session_id: str` (`sessionId` on the wire)
- `user_id: str` (`userId` on the wire)
- `provider_id: str` (`providerId` on the wire)
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `expires_at: AwareDatetime` (`expiresAt` on the wire)
- `scopes: list[str]`
- `revoked_at: AwareDatetime | None` (`revokedAt` on the wire) (optional)

## `IdpCertificate`

- `root: str`

## `ImproveReadinessItem`

One thing an Improve run needs. In this order: `wording` (a prompt block to reword), `settings` (settings marked Improve may tune), `test-cases` (the project's active cases for the agent, `count`), `permission` (`publish` on the agent), `one-at-a-time` (no Improve run of the agent running in the project) and `project` (a version of the agent runs in the project, and it isn't suspended).

- `key: Union[Literal['wording', 'settings', 'test-cases', 'permission', 'one-at-a-time', 'project'], str]`
- `missing: bool`
- `count: int | None` (optional)
- `improve_run_id: uuid.UUID | None` (`improveRunId` on the wire) (optional)
- `fix: kindgi.client.Fix | None` (optional)

## `ImproveRun`

An Improve run: the runtime looking for better wording or settings values for an agent in a project, on the project's test set, within a budget. A candidate that does better becomes a suggested change.

- `id: uuid.UUID`
- `agent_id: str` (`agentId` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `starts_from: kindgi.client.ImproveRunStart` (`startsFrom` on the wire)
- `test_set_version: str | None` (`testSetVersion` on the wire) (optional)
- `set_aside: kindgi.client.SetAside | None` (`setAside` on the wire) (optional)
- `tiers: list[Annotated[Union[Literal['settings', 'prompt'], str], <kindgi.client._open.OpenEnum object at 0x1073beed0>]]`
- `objective: Union[Literal['passRate', 'weightedPrecisionAtK'], str]`
- `group_weights: Union[Literal['as-recorded', 'experts-only'], str]` (`groupWeights` on the wire)
- `model: kindgi.client.ImproveRunModel | None` (optional)
- `candidates: int | None` (optional)
- `budget: kindgi.client.ImprovementBudget`
- `requested_by: str` (`requestedBy` on the wire)
- `status: Union[Literal['running', 'completed', 'failed', 'cancelled'], str]`
- `tried: int`
- `cost_usd: str` (`costUsd` on the wire)
- `outcome: Optional[Annotated[kindgi.client.ImproveRunOutcomeSuggested | kindgi.client.ImproveRunOutcomeNothingBetter | kindgi.client.ImproveRunOutcomeCostCap | kindgi.client.ImproveRunOutcomeFailed | kindgi.client.ImproveRunOutcomeUnrecognized, <kindgi.client._open.OpenUnion object at 0x107fbec90>]]` (optional)
- `takes: list[str] | None` (optional)
- `cancel_reason: str | None` (`cancelReason` on the wire) (optional)
- `comparisons: list[kindgi.client.Comparison1] | None` (optional)
- `trigger: kindgi.client.Trigger | None` (optional)
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `updated_at: AwareDatetime` (`updatedAt` on the wire)
- `finished_at: AwareDatetime | None` (`finishedAt` on the wire) (optional)

## `ImproveRunCheck`

Whether the Improve run this input would start is ready, and what it's estimated to cost. It's ready when no item it needs is missing: with no `tiers` named, `wording` or `settings` is enough; a named tier needs its own.

- `ready: bool`
- `starts_from: kindgi.client.ImproveRunStart | None` (`startsFrom` on the wire) (optional)
- `items: list[kindgi.client.ImproveReadinessItem]`
- `estimate: kindgi.client.Estimate`
- `month: kindgi.client.Month | None` (optional)

## `ImproveRunCollectionPage`

- `data: list[kindgi.client.ImproveRun]`
- `has_more: bool` (`hasMore` on the wire)
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)

## `ImproveRunFinishedEvent`

An Improve run ended (`completed`, `failed` or `cancelled`): one a person started, or one an `improve` schedule did. Its outcome names the suggested change it wrote, if it wrote one.

- `id: str`
- `type: Literal['improve-run.finished']`
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `data: kindgi.client.Data1`

## `ImproveRunModel`

For the prompt tier: the provider and model that drafts the templates.

- `provider_id: str` (`providerId` on the wire)
- `model: str`

## `ImproveRunOutcomeCostCap`

The run reached its budget with nothing kept.

- `kind: Literal['cost-cap']`
- `spent_usd: str` (`spentUsd` on the wire)

## `ImproveRunOutcomeFailed`

The run failed: `message` says why.

- `kind: Literal['failed']`
- `message: str`

## `ImproveRunOutcomeNothingBetter`

No change the run tried did better: `reason` says why, and `holdOut` has the best change's numbers when one got that far.

- `kind: Literal['nothing-better']`
- `reason: str`
- `hold_out: kindgi.client.HoldOut | None` (`holdOut` on the wire) (optional)

## `ImproveRunOutcomeSuggested`

A change passed more cases than the version the run started from, and failed none that passed: the run wrote it as a suggested change for a reviewer to decide.

- `kind: Literal['suggested']`
- `suggested_change_id: uuid.UUID` (`suggestedChangeId` on the wire)

## `ImproveRunOutcomeUnrecognized`

A `kind` this client doesn't know yet, from a newer runtime: the object as it came, every field kept.

- `kind: str`

## `ImproveRunStart`

The version an Improve run starts from: the one the project runs, pinned there (`pin`) or the agent's latest (`latest`).

- `version: str`
- `follows: Union[Literal['pin', 'latest'], str]`

## `ImproveScheduleInput`

An improve schedule's `config.input`. Each fire counts the project's open corrections sorted to improve, from `from`, made or sorted since its last Improve run started. With `corrections` of them, and room under `monthCapUsd`, it starts an Improve run that takes every open one; otherwise the fire is `skipped`, saying which was short. An Improve run that suggests a change asks for the review at once.

- `corrections: int | None` (optional)
- `from_: Optional[Literal['experts', 'everyone']]` (`from` on the wire) (optional)
- `run_cap_usd: float | None` (`runCapUsd` on the wire) (optional)
- `month_cap_usd: float | None` (`monthCapUsd` on the wire) (optional)
- `tiers: list[Literal['settings', 'prompt']] | None` (optional)
- `model: kindgi.client.ImproveScheduleInputModel | None` (optional)

## `ImproveScheduleInputModel`

For the prompt tier: what drafts the templates. Absent: the version's own model.

- `provider_id: str` (`providerId` on the wire)
- `model: str`

## `ImproveScheduleTarget`

What an improve schedule works on: the agent, in the project its Improve runs work in (the schedule's own).

- `agent_id: str` (`agentId` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)

## `ImproveScheduleTargetInput`

What an improve schedule works on, as registering or changing one names it: the agent, and the project its Improve runs work in (the schedule's own).

- `agent_id: str` (`agentId` on the wire)
- `project_id: uuid.UUID` (`projectId` on the wire)

## `ImprovementBudget`

- `max_cost_usd: float` (`maxCostUsd` on the wire)
- `max_candidates: int` (`maxCandidates` on the wire)

## `InYourFiles`

Whether the pack's files have `blockVersion`: `yes` when the newest deployment in the project that ships `agentId` (its pack's newest there, looked for among the project's 200 newest deployments) lists the block at that version or a newer one, or the pull request opened for it there was merged; `not-yet` otherwise. Absent from a runtime that can't say, and for a row whose pull request can't be read now.

- `state: Union[Literal['yes', 'not-yet'], str]`
- `pr: kindgi.client.Pr | None` (optional)

## `InstructionType`

- `root: str`

## `Instructions`

- `root: str`

## `InviteEmail`

Whether the invitation was emailed, and why not: `no-email` (the person has no email, so isn't invited), `not-requested` (`sendInvite: false`), `not-configured` (the deployment sends no email), `send-failed` (the mail server refused it or didn't answer), `capped` (the workspace, or the whole deployment, has sent as many invitation emails as it may in 24 hours). An invitation not emailed is still open: tell them yourself.

- `sent: bool`
- `reason: Optional[Annotated[Union[Literal['no-email', 'not-requested', 'not-configured', 'send-failed', 'capped'], str], <kindgi.client._open.OpenEnum object at 0x1073beed0>]]` (optional)

## `InviteRenewed`

The person, with their invitation's new expiry, and whether it was emailed.

- `user: kindgi.client.UserRecord`
- `invite_email: kindgi.client.InviteEmail` (`inviteEmail` on the wire)
