@standards/schema 1.0.0-alpha.418 → 1.0.0-alpha.419

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 (36) hide show
  1. package/dist/{all-1pGx58g6.mjs → all-BFZvSwku.mjs} +1 -1
  2. package/dist/{all-C-tG86Pt.d.mts → all-CcI67hiC.d.mts} +1 -1
  3. package/dist/{all-DxVkjo74.d.ts → all-cpt9cxka.d.ts} +1 -1
  4. package/dist/{all-B1SMbpC9.js → all-kYfkyIit.js} +1 -1
  5. package/dist/api/index.d.mts +793 -46
  6. package/dist/api/index.d.ts +793 -46
  7. package/dist/api/index.js +1 -1
  8. package/dist/api/index.mjs +1 -1
  9. package/dist/{exceptions-BQiNZXm5.d.mts → exceptions-C3d0YoMy.d.mts} +8 -0
  10. package/dist/{exceptions-g7YWWqxM.d.ts → exceptions-DzEpWPJ7.d.ts} +8 -0
  11. package/dist/exceptions.d.mts +1 -1
  12. package/dist/exceptions.d.ts +1 -1
  13. package/dist/exceptions.js +1 -1
  14. package/dist/exceptions.mjs +1 -1
  15. package/dist/{index-B_nj48YC.d.mts → index-D59FeAd4.d.mts} +358 -71
  16. package/dist/{index-DsmLdvid.d.ts → index-DhzoMOYA.d.ts} +358 -71
  17. package/dist/index.d.mts +5 -5
  18. package/dist/index.d.ts +5 -5
  19. package/dist/index.js +2 -2
  20. package/dist/index.mjs +2 -2
  21. package/dist/{primitives-CXio5R1q.mjs → primitives-B-h9MEQ4.mjs} +1 -1
  22. package/dist/{primitives-B4ZEOP32.js → primitives-CvuPz5hX.js} +1 -1
  23. package/dist/record-operation-BYjGrZ1R.js +2 -0
  24. package/dist/record-operation-q6w-3EDJ.mjs +2 -0
  25. package/dist/{utils-Cb1wqWLJ.d.mts → utils-Bl7NhRVP.d.mts} +1 -1
  26. package/dist/{utils-zJGDp1O7.d.ts → utils-YUFgn36U.d.ts} +1 -1
  27. package/dist/utils.d.mts +1 -1
  28. package/dist/utils.d.ts +1 -1
  29. package/dist/validation/all.d.mts +1 -1
  30. package/dist/validation/all.d.ts +1 -1
  31. package/dist/validation/all.js +1 -1
  32. package/dist/validation/all.mjs +1 -1
  33. package/openapi.json +24996 -0
  34. package/package.json +4 -2
  35. package/dist/record-operation-Ce5oJe9K.js +0 -2
  36. package/dist/record-operation-DszVqr_i.mjs +0 -2
@@ -1,42 +1,168 @@
1
1
 
2
- import { TenantId, Uuid } from "./utils-zJGDp1O7.js";
3
- import { ActivityContentDefinition, Attribute, AttributeType, BLOCK_PERIODS, BilateralConfig, BlockContext, BlockDefinition, BlockInput, BlockWidth, CheckboxAttribute, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, Currency, CurrencyAttribute, CustomContentDefinition, DateAttribute, DatePrecision, DateRangeValue, DocumentAttribute, DocumentLayout, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, FormulaAttribute, FormulaReturnType, GridPosition, GridViolation, HeightMode, ImageShape, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListViewTabVisibility, ListableBlockInput, Location, LocationAttribute, LocationGranularity, MeetingsContentDefinition, MultiRelationAttribute, MultiselectAttribute, NumberAttribute, ObjectBuilderLike, ObjectDefinition, ObjectImage, ObjectRecord, ObjectViewContext, ObjectViewDefinition, Option, PageContentDefinition, PageViewDefinition, Phone, PhoneAttribute, PropertyAttribute, PropertySchema, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, QueryState, RecordAppearance, RecordListScope, RecordMetadata, RecordQuery, RecordQueryDefinition, RelationAttribute, RelationTarget, RelativeDateValue, ResourceVisibility, RichtextAttribute, RichtextContentDefinition, RollupAttribute, RollupFunction, SelectAttribute, SingleRelationAttribute, SortRule, StatusAttribute, TextAttribute, TimeFormat, Timestamps, UpdateObjectInput, UserAttribute, UserReferenceType, ViewContentDefinition, ViewRead, ViewerAccess, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-DxVkjo74.js";
4
2
  import "./zod-locale.js";
5
- import { SchemaError, SchemaErrorCode, ValidationError } from "./exceptions-g7YWWqxM.js";
3
+ import { TenantId, Uuid } from "./utils-YUFgn36U.js";
4
+ import { ActivityContentDefinition, Attribute, AttributeType, BLOCK_PERIODS, BilateralConfig, BlockContext, BlockDefinition, BlockInput, BlockWidth, CheckboxAttribute, CollectionAction, CollectionContentDefinition, CollectionContentSource, ColumnReference, ContentConfiguration, ContentCreateMode, ContentField, ContentFieldGroup, ContentOpenMode, ContentViewContext, ContentViewDefinition, Currency, CurrencyAttribute, CustomContentDefinition, DateAttribute, DatePrecision, DateRangeValue, DocumentAttribute, DocumentLayout, DocumentsContentDefinition, DynamicValue, Eager, EmailsContentDefinition, FilterOperator, FilterRule, FilterState, FilterValue, FormContentDefinition, FormDensity, FormsContentDefinition, FormulaAttribute, FormulaReturnType, GridPosition, GridViolation, HeightMode, ImageShape, InferAttributeValue, InferQualifiedProps, InputShape, LayoutTraits, ListViewTabVisibility, ListableBlockInput, Location, LocationAttribute, LocationGranularity, MeetingsContentDefinition, MultiRelationAttribute, MultiselectAttribute, NumberAttribute, ObjectBuilderLike, ObjectDefinition, ObjectImage, ObjectRecord, ObjectViewContext, ObjectViewDefinition, Option, PageContentDefinition, PageViewDefinition, Phone, PhoneAttribute, PropertyAttribute, PropertySchema, QualifiedDocumentAttributeBuilder, QualifiedDocumentBrand, QueryState, RecordAppearance, RecordListScope, RecordMetadata, RecordQuery, RecordQueryDefinition, RelationAttribute, RelationTarget, RelativeDateValue, ResourceVisibility, RichtextAttribute, RichtextContentDefinition, RollupAttribute, RollupFunction, SelectAttribute, SingleRelationAttribute, SortRule, StatusAttribute, TextAttribute, TimeFormat, Timestamps, UpdateObjectInput, UserAttribute, UserReferenceType, ViewContentDefinition, ViewRead, ViewerAccess, WithCustomAttributes, WithCustomRecordAttributes, WithoutSystemFields } from "./all-cpt9cxka.js";
5
+ import { SchemaError, SchemaErrorCode, ValidationError } from "./exceptions-DzEpWPJ7.js";
6
6
  import * as z$2 from "zod";
7
7
  import z, { z as z$1 } from "zod";
8
8
  import { ColorId, CountryIso3, CurrencyCode, IconName } from "@standards/constants";
9
9
  import { StandardSchemaV1, StandardSchemaV1 as StandardSchemaV1$1 } from "@standard-schema/spec";
10
10
  export type ActorType = "user" | "agent" | "api_key" | "system";
11
11
  export type ActorStatus = "active" | "suspended" | "deleted";
12
- interface ActorBase {
13
- id: Uuid;
14
- tenantId: TenantId;
15
- displayName: string;
16
- avatarUrl?: string | null;
17
- metadata: Record<string, unknown>;
18
- deletedAt?: Date | null;
19
- anonymizedAt?: Date | null;
20
- createdAt: Date;
21
- updatedAt: Date;
22
- }
23
12
  type SubjectActorType = Exclude<ActorType, "system">;
24
- type ActiveActorStatus = Exclude<ActorStatus, "deleted">;
25
- type ActiveSubjectActor = { [Type in SubjectActorType]: { [Status in ActiveActorStatus]: {
26
- type: Type;
27
- status: Status;
28
- subjectId: Uuid;
29
- }; }[ActiveActorStatus]; }[SubjectActorType];
30
- type DeletedSubjectActor = { [Type in SubjectActorType]: {
31
- type: Type;
32
- status: "deleted";
33
- subjectId: Uuid | null;
34
- }; }[SubjectActorType];
35
- export type Actor = (ActorBase & ActiveSubjectActor) | (ActorBase & DeletedSubjectActor) | (ActorBase & {
36
- type: "system";
37
- status: ActorStatus;
38
- subjectId?: null;
39
- });
13
+ /**
14
+ * An actor as every answer carries it, one branch per type and status so the
15
+ * type narrows on both (a discriminated union on `type`, then on `status`, so
16
+ * a check reads two keys rather than trying every branch): a subject actor
17
+ * names its subject until it is deleted (then the subject may be gone); the
18
+ * system actor has none. Timestamps travel as ISO strings and read as `Date`
19
+ * (`isoDateTime`).
20
+ */
21
+ export declare const actorSchema: z$2.ZodDiscriminatedUnion<[z$2.ZodDiscriminatedUnion<[z$2.ZodObject<{
22
+ id: z$2.ZodString;
23
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
24
+ displayName: z$2.ZodString;
25
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
26
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
27
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
28
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
29
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
30
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
31
+ } & {
32
+ type: z$2.ZodLiteral<"user">;
33
+ status: z$2.ZodLiteral<"active">;
34
+ subjectId: z$2.ZodString;
35
+ }, z$2.core.$strip>, z$2.ZodObject<{
36
+ id: z$2.ZodString;
37
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
38
+ displayName: z$2.ZodString;
39
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
40
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
41
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
42
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
43
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
44
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
45
+ } & {
46
+ type: z$2.ZodLiteral<"user">;
47
+ status: z$2.ZodLiteral<"suspended">;
48
+ subjectId: z$2.ZodString;
49
+ }, z$2.core.$strip>, z$2.ZodObject<{
50
+ id: z$2.ZodString;
51
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
52
+ displayName: z$2.ZodString;
53
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
54
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
55
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
56
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
57
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
58
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
59
+ } & {
60
+ type: z$2.ZodLiteral<"user">;
61
+ status: z$2.ZodLiteral<"deleted">;
62
+ subjectId: z$2.ZodNullable<z$2.ZodString>;
63
+ }, z$2.core.$strip>], "status">, z$2.ZodDiscriminatedUnion<[z$2.ZodObject<{
64
+ id: z$2.ZodString;
65
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
66
+ displayName: z$2.ZodString;
67
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
68
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
69
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
70
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
71
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
72
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
73
+ } & {
74
+ type: z$2.ZodLiteral<"agent">;
75
+ status: z$2.ZodLiteral<"active">;
76
+ subjectId: z$2.ZodString;
77
+ }, z$2.core.$strip>, z$2.ZodObject<{
78
+ id: z$2.ZodString;
79
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
80
+ displayName: z$2.ZodString;
81
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
82
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
83
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
84
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
85
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
86
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
87
+ } & {
88
+ type: z$2.ZodLiteral<"agent">;
89
+ status: z$2.ZodLiteral<"suspended">;
90
+ subjectId: z$2.ZodString;
91
+ }, z$2.core.$strip>, z$2.ZodObject<{
92
+ id: z$2.ZodString;
93
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
94
+ displayName: z$2.ZodString;
95
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
96
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
97
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
98
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
99
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
100
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
101
+ } & {
102
+ type: z$2.ZodLiteral<"agent">;
103
+ status: z$2.ZodLiteral<"deleted">;
104
+ subjectId: z$2.ZodNullable<z$2.ZodString>;
105
+ }, z$2.core.$strip>], "status">, z$2.ZodDiscriminatedUnion<[z$2.ZodObject<{
106
+ id: z$2.ZodString;
107
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
108
+ displayName: z$2.ZodString;
109
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
110
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
111
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
112
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
113
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
114
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
115
+ } & {
116
+ type: z$2.ZodLiteral<"api_key">;
117
+ status: z$2.ZodLiteral<"active">;
118
+ subjectId: z$2.ZodString;
119
+ }, z$2.core.$strip>, z$2.ZodObject<{
120
+ id: z$2.ZodString;
121
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
122
+ displayName: z$2.ZodString;
123
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
124
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
125
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
126
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
127
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
128
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
129
+ } & {
130
+ type: z$2.ZodLiteral<"api_key">;
131
+ status: z$2.ZodLiteral<"suspended">;
132
+ subjectId: z$2.ZodString;
133
+ }, z$2.core.$strip>, z$2.ZodObject<{
134
+ id: z$2.ZodString;
135
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
136
+ displayName: z$2.ZodString;
137
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
138
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
139
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
140
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
141
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
142
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
143
+ } & {
144
+ type: z$2.ZodLiteral<"api_key">;
145
+ status: z$2.ZodLiteral<"deleted">;
146
+ subjectId: z$2.ZodNullable<z$2.ZodString>;
147
+ }, z$2.core.$strip>], "status">, z$2.ZodObject<{
148
+ id: z$2.ZodString;
149
+ tenantId: z$2.ZodType<TenantId, string, z$2.core.$ZodTypeInternals<TenantId, string>>;
150
+ displayName: z$2.ZodString;
151
+ avatarUrl: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
152
+ metadata: z$2.ZodRecord<z$2.ZodString, z$2.ZodUnknown>;
153
+ deletedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
154
+ anonymizedAt: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>>>;
155
+ createdAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
156
+ updatedAt: z$2.ZodCodec<z$2.ZodISODateTime, z$2.ZodDate>;
157
+ type: z$2.ZodLiteral<"system">;
158
+ status: z$2.ZodEnum<{
159
+ active: "active";
160
+ deleted: "deleted";
161
+ suspended: "suspended";
162
+ }>;
163
+ subjectId: z$2.ZodOptional<z$2.ZodNull>;
164
+ }, z$2.core.$strip>], "type">;
165
+ export type Actor = z$2.output<typeof actorSchema>;
40
166
  interface CreateActorInputBase {
41
167
  displayName: string;
42
168
  avatarUrl?: string | null;
@@ -1369,15 +1495,32 @@ export interface InstalledBundleSummary {
1369
1495
  mode: BundleMode;
1370
1496
  /** `null` for an added bundle. */
1371
1497
  origin: BundleOrigin | null;
1372
- /** The version the workspace holds; `null` for an added bundle. */
1498
+ /**
1499
+ * The version the workspace holds: the applied one for a synced bundle, the
1500
+ * offered one it was added or last updated from for an added bundle; `null`
1501
+ * for an added bundle recorded before its baseline.
1502
+ */
1373
1503
  hash: string | null;
1374
- /** Names of the bundles a synced bundle uses; empty for an added one. */
1504
+ /** Names of the bundles it uses, as recorded when it was synced, added or updated. */
1375
1505
  uses: string[];
1376
1506
  installedAt: string;
1377
1507
  updatedAt: string;
1378
1508
  /** The actor who installed it; `null` when the system did. */
1379
1509
  installedBy: string | null;
1380
1510
  }
1511
+ /**
1512
+ * Where an installed bundle stands: `repair` while a piece it installed no
1513
+ * longer exists, `update` when the host offers another version than the one
1514
+ * it holds, `current` otherwise (and always for a synced bundle or one the
1515
+ * host no longer offers).
1516
+ */
1517
+ export type BundleStatus = "current" | "update" | "repair";
1518
+ /** One installed bundle as `bundles.status` answers it: its status and the bundles that depend on it. */
1519
+ export interface BundleStatusEntry {
1520
+ name: string;
1521
+ status: BundleStatus;
1522
+ usedBy: string[];
1523
+ }
1381
1524
  /** What a bundle card shows of its pieces, projected from the bundle and the closure it uses. */
1382
1525
  export interface BundleContents {
1383
1526
  /** The objects the bundle declares; `inWorkspace` when the caller already sees one by that name. */
@@ -1497,6 +1640,105 @@ export interface BundleAddPlan {
1497
1640
  /** Ties `bundles.add` to the workspace this preview saw. */
1498
1641
  fingerprint: string;
1499
1642
  }
1643
+ /** What an update piece names: a piece, or one part of an installed object (an attribute, an option). */
1644
+ export type BundleUpdatePieceKind = "object" | "view" | "page" | "tab" | "agent" | "attribute" | "option";
1645
+ /**
1646
+ * How an update treats a piece: `added` (new), `updated` (untouched since the
1647
+ * bundle wrote it), `conflict` (the admin changed it, the bundle too: kept
1648
+ * unless taken), `missing` (gone: reinstalled unless skipped), `notApplied`
1649
+ * (it would lose stored values, or its name is taken).
1650
+ */
1651
+ export type BundleUpdateGroup = "added" | "updated" | "conflict" | "missing" | "notApplied";
1652
+ /**
1653
+ * Why a piece is `notApplied`, as a code the screen words: `lossy` (the new
1654
+ * type would lose stored values), `required` (it would become required while
1655
+ * records may be empty), `retype` (no update changes a type), `move` (no
1656
+ * update moves a content between placements), `nameTaken` (its name is held,
1657
+ * `reasonName`), `refused` (adding it is refused here).
1658
+ */
1659
+ export type BundleUpdateReasonCode = "lossy" | "required" | "retype" | "move" | "nameTaken" | "refused";
1660
+ export interface BundleUpdatePiece {
1661
+ pieceId: string;
1662
+ kind: BundleUpdatePieceKind;
1663
+ group: BundleUpdateGroup;
1664
+ label: string;
1665
+ /** Set on a `notApplied` piece. */
1666
+ reasonCode?: BundleUpdateReasonCode;
1667
+ /** The name that is taken, with `reasonCode: "nameTaken"`. */
1668
+ reasonName?: string;
1669
+ }
1670
+ /** What updating an added bundle would do, and the fingerprint `bundles.update` must carry. */
1671
+ export interface BundleUpdatePlan {
1672
+ pieces: BundleUpdatePiece[];
1673
+ /** Ties `bundles.update` to the workspace this preview saw. */
1674
+ fingerprint: string;
1675
+ }
1676
+ /**
1677
+ * What uninstalling an added bundle would delete, counted as the system (a
1678
+ * piece another member made private shows in the totals, never by name), and
1679
+ * the fingerprint `bundles.remove` must carry. `blockedBy` names the bundles
1680
+ * that use it: while one does, the uninstall is refused.
1681
+ */
1682
+ export interface BundleRemovalPreview {
1683
+ blockedBy: string[];
1684
+ /** Each object that goes, with every one of its records: private and trashed ones included. */
1685
+ objects: {
1686
+ name: string;
1687
+ label: string;
1688
+ records: number;
1689
+ }[];
1690
+ /** The views on those objects the bundle did not write, any owner's, which go with them. */
1691
+ views: number;
1692
+ /**
1693
+ * The contents on views that stay that go too, on views the caller sees: a
1694
+ * tab opening one of its pages, or one reading what goes, the admin's own
1695
+ * included. The view stays, unless it is in `emptiedViews`.
1696
+ */
1697
+ viewContents: {
1698
+ viewLabel: string;
1699
+ contentLabel: string;
1700
+ }[];
1701
+ /** The same contents on views the caller cannot see: counted, never named. */
1702
+ hiddenViewContents: number;
1703
+ pages: number;
1704
+ routines: number;
1705
+ agents: number;
1706
+ /** The skills that will be purged: never one the workspace held before, nor one another bundle installed. */
1707
+ skills: number;
1708
+ /** The relations of objects outside the bundle that point at its objects: removed, their records kept. */
1709
+ inboundRelations: {
1710
+ objectLabel: string;
1711
+ attributeLabel: string;
1712
+ }[];
1713
+ /** The computed fields of objects outside the bundle that read what goes: removed, their records kept. */
1714
+ computedAttributes: {
1715
+ objectLabel: string;
1716
+ attributeLabel: string;
1717
+ }[];
1718
+ /** The relations outside the bundle that also target another object: they keep it and lose its objects. */
1719
+ prunedRelations: {
1720
+ objectLabel: string;
1721
+ attributeLabel: string;
1722
+ }[];
1723
+ /** The views that stay no longer: every main content they held goes, the rest with them. */
1724
+ emptiedViews: {
1725
+ viewLabel: string;
1726
+ }[];
1727
+ /**
1728
+ * What an uninstall does not rewrite and would leave broken: an object's
1729
+ * label or embedding naming a field that goes (`objectLabel` alone), a kept
1730
+ * relation's display or filter naming one (`attributeLabel`),
1731
+ * or a default view left with no main content (`viewLabel`). While one
1732
+ * stands, the uninstall is refused, as under `blockedBy`.
1733
+ */
1734
+ citedBy: {
1735
+ objectLabel: string;
1736
+ attributeLabel?: string;
1737
+ viewLabel?: string;
1738
+ }[];
1739
+ /** Ties `bundles.remove` to the pieces, relations and views this preview saw (not the record counts). */
1740
+ fingerprint: string;
1741
+ }
1500
1742
  /** What adding wrote: one entry per object, view or agent created, under the bundle that declares it. */
1501
1743
  export interface BundleAddResult {
1502
1744
  added: {
@@ -3531,6 +3773,11 @@ export interface EnvironmentHarness {
3531
3773
  readonly provider: ProviderName;
3532
3774
  /** The variable that carries the harness's API key (read from the Variables, spec §3.2). */
3533
3775
  readonly apiKeyEnv: string;
3776
+ /**
3777
+ * The variable that carries a subscription sign-in token, when the harness
3778
+ * accepts one (Claude Code `claude setup-token`). The API key wins when both are set.
3779
+ */
3780
+ readonly oauthTokenEnv?: string;
3534
3781
  readonly models: readonly EnvironmentHarnessModel[];
3535
3782
  readonly defaultModel: string;
3536
3783
  }
@@ -3539,6 +3786,7 @@ export declare const ENVIRONMENT_HARNESSES: readonly [{
3539
3786
  readonly label: "Claude Code";
3540
3787
  readonly provider: "anthropic";
3541
3788
  readonly apiKeyEnv: "ANTHROPIC_API_KEY";
3789
+ readonly oauthTokenEnv: "CLAUDE_CODE_OAUTH_TOKEN";
3542
3790
  readonly models: readonly [{
3543
3791
  readonly id: "sonnet";
3544
3792
  readonly label: "Claude Sonnet";
@@ -3769,8 +4017,9 @@ export type ConnectorScope = "actor" | "tenant";
3769
4017
  export interface StartConnectorAuthInput {
3770
4018
  provider: ConnectorProviderId;
3771
4019
  scope: ConnectorScope;
3772
- /** Page the callback 302s back to. Must match a configured allowed origin; otherwise silently ignored. */
4020
+ /** Page the callback 302s back to, on a configured allowed origin. Exactly one of this or `mode`. */
3773
4021
  returnUrl?: string;
4022
+ mode?: "desktop";
3774
4023
  /** Beyond `read`, which is always requested. */
3775
4024
  capabilities?: Exclude<ConnectorCapability, "read">[];
3776
4025
  /**
@@ -3779,10 +4028,6 @@ export interface StartConnectorAuthInput {
3779
4028
  */
3780
4029
  loginHint?: string;
3781
4030
  }
3782
- /** Result of starting an OAuth flow — the URL the browser must visit. */
3783
- export interface StartConnectorAuthResult {
3784
- authorizeUrl: string;
3785
- }
3786
4031
  /**
3787
4032
  * Providers this deployment holds OAuth credentials for. A provider absent from
3788
4033
  * the list cannot start an authorization flow, so its card is not offered.
@@ -3803,15 +4048,7 @@ export interface AddSharedMailboxInput {
3803
4048
  /** Visibility of the synced emails: tenant (default UX) or only the adding actor. */
3804
4049
  scope: ConnectorScope;
3805
4050
  }
3806
- /** Query params the OAuth callback redirect appends to the return URL. */
3807
- export declare const CONNECTOR_CALLBACK_PARAM: {
3808
- readonly status: "connector_status";
3809
- readonly error: "connector_error";
3810
- readonly provider: "connector_provider";
3811
- /** The `QuotaKey` that refused the connection, with `error` at `QUOTA_EXCEEDED`. */
3812
- readonly quota: "connector_quota";
3813
- };
3814
- /** Values `CONNECTOR_CALLBACK_PARAM.status` can take on the redirect. */
4051
+ /** How a connector's consent ended, as the app's surfaces read it. */
3815
4052
  export type ConnectorCallbackStatusValue = "connected" | "error";
3816
4053
  /** The unified verbs an agent calls on typed references. */
3817
4054
  export declare const VERB_NAMES: readonly ["search", "query", "read", "write", "delete", "organize", "copy", "send"];
@@ -7864,7 +8101,7 @@ export type AuditResourceType = (typeof AUDIT_RESOURCE_TYPES)[number];
7864
8101
  /**
7865
8102
  * Actions that can be audited
7866
8103
  */
7867
- export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "agent_session.supervised_read", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
8104
+ export declare const AUDIT_ACTIONS: readonly ["record.created", "record.updated", "record.deleted", "record.restored", "record.purged", "record.access_changed", "agent.access_changed", "agent_session.supervised_read", "object.created", "object.updated", "object.deleted", "attribute.created", "attribute.updated", "attribute.deleted", "view.created", "view.updated", "view.deleted", "bundle.synced", "bundle.removed", "bundle.added", "bundle.updated", "user.created", "user.invited", "user.updated", "user.deleted", "user.login", "user.logout", "tenant_invitation.created", "tenant_invitation.delivery_failed", "tenant_invitation.resent", "tenant_invitation.revoked", "tenant_invitation.accepted", "role.created", "role.updated", "role.deleted", "role.assigned", "role.revoked", "api_key.detached", "settings.updated", "file.uploaded", "file.updated", "file.deleted"];
7868
8105
  export type AuditAction = (typeof AUDIT_ACTIONS)[number];
7869
8106
  /**
7870
8107
  * Actor type - who performed the action
@@ -8902,7 +9139,13 @@ export interface OperationDefinition {
8902
9139
  method: HttpMethod;
8903
9140
  path: `/${string}`;
8904
9141
  input: z$1.ZodType;
8905
- output: OutputType<unknown>;
9142
+ /**
9143
+ * The answer: a zod schema (preferred) validated by the server and decoded
9144
+ * by the client, or a type-only `type<T>()` nothing checks. A schema's
9145
+ * input side is the JSON on the wire, its output side the value both the
9146
+ * handler and the client hold (`isoDateTime`: an ISO string, a `Date`).
9147
+ */
9148
+ output: z$1.ZodType | OutputType<unknown>;
8906
9149
  permission?: OperationPermission;
8907
9150
  status?: OperationStatus;
8908
9151
  throttle?: OperationThrottle;
@@ -8983,16 +9226,22 @@ export type OperationInput<O extends {
8983
9226
  export type OperationParsedInput<O extends {
8984
9227
  input: z$1.ZodType;
8985
9228
  }> = WithUpload<O, z$1.output<O["input"]>, UploadedPart, UploadedPart>;
8986
- /** What a handler answers. */
9229
+ /** What a handler answers, and what a client holds once the body is decoded. */
8987
9230
  export type OperationOutput<O extends {
8988
- output: OutputType<unknown>;
8989
- }> = O["output"] extends OutputType<infer T> ? T : never;
9231
+ output: z$1.ZodType | OutputType<unknown>;
9232
+ }> = OutputOf<O["output"]>;
9233
+ /** The JSON on the wire: an output schema's input side; a type-only output's own type. */
9234
+ export type OperationWireOutput<O extends {
9235
+ output: z$1.ZodType | OutputType<unknown>;
9236
+ }> = WireOf<O["output"]>;
9237
+ type OutputOf<X> = X extends z$1.ZodType ? z$1.output<X> : X extends OutputType<infer T> ? T : never;
9238
+ type WireOf<X> = X extends z$1.ZodType ? z$1.input<X> : OutputOf<X>;
8990
9239
  /**
8991
9240
  * What a client receives: the handler's output, a `DownloadedFile` for bytes,
8992
9241
  * the open `Response` for events.
8993
9242
  */
8994
9243
  export type OperationResult<O extends {
8995
- output: OutputType<unknown>;
9244
+ output: z$1.ZodType | OutputType<unknown>;
8996
9245
  }> = O extends {
8997
9246
  readonly response: "bytes";
8998
9247
  } ? DownloadedFile : O extends {
@@ -13740,6 +13989,61 @@ export declare function normalizePhoneNumber(phoneNumber: string, countryIso3: C
13740
13989
  * // → "+1 555 123 4567"
13741
13990
  */
13742
13991
  export declare function formatPhoneForDisplay(phone: Phone): string;
13992
+ /** How long a ticket can be redeemed. The app counts from receiving it, which errs short by a redirect. */
13993
+ export declare const OAUTH_TICKET_TTL_MS = 300000;
13994
+ /** Which flow an outbound OAuth attempt serves. */
13995
+ export type OAuthKind = "connector" | "mcp";
13996
+ export type OAuthAttemptStatus = "preparing" | "pending" | "returned" | "exchanging" | "choosing" | "completed" | "failed" | "expired";
13997
+ /** Where the browser lands after consent: a web return URL, or the desktop shell. */
13998
+ export interface OAuthCompletionInput {
13999
+ returnUrl?: string;
14000
+ mode?: "desktop";
14001
+ }
14002
+ /** Answer of every start operation: the page to open and when the attempt lapses. */
14003
+ export interface OAuthAttemptStarted {
14004
+ attemptId: string;
14005
+ authorizeUrl: string;
14006
+ expiresAt: string;
14007
+ }
14008
+ /** The GitHub App installations the person can bind, and where to install another. */
14009
+ export interface GitHubInstallationChoice {
14010
+ installations: {
14011
+ id: string;
14012
+ login?: string;
14013
+ }[];
14014
+ installUrl: string;
14015
+ }
14016
+ /** Authenticated projection of an attempt; `errorCode` is a stable reason, never provider text. */
14017
+ export interface OAuthAttemptView {
14018
+ attemptId: string;
14019
+ status: OAuthAttemptStatus;
14020
+ kind: OAuthKind;
14021
+ expiresAt: string;
14022
+ result?: Record<string, unknown>;
14023
+ choice?: GitHubInstallationChoice;
14024
+ errorCode?: string;
14025
+ }
14026
+ /** What completing a ticket or reading an attempt settles on. */
14027
+ export type OAuthCompleteOutcome = {
14028
+ status: "completed";
14029
+ attemptId: string;
14030
+ kind: OAuthKind;
14031
+ result: Record<string, unknown>;
14032
+ } | {
14033
+ status: "failed";
14034
+ attemptId: string;
14035
+ kind: OAuthKind;
14036
+ errorCode: string;
14037
+ result?: Record<string, unknown>;
14038
+ } | ({
14039
+ status: "choose";
14040
+ attemptId: string;
14041
+ kind: "connector";
14042
+ } & GitHubInstallationChoice) | {
14043
+ status: "pending";
14044
+ attemptId: string;
14045
+ kind: OAuthKind;
14046
+ };
13743
14047
  /** How an MCP server authenticates outbound calls. `oauth` carries no secret
13744
14048
  * on the wire — the tokens stay server-side. */
13745
14049
  export type McpServerAuthType = "none" | "header" | "oauth";
@@ -13811,32 +14115,15 @@ export interface ConnectMcpServerInput {
13811
14115
  auth: McpServerAuthInput;
13812
14116
  }
13813
14117
  /** Starts consent without exposing provider credentials to the browser. */
13814
- export declare enum McpOAuthCompletionMode {
13815
- Desktop = "desktop"
13816
- }
13817
- export type StartMcpOAuthAttemptInput = Omit<ConnectMcpServerInput, "auth"> & {
13818
- completionMode?: McpOAuthCompletionMode;
13819
- returnUrl?: string;
13820
- };
13821
- export interface ReconnectMcpOAuthAttemptInput {
14118
+ export type StartMcpOAuthAttemptInput = Omit<ConnectMcpServerInput, "auth"> & OAuthCompletionInput;
14119
+ export interface ReconnectMcpOAuthAttemptInput extends OAuthCompletionInput {
13822
14120
  scope?: string;
13823
- completionMode?: McpOAuthCompletionMode;
13824
- returnUrl?: string;
13825
14121
  }
13826
- export type McpOAuthAttemptStatus = "preparing" | "pending" | "exchanging" | "completed" | "failed" | "expired";
13827
14122
  export interface McpOAuthAttemptStarted {
13828
14123
  attemptId: string;
13829
14124
  authorizeUrl: string;
13830
14125
  expiresAt: string;
13831
14126
  }
13832
- /** Authenticated projection; errorCode is a stable reason, never provider text. */
13833
- export interface McpOAuthAttemptView {
13834
- attemptId: string;
13835
- status: McpOAuthAttemptStatus;
13836
- serverId?: string;
13837
- errorCode?: string;
13838
- expiresAt: string;
13839
- }
13840
14127
  export type EmailCategoryScope = "personal" | "workspace";
13841
14128
  export type EmailClassifiedBy = "model" | "rule" | "manual";
13842
14129
  export type EmailRuleScope = "address" | "domain";