@deliverd/sdk 0.25.1 → 0.26.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.
Files changed (47) hide show
  1. package/README.md +65 -0
  2. package/dist/adapters/index.d.ts +4 -0
  3. package/dist/adapters/index.d.ts.map +1 -1
  4. package/dist/adapters/index.js +2 -0
  5. package/dist/adapters/mastra.d.ts +81 -0
  6. package/dist/adapters/mastra.d.ts.map +1 -0
  7. package/dist/adapters/mastra.js +54 -0
  8. package/dist/adapters/muse-spark.d.ts +79 -0
  9. package/dist/adapters/muse-spark.d.ts.map +1 -0
  10. package/dist/adapters/muse-spark.js +59 -0
  11. package/dist/adapters/shared.d.ts +2 -1
  12. package/dist/adapters/shared.d.ts.map +1 -1
  13. package/dist/data-screen.d.ts +233 -0
  14. package/dist/data-screen.d.ts.map +1 -0
  15. package/dist/data-screen.js +389 -0
  16. package/dist/dev.d.ts.map +1 -1
  17. package/dist/dev.js +42 -2
  18. package/dist/governance.d.ts +94 -0
  19. package/dist/governance.d.ts.map +1 -0
  20. package/dist/governance.js +166 -0
  21. package/dist/index.d.ts +27 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +30 -0
  24. package/dist/released.d.ts +1 -1
  25. package/dist/released.d.ts.map +1 -1
  26. package/dist/released.js +1265 -0
  27. package/dist/screen.d.ts +85 -0
  28. package/dist/screen.d.ts.map +1 -0
  29. package/dist/screen.js +69 -0
  30. package/dist/tasks.d.ts +38 -1
  31. package/dist/tasks.d.ts.map +1 -1
  32. package/dist/tasks.js +67 -0
  33. package/dist/types.d.ts +589 -3
  34. package/dist/types.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/src/adapters/index.ts +11 -0
  37. package/src/adapters/mastra.ts +118 -0
  38. package/src/adapters/muse-spark.ts +147 -0
  39. package/src/adapters/shared.ts +2 -1
  40. package/src/data-screen.ts +533 -0
  41. package/src/dev.ts +45 -2
  42. package/src/governance.ts +204 -0
  43. package/src/index.ts +43 -0
  44. package/src/released.ts +1265 -0
  45. package/src/screen.ts +144 -0
  46. package/src/tasks.ts +88 -0
  47. package/src/types.ts +577 -3
package/dist/types.d.ts CHANGED
@@ -705,10 +705,11 @@ export interface WebhookEvent {
705
705
  }
706
706
  /**
707
707
  * How an endpoint's body is shaped: the signed JSON envelope, a Slack Block
708
- * Kit message for an Incoming Webhook, or a Teams Adaptive Card for a
709
- * Workflows webhook. The signature headers are sent with all three.
708
+ * Kit message for an Incoming Webhook, a Teams Adaptive Card for a Workflows
709
+ * webhook, or a Discord embed with a link button for a channel webhook. The
710
+ * signature headers are sent with all four.
710
711
  */
711
- export type WebhookEndpointFormat = "json" | "slack" | "teams";
712
+ export type WebhookEndpointFormat = "json" | "slack" | "teams" | "discord";
712
713
  /** An organisation's webhook endpoint, as `deliverd.webhookEndpoints` reads it. Never its secret. */
713
714
  export interface WebhookEndpoint {
714
715
  id: string;
@@ -1555,6 +1556,549 @@ export interface GovernanceGate {
1555
1556
  missingControls: string[];
1556
1557
  blockers: GovernanceBlocker[];
1557
1558
  }
1559
+ export type GovernanceRisk = "low" | "medium" | "high" | "critical";
1560
+ export type GovernanceOversight = NonNullable<GovernanceProfileInput["oversight"]>;
1561
+ export type DataClassification = NonNullable<GovernanceProfileInput["dataClassification"]>;
1562
+ /** Something governed work does, for the authority check. */
1563
+ export type AuthorityAction = "read" | "analyse" | "recommend" | "draft" | "modify" | "execute" | "publish" | "deploy" | "send" | "delete" | "financial_action" | "customer_decision";
1564
+ /** One entry in the organisation's register of AI systems. */
1565
+ export interface AiSystem {
1566
+ id: string;
1567
+ orgId: string;
1568
+ name: string;
1569
+ provider: string | null;
1570
+ model: string | null;
1571
+ modelVersion: string | null;
1572
+ /** A digest of the prompt it runs with, never the prompt. */
1573
+ promptHash: string | null;
1574
+ /** A digest of its guardrail configuration. */
1575
+ guardrailsHash: string | null;
1576
+ purpose: string | null;
1577
+ businessOwner: string | null;
1578
+ technicalOwner: string | null;
1579
+ environment: "development" | "pilot" | "production";
1580
+ risk: GovernanceRisk;
1581
+ oversight: GovernanceOversight | null;
1582
+ dataClassification: DataClassification | null;
1583
+ personalData: boolean;
1584
+ customerFacing: boolean;
1585
+ status: "active" | "retired";
1586
+ /** The contract in the ICT third-party register it runs under. */
1587
+ ictArrangementId: string | null;
1588
+ createdByLabel: string;
1589
+ createdAt: string;
1590
+ updatedAt: string;
1591
+ }
1592
+ export interface RegisterAiSystemInput {
1593
+ name: string;
1594
+ /** OpenAI, Anthropic, an internal team… */
1595
+ provider?: string | null;
1596
+ model?: string | null;
1597
+ modelVersion?: string | null;
1598
+ /** A digest of the prompt (`sha256:…`, a commit, a version tag), never the prompt. */
1599
+ promptHash?: string | null;
1600
+ /** A digest of the guardrail configuration, never the configuration. */
1601
+ guardrailsHash?: string | null;
1602
+ purpose?: string | null;
1603
+ businessOwner?: string | null;
1604
+ technicalOwner?: string | null;
1605
+ environment?: AiSystem["environment"];
1606
+ risk?: GovernanceRisk;
1607
+ oversight?: GovernanceOversight | null;
1608
+ dataClassification?: DataClassification | null;
1609
+ personalData?: boolean;
1610
+ customerFacing?: boolean;
1611
+ /** The contract in the ICT third-party register it runs under. */
1612
+ ictArrangementId?: string | null;
1613
+ }
1614
+ /** An agent may raise a system's risk but not lower it, and may not retire it. */
1615
+ export interface UpdateAiSystemInput extends Partial<RegisterAiSystemInput> {
1616
+ status?: AiSystem["status"];
1617
+ }
1618
+ /** One AI system, and the governed tasks that name it. */
1619
+ export interface AiSystemDetail {
1620
+ system: AiSystem;
1621
+ governedTaskIds: string[];
1622
+ }
1623
+ /** A new provider, model, version, prompt or guardrails for a system. Name at least one. */
1624
+ export interface ModelChangeInput {
1625
+ provider?: string | null;
1626
+ model?: string | null;
1627
+ modelVersion?: string | null;
1628
+ promptHash?: string | null;
1629
+ guardrailsHash?: string | null;
1630
+ /** What changed and why, for the record. */
1631
+ note?: string;
1632
+ }
1633
+ export interface ModelChangeResult {
1634
+ system: AiSystem;
1635
+ /** The reassessment opened on each governed task that uses it. */
1636
+ reassessments: Reassessment[];
1637
+ /** Which of provider, model, modelVersion, promptHash and guardrailsHash changed. */
1638
+ changed: string[];
1639
+ }
1640
+ /** A governed task's reassessment. Its governance gate stays closed until a person completes it. */
1641
+ export interface Reassessment {
1642
+ id: string;
1643
+ taskId: string;
1644
+ trigger: "profile_change" | "model_change" | "framework_version" | "policy_version" | "incident" | "manual";
1645
+ changes: {
1646
+ field: string;
1647
+ before: unknown;
1648
+ after: unknown;
1649
+ label: string;
1650
+ }[];
1651
+ /** Controls to look at again. */
1652
+ recheck: string[];
1653
+ reason: string;
1654
+ status: "open" | "completed";
1655
+ openedByLabel: string;
1656
+ openedByAgentId: string | null;
1657
+ openedAt: string;
1658
+ completedByLabel: string | null;
1659
+ completedAt: string | null;
1660
+ completionNote: string | null;
1661
+ }
1662
+ export interface ReassessmentResult {
1663
+ reassessment: Reassessment;
1664
+ governance: Governance;
1665
+ }
1666
+ /** What an agent may do: on its own, only with a person's approval, or not at all. */
1667
+ export interface AuthorityDecision {
1668
+ action: AuthorityAction;
1669
+ mode: "allowed" | "approval" | "denied";
1670
+ /** Which setting decided it: the organisation's, the agent's own, or the default. */
1671
+ source: "organisation" | "agent" | "default";
1672
+ reason: string;
1673
+ agentId: string | null;
1674
+ agentName: string | null;
1675
+ }
1676
+ export interface CheckAuthorityInput {
1677
+ action: AuthorityAction;
1678
+ /** An agent of this organisation; the agent whose key this is when omitted. */
1679
+ agentId?: string;
1680
+ }
1681
+ export interface ReportIncidentInput {
1682
+ /** The governed task it concerns. Give this, `aiSystemId`, or both. */
1683
+ taskId?: string;
1684
+ /** The AI system it concerns; the task's own when only `taskId` is given. */
1685
+ aiSystemId?: string;
1686
+ title: string;
1687
+ description?: string;
1688
+ /** `high` or `critical` closes the task's governance gate until a person resolves it. */
1689
+ severity: GovernanceRisk;
1690
+ /** When the organisation became aware of it, if earlier than now. DORA's clocks start here. */
1691
+ detectedAt?: string;
1692
+ }
1693
+ /** A DORA classification a person recorded. */
1694
+ export interface DoraClassification {
1695
+ facts: Record<string, unknown>;
1696
+ major: boolean;
1697
+ criteria: {
1698
+ criterion: string;
1699
+ met: boolean;
1700
+ detail: string;
1701
+ }[];
1702
+ /** The verdict in a sentence. */
1703
+ reason: string;
1704
+ /** Which version of the rules worked it out. */
1705
+ rules: string;
1706
+ }
1707
+ export interface AiIncident {
1708
+ id: string;
1709
+ taskId: string | null;
1710
+ aiSystemId: string | null;
1711
+ title: string;
1712
+ description: string;
1713
+ severity: GovernanceRisk;
1714
+ status: "open" | "resolved";
1715
+ reportedByLabel: string;
1716
+ reportedByAgentId: string | null;
1717
+ reportedAt: string;
1718
+ resolution: string | null;
1719
+ resolvedByLabel: string | null;
1720
+ resolvedAt: string | null;
1721
+ detectedAt: string;
1722
+ /** Null until a person classifies it. */
1723
+ dora: DoraClassification | null;
1724
+ /** When it was first classified major; the reporting clock runs from here. */
1725
+ doraMajorAt: string | null;
1726
+ doraClassifiedAt: string | null;
1727
+ doraClassifiedBy: string | null;
1728
+ }
1729
+ export type DoraReportKind = "initial" | "intermediate" | "final" | "reclassification";
1730
+ export interface IncidentReport {
1731
+ id: string;
1732
+ incidentId: string;
1733
+ kind: DoraReportKind;
1734
+ content: string;
1735
+ fields: Record<string, unknown>;
1736
+ approvalId: string | null;
1737
+ /** The sign-off approval's state; null when none was asked for. */
1738
+ approvalStatus: string | null;
1739
+ submittedAt: string | null;
1740
+ submittedByLabel: string | null;
1741
+ authorityReference: string | null;
1742
+ createdByLabel: string;
1743
+ createdByAgentId: string | null;
1744
+ createdAt: string;
1745
+ }
1746
+ export interface ReportingStep {
1747
+ kind: DoraReportKind;
1748
+ /** Null until the step before it is done. */
1749
+ dueAt: string | null;
1750
+ submittedAt: string | null;
1751
+ overdue: boolean;
1752
+ late: boolean;
1753
+ }
1754
+ /** Which DORA report is due next and by when. Nothing is due unless the incident is classified major. */
1755
+ export interface ReportingSchedule {
1756
+ required: boolean;
1757
+ steps: ReportingStep[];
1758
+ next: ReportingStep | null;
1759
+ }
1760
+ /** One incident with its reports and reporting schedule. */
1761
+ export interface AiIncidentDetail {
1762
+ id: string;
1763
+ taskId: string | null;
1764
+ aiSystemId: string | null;
1765
+ title: string;
1766
+ description: string;
1767
+ severity: GovernanceRisk;
1768
+ status: "open" | "resolved";
1769
+ reportedByLabel: string;
1770
+ reportedByAgentId: string | null;
1771
+ reportedAt: string;
1772
+ resolution: string | null;
1773
+ resolvedByLabel: string | null;
1774
+ resolvedAt: string | null;
1775
+ detectedAt: string;
1776
+ /** Null until a person classifies it. */
1777
+ dora: DoraClassification | null;
1778
+ /** When it was first classified major; the reporting clock runs from here. */
1779
+ doraMajorAt: string | null;
1780
+ doraClassifiedAt: string | null;
1781
+ doraClassifiedBy: string | null;
1782
+ url: string;
1783
+ reports: IncidentReport[];
1784
+ schedule: ReportingSchedule;
1785
+ /** Notified as major, now classified as not, and the authority not yet told. */
1786
+ reclassificationOwed: boolean;
1787
+ }
1788
+ export interface ListIncidentsInput {
1789
+ status?: "open" | "resolved";
1790
+ aiSystemId?: string;
1791
+ /** One page of this size. Leave it unset to get every row. */
1792
+ limit?: number;
1793
+ cursor?: string;
1794
+ }
1795
+ export interface DraftIncidentReportInput {
1796
+ kind: DoraReportKind;
1797
+ /** What the report says, for the person who signs it off and for the authority. */
1798
+ content: string;
1799
+ /**
1800
+ * The report's structured fields. initial: discoveredBy, memberStates,
1801
+ * originatedAtThirdParty, businessContinuityActivated; intermediate:
1802
+ * incidentType, occurredAt, recoveredAt, authorityReference, clientsAffected,
1803
+ * figuresAreEstimates, temporaryMeasures; final: rootCause,
1804
+ * rootCauseAddressedAt, resolvedAt, grossCostsEur, financialRecoveriesEur;
1805
+ * reclassification: reason.
1806
+ */
1807
+ fields?: Record<string, unknown>;
1808
+ /** Who signs it off; the organisation's administrators when omitted. */
1809
+ approvers?: string[];
1810
+ }
1811
+ export interface DraftedIncidentReport {
1812
+ incident: AiIncidentDetail;
1813
+ reportId: string;
1814
+ approvalId: string;
1815
+ approvalUrl: string;
1816
+ }
1817
+ /** Conditions on a governance profile under which a requirement applies. Every one given must hold. */
1818
+ export interface RequirementAppliesWhen {
1819
+ minRisk?: GovernanceRisk;
1820
+ personalData?: boolean;
1821
+ customerFacing?: boolean;
1822
+ productionUse?: boolean;
1823
+ decisionImpact?: NonNullable<GovernanceProfileInput["decisionImpact"]>[];
1824
+ }
1825
+ export interface FrameworkRequirement {
1826
+ /** The framework's own reference: an article, a clause. */
1827
+ ref: string;
1828
+ title: string;
1829
+ /** Controls that evidence it: common ones, or the organisation's own `custom_` controls. */
1830
+ controls: string[];
1831
+ appliesWhen?: RequirementAppliesWhen;
1832
+ }
1833
+ export interface FrameworkSummary {
1834
+ key: string;
1835
+ name: string;
1836
+ version: string;
1837
+ versions: string[];
1838
+ source: string;
1839
+ summary: string;
1840
+ jurisdictions: string[];
1841
+ builtIn: boolean;
1842
+ status: "published" | "draft" | "retired";
1843
+ requirements: FrameworkRequirement[];
1844
+ /** Whether and at which version the organisation applies it. */
1845
+ adoption: {
1846
+ frameworkKey: string;
1847
+ version: string;
1848
+ active: boolean;
1849
+ adoptedByLabel: string;
1850
+ adoptedAt: string;
1851
+ updatedAt: string;
1852
+ } | null;
1853
+ }
1854
+ export interface CustomFramework {
1855
+ id: string;
1856
+ key: string;
1857
+ version: string;
1858
+ name: string;
1859
+ summary: string;
1860
+ jurisdictions: string[];
1861
+ requirements: FrameworkRequirement[];
1862
+ status: "draft" | "published" | "retired";
1863
+ effectiveFrom: string | null;
1864
+ publishedAt: string | null;
1865
+ publishedByLabel: string | null;
1866
+ createdByLabel: string;
1867
+ createdByAgentId: string | null;
1868
+ createdAt: string;
1869
+ }
1870
+ export interface CustomControl {
1871
+ id: string;
1872
+ key: string;
1873
+ title: string;
1874
+ description: string;
1875
+ family: string;
1876
+ satisfiedBy: "evidence" | "approval";
1877
+ status: "active" | "retired";
1878
+ createdByLabel: string;
1879
+ createdAt: string;
1880
+ }
1881
+ /** Every framework the organisation can see: the built-in packs and its own. */
1882
+ export interface FrameworkCatalogue {
1883
+ frameworks: FrameworkSummary[];
1884
+ /** The organisation's own frameworks, every version (Enterprise). */
1885
+ custom: CustomFramework[];
1886
+ customControls: CustomControl[];
1887
+ canAdopt: boolean;
1888
+ canWriteCustom: boolean;
1889
+ statement: string;
1890
+ }
1891
+ /** An organisation's own framework (Enterprise). A draft adds nothing until a person publishes and applies it. */
1892
+ export interface CreateCustomFrameworkInput {
1893
+ /** `custom_` followed by lower case letters, digits and underscores. */
1894
+ key: string;
1895
+ /** e.g. `1.0` or `2026.10`. A change to a published framework is a new version. */
1896
+ version: string;
1897
+ name: string;
1898
+ summary?: string;
1899
+ jurisdictions?: string[];
1900
+ /** An ISO date. */
1901
+ effectiveFrom?: string;
1902
+ requirements: FrameworkRequirement[];
1903
+ }
1904
+ export interface RequirementCoverage {
1905
+ ref: string;
1906
+ title: string;
1907
+ applies: boolean;
1908
+ controls: {
1909
+ key: string;
1910
+ status: "outstanding" | "satisfied" | "waived" | "missing";
1911
+ }[];
1912
+ /** Every mapped control satisfied or waived. Not "compliant": covered by controls that are done. */
1913
+ covered: boolean;
1914
+ }
1915
+ /** How requirements map onto controls and, for a task, how far its controls cover each. Never a compliance verdict. */
1916
+ export interface FrameworkMapping {
1917
+ taskId: string | null;
1918
+ frameworks: {
1919
+ key: string;
1920
+ name: string;
1921
+ version: string;
1922
+ source: string;
1923
+ /** Adopted by the organisation and so adding controls to the task. */
1924
+ applied: boolean;
1925
+ applies: boolean;
1926
+ covered: number;
1927
+ applicable: number;
1928
+ requirements: RequirementCoverage[];
1929
+ }[];
1930
+ statement: string;
1931
+ }
1932
+ export interface FrameworkMappingInput {
1933
+ /** A governed task, to see how far its controls cover each requirement. */
1934
+ taskId?: string;
1935
+ /** One framework's key. */
1936
+ framework?: string;
1937
+ }
1938
+ /** An entry in the ICT third-party register, with what it still lacks. Its other fields follow the DORA register templates. */
1939
+ export interface IctRegisterEntry {
1940
+ id: string;
1941
+ gaps: unknown[];
1942
+ [field: string]: unknown;
1943
+ }
1944
+ /** The ICT third-party register, kept by a person in the app. Read-only here. */
1945
+ export interface IctRegister {
1946
+ entity: Record<string, unknown> | null;
1947
+ providers: (IctRegisterEntry & {
1948
+ name: string;
1949
+ })[];
1950
+ arrangements: (IctRegisterEntry & {
1951
+ providerId: string;
1952
+ providerName: string;
1953
+ aiSystems: {
1954
+ id: string;
1955
+ name: string;
1956
+ environment: AiSystem["environment"];
1957
+ }[];
1958
+ })[];
1959
+ /** How many AI systems, and which critical or important functions, depend on each provider. */
1960
+ concentration: Record<string, unknown>[];
1961
+ /** Active AI systems not yet linked to an arrangement. */
1962
+ unregisteredSystems: {
1963
+ id: string;
1964
+ name: string;
1965
+ environment: AiSystem["environment"];
1966
+ }[];
1967
+ /** Which version of the regulation's lists this follows. */
1968
+ rules: string;
1969
+ }
1970
+ export interface GovernanceSummaryInput {
1971
+ aiSystemId?: string;
1972
+ risk?: GovernanceRisk;
1973
+ owner?: string;
1974
+ provider?: string;
1975
+ dataClassification?: string;
1976
+ /** Enterprise. */
1977
+ jurisdiction?: string;
1978
+ /** Enterprise: tasks held to this framework. */
1979
+ framework?: string;
1980
+ }
1981
+ /** The organisation's AI governance in counts. Never a compliance percentage. */
1982
+ export interface GovernanceSummary {
1983
+ aiSystems: number;
1984
+ production: number;
1985
+ elevatedOrHighRisk: number;
1986
+ governedTasks: number;
1987
+ outstandingControls: number;
1988
+ approvalsPending: number;
1989
+ expiredExceptions: number;
1990
+ openIncidents: number;
1991
+ tasksRequiringReview: number;
1992
+ systemsRequiringReview: number;
1993
+ tasks: {
1994
+ taskId: string;
1995
+ title: string;
1996
+ risk: GovernanceRisk;
1997
+ aiSystem: string | null;
1998
+ controls: {
1999
+ required: number;
2000
+ outstanding: number;
2001
+ };
2002
+ reassessmentOpen: boolean;
2003
+ reviewOverdue: boolean;
2004
+ }[];
2005
+ filters: GovernanceSummaryInput;
2006
+ advancedFilters: boolean;
2007
+ }
2008
+ /**
2009
+ * A governed task's evidence pack: profile, controls, evidence, task graph,
2010
+ * decisions, approvals and the audit timeline, with a digest. It assists
2011
+ * audit; it does not certify compliance. Every export is audited.
2012
+ */
2013
+ export interface GovernancePack {
2014
+ packKind: "ai_governance";
2015
+ packVersion: number;
2016
+ generatedAt: string;
2017
+ generatedBy: string;
2018
+ organisation: {
2019
+ id: string;
2020
+ name: string;
2021
+ };
2022
+ statement: string;
2023
+ subject: {
2024
+ taskId: string;
2025
+ title: string;
2026
+ objective: string;
2027
+ url: string;
2028
+ };
2029
+ aiSystem: AiSystem | null;
2030
+ profile: GovernanceProfileInput & {
2031
+ requiredByPolicy: boolean;
2032
+ };
2033
+ readiness: GovernanceReadiness;
2034
+ gate: GovernanceGate;
2035
+ controls: GovernanceControl[];
2036
+ evidence: GovernanceEvidence[];
2037
+ frameworks: (GovernanceFramework & {
2038
+ requirements: RequirementCoverage[];
2039
+ })[];
2040
+ frameworkStatement: string | null;
2041
+ policies: Record<string, unknown>[];
2042
+ exceptions: Record<string, unknown>[];
2043
+ review: Record<string, unknown>;
2044
+ reassessments: Reassessment[];
2045
+ incidents: AiIncident[];
2046
+ thirdParty: Record<string, unknown> | null;
2047
+ doraReporting: Record<string, unknown>[];
2048
+ taskGraph: {
2049
+ id: string;
2050
+ parentTaskId: string | null;
2051
+ kind: string;
2052
+ title: string;
2053
+ status: string;
2054
+ outcome: string | null;
2055
+ result: string | null;
2056
+ }[];
2057
+ findings: {
2058
+ taskId: string;
2059
+ kind: string;
2060
+ title: string;
2061
+ body: string;
2062
+ decisionStatus: string | null;
2063
+ decidedBy: string | null;
2064
+ recordedBy: string;
2065
+ at: string;
2066
+ }[];
2067
+ approvals: {
2068
+ id: string;
2069
+ status: string;
2070
+ for: string;
2071
+ }[];
2072
+ timeline: {
2073
+ at: string;
2074
+ event: string;
2075
+ actor: string;
2076
+ actorType: string;
2077
+ metadata: Record<string, unknown>;
2078
+ }[];
2079
+ integrity: {
2080
+ algorithm: "sha256";
2081
+ digest: string;
2082
+ covers: string;
2083
+ doesNotCover: string;
2084
+ };
2085
+ }
2086
+ export interface UpdateGovernanceProfileInput extends GovernanceProfileInput {
2087
+ /** The version you read; refused if somebody wrote in between. */
2088
+ expectedVersion?: number;
2089
+ }
2090
+ export interface ControlApprovalInput {
2091
+ /** Emails, names or groups; the organisation's administrators when omitted. */
2092
+ approvers?: string[];
2093
+ note?: string;
2094
+ /** An ISO time. */
2095
+ expiresAt?: string;
2096
+ }
2097
+ export interface ControlApprovalResult {
2098
+ governance: Governance;
2099
+ approvalId: string;
2100
+ approvalUrl: string;
2101
+ }
1558
2102
  export interface ListTasksInput {
1559
2103
  /** A status, or `active` for anything not completed or cancelled. */
1560
2104
  status?: TaskStatus | "active";
@@ -1720,4 +2264,46 @@ export interface CallbackEnvelope {
1720
2264
  requestId: string;
1721
2265
  data: Record<string, unknown>;
1722
2266
  }
2267
+ /** `allow` | `redact` | `ask` | `deny`: what may happen to text bound for a model. */
2268
+ export type ScreenVerdict = "allow" | "redact" | "ask" | "deny";
2269
+ /** The AI register's record for the model the text is going to. */
2270
+ export interface ScreenTargetData {
2271
+ aiSystemId: string;
2272
+ name: string;
2273
+ /** The highest classification it is approved to receive; null when the record does not say. */
2274
+ approvedClassification: string | null;
2275
+ personalData: boolean;
2276
+ }
2277
+ /** Where one finding is in the text you screened. Never its value. */
2278
+ export interface ScreenFindingData {
2279
+ kind: string;
2280
+ label: string;
2281
+ start: number;
2282
+ end: number;
2283
+ }
2284
+ export interface ScreenApprovalRef {
2285
+ id: string;
2286
+ url: string;
2287
+ status: string;
2288
+ }
2289
+ /** What `POST /screen` answers: the verdict, and why. */
2290
+ export interface ScreenData {
2291
+ verdict: ScreenVerdict;
2292
+ /** Whether the text may be sent now: as it is for `allow`, redacted for `redact`. */
2293
+ allowed: boolean;
2294
+ classification: "public" | "internal" | "confidential" | "restricted";
2295
+ personalData: boolean;
2296
+ categories: string[];
2297
+ /** What was found, by kind. */
2298
+ counts: Record<string, number>;
2299
+ /** The kinds behind the verdict: what redaction replaces. */
2300
+ offending: string[];
2301
+ reasons: string[];
2302
+ target: ScreenTargetData | null;
2303
+ /** Only when the server read the text. The SDK screens locally, so this is null from `screen()`. */
2304
+ findings: ScreenFindingData[] | null;
2305
+ redactedText: string | null;
2306
+ /** The approval a person decides, for an `ask` verdict. */
2307
+ approval: ScreenApprovalRef | null;
2308
+ }
1723
2309
  //# sourceMappingURL=types.d.ts.map