@squidcloud/jira-jsm-client 1.0.511 → 1.0.512

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.
@@ -1,6 +1,7 @@
1
1
  import { JSONSchema } from 'json-schema-typed';
2
2
  import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, CanonicalReasoningEffort, EmbeddingModelIdSpec, GeminiChatModelName, GrokChatModelName, ModelIdSpec, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat, OpenAiImageModelName, VendorAiChatModelName } from './ai-common.public-types';
3
3
  import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
4
+ import { AiOntologyId } from './ai-ontology.public-types';
4
5
  import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
5
6
  import { AiAgentId, AiContextId, AiKnowledgeBaseId, AppId, IntegrationId } from './communication.public-types';
6
7
  import { DocumentExtractionMethod } from './extraction.public-types';
@@ -624,6 +625,11 @@ export interface BaseAiChatOptions {
624
625
  * enable downloads. Default to false (citations render source names only).
625
626
  */
626
627
  allowSourceDownloads?: boolean;
628
+ /**
629
+ * The ontology whose accepted relationships this agent's answers and database queries follow. Honored ONLY from the
630
+ * agent's stored options; the per-request value is ignored.
631
+ */
632
+ ontologyId?: AiOntologyId;
627
633
  /**
628
634
  * The format of the response from the AI model. Defaults to 'text'. A `json_schema` format is
629
635
  * refused for a model whose provider has no way to carry a schema — see
@@ -1050,6 +1056,12 @@ export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'opti
1050
1056
  * @category AI
1051
1057
  */
1052
1058
  export declare const AGENT_STATUS_TITLE_AGENT_RESPONSE = "Agent Response";
1059
+ /**
1060
+ * Status update title broadcast when the agent's model fails and the `ask` is retried on its backup model. Its audit
1061
+ * log entry carries the failed model and its usage in its tags; the backup's attempt records the job's response.
1062
+ * @category AI
1063
+ */
1064
+ export declare const AGENT_STATUS_TITLE_MODEL_FAILOVER = "Primary Model Failed";
1053
1065
  /**
1054
1066
  * Status update title broadcast when the agent invokes a knowledge-base
1055
1067
  * callable. A matching invocation produces a single event with this title.
@@ -61,101 +61,62 @@ export interface AiKnowledgeBase {
61
61
  accessControl?: AiKnowledgeBaseAccessControl;
62
62
  /**
63
63
  * Binds the knowledge base to content that lives outside Squid. Such a knowledge base is read-only: its
64
- * content cannot be upserted or deleted, and searches run against the source. It is set by the
65
- * `azure_ai_search` integration whose `knowledgeBaseId` names the knowledge base, never by an upsert.
64
+ * content cannot be upserted or deleted, and searches run against the source. It is set by the integration
65
+ * whose `knowledgeBaseId` names the knowledge base, never by an upsert.
66
66
  */
67
67
  externalSource?: AiKnowledgeBaseExternalSource;
68
68
  /** The timestamp the knowledge base was last updated */
69
69
  updatedAt: Date;
70
70
  }
71
71
  /**
72
- * Maps the fields of an Azure AI Search index to the roles Squid reads them in.
73
- * @category AI
74
- */
75
- export interface AzureAiSearchFieldRoles {
76
- /** The key field of the index. */
77
- key: string;
78
- /** The parent document key of a chunked index (index projections). Absent when each record is a whole document. */
79
- parentKey?: string;
80
- /** The field holding the document title. */
81
- title?: string;
82
- /** The retrievable text fields that make up a record's content, in reading order. */
83
- content: Array<string>;
84
- /** The field holding a link to the source document. */
85
- url?: string;
86
- /** A filterable, sortable timestamp field. Enables incremental sync of the entity graph. */
87
- lastModified?: string;
88
- /** Filterable or facetable fields exposed as knowledge base metadata and facet candidates. */
89
- metadata: Array<string>;
90
- /** Vector fields that have a vectorizer, so a vector search can send text and let the index embed it. */
91
- vector?: Array<string>;
92
- /** The metadata and security fields that hold a collection of values; filters on them match any element. */
93
- collections?: Array<string>;
94
- }
95
- /**
96
- * The document-level security models of an Azure AI Search index. See {@link AzureAiSearchSecurity}.
97
- * @category AI
98
- */
99
- export declare const AZURE_AI_SEARCH_SECURITY_MODES: readonly ["none", "filter", "nativeAcl"];
100
- /**
101
- * How Squid restricts a search of an Azure AI Search index to what its caller may read.
72
+ * How an external source restricts a read to what its caller may see.
102
73
  *
103
- * - `'none'`: the index has no document-level security.
104
- * - `'filter'`: the index has a security field. The caller's values come from the knowledge base's
105
- * `accessControl.scopeResolver`; a record is visible when the field holds one of them or one of `publicValues`.
106
- * - `'nativeAcl'`: the index enforces its own ACLs. The caller's Entra token is supplied per request in
107
- * `integrationAccessTokens` under the integration's id; a search without it fails. Search works as the
108
- * caller, but Squid's own reads see only the records every user may read, so the knowledge base has no
109
- * facet concepts and its index card is written from the index definition alone.
74
+ * - `'none'`: the source has no document-level security.
75
+ * - `'callerScopes'`: a record is visible when it holds one of the caller's scopes, which the knowledge base's
76
+ * `accessControl.scopeResolver` resolves.
77
+ * - `'callerToken'`: the source enforces its own ACLs with the caller's token, supplied per request in
78
+ * `integrationAccessTokens` under the integration's id. Squid's own reads see only the records every caller
79
+ * may read.
110
80
  *
111
81
  * @category AI
112
82
  */
113
- export type AzureAiSearchSecurity = {
114
- /** The index has no document-level security. */
115
- mode: 'none';
116
- } | {
117
- /** The index is filtered on a security field. */
118
- mode: 'filter';
119
- /** The filterable security field: a string, or a collection of strings. */
120
- field: string;
121
- /** Values of the security field that mark a record as visible to every caller. */
122
- publicValues?: Array<string>;
123
- } | {
124
- /** The index enforces native ACLs with the caller's Entra token. */
125
- mode: 'nativeAcl';
126
- };
83
+ export type AiKnowledgeBaseExternalDocumentSecurity = 'none' | 'callerScopes' | 'callerToken';
127
84
  /**
128
- * Marks a knowledge base whose content lives in a customer-owned Azure AI Search index. Squid queries the
129
- * index with the access the integration grants and never modifies it.
85
+ * What Squid knows about an external source whatever its type. The integration's connector reports it when the
86
+ * integration is saved.
130
87
  * @category AI
131
88
  */
132
- export interface AiKnowledgeBaseAzureAiSearchSource {
133
- /** The kind of external source. */
134
- type: 'azureAiSearch';
135
- /** The `azure_ai_search` integration that holds the connection to the search service. */
136
- integrationId: IntegrationId;
137
- /** The name of the index. */
138
- indexName: string;
139
- /** Which index fields Squid reads, and as what. */
140
- fieldRoles: AzureAiSearchFieldRoles;
141
- /** How searches are restricted to what the caller may read. */
142
- security: AzureAiSearchSecurity;
143
- /**
144
- * The semantic configuration that hybrid searches rank with. Semantic ranking is billed to the owner of the
145
- * search service. Omitted ⇒ no semantic ranking.
146
- */
147
- semanticConfiguration?: string;
148
- /**
149
- * Minutes between the sync scans that keep the entity graph in step with the index. Only used while
150
- * `graphRag.enabled` is set. Defaults to 60.
151
- */
152
- syncIntervalMinutes?: number;
89
+ export interface AiKnowledgeBaseExternalSourceTraits {
90
+ /** A one-line name of the source for people and agents, such as `Azure AI Search index "handbook"`. */
91
+ label: string;
92
+ /** What the integration reads in the source, such as an index name. Fixed once the knowledge base is bound. */
93
+ target: string;
94
+ /** How a read is restricted to what its caller may see. */
95
+ documentSecurity: AiKnowledgeBaseExternalDocumentSecurity;
96
+ /** True when a document spans several records of the source. */
97
+ chunked: boolean;
98
+ /** True when the source embeds the text of a vector query itself. */
99
+ embedsQueries: boolean;
100
+ /** True when the source records when each record last changed, so a sync reads only what changed. */
101
+ incrementalSync: boolean;
102
+ /** The source fields the knowledge base exposes as metadata. */
103
+ metadataFields: Array<string>;
153
104
  }
154
105
  /**
155
- * Where the content of an external, read-only knowledge base lives.
106
+ * Where the content of an external, read-only knowledge base lives. Squid reads the source with the access the
107
+ * integration grants and never modifies it.
156
108
  * @category AI
157
109
  */
158
- export type AiKnowledgeBaseExternalSource = AiKnowledgeBaseAzureAiSearchSource;
110
+ export interface AiKnowledgeBaseExternalSource {
111
+ /** The type of the integration that serves the source. */
112
+ type: string;
113
+ /** The integration that holds the connection to the source. */
114
+ integrationId: IntegrationId;
115
+ /** What Squid knows about the source whatever its type. */
116
+ traits: AiKnowledgeBaseExternalSourceTraits;
117
+ /** How the integration's connector reads the source. Only that connector reads them. */
118
+ settings: Record<string, unknown>;
119
+ }
159
120
  /**
160
121
  * The access-control modes a knowledge base can be in. See {@link AiKnowledgeBaseAccessControl}.
161
122
  * @category AI
@@ -2761,22 +2722,17 @@ export type KnowledgeBaseExternalSourceTier = 1 | 2;
2761
2722
  * @category AI
2762
2723
  */
2763
2724
  export interface KnowledgeBaseExternalSourcePrerequisite {
2764
- /** A stable identifier of the prerequisite. */
2765
- id: KnowledgeBaseExternalSourcePrerequisiteId;
2725
+ /** A stable identifier of the prerequisite, which the source's connector names. */
2726
+ id: string;
2766
2727
  /** The lowest tier that needs it. */
2767
2728
  tier: KnowledgeBaseExternalSourceTier;
2768
- /** Whether the index provides it: `'unknown'` when the integration may not read what answers that. */
2729
+ /** Whether the source provides it: `'unknown'` when the integration may not read what answers that. */
2769
2730
  status: 'met' | 'unmet' | 'unknown';
2770
2731
  /** True when the tier cannot run without it; false when the tier runs degraded. */
2771
2732
  required: boolean;
2772
2733
  /** What was found, and what it means for the tier. */
2773
2734
  message: string;
2774
2735
  }
2775
- /**
2776
- * The prerequisites the binding of an external source reports.
2777
- * @category AI
2778
- */
2779
- export type KnowledgeBaseExternalSourcePrerequisiteId = 'definitionReadable' | 'documentSecurityKnown' | 'contentRetrievable' | 'vectorizer' | 'keyFilterableSortable' | 'withinScanLimit' | 'timestampField' | 'noDocumentSecurity';
2780
2736
  /**
2781
2737
  * Request structure for reading the state of an external knowledge base's semantic layer.
2782
2738
  * @category AI
@@ -0,0 +1,996 @@
1
+ import { AiKnowledgeBaseId, IntegrationId } from './communication.public-types';
2
+ /**
3
+ * Id of an ontology.
4
+ * @category AI
5
+ */
6
+ export type AiOntologyId = string;
7
+ /**
8
+ * Review state of an ontology relationship. Only accepted relationships reach models. Imports and generation save
9
+ * `accepted` rows; a row without `reviewedAt` and with a source other than `human` is unreviewed.
10
+ * @category AI
11
+ */
12
+ export type AiOntologyRelationshipStatus = 'suggested' | 'accepted' | 'rejected';
13
+ /**
14
+ * Where an ontology relationship came from. `declared` covers declared and manual schema associations.
15
+ * @category AI
16
+ */
17
+ export type AiOntologyRelationshipSource = 'declared' | 'inferred' | 'ai' | 'human';
18
+ /**
19
+ * How many rows one side of a relationship can match.
20
+ * @category AI
21
+ */
22
+ export type AiOntologyCardinality = 'ONE' | 'MANY';
23
+ /**
24
+ * One side of an ontology relationship.
25
+ * @category AI
26
+ */
27
+ export interface AiOntologyRelationshipEnd {
28
+ /** The integration that holds the table. */
29
+ integrationId: IntegrationId;
30
+ /** The table or collection name. */
31
+ table: string;
32
+ /** The columns or fields the side joins on, aligned by position with the other side's. */
33
+ columns: string[];
34
+ /** How many rows of this side match one row of the other side. */
35
+ cardinality: AiOntologyCardinality;
36
+ /** The navigation property of this side, used by semantic-layer integrations. */
37
+ propertyName?: string;
38
+ }
39
+ /**
40
+ * Limits a relationship to rows where a column holds one value.
41
+ * @category AI
42
+ */
43
+ export interface AiOntologyRelationshipCondition {
44
+ /** The column that is tested. */
45
+ field: string;
46
+ /** The value the column holds. */
47
+ value: string | number | boolean;
48
+ }
49
+ /**
50
+ * Two columns, one on each side of a relationship.
51
+ * @category AI
52
+ */
53
+ export interface AiOntologyColumnPair {
54
+ /** A column of the referencing side's table. */
55
+ fromColumn: string;
56
+ /** A column of the referenced side's table. */
57
+ toColumn: string;
58
+ }
59
+ /**
60
+ * The outcome of the last run that generated relationships, business entities or properties, or refreshed the
61
+ * knowledge bases.
62
+ * @category AI
63
+ */
64
+ export interface AiOntologyGenerationRun {
65
+ /** Whether the run is still going, finished or failed. */
66
+ status: 'running' | 'completed' | 'failed';
67
+ /** Start time in epoch milliseconds. */
68
+ startedAt: number;
69
+ /** End time in epoch milliseconds. */
70
+ endedAt?: number;
71
+ /** How many relationships the run added. A run only adds: it never removes a stored row. */
72
+ relationshipsAdded: number;
73
+ /**
74
+ * How many unreviewed imported relationships labelled with their association name the run gave a business label. It
75
+ * changes nothing else of a stored row.
76
+ */
77
+ relationshipsRenamed?: number;
78
+ /** How many business entities the run added. */
79
+ entitiesAdded: number;
80
+ /** How many properties the run added. */
81
+ propertiesAdded: number;
82
+ /** Things the run left out. */
83
+ warnings: string[];
84
+ /** The failure, when the run failed. */
85
+ error?: string;
86
+ }
87
+ /**
88
+ * A named ontology: databases, the relationships between their tables and the business entities those tables hold.
89
+ * @category AI
90
+ */
91
+ export interface AiOntology {
92
+ /** Unique id of the ontology. */
93
+ id: AiOntologyId;
94
+ /** Name of the ontology. */
95
+ name: string;
96
+ /** What the ontology describes. */
97
+ description: string;
98
+ /** The databases attached to the ontology. */
99
+ integrationIds: IntegrationId[];
100
+ /** The knowledge bases attached to the ontology, each with a knowledge graph. */
101
+ knowledgeBaseIds: AiKnowledgeBaseId[];
102
+ /** The last run that generated relationships, business entities or properties. */
103
+ lastGenerationRun?: AiOntologyGenerationRun;
104
+ /** Number of accepted relationships. Set only on the ontologies of a list. */
105
+ acceptedRelationshipCount?: number;
106
+ /** Number of accepted business entities. Set only on the ontologies of a list. */
107
+ acceptedEntityCount?: number;
108
+ /** Creation time in epoch milliseconds. */
109
+ createdAt: number;
110
+ /** Last update time in epoch milliseconds. */
111
+ updatedAt: number;
112
+ }
113
+ /**
114
+ * A relationship between two tables of an ontology.
115
+ * @category AI
116
+ */
117
+ export interface AiOntologyRelationship {
118
+ /** Unique id of the relationship. */
119
+ id: string;
120
+ /** The ontology the relationship belongs to. */
121
+ ontologyId: AiOntologyId;
122
+ /** Identifies the link; a link written in either direction has one signature. */
123
+ signature: string;
124
+ /** The referencing side. */
125
+ from: AiOntologyRelationshipEnd;
126
+ /** The referenced side. */
127
+ to: AiOntologyRelationshipEnd;
128
+ /** Short verb phrase, such as "placed by". */
129
+ label: string;
130
+ /** What the relationship means. */
131
+ description?: string;
132
+ /** Review state. A row without `reviewedAt` and with a source other than `human` is unreviewed. */
133
+ status: AiOntologyRelationshipStatus;
134
+ /** Where the relationship came from. */
135
+ source: AiOntologyRelationshipSource;
136
+ /** From 0 to 1, when inference or a model proposed the relationship. */
137
+ confidence?: number;
138
+ /** Why the relationship was proposed. */
139
+ reasoning?: string;
140
+ /** Limits the relationship to rows where a column holds one value. */
141
+ condition?: AiOntologyRelationshipCondition;
142
+ /** How a query in the database's own language traverses the relationship. */
143
+ queryHint?: string;
144
+ /** The name of the schema association the relationship was imported from. */
145
+ associationName?: string;
146
+ /** The business entity a caller chose for the referencing side, as stored; it may since have become invalid. */
147
+ fromEntityId?: string;
148
+ /** The business entity a caller chose for the referenced side, as stored; it may since have become invalid. */
149
+ toEntityId?: string;
150
+ /**
151
+ * Output only: the entity of the referencing side on this read. The stored choice when it is still eligible, else
152
+ * none; with no choice stored, the only eligible entity that has the table as a member, else the only one that has it
153
+ * as a supporting table. An eligible entity is in the ontology, not rejected, and has the side's table as a member or
154
+ * a supporting table.
155
+ */
156
+ resolvedFromEntityId?: string;
157
+ /** Output only: the entity of the referenced side on this read, resolved as `resolvedFromEntityId` is. */
158
+ resolvedToEntityId?: string;
159
+ /** Column pairs whose values should agree once the join columns match; a record that differs is a possible match. */
160
+ confirmationColumns?: AiOntologyColumnPair[];
161
+ /** Creation time in epoch milliseconds. */
162
+ createdAt: number;
163
+ /** Last update time in epoch milliseconds. */
164
+ updatedAt: number;
165
+ /** Who accepted or rejected the relationship. The caller's claim, not an authenticated identity. */
166
+ reviewedBy?: string;
167
+ /** When the relationship was reviewed, in epoch milliseconds. */
168
+ reviewedAt?: number;
169
+ }
170
+ /**
171
+ * The editable fields of an ontology relationship.
172
+ * @category AI
173
+ */
174
+ export interface AiOntologyRelationshipInput {
175
+ /** The referencing side. Cardinality defaults to `MANY` in the service. */
176
+ from: AiOntologyRelationshipEnd;
177
+ /** The referenced side. Cardinality defaults to `ONE` in the service. */
178
+ to: AiOntologyRelationshipEnd;
179
+ /** Short verb phrase, such as "placed by". */
180
+ label: string;
181
+ /** What the relationship means. */
182
+ description?: string;
183
+ /**
184
+ * The entity of the referencing side: one of the ontology, not rejected, with the side's table as a member or a
185
+ * supporting table. On update an omitted value, or the stored one sent back, is kept without being checked again;
186
+ * `null` clears it. When the update moves the side to another table, a value sent is checked, and an omitted one
187
+ * the new table makes invalid is removed.
188
+ */
189
+ fromEntityId?: string | null;
190
+ /** The entity of the referenced side, set as `fromEntityId` is. */
191
+ toEntityId?: string | null;
192
+ /**
193
+ * Columns, at most `maxConfirmationColumnPairs` pairs, whose values should agree once the join columns match. Each
194
+ * column must exist in its side's table. On update an omitted value, or the stored pairs sent back while both sides
195
+ * stay, is kept without being checked again; `[]` clears them.
196
+ */
197
+ confirmationColumns?: AiOntologyColumnPair[];
198
+ }
199
+ /**
200
+ * Response that carries the ontologies of the application.
201
+ * @category AI
202
+ */
203
+ export interface ListAiOntologiesResponse {
204
+ /** The ontologies. */
205
+ ontologies: AiOntology[];
206
+ }
207
+ /**
208
+ * Request to get one ontology.
209
+ * @category AI
210
+ */
211
+ export interface GetAiOntologyRequest {
212
+ /** Id of the ontology. */
213
+ id: AiOntologyId;
214
+ }
215
+ /**
216
+ * Response to {@link GetAiOntologyRequest}.
217
+ * @category AI
218
+ */
219
+ export interface GetAiOntologyResponse {
220
+ /** The ontology, or undefined when it does not exist. */
221
+ ontology?: AiOntology;
222
+ }
223
+ /**
224
+ * Response that carries one ontology.
225
+ * @category AI
226
+ */
227
+ export interface AiOntologyResponse {
228
+ /** The ontology. */
229
+ ontology: AiOntology;
230
+ /** Things the request left out, such as imported relationships past the relationship limit. */
231
+ warnings: string[];
232
+ }
233
+ /**
234
+ * Request to create an ontology.
235
+ * @category AI
236
+ */
237
+ export interface CreateAiOntologyRequest {
238
+ /** Name of the ontology. */
239
+ name: string;
240
+ /** What the ontology describes. */
241
+ description?: string;
242
+ /** The databases to attach. */
243
+ integrationIds?: IntegrationId[];
244
+ /**
245
+ * The knowledge bases to attach, at most `maxKnowledgeBasesPerOntology`. Each must have a knowledge graph whose topics
246
+ * every caller may read (`ONTOLOGY_KNOWLEDGE_BASE_HAS_NO_GRAPH`: no graph, or document-level security on an external
247
+ * source) and no enforced access control (`ONTOLOGY_KNOWLEDGE_BASE_ACCESS_RESTRICTED`).
248
+ */
249
+ knowledgeBaseIds?: AiKnowledgeBaseId[];
250
+ }
251
+ /**
252
+ * Request to update an ontology. It replaces the name, the description, the attached databases and, when given, the
253
+ * attached knowledge bases.
254
+ * @category AI
255
+ */
256
+ export interface UpdateAiOntologyRequest {
257
+ /** Id of the ontology. */
258
+ id: AiOntologyId;
259
+ /** Name of the ontology. */
260
+ name: string;
261
+ /** What the ontology describes. */
262
+ description: string;
263
+ /** The databases to attach. */
264
+ integrationIds: IntegrationId[];
265
+ /**
266
+ * The knowledge bases to attach, as in {@link CreateAiOntologyRequest}. Omitted keeps the attached ones. A detached
267
+ * knowledge base loses what the ontology stored about it.
268
+ */
269
+ knowledgeBaseIds?: AiKnowledgeBaseId[];
270
+ }
271
+ /**
272
+ * Request to delete an ontology with its relationships, entities and properties.
273
+ * @category AI
274
+ */
275
+ export interface DeleteAiOntologyRequest {
276
+ /** Id of the ontology. */
277
+ id: AiOntologyId;
278
+ }
279
+ /**
280
+ * Request to list the relationships of an ontology.
281
+ * @category AI
282
+ */
283
+ export interface ListAiOntologyRelationshipsRequest {
284
+ /** Id of the ontology. */
285
+ ontologyId: AiOntologyId;
286
+ /** Returns only relationships in this state. */
287
+ status?: AiOntologyRelationshipStatus;
288
+ }
289
+ /**
290
+ * Response to {@link ListAiOntologyRelationshipsRequest}.
291
+ * @category AI
292
+ */
293
+ export interface ListAiOntologyRelationshipsResponse {
294
+ /** The matching relationships. */
295
+ relationships: AiOntologyRelationship[];
296
+ }
297
+ /**
298
+ * Whether a linked row agrees with its starting record on the relationship's confirmation columns. Dates and
299
+ * timestamps agree when they fall on the same calendar day; the time of day is ignored.
300
+ * @category AI
301
+ */
302
+ export type AiOntologyFollowMatch = 'confirmed' | 'mismatch' | 'unverifiable' | 'unchecked';
303
+ /**
304
+ * A comparison a followed relationship applies to the linked rows.
305
+ * @category AI
306
+ */
307
+ export type AiOntologyFollowFilterOperator = 'eq' | 'in' | 'gt' | 'gte' | 'lt' | 'lte';
308
+ /**
309
+ * Keeps only the linked rows whose column satisfies the comparison. A date or timestamp compares by calendar day,
310
+ * ignoring the time of day.
311
+ * @category AI
312
+ */
313
+ export interface AiOntologyFollowFilter {
314
+ /** The linked column that is tested. */
315
+ column: string;
316
+ /** How the column is compared with the value. */
317
+ operator: AiOntologyFollowFilterOperator;
318
+ /** The value to compare with; an array for `in`. */
319
+ value: unknown;
320
+ }
321
+ /**
322
+ * Two columns, one in the starting table and one in the linked table.
323
+ * @category AI
324
+ */
325
+ export interface AiOntologyFollowColumnPair {
326
+ /** A column of the starting table. */
327
+ startColumn: string;
328
+ /** A column of the linked table. */
329
+ linkedColumn: string;
330
+ }
331
+ /**
332
+ * A confirmation pair whose two values differ.
333
+ * @category AI
334
+ */
335
+ export interface AiOntologyFollowMismatch extends AiOntologyFollowColumnPair {
336
+ /** The value in the starting record. */
337
+ startValue: unknown;
338
+ /** The value in the linked row. */
339
+ linkedValue: unknown;
340
+ }
341
+ /**
342
+ * One linked row of a followed relationship.
343
+ * @category AI
344
+ */
345
+ export interface AiOntologyFollowRow {
346
+ /** Whether the row agrees with its starting record on the confirmation columns. */
347
+ match: AiOntologyFollowMatch;
348
+ /** The returned columns of the linked row. */
349
+ values: Record<string, unknown>;
350
+ /** The confirmation pairs that differ; set only when `match` is `mismatch`. */
351
+ mismatches?: AiOntologyFollowMismatch[];
352
+ }
353
+ /**
354
+ * The row count and column sums of the linked rows with one match.
355
+ * @category AI
356
+ */
357
+ export interface AiOntologyFollowTotals {
358
+ /** The number of linked rows. */
359
+ count: number;
360
+ /** The sum of each requested column. */
361
+ sums: Record<string, number>;
362
+ }
363
+ /**
364
+ * Request to follow a relationship from rows of one of its tables to the rows on the other side.
365
+ * @category AI
366
+ */
367
+ export interface FollowAiOntologyRelationshipRequest {
368
+ /** The ontology the relationship belongs to. */
369
+ ontologyId: AiOntologyId;
370
+ /** The id or the label of the relationship. */
371
+ relationship: string;
372
+ /** The table to start from, as `<integrationId>.<table>`. */
373
+ startTable: string;
374
+ /** The column of the starting table that holds the values. */
375
+ startColumn: string;
376
+ /** The values that pick the starting records. */
377
+ startValues: Array<string | number | boolean>;
378
+ /** The side of the relationship the starting table is; required when both sides are one table. */
379
+ startSide?: 'from' | 'to';
380
+ /** The linked columns to return; all visible ones when omitted. */
381
+ columns?: string[];
382
+ /** Keeps only the linked rows that satisfy every filter. */
383
+ filters?: AiOntologyFollowFilter[];
384
+ /** The linked columns to sum per match. */
385
+ sum?: string[];
386
+ }
387
+ /**
388
+ * Response to {@link FollowAiOntologyRelationshipRequest}.
389
+ * @category AI
390
+ */
391
+ export interface FollowAiOntologyRelationshipResponse {
392
+ /** The id of the followed relationship. */
393
+ relationshipId: string;
394
+ /** The label of the followed relationship. */
395
+ label: string;
396
+ /** The table the records started from, as `<integrationId>.<table>`. */
397
+ startTable: string;
398
+ /** The table the rows were read from, as `<integrationId>.<table>`. */
399
+ linkedTable: string;
400
+ /** The columns the two tables were joined on. */
401
+ matchedOn: AiOntologyFollowColumnPair[];
402
+ /** The confirmation pairs that were read. */
403
+ confirmedOn: AiOntologyFollowColumnPair[];
404
+ /** The number of confirmation pairs that were not read because a column is hidden. */
405
+ hiddenConfirmationPairs: number;
406
+ /** The condition of the relationship, if it has one. */
407
+ condition?: AiOntologyRelationshipCondition;
408
+ /** The number of starting records found. */
409
+ startingRecords: number;
410
+ /** Row counts and sums per match, over every linked row that passed the filters, not only the returned ones. */
411
+ totalsByMatch: Partial<Record<AiOntologyFollowMatch, AiOntologyFollowTotals>>;
412
+ /** Whether the totals cover only confirmed rows or every row read. */
413
+ totalsCover: 'confirmed' | 'unchecked';
414
+ /** The linked rows, up to the returned-rows limit. */
415
+ rows: AiOntologyFollowRow[];
416
+ /** True when more linked rows matched than `rows` holds. A read over a cap fails, it does not truncate. */
417
+ truncated: boolean;
418
+ /** A short note for the reader on how to interpret the result. */
419
+ note: string;
420
+ }
421
+ /**
422
+ * Request to create an accepted relationship by hand.
423
+ * @category AI
424
+ */
425
+ export interface CreateAiOntologyRelationshipRequest extends AiOntologyRelationshipInput {
426
+ /** Id of the ontology. */
427
+ ontologyId: AiOntologyId;
428
+ /** The caller's claim of who they are, not an authenticated identity. */
429
+ actor?: string;
430
+ }
431
+ /**
432
+ * Request to update a relationship. It replaces the sides, label and description; an omitted `fromEntityId`,
433
+ * `toEntityId` or `confirmationColumns`, or one sent back as stored, keeps its stored value, except an entity id whose
434
+ * side moves to another table: see `fromEntityId`.
435
+ * @category AI
436
+ */
437
+ export interface UpdateAiOntologyRelationshipRequest extends AiOntologyRelationshipInput {
438
+ /** Id of the relationship. */
439
+ id: string;
440
+ }
441
+ /**
442
+ * Response that carries one relationship.
443
+ * @category AI
444
+ */
445
+ export interface AiOntologyRelationshipResponse {
446
+ /** The relationship. */
447
+ relationship: AiOntologyRelationship;
448
+ }
449
+ /**
450
+ * Request to delete a relationship.
451
+ * @category AI
452
+ */
453
+ export interface DeleteAiOntologyRelationshipRequest {
454
+ /** Id of the relationship. */
455
+ id: string;
456
+ }
457
+ /**
458
+ * Request to accept, reject or reset a relationship.
459
+ * @category AI
460
+ */
461
+ export interface ReviewAiOntologyRelationshipRequest {
462
+ /** Id of the relationship. */
463
+ id: string;
464
+ /**
465
+ * The decision. `reset` returns the relationship to suggested and clears `reviewedAt`, so the next import may refresh
466
+ * or delete an imported row.
467
+ */
468
+ decision: 'accept' | 'reject' | 'reset';
469
+ /** The caller's claim of who they are, not an authenticated identity. */
470
+ actor?: string;
471
+ }
472
+ /**
473
+ * Where a business entity came from.
474
+ * @category AI
475
+ */
476
+ export type AiOntologyEntitySource = 'ai' | 'human';
477
+ /**
478
+ * A table that holds the master records of a business entity, one row per real-world thing.
479
+ * @category AI
480
+ */
481
+ export interface AiOntologyEntityMember {
482
+ /** The integration that holds the table. */
483
+ integrationId: IntegrationId;
484
+ /** The table or collection name. */
485
+ table: string;
486
+ /** The columns that identify the thing; members of one entity are matched on them. */
487
+ keyColumns: string[];
488
+ }
489
+ /**
490
+ * What a supporting table holds about its entity: `detail` is child rows such as order lines, `link` maps the entity
491
+ * to another one, `measurement` is metrics over time, `lookup` is a small code or status table.
492
+ * @category AI
493
+ */
494
+ export declare const AI_ONTOLOGY_SUPPORTING_TABLE_KINDS: readonly ["detail", "link", "measurement", "lookup"];
495
+ /**
496
+ * The kind of a supporting table.
497
+ * @category AI
498
+ */
499
+ export type AiOntologySupportingTableKind = (typeof AI_ONTOLOGY_SUPPORTING_TABLE_KINDS)[number];
500
+ /**
501
+ * A table that holds more rows about a business entity, such as the lines of an order.
502
+ * @category AI
503
+ */
504
+ export interface AiOntologySupportingTable {
505
+ /** The integration that holds the table. */
506
+ integrationId: IntegrationId;
507
+ /** The table or collection name. */
508
+ table: string;
509
+ /** What the table holds about the entity. */
510
+ kind: AiOntologySupportingTableKind;
511
+ }
512
+ /**
513
+ * A business concept, such as Customer, with the tables that hold its master records.
514
+ * @category AI
515
+ */
516
+ export interface AiOntologyEntity {
517
+ /** Unique id of the entity. */
518
+ id: string;
519
+ /** The ontology the entity belongs to. */
520
+ ontologyId: AiOntologyId;
521
+ /** Name of the entity, unique in the ontology regardless of letter case. */
522
+ name: string;
523
+ /** What the entity means to the business. */
524
+ description: string;
525
+ /** The tables that hold the entity, most authoritative first. */
526
+ members: AiOntologyEntityMember[];
527
+ /**
528
+ * The tables around the members that hold more rows about the entity. A table hidden from agents may be listed; an
529
+ * agent that cannot read one of the tables sees the entity without its description.
530
+ */
531
+ supportingTables?: AiOntologySupportingTable[];
532
+ /** Review state. A row without `reviewedAt` and with a source other than `human` is unreviewed. */
533
+ status: AiOntologyRelationshipStatus;
534
+ /** Where the entity came from. */
535
+ source: AiOntologyEntitySource;
536
+ /** Why the entity was proposed. */
537
+ reasoning?: string;
538
+ /** Creation time in epoch milliseconds. */
539
+ createdAt: number;
540
+ /** Last update time in epoch milliseconds. */
541
+ updatedAt: number;
542
+ /** Who accepted or rejected the entity. The caller's claim, not an authenticated identity. */
543
+ reviewedBy?: string;
544
+ /** When the entity was reviewed, in epoch milliseconds. */
545
+ reviewedAt?: number;
546
+ }
547
+ /**
548
+ * The editable fields of a business entity.
549
+ * @category AI
550
+ */
551
+ export interface AiOntologyEntityInput {
552
+ /** Name of the entity. */
553
+ name: string;
554
+ /** What the entity means to the business. */
555
+ description: string;
556
+ /** The tables that hold the entity, most authoritative first. */
557
+ members: AiOntologyEntityMember[];
558
+ /** The supporting tables. When omitted on update the stored list is kept; an empty list clears it. */
559
+ supportingTables?: AiOntologySupportingTable[];
560
+ }
561
+ /**
562
+ * Request to list the business entities of an ontology.
563
+ * @category AI
564
+ */
565
+ export interface ListAiOntologyEntitiesRequest {
566
+ /** Id of the ontology. */
567
+ ontologyId: AiOntologyId;
568
+ /** Returns only entities in this state. */
569
+ status?: AiOntologyRelationshipStatus;
570
+ }
571
+ /**
572
+ * Response to {@link ListAiOntologyEntitiesRequest}.
573
+ * @category AI
574
+ */
575
+ export interface ListAiOntologyEntitiesResponse {
576
+ /** The matching entities. */
577
+ entities: AiOntologyEntity[];
578
+ }
579
+ /**
580
+ * Request to create an accepted business entity by hand.
581
+ * @category AI
582
+ */
583
+ export interface CreateAiOntologyEntityRequest extends AiOntologyEntityInput {
584
+ /** Id of the ontology. */
585
+ ontologyId: AiOntologyId;
586
+ /** The caller's claim of who they are, not an authenticated identity. */
587
+ actor?: string;
588
+ }
589
+ /**
590
+ * Request to update a business entity. It replaces the name, the description and the members.
591
+ * @category AI
592
+ */
593
+ export interface UpdateAiOntologyEntityRequest extends AiOntologyEntityInput {
594
+ /** Id of the entity. */
595
+ id: string;
596
+ }
597
+ /**
598
+ * Response that carries one business entity.
599
+ * @category AI
600
+ */
601
+ export interface AiOntologyEntityResponse {
602
+ /** The entity. */
603
+ entity: AiOntologyEntity;
604
+ }
605
+ /**
606
+ * Request to delete a business entity with its properties.
607
+ * @category AI
608
+ */
609
+ export interface DeleteAiOntologyEntityRequest {
610
+ /** Id of the entity. */
611
+ id: string;
612
+ }
613
+ /**
614
+ * Request to accept, reject or reset a business entity.
615
+ * @category AI
616
+ */
617
+ export interface ReviewAiOntologyEntityRequest {
618
+ /** Id of the entity. */
619
+ id: string;
620
+ /** The decision. `reset` returns the entity to suggested and clears `reviewedAt`. */
621
+ decision: ReviewAiOntologyRelationshipRequest['decision'];
622
+ /** The caller's claim of who they are, not an authenticated identity. */
623
+ actor?: string;
624
+ }
625
+ /**
626
+ * The value type of an entity property.
627
+ * @category AI
628
+ */
629
+ export type AiOntologyPropertyType = 'string' | 'number' | 'date' | 'boolean' | 'id';
630
+ /**
631
+ * What an entity property's values reveal: `pii` identifies a person, `phi` is health information and `confidential`
632
+ * is sensitive to the business. Advisory: Squid stores and shows it and enforces nothing on it.
633
+ * @category AI
634
+ */
635
+ export type AiOntologyPropertySensitivity = 'pii' | 'phi' | 'confidential';
636
+ /**
637
+ * The column that holds an entity property in one member or supporting table of its entity. A source on a supporting
638
+ * table is the property's only source (`ONTOLOGY_PROPERTY_SUPPORTING_SOURCE_ALONE`).
639
+ * @category AI
640
+ */
641
+ export interface AiOntologyPropertySource {
642
+ /** The integration that holds the table. */
643
+ integrationId: IntegrationId;
644
+ /** A member or supporting table of the entity. */
645
+ table: string;
646
+ /** The column that holds the property. */
647
+ column: string;
648
+ }
649
+ /**
650
+ * A named, typed business field of an entity, such as `date_of_birth`, with the column that holds it in each member
651
+ * table that has it.
652
+ * @category AI
653
+ */
654
+ export interface AiOntologyProperty {
655
+ /** Unique id of the property. */
656
+ id: string;
657
+ /** The ontology the property belongs to. */
658
+ ontologyId: AiOntologyId;
659
+ /** The entity the property belongs to. */
660
+ entityId: string;
661
+ /** Name of the property in snake_case, unique in its entity. */
662
+ name: string;
663
+ /** What the property means to the business; may be empty. */
664
+ description: string;
665
+ /** The value type. */
666
+ type: AiOntologyPropertyType;
667
+ /**
668
+ * The columns that hold the property, at most one per member or supporting table. A source on a supporting table is
669
+ * the only source (`ONTOLOGY_PROPERTY_SUPPORTING_SOURCE_ALONE`).
670
+ */
671
+ sources: AiOntologyPropertySource[];
672
+ /** More columns a generation run found for a reviewed or edited property; unused until an update moves them. */
673
+ suggestedSources?: AiOntologyPropertySource[];
674
+ /** What the values reveal; absent means unclassified, not safe. */
675
+ sensitivity?: AiOntologyPropertySensitivity;
676
+ /** `false` keeps the property from agents and AI queries; absent means visible. */
677
+ agentVisible?: boolean;
678
+ /** Review state. A row without `reviewedAt` and with a source other than `human` is unreviewed. */
679
+ status: AiOntologyRelationshipStatus;
680
+ /** Where the property came from. */
681
+ source: 'ai' | 'human';
682
+ /** Why the property was proposed. */
683
+ reasoning?: string;
684
+ /** Creation time in epoch milliseconds. */
685
+ createdAt: number;
686
+ /** Last update time in epoch milliseconds. */
687
+ updatedAt: number;
688
+ /** Who accepted or rejected the property. The caller's claim, not an authenticated identity. */
689
+ reviewedBy?: string;
690
+ /** When the property was reviewed, in epoch milliseconds. */
691
+ reviewedAt?: number;
692
+ }
693
+ /**
694
+ * Request to list the properties of an ontology.
695
+ * @category AI
696
+ */
697
+ export interface ListAiOntologyPropertiesRequest {
698
+ /** Id of the ontology. */
699
+ ontologyId: AiOntologyId;
700
+ /** Returns only the properties of this entity. */
701
+ entityId?: string;
702
+ /** Returns only properties in this state. */
703
+ status?: AiOntologyRelationshipStatus;
704
+ }
705
+ /**
706
+ * Response to {@link ListAiOntologyPropertiesRequest}.
707
+ * @category AI
708
+ */
709
+ export interface ListAiOntologyPropertiesResponse {
710
+ /** The matching properties. */
711
+ properties: AiOntologyProperty[];
712
+ }
713
+ /**
714
+ * Request to create a property of a business entity.
715
+ * @category AI
716
+ */
717
+ export interface CreateAiOntologyPropertyRequest {
718
+ /** Id of the entity. */
719
+ entityId: string;
720
+ /** Name of the property in snake_case. */
721
+ name: string;
722
+ /** What the property means to the business. */
723
+ description?: string;
724
+ /** The value type. */
725
+ type: AiOntologyPropertyType;
726
+ /**
727
+ * The columns that hold the property, at most one per member or supporting table. A source on a supporting table is
728
+ * the only source (`ONTOLOGY_PROPERTY_SUPPORTING_SOURCE_ALONE`).
729
+ */
730
+ sources: AiOntologyPropertySource[];
731
+ /** What the values reveal. */
732
+ sensitivity?: AiOntologyPropertySensitivity;
733
+ /** `false` keeps the property from agents and AI queries. */
734
+ agentVisible?: boolean;
735
+ /** Review state. Defaults to `accepted`. An accepted or rejected property is stored as reviewed. */
736
+ status?: AiOntologyRelationshipStatus;
737
+ /** Where the property came from. Defaults to `human`. */
738
+ source?: 'ai' | 'human';
739
+ }
740
+ /**
741
+ * Request to update a property. It replaces the name, description, type and sources; an omitted `sensitivity` or
742
+ * `agentVisible` keeps its stored value.
743
+ * @category AI
744
+ */
745
+ export interface UpdateAiOntologyPropertyRequest {
746
+ /** Id of the property. */
747
+ id: string;
748
+ /** Name of the property in snake_case. */
749
+ name: string;
750
+ /** What the property means to the business. */
751
+ description?: string;
752
+ /** The value type. */
753
+ type: AiOntologyPropertyType;
754
+ /**
755
+ * The columns that hold the property, at most one per member or supporting table. A source the property already
756
+ * stores is kept as stored, even when its table has left the entity or its column is hidden; a new one must be a
757
+ * visible column of a member or supporting table. A source on a supporting table is the only source
758
+ * (`ONTOLOGY_PROPERTY_SUPPORTING_SOURCE_ALONE`).
759
+ */
760
+ sources: AiOntologyPropertySource[];
761
+ /** What the values reveal. Omitted keeps the stored value; `null` clears it. */
762
+ sensitivity?: AiOntologyPropertySensitivity | null;
763
+ /** `false` keeps the property from agents and AI queries. Omitted keeps the stored value. */
764
+ agentVisible?: boolean;
765
+ }
766
+ /**
767
+ * Response that carries one property.
768
+ * @category AI
769
+ */
770
+ export interface AiOntologyPropertyResponse {
771
+ /** The property. */
772
+ property: AiOntologyProperty;
773
+ }
774
+ /**
775
+ * Request to delete a property.
776
+ * @category AI
777
+ */
778
+ export interface DeleteAiOntologyPropertyRequest {
779
+ /** Id of the property. */
780
+ id: string;
781
+ }
782
+ /**
783
+ * Request to accept, reject or reset properties.
784
+ * @category AI
785
+ */
786
+ export interface ReviewAiOntologyPropertiesRequest {
787
+ /** Ids of the properties. */
788
+ ids: string[];
789
+ /** The decision. `reset` returns the properties to suggested and clears `reviewedAt`. */
790
+ decision: ReviewAiOntologyRelationshipRequest['decision'];
791
+ /** The caller's claim of who they are, not an authenticated identity. */
792
+ actor?: string;
793
+ }
794
+ /**
795
+ * Response to {@link ReviewAiOntologyPropertiesRequest}.
796
+ * @category AI
797
+ */
798
+ export interface ReviewAiOntologyPropertiesResponse {
799
+ /** The properties the review changed. */
800
+ changed: AiOntologyProperty[];
801
+ /** The properties left as they were, with the reason. */
802
+ skipped: Array<{
803
+ id: string;
804
+ reason: string;
805
+ }>;
806
+ }
807
+ /**
808
+ * Request to generate the relationships, business entities and properties of an ontology. Answered by
809
+ * {@link AiOntologyResponse}.
810
+ * @category AI
811
+ */
812
+ export interface GenerateAiOntologyRequest {
813
+ /** Id of the ontology. */
814
+ ontologyId: AiOntologyId;
815
+ /** The status the run saves what it generates with. Defaults to `accepted`. */
816
+ saveAs?: AiOntologyGenerationSaveStatus;
817
+ }
818
+ /**
819
+ * Request to generate only the properties of business entities of an ontology. Answered by
820
+ * {@link AiOntologyResponse}.
821
+ * @category AI
822
+ */
823
+ export interface GenerateAiOntologyPropertiesRequest {
824
+ /** Id of the ontology. */
825
+ ontologyId: AiOntologyId;
826
+ /** The entities to generate properties for, 1 to 50. Default: the entities that have no property yet. */
827
+ entityIds?: string[];
828
+ /** The status the run saves the properties with. Defaults to `accepted`. */
829
+ saveAs?: AiOntologyGenerationSaveStatus;
830
+ }
831
+ /**
832
+ * Request to refresh what an ontology stores about its attached knowledge bases, in a run of its own that stores what
833
+ * it reads. Answered by {@link AiOntologyResponse}.
834
+ * @category AI
835
+ */
836
+ export interface RefreshAiOntologyKnowledgeBasesRequest {
837
+ /** Id of the ontology. */
838
+ ontologyId: AiOntologyId;
839
+ }
840
+ /**
841
+ * The status a generation run saves what it generates with: `accepted` puts it to use at once, `suggested` keeps it
842
+ * from agents until a review accepts it.
843
+ * @category AI
844
+ */
845
+ export type AiOntologyGenerationSaveStatus = 'accepted' | 'suggested';
846
+ /**
847
+ * A root topic of the knowledge graph of an attached knowledge base.
848
+ * @category AI
849
+ */
850
+ export interface AiOntologyKnowledgeBaseTopic {
851
+ /** Name of the topic. */
852
+ name: string;
853
+ /** What the topic covers, cut to `maxKnowledgeBaseTopicDescriptionLength`. */
854
+ description?: string;
855
+ /** How many documents the topic holds. */
856
+ docCount: number;
857
+ }
858
+ /**
859
+ * A business entity whose records the documents of a topic of a knowledge base are about.
860
+ * @category AI
861
+ */
862
+ export interface AiOntologyKnowledgeBaseTopicLink {
863
+ /** Name of a topic of the record; it identifies the topic inside its knowledge base, since topic ids change. */
864
+ topicName: string;
865
+ /** Id of the entity. */
866
+ entityId: string;
867
+ /** Why the model linked them; absent on a link a person added. */
868
+ reasoning?: string;
869
+ }
870
+ /**
871
+ * What an ontology stores about one attached knowledge base. A refresh replaces the summary and topics, and the topic
872
+ * links until a person edits them.
873
+ * @category AI
874
+ */
875
+ export interface AiOntologyKnowledgeBase {
876
+ /** The ontology. */
877
+ ontologyId: AiOntologyId;
878
+ /** The knowledge base. */
879
+ knowledgeBaseId: AiKnowledgeBaseId;
880
+ /** What the documents cover, written by a model; empty before the first summary. */
881
+ summary: string;
882
+ /** The root topics of the knowledge graph, most documents first. */
883
+ topics: AiOntologyKnowledgeBaseTopic[];
884
+ /**
885
+ * The business entities each topic's documents are about. Only links whose topic is in `topics` and whose entity
886
+ * exists are returned, so a refresh that replaces the topics drops the links of topics that are gone.
887
+ */
888
+ topicLinks: AiOntologyKnowledgeBaseTopicLink[];
889
+ /** When the last refresh started reading the topics, in epoch milliseconds. */
890
+ refreshedAt: number;
891
+ /** When a person last set the links, in epoch milliseconds; later runs then leave the links alone. */
892
+ linksEditedAt?: number;
893
+ /** Why the last refresh left something as it was. */
894
+ warning?: string;
895
+ }
896
+ /**
897
+ * Request to list what an ontology stores about its attached knowledge bases.
898
+ * @category AI
899
+ */
900
+ export interface ListAiOntologyKnowledgeBasesRequest {
901
+ /** Id of the ontology. */
902
+ ontologyId: AiOntologyId;
903
+ }
904
+ /**
905
+ * Response to {@link ListAiOntologyKnowledgeBasesRequest}.
906
+ * @category AI
907
+ */
908
+ export interface ListAiOntologyKnowledgeBasesResponse {
909
+ /** One record per attached knowledge base a generation run has read, in attached order. */
910
+ knowledgeBases: AiOntologyKnowledgeBase[];
911
+ }
912
+ /**
913
+ * Request to set the topic links of an attached knowledge base. Later refreshes keep these links.
914
+ * @category AI
915
+ */
916
+ export interface UpdateAiOntologyKnowledgeBaseRequest {
917
+ /** Id of the ontology. */
918
+ ontologyId: AiOntologyId;
919
+ /** Id of an attached knowledge base that a refresh has read. */
920
+ knowledgeBaseId: AiKnowledgeBaseId;
921
+ /**
922
+ * The links, at most `maxKnowledgeBaseTopicLinks` and `maxEntitiesPerKnowledgeBaseTopic` per topic: each names a
923
+ * topic of the record and an entity of the ontology. An empty list clears the links.
924
+ */
925
+ topicLinks: Array<Pick<AiOntologyKnowledgeBaseTopicLink, 'topicName' | 'entityId'>>;
926
+ }
927
+ /**
928
+ * Response that carries what an ontology stores about one knowledge base.
929
+ * @category AI
930
+ */
931
+ export interface AiOntologyKnowledgeBaseResponse {
932
+ /** The record of the knowledge base. */
933
+ knowledgeBase: AiOntologyKnowledgeBase;
934
+ }
935
+ /**
936
+ * Request to delete every relationship, business entity and property of an ontology, and what it stores about its
937
+ * knowledge bases, keeping the ontology with its databases and knowledge bases.
938
+ * @category AI
939
+ */
940
+ export interface ResetAiOntologyRequest {
941
+ /** Id of the ontology. */
942
+ id: AiOntologyId;
943
+ }
944
+ /**
945
+ * Size limits of an ontology.
946
+ * @category AI
947
+ */
948
+ export declare const AI_ONTOLOGY_LIMITS: {
949
+ readonly maxOntologies: 1000;
950
+ readonly maxIntegrationsPerOntology: 20;
951
+ readonly maxRelationships: 2000;
952
+ readonly maxEntities: 500;
953
+ readonly maxMembersPerEntity: 20;
954
+ readonly maxSupportingTablesPerEntity: 50;
955
+ readonly maxNameLength: 100;
956
+ readonly maxDescriptionLength: 2000;
957
+ readonly maxGeneratedDescriptionLength: 500;
958
+ readonly maxLabelLength: 200;
959
+ readonly maxReasoningLength: 2000;
960
+ readonly maxColumnsPerSide: 16;
961
+ readonly maxConfirmationColumnPairs: 10;
962
+ readonly maxActorLength: 200;
963
+ readonly maxTablesPerPrompt: 200;
964
+ readonly maxColumnsPerTableInPrompt: 100;
965
+ readonly maxToolCallsPerRun: 40;
966
+ readonly maxSampleCallsPerPropertyPass: 8;
967
+ readonly defaultSampleRows: 10;
968
+ readonly maxSampleRows: 20;
969
+ readonly maxSampleValueLength: 200;
970
+ readonly maxSampleAnswerLength: 12000;
971
+ readonly maxDescriptionLengthInPrompt: 300;
972
+ readonly maxPromptChars: 300000;
973
+ readonly maxPropertiesPerEntity: 100;
974
+ readonly maxPropertiesPerOntology: 2000;
975
+ readonly maxPropertySources: 20;
976
+ readonly maxPropertyDescriptionLength: 500;
977
+ readonly maxReviewedPropertiesPerCall: 200;
978
+ readonly maxEntitiesPerPropertyPass: 5;
979
+ readonly maxGeneratedPropertiesPerEntity: 30;
980
+ readonly maxEntitiesPerPropertyRun: 50;
981
+ readonly maxFollowStartValues: 100;
982
+ readonly maxFollowStartRecords: 500;
983
+ readonly maxFollowKeyValues: 1000;
984
+ readonly maxFollowLinkedRows: 5000;
985
+ readonly maxFollowReturnedRows: 100;
986
+ readonly maxFollowAgentRowsChars: 30000;
987
+ readonly maxFollowLinkedReads: 5;
988
+ readonly maxKnowledgeBasesPerOntology: 5;
989
+ readonly maxKnowledgeBaseTopics: 20;
990
+ readonly maxKnowledgeBaseTopicDescriptionLength: 250;
991
+ readonly maxKnowledgeBaseSummaryLength: 500;
992
+ readonly maxKnowledgeBaseTopicLinks: 100;
993
+ readonly maxEntitiesPerKnowledgeBaseTopic: 5;
994
+ readonly maxKnowledgeBaseLinkReasoningLength: 300;
995
+ readonly maxMembersPerEntityInLinkPrompt: 5;
996
+ };
@@ -1,5 +1,6 @@
1
1
  import { AiAgentMemoryOptions, AiChatOptions, AiFileUrl, AiSessionContext } from './ai-agent.public-types';
2
2
  import { AiChatModelName } from './ai-common.public-types';
3
+ import { AiOntologyId } from './ai-ontology.public-types';
3
4
  import { ApiOptions } from './api-client.public-types';
4
5
  import { AiAgentId, IntegrationId } from './communication.public-types';
5
6
  import { JobId } from './job.public-types';
@@ -25,6 +26,12 @@ export interface AiQueryOptions {
25
26
  instructions?: string;
26
27
  /** Whether to enable raw results output. */
27
28
  enableRawResults?: boolean;
29
+ /**
30
+ * Replaces the relationships the query sees in this database with the accepted ones of this ontology, when the
31
+ * ontology attaches the database. Honored for any caller the query's security rules allow, since it only reshapes
32
+ * the joins of this one database. An agent's database tool uses the agent's own `ontologyId` in place of this value.
33
+ */
34
+ ontologyId?: AiOntologyId;
28
35
  /**
29
36
  * When the results are too large to analyze in the answer, skips the analysis and returns the raw results as
30
37
  * files instead, for a caller that processes them itself (e.g. an agent with `executePythonCode`). Default: false.
@@ -4,7 +4,7 @@
4
4
  * 'CONNECTOR_PACKAGES_TO_EXCLUDE_FROM_AUTO_SYNC' in ConnectorsService (console-backend).
5
5
  * @category Platform
6
6
  */
7
- export declare const CONNECTOR_IDS: readonly ["bigquery", "bitbucket", "cockroach", "confluence", "connect_companion", "cotomi", "databricks", "databricks_genie", "dynamodb", "elasticsearch", "elevenlabs", "openai_voice", "essentials", "freshdesk", "generic_site_ingester", "github", "google_calendar", "google_drive", "hubspot", "sharepoint", "jira", "jira_jsm", "legend", "linear", "mail", "mssql", "mysql", "onedrive", "oracledb", "outlook", "postgres", "salesforce", "salesforce_db", "servicenow_csm", "slack", "snowflake", "teams", "ticketmind_companion", "twilio", "zendesk"];
7
+ export declare const CONNECTOR_IDS: readonly ["azure_ai_search", "bigquery", "bitbucket", "cockroach", "confluence", "connect_companion", "cotomi", "databricks", "databricks_genie", "dynamodb", "elasticsearch", "elevenlabs", "openai_voice", "essentials", "freshdesk", "generic_site_ingester", "github", "google_calendar", "google_drive", "hubspot", "sharepoint", "jira", "jira_jsm", "legend", "linear", "mail", "mssql", "mysql", "onedrive", "oracledb", "outlook", "postgres", "salesforce", "salesforce_db", "servicenow_csm", "slack", "snowflake", "teams", "ticketmind_companion", "twilio", "zendesk"];
8
8
  /**
9
9
  * Unique connector package name.
10
10
  * @category Platform
@@ -10,6 +10,10 @@ export interface TriggerEvent<T = unknown> {
10
10
  type: string;
11
11
  /** Arbitrary, JSON-serializable event payload. */
12
12
  payload: T;
13
+ /** The integration the event came from. Agent automations bound to integrations match on it. */
14
+ integrationId?: string;
15
+ /** The prompt an agent automation listening to the event runs its agent with, in place of its default one. */
16
+ prompt?: string;
13
17
  }
14
18
  /** Request body for the `events/emit` core endpoint that publishes a `TriggerEvent`. */
15
19
  export interface EmitEventRequest<T = unknown> {
@@ -1,8 +1,11 @@
1
1
  import { HttpStatusCode } from '../public-types/http-status.public-types';
2
2
  import { JobId } from '../public-types/job.public-types';
3
3
  import { ConnectorId } from './connector.types';
4
- /** A role a worker plays apart from running the application's code. */
5
- export type WorkerRole = 'database';
4
+ /**
5
+ * A role a worker plays apart from running the application's code: `database` holds a database connector,
6
+ * `kbSource` a knowledge-base source connector.
7
+ */
8
+ export type WorkerRole = 'database' | 'kbSource';
6
9
  export interface AppRunConfiguration {
7
10
  /** List of enabled connectors packages. */
8
11
  connectors: Array<ConnectorRunConfiguration>;
@@ -56,10 +56,21 @@ export interface JiraJsmIntegrationConfiguration {
56
56
  requestHistoryDays?: number;
57
57
  }
58
58
  export interface GenericSiteIngesterIntegrationConfiguration {
59
- /** The ingestion mode. Only `'sitemap'` is implemented today. */
60
- type: 'sitemap';
61
- /** URL of the site's sitemap.xml, following the sitemaps.org protocol. */
62
- sitemapUrl: string;
59
+ /** The ingestion mode: discover pages from a sitemap, or by walking a paginated listing. */
60
+ type: 'sitemap' | 'pagination';
61
+ /** URL of the site's sitemap.xml, following the sitemaps.org protocol. Required for `type: 'sitemap'`. */
62
+ sitemapUrl?: string;
63
+ /** Listing URL containing a `{page}` placeholder, e.g. `https://example.com/blog/page/{page}`. Required for `type: 'pagination'`. */
64
+ paginationUrlTemplate?: string;
65
+ /**
66
+ * CSS selector of the element(s) on each listing page whose links are ingested. Pagination stops at
67
+ * the first page with no such links. Required for `type: 'pagination'`.
68
+ */
69
+ paginationLinkSelector?: string;
70
+ /** Value substituted for `{page}` on the first listing page. Defaults to 1. */
71
+ paginationStartPage?: number;
72
+ /** Maximum number of listing requests, including the final one that ends pagination; exceeding it fails the sync. Defaults to 200. */
73
+ paginationMaxPages?: number;
63
74
  /**
64
75
  * When true, pages are rendered in a headless browser before extraction, so client-side JavaScript
65
76
  * (SPAs, content hydrated after page load) runs and appears in the ingested text. Slower and more
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/jira-jsm-client",
3
- "version": "1.0.511",
3
+ "version": "1.0.512",
4
4
  "description": "Squid Jira Service Management Client - SDK for interacting with the JSM connector",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/jira-jsm-client/src/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "author": "",
25
25
  "license": "ISC",
26
26
  "dependencies": {
27
- "@squidcloud/client": "^1.0.511"
27
+ "@squidcloud/client": "^1.0.512"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=20.0.0"