@squidcloud/client 1.0.499 → 1.0.501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +23 -4
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +104 -13
- package/dist/internal-common/src/public-types/connector.public-types.d.ts +45 -0
- package/dist/typescript-client/src/admin-client.d.ts +1 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +2 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +3 -1
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +9 -7
- package/dist/typescript-client/src/integration-client.d.ts +14 -1
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/ai/system-openai-compatible.d.ts +0 -35
- package/dist/internal-common/src/metric-name.d.ts +0 -5
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -161
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -75
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -193
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -303
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -639
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -19
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/file.types.d.ts +0 -6
- package/dist/internal-common/src/types/headers.types.d.ts +0 -45
- package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/notification.types.d.ts +0 -19
- package/dist/internal-common/src/types/observability.types.d.ts +0 -296
- package/dist/internal-common/src/types/query.types.d.ts +0 -21
- package/dist/internal-common/src/types/secret.types.d.ts +0 -7
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/stage.d.ts +0 -9
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
- package/dist/internal-common/src/utils/array.d.ts +0 -7
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http-utils.d.ts +0 -15
- package/dist/internal-common/src/utils/http.d.ts +0 -4
- package/dist/internal-common/src/utils/integration-access-tokens.d.ts +0 -15
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -93
- package/dist/internal-common/src/utils/serialization.d.ts +0 -30
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -3
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -21
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -488,11 +488,28 @@ export interface BackupModelOptions {
|
|
|
488
488
|
/** Response length and detail level; supported by OpenAI models only. */
|
|
489
489
|
verbosity?: AiVerbosityLevel;
|
|
490
490
|
}
|
|
491
|
-
/**
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
/** Configures independent answer validation and bounded correction. @category AI */
|
|
492
|
+
export interface AiAnswerValidationOptions {
|
|
493
|
+
/** Judge model; defaults to the model that produced the initial answer. */
|
|
494
|
+
model?: AiChatModelSelection;
|
|
495
|
+
/** Additional acceptance criteria for the judge. */
|
|
496
|
+
instructions?: string;
|
|
497
|
+
/** Maximum answer attempts, including the initial answer. Defaults to 2; accepts 1–5. */
|
|
498
|
+
maxAttempts?: number;
|
|
499
|
+
}
|
|
500
|
+
/** Reports the judge's verdict for the returned answer. @category AI */
|
|
501
|
+
export interface AiAnswerValidationResult {
|
|
502
|
+
/** Whether the returned answer passed validation; false also covers incomplete validation. */
|
|
503
|
+
passed: boolean;
|
|
504
|
+
/** Concise explanation of the verdict or validation failure. */
|
|
505
|
+
summary: string;
|
|
506
|
+
/** Actionable defects or reasons validation could not complete. */
|
|
507
|
+
issues: Array<string>;
|
|
508
|
+
}
|
|
509
|
+
/** Shared options for agent chat requests. @category AI */
|
|
495
510
|
export interface BaseAiChatOptions {
|
|
511
|
+
/** Enables validation for non-CLI models; an empty object uses defaults. Judge read-only behavior is instruction-based. */
|
|
512
|
+
validation?: AiAnswerValidationOptions;
|
|
496
513
|
/**
|
|
497
514
|
* The maximum number of input tokens that Squid can use when making the request to the AI model.
|
|
498
515
|
* Defaults to the max tokens the model can accept.
|
|
@@ -1445,6 +1462,8 @@ export interface DeleteAgentRequest {
|
|
|
1445
1462
|
* @category AI
|
|
1446
1463
|
*/
|
|
1447
1464
|
export interface AiAskResponse {
|
|
1465
|
+
/** Judge verdict, present when answer validation is enabled. */
|
|
1466
|
+
validation?: AiAnswerValidationResult;
|
|
1448
1467
|
/** The response string from the agent */
|
|
1449
1468
|
responseString: string;
|
|
1450
1469
|
/** Optional annotations (e.g., file references) in the response */
|
|
@@ -1189,6 +1189,11 @@ export interface GeneratedMetadataFieldDescription {
|
|
|
1189
1189
|
export interface GetKnowledgeBaseGraphStatusRequest {
|
|
1190
1190
|
/** The id of the AiKnowledgeBase. */
|
|
1191
1191
|
knowledgeBaseId: AiKnowledgeBaseId;
|
|
1192
|
+
/**
|
|
1193
|
+
* Whether to include the topic table (`topics`, `topicEdges`). Default true. A poller that reads only the
|
|
1194
|
+
* build state can pass false: on a large graph the table runs to thousands of topics.
|
|
1195
|
+
*/
|
|
1196
|
+
includeTopics?: boolean;
|
|
1192
1197
|
}
|
|
1193
1198
|
/**
|
|
1194
1199
|
* Response structure for a knowledge base's GraphRAG build/readiness status. Drives the ai-eval
|
|
@@ -1552,17 +1557,20 @@ export interface RebuildKnowledgeBaseGraphRequest {
|
|
|
1552
1557
|
*/
|
|
1553
1558
|
ignoreActiveBulkJobs?: boolean;
|
|
1554
1559
|
}
|
|
1560
|
+
/** Hard ceiling on the nodes one graph explore returns: a larger `nodeLimit` is clamped down to this value. */
|
|
1561
|
+
export declare const KNOWLEDGE_BASE_GRAPH_EXPLORE_MAX_NODES = 1000;
|
|
1562
|
+
/** Longest `search` text a graph explore accepts; a longer one is rejected. */
|
|
1563
|
+
export declare const KNOWLEDGE_BASE_GRAPH_SEARCH_MAX_LENGTH = 200;
|
|
1555
1564
|
/**
|
|
1556
|
-
* Request structure for exploring a bounded subgraph of a knowledge base's graph (
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
* here once implemented.
|
|
1565
|
+
* Request structure for exploring a bounded subgraph of a knowledge base's graph (visualization). By default
|
|
1566
|
+
* it returns the highest-degree entities and the relationships among them; `topicId`, `entityId` and `search`
|
|
1567
|
+
* select other entity pools, and `contextMetadataFilter` narrows any of them.
|
|
1560
1568
|
* @category AI
|
|
1561
1569
|
*/
|
|
1562
1570
|
export interface ExploreKnowledgeBaseGraphRequest {
|
|
1563
1571
|
/** The id of the AiKnowledgeBase. */
|
|
1564
1572
|
knowledgeBaseId: AiKnowledgeBaseId;
|
|
1565
|
-
/** Hard cap on returned nodes. Default 200,
|
|
1573
|
+
/** Hard cap on returned nodes. Default 200, at most {@link KNOWLEDGE_BASE_GRAPH_EXPLORE_MAX_NODES}. */
|
|
1566
1574
|
nodeLimit?: number;
|
|
1567
1575
|
/**
|
|
1568
1576
|
* Restricts the subgraph to entities under the given topic node id — any hierarchy level; an entity
|
|
@@ -1570,6 +1578,30 @@ export interface ExploreKnowledgeBaseGraphRequest {
|
|
|
1570
1578
|
* `TOPIC_NOT_FOUND`. Ids come from {@link KnowledgeBaseGraphTopic.id} and churn on rebuild.
|
|
1571
1579
|
*/
|
|
1572
1580
|
topicId?: string;
|
|
1581
|
+
/**
|
|
1582
|
+
* Centers the subgraph on one entity: the entity plus its neighbors, strongest relationships first. Ids
|
|
1583
|
+
* come from {@link KnowledgeBaseGraphNode.id} and churn on rebuild; an unknown id fails with
|
|
1584
|
+
* `ENTITY_NOT_FOUND`. Cannot be combined with `topicId` or `search`.
|
|
1585
|
+
*/
|
|
1586
|
+
entityId?: string;
|
|
1587
|
+
/**
|
|
1588
|
+
* Finds entities by name: exact names and aliases first, then prefixes, then substrings, each by degree.
|
|
1589
|
+
* When no name matches, returns the entities nearest in meaning instead (`searchMatch: 'similar'`).
|
|
1590
|
+
* At most {@link KNOWLEDGE_BASE_GRAPH_SEARCH_MAX_LENGTH} characters. Cannot be combined with `topicId` or
|
|
1591
|
+
* `entityId`.
|
|
1592
|
+
*/
|
|
1593
|
+
search?: string;
|
|
1594
|
+
/**
|
|
1595
|
+
* Keeps only the entities mentioned by contexts matching the filter. Without `entityId` or `search`, they
|
|
1596
|
+
* are ranked by how many matching contexts mention them. Filters on context-record metadata only, not on
|
|
1597
|
+
* per-chunk keys.
|
|
1598
|
+
*/
|
|
1599
|
+
contextMetadataFilter?: AiContextMetadataFilter;
|
|
1600
|
+
/**
|
|
1601
|
+
* Whether to attach the topic table (`topics`). Default true. A caller that already holds it can pass false:
|
|
1602
|
+
* on a large graph the table runs to thousands of topics.
|
|
1603
|
+
*/
|
|
1604
|
+
includeTopics?: boolean;
|
|
1573
1605
|
}
|
|
1574
1606
|
/** A node in an {@link ExploreKnowledgeBaseGraphResponse}. @category AI */
|
|
1575
1607
|
export interface KnowledgeBaseGraphNode {
|
|
@@ -1608,14 +1640,32 @@ export interface KnowledgeBaseGraphEdge {
|
|
|
1608
1640
|
export interface ExploreKnowledgeBaseGraphResponse {
|
|
1609
1641
|
/** The subgraph nodes. */
|
|
1610
1642
|
nodes: Array<KnowledgeBaseGraphNode>;
|
|
1611
|
-
/**
|
|
1643
|
+
/**
|
|
1644
|
+
* The subgraph edges (outgoing only, both endpoints present in `nodes`). Capped: past the cap only the
|
|
1645
|
+
* heaviest are returned and {@link edgesTruncated} is set.
|
|
1646
|
+
*/
|
|
1612
1647
|
edges: Array<KnowledgeBaseGraphEdge>;
|
|
1648
|
+
/** True when the nodes are linked by more relationships than `edges` carries. */
|
|
1649
|
+
edgesTruncated?: boolean;
|
|
1613
1650
|
/**
|
|
1614
1651
|
* The KB's topic (theme) nodes — the id→name/hierarchy table for the nodes' `topicPath` ids, so a
|
|
1615
1652
|
* visualization can label and group by theme without extra round trips. Present when the concept
|
|
1616
|
-
* layer has been built (a rebuild ran).
|
|
1653
|
+
* layer has been built (a rebuild ran). Under `contextMetadataFilter`, `docCount` counts only the
|
|
1654
|
+
* matching contexts.
|
|
1617
1655
|
*/
|
|
1618
1656
|
topics?: Array<KnowledgeBaseGraphTopic>;
|
|
1657
|
+
/**
|
|
1658
|
+
* Size of the pool the subgraph was cut from — the entities in scope, the topic's members, the entity's
|
|
1659
|
+
* neighbors or the search matches. Compare with `nodes.length` to offer more. Absent when not counted.
|
|
1660
|
+
*/
|
|
1661
|
+
totalCount?: number;
|
|
1662
|
+
/** How a `search` matched: by entity name, or by meaning when no name matched. */
|
|
1663
|
+
searchMatch?: 'name' | 'similar';
|
|
1664
|
+
/**
|
|
1665
|
+
* True when `contextMetadataFilter` matched more contexts than one request reads; the subgraph then
|
|
1666
|
+
* covers only the first of them.
|
|
1667
|
+
*/
|
|
1668
|
+
scopeTruncated?: boolean;
|
|
1619
1669
|
}
|
|
1620
1670
|
/**
|
|
1621
1671
|
* A topic (theme) node of the graph's concept layer, as referenced by
|
|
@@ -1656,12 +1706,14 @@ export interface KnowledgeBaseGraphTopicEdge {
|
|
|
1656
1706
|
* round trip with a complete answer — no per-level walking.
|
|
1657
1707
|
* @category AI
|
|
1658
1708
|
*/
|
|
1659
|
-
export type KnowledgeBaseGraphQueryOp = 'overview' | 'resolve' | 'describe' | 'subtree' | 'docsUnder' | 'conceptsOf' | 'neighborhood' | 'pathBetween' | 'globalSummary';
|
|
1709
|
+
export type KnowledgeBaseGraphQueryOp = 'overview' | 'resolve' | 'describe' | 'subtree' | 'docsUnder' | 'conceptsOf' | 'neighborhood' | 'pathBetween' | 'globalSummary' | 'relationship';
|
|
1660
1710
|
/**
|
|
1661
1711
|
* Request structure for querying a knowledge base's graph (documents, entities, topics, facets) through
|
|
1662
1712
|
* the closed op set. `ref` accepts a facet nodeId (`facet_…` — exact; the only persistable concept
|
|
1663
|
-
* handles)
|
|
1664
|
-
*
|
|
1713
|
+
* handles), a topic id from {@link KnowledgeBaseGraphTopic.id} or an entity id from
|
|
1714
|
+
* {@link KnowledgeBaseGraphNode.id} (both exact, both churn on rebuild) or a name, resolved server-side
|
|
1715
|
+
* (exact → alias → similarity). An unresolvable ref fails with `CONCEPT_NOT_FOUND` plus the nearest
|
|
1716
|
+
* matching names.
|
|
1665
1717
|
* @category AI
|
|
1666
1718
|
*/
|
|
1667
1719
|
export interface QueryKnowledgeBaseGraphRequest {
|
|
@@ -1669,9 +1721,12 @@ export interface QueryKnowledgeBaseGraphRequest {
|
|
|
1669
1721
|
knowledgeBaseId: AiKnowledgeBaseId;
|
|
1670
1722
|
/** The operation to run. */
|
|
1671
1723
|
op: KnowledgeBaseGraphQueryOp;
|
|
1672
|
-
/**
|
|
1724
|
+
/**
|
|
1725
|
+
* Node ref (name, facet nodeId, topic id or entity id). Required by resolve/describe/subtree/docsUnder/
|
|
1726
|
+
* neighborhood/pathBetween/relationship.
|
|
1727
|
+
*/
|
|
1673
1728
|
ref?: string;
|
|
1674
|
-
/** Second node ref for `pathBetween`. */
|
|
1729
|
+
/** Second node ref for `pathBetween`, and the target entity for `relationship`. */
|
|
1675
1730
|
refB?: string;
|
|
1676
1731
|
/** The document's contextId for `conceptsOf`. */
|
|
1677
1732
|
contextId?: string;
|
|
@@ -1683,8 +1738,16 @@ export interface QueryKnowledgeBaseGraphRequest {
|
|
|
1683
1738
|
hops?: number;
|
|
1684
1739
|
/** `docsUnder`: when true (default), include documents under the whole subtree, not just the node itself. */
|
|
1685
1740
|
recursive?: boolean;
|
|
1686
|
-
/**
|
|
1741
|
+
/**
|
|
1742
|
+
* `docsUnder` and `relationship`: maximum documents returned. Default 25, max 100 (`totalDocs` always
|
|
1743
|
+
* reports the full count).
|
|
1744
|
+
*/
|
|
1687
1745
|
limit?: number;
|
|
1746
|
+
/**
|
|
1747
|
+
* `docsUnder` and `relationship`: keeps only the documents whose context matches the filter. Filters on
|
|
1748
|
+
* context-record metadata only, not on per-chunk keys.
|
|
1749
|
+
*/
|
|
1750
|
+
contextMetadataFilter?: AiContextMetadataFilter;
|
|
1688
1751
|
}
|
|
1689
1752
|
/** One node matched by a graph query (`resolve`, and the anchors of other ops). @category AI */
|
|
1690
1753
|
export interface KnowledgeBaseGraphQueryMatch {
|
|
@@ -1767,6 +1830,27 @@ export interface KnowledgeBaseGraphQueryPath {
|
|
|
1767
1830
|
/** Thematic tier: names of concepts both refs sit under. */
|
|
1768
1831
|
sharedConcepts?: Array<string>;
|
|
1769
1832
|
}
|
|
1833
|
+
/**
|
|
1834
|
+
* A `relationship` answer: the direct relationship between two entities, in its asserted direction, and
|
|
1835
|
+
* the documents asserting it.
|
|
1836
|
+
* @category AI
|
|
1837
|
+
*/
|
|
1838
|
+
export interface KnowledgeBaseGraphQueryRelationship {
|
|
1839
|
+
/** Source entity name. */
|
|
1840
|
+
source: string;
|
|
1841
|
+
/** Target entity name. */
|
|
1842
|
+
target: string;
|
|
1843
|
+
/** Relationship label. */
|
|
1844
|
+
type: string;
|
|
1845
|
+
/** Relationship description, when the extraction produced one. */
|
|
1846
|
+
description?: string;
|
|
1847
|
+
/** How many times the relationship was asserted. */
|
|
1848
|
+
weight: number;
|
|
1849
|
+
/** Documents asserting the relationship (capped by `limit`). */
|
|
1850
|
+
documents: Array<KnowledgeBaseGraphQueryDoc>;
|
|
1851
|
+
/** Number of documents asserting it (compare with `documents.length` for truncation). */
|
|
1852
|
+
totalDocs: number;
|
|
1853
|
+
}
|
|
1770
1854
|
/**
|
|
1771
1855
|
* Response structure for a graph query. `op` echoes the request; exactly the fields that op produces
|
|
1772
1856
|
* are set (e.g. `matches` for `resolve`, `tree` for `subtree`).
|
|
@@ -1803,6 +1887,13 @@ export interface QueryKnowledgeBaseGraphResponse {
|
|
|
1803
1887
|
pathBetween?: KnowledgeBaseGraphQueryPath;
|
|
1804
1888
|
/** `globalSummary`: the KB's topic summaries ranked against the query, most relevant first. */
|
|
1805
1889
|
summaries?: Array<KnowledgeBaseGraphQueryGlobalSummary>;
|
|
1890
|
+
/** `relationship`: the relationship between `ref` and `refB` and the documents asserting it. */
|
|
1891
|
+
relationship?: KnowledgeBaseGraphQueryRelationship;
|
|
1892
|
+
/**
|
|
1893
|
+
* True when `contextMetadataFilter` matched more contexts than one request reads; the documents then come
|
|
1894
|
+
* from only the first of them.
|
|
1895
|
+
*/
|
|
1896
|
+
scopeTruncated?: boolean;
|
|
1806
1897
|
}
|
|
1807
1898
|
/**
|
|
1808
1899
|
* One context to stage through bulk ingestion. Unlike the sync request, `imageExtractionModel` is not
|
|
@@ -10,3 +10,48 @@ export declare const CONNECTOR_IDS: readonly ["bitbucket", "confluence", "connec
|
|
|
10
10
|
* @category Platform
|
|
11
11
|
*/
|
|
12
12
|
export type ConnectorId = (typeof CONNECTOR_IDS)[number];
|
|
13
|
+
/** Where one file/folder sits in a connector's own tracking, independent of the KB ledger. */
|
|
14
|
+
export type ConnectorPathStatusClassification = 'indexed' | 'staged' | 'failed' | 'skipped' | 'folder_tracked';
|
|
15
|
+
/** The durable ingestion status of one file in the knowledge base ledger, as {@link ConnectorPathStatusEntry.kbStatus}. */
|
|
16
|
+
export interface ConnectorKbFileStatus {
|
|
17
|
+
/** The file's current durable status in the knowledge base ledger. */
|
|
18
|
+
status: 'no_record' | 'in_progress' | 'completed' | 'failed';
|
|
19
|
+
/** Present only when `status` is `'failed'`. */
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
/** Present only when `status` is `'failed'`, when known. */
|
|
22
|
+
errorCode?: string;
|
|
23
|
+
/** When this status was last recorded; absent when `status` is `'no_record'`. */
|
|
24
|
+
updatedAt?: Date;
|
|
25
|
+
}
|
|
26
|
+
/** One file or folder a connector knows about at or under a searched path. */
|
|
27
|
+
export interface ConnectorPathStatusEntry {
|
|
28
|
+
/** The connector-specific id of the document. */
|
|
29
|
+
documentId: string;
|
|
30
|
+
/** The document's name. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Whether this document is a file or a folder. */
|
|
33
|
+
type: 'file' | 'folder';
|
|
34
|
+
/** Folder path, when this document was indexed through a folder. With `name`, forms the KB ledger's lookup path. */
|
|
35
|
+
folderPath?: string;
|
|
36
|
+
/** Where this document sits in the connector's own tracking. */
|
|
37
|
+
classification: ConnectorPathStatusClassification;
|
|
38
|
+
/** Message describing the most recent failure, when `classification` is `'failed'` or `'skipped'`. */
|
|
39
|
+
errorMessage?: string;
|
|
40
|
+
/** Last successful ingestion, when the document has one. */
|
|
41
|
+
lastIndexedDate?: Date;
|
|
42
|
+
/** The knowledge-base context ID this document maps to, when it has one. */
|
|
43
|
+
contextId?: string;
|
|
44
|
+
/** The KB ledger's own status for this file, when the connector resolved one. */
|
|
45
|
+
kbStatus?: ConnectorKbFileStatus;
|
|
46
|
+
}
|
|
47
|
+
/** A connector's own record of files/folders matching a searched path, from `Squid.getConnectorPathStatus`. */
|
|
48
|
+
export interface ConnectorPathStatusResult {
|
|
49
|
+
/** False when the integration's type doesn't expose path-status search (most types). */
|
|
50
|
+
supported: boolean;
|
|
51
|
+
/** The knowledge base this integration indexes into, when resolvable. */
|
|
52
|
+
knowledgeBaseId?: string;
|
|
53
|
+
/** The matching files/folders, absent when `supported` is false. */
|
|
54
|
+
entries?: Array<ConnectorPathStatusEntry>;
|
|
55
|
+
/** True when more matches exist than `entries` returns. */
|
|
56
|
+
truncated?: boolean;
|
|
57
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare class AdminClient {
|
|
|
11
11
|
private readonly region;
|
|
12
12
|
private readonly appId;
|
|
13
13
|
private readonly consoleRegion;
|
|
14
|
+
private readonly backendFunctionManager;
|
|
14
15
|
private readonly integrationClient;
|
|
15
16
|
private readonly connectorClient;
|
|
16
17
|
private readonly secretClient;
|
|
@@ -132,6 +132,8 @@ export declare class AiAgentReference {
|
|
|
132
132
|
* knows it can look up the job’s status.
|
|
133
133
|
*/
|
|
134
134
|
ask<T extends AiAskModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
|
|
135
|
+
/** Returns the answer, annotations, routing information, and optional validation verdict. */
|
|
136
|
+
askWithResult<T extends AiAskModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<AskResponse>;
|
|
135
137
|
/**
|
|
136
138
|
* Sends a prompt and returns the string response and file annotations.
|
|
137
139
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAnnotation, AiAskModelSelection, AiChatModelSelection, AiChatOptions, AiChatRequestCredentials, AiModelRoutingResult } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
|
+
import { AiAnnotation, AiAnswerValidationResult, AiAskModelSelection, AiChatModelSelection, AiChatOptions, AiChatRequestCredentials, AiModelRoutingResult } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* Response format for transcribing audio and generating a chat response.
|
|
5
5
|
* Contains the transcribed text and a stream of AI-generated responses.
|
|
@@ -29,6 +29,8 @@ export interface TranscribeAndAskWithVoiceResponse {
|
|
|
29
29
|
* @category AI
|
|
30
30
|
*/
|
|
31
31
|
export interface AskResponse {
|
|
32
|
+
/** Judge verdict, present when answer validation is enabled. */
|
|
33
|
+
validation?: AiAnswerValidationResult;
|
|
32
34
|
/** The main text response from the AI agent. */
|
|
33
35
|
responseString: string;
|
|
34
36
|
/** Optional annotations that provide additional context or metadata about the response. */
|
package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiEmbeddingsModelWithOptionalFields, AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseContextWithReasoning, AiKnowledgeBaseDownloadContextResponse, AiKnowledgeBaseFileStatusInfo, AiKnowledgeBaseFolderStatusResponse, AiKnowledgeBaseSearchContextsWithContextIdRequest, AiKnowledgeBaseSearchContextsWithPromptRequest, AiKnowledgeBaseSearchResponse, AiKnowledgeBaseSearchResultChunk, BulkIngestionContext, BulkIngestionCreateUploadUrlsResponse, BulkIngestionJobStatusResponse, BulkIngestionUpsertContextsOptions, BulkIngestionUpsertContextsResponse, ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GenerateMetadataFieldDescriptionsRequest, GenerateMetadataFieldDescriptionsResponse, GetKnowledgeBaseGraphStatusResponse, GrepKnowledgeBaseOptions, GrepKnowledgeBaseResponse, ListAiKnowledgeBaseContextsPageResponse, ListKnowledgeBaseContextsOptions, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, UpsertKnowledgeBaseContextResponse, UpsertKnowledgeBaseContextsResponse } from '../../../internal-common/src/public-types/ai-knowledge-base.public-types';
|
|
2
|
+
import { AiEmbeddingsModelWithOptionalFields, AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseContextWithReasoning, AiKnowledgeBaseDownloadContextResponse, AiKnowledgeBaseFileStatusInfo, AiKnowledgeBaseFolderStatusResponse, AiKnowledgeBaseSearchContextsWithContextIdRequest, AiKnowledgeBaseSearchContextsWithPromptRequest, AiKnowledgeBaseSearchResponse, AiKnowledgeBaseSearchResultChunk, BulkIngestionContext, BulkIngestionCreateUploadUrlsResponse, BulkIngestionJobStatusResponse, BulkIngestionUpsertContextsOptions, BulkIngestionUpsertContextsResponse, ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GenerateMetadataFieldDescriptionsRequest, GenerateMetadataFieldDescriptionsResponse, GetKnowledgeBaseGraphStatusRequest, GetKnowledgeBaseGraphStatusResponse, GrepKnowledgeBaseOptions, GrepKnowledgeBaseResponse, ListAiKnowledgeBaseContextsPageResponse, ListKnowledgeBaseContextsOptions, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, UpsertKnowledgeBaseContextResponse, UpsertKnowledgeBaseContextsResponse } from '../../../internal-common/src/public-types/ai-knowledge-base.public-types';
|
|
3
3
|
import { AiContextId } from '../../../internal-common/src/public-types/communication.public-types';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for creating or updating an AI agent.
|
|
@@ -197,16 +197,17 @@ export declare class AiKnowledgeBaseReference {
|
|
|
197
197
|
/**
|
|
198
198
|
* Queries the knowledge base's graph (documents, entities, themes, facets) through the closed op set
|
|
199
199
|
* — overview / resolve / describe / subtree / docsUnder / conceptsOf / neighborhood / pathBetween /
|
|
200
|
-
* globalSummary. Requires `graphRag.enabled` on the knowledge base. Refused on a knowledge
|
|
201
|
-
* `accessControl.mode: 'enforced'` — the graph carries no access scopes, so its answers cannot
|
|
202
|
-
* filtered per caller.
|
|
200
|
+
* globalSummary / relationship. Requires `graphRag.enabled` on the knowledge base. Refused on a knowledge
|
|
201
|
+
* base with `accessControl.mode: 'enforced'` — the graph carries no access scopes, so its answers cannot
|
|
202
|
+
* be filtered per caller.
|
|
203
203
|
*/
|
|
204
204
|
queryGraph(request: Omit<QueryKnowledgeBaseGraphRequest, 'knowledgeBaseId'>): Promise<QueryKnowledgeBaseGraphResponse>;
|
|
205
205
|
/**
|
|
206
206
|
* Returns the knowledge base's graph build/readiness status: counts, facets, staleness, the most
|
|
207
207
|
* recent rebuild job, and the graph's LLM token/cost usage (`ingestUsage`, `lastRebuildUsage`).
|
|
208
|
+
* Pass `includeTopics: false` to poll it without the topic table.
|
|
208
209
|
*/
|
|
209
|
-
getGraphStatus(): Promise<GetKnowledgeBaseGraphStatusResponse>;
|
|
210
|
+
getGraphStatus(options?: Omit<GetKnowledgeBaseGraphStatusRequest, 'knowledgeBaseId'>): Promise<GetKnowledgeBaseGraphStatusResponse>;
|
|
210
211
|
/**
|
|
211
212
|
* Looks up the durable ingestion status of one file by path (`folderPath/filename`, or just
|
|
212
213
|
* `filename` at the upload root): `'completed'`, `'failed'` (with `errorMessage`/`errorCode`),
|
|
@@ -231,8 +232,9 @@ export declare class AiKnowledgeBaseReference {
|
|
|
231
232
|
*/
|
|
232
233
|
rebuildGraph(request?: Omit<RebuildKnowledgeBaseGraphRequest, 'knowledgeBaseId'>): Promise<void>;
|
|
233
234
|
/**
|
|
234
|
-
* Returns a bounded slice of the knowledge base's entity graph
|
|
235
|
-
*
|
|
235
|
+
* Returns a bounded slice of the knowledge base's entity graph for exploration/visualization: the
|
|
236
|
+
* highest-degree entities, a topic's members, an entity's neighborhood or a name search, optionally
|
|
237
|
+
* narrowed by a context metadata filter, with the relationships among them. Requires `graphRag.enabled`.
|
|
236
238
|
*/
|
|
237
239
|
exploreGraph(request?: Omit<ExploreKnowledgeBaseGraphRequest, 'knowledgeBaseId'>): Promise<ExploreKnowledgeBaseGraphResponse>;
|
|
238
240
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiscoverSourceRepositoriesResponse, IntegrationId, IntegrationInfo, IntegrationType } from './public-types';
|
|
1
|
+
import { ConnectorPathStatusResult, DiscoverSourceRepositoriesResponse, IntegrationId, IntegrationInfo, IntegrationType } from './public-types';
|
|
2
2
|
/**
|
|
3
3
|
* IntegrationClient manages integrations within an application,
|
|
4
4
|
* providing methods for listing, retrieving, updating, and deleting integrations.
|
|
@@ -6,6 +6,7 @@ import { DiscoverSourceRepositoriesResponse, IntegrationId, IntegrationInfo, Int
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class IntegrationClient {
|
|
8
8
|
private readonly rpcManager;
|
|
9
|
+
private readonly backendFunctionManager;
|
|
9
10
|
private readonly iacBaseUrl;
|
|
10
11
|
/**
|
|
11
12
|
* Lists all enabled integrations for the current application.
|
|
@@ -23,6 +24,18 @@ export declare class IntegrationClient {
|
|
|
23
24
|
* @returns A promise that resolves with the integration info, or `undefined` if not found.
|
|
24
25
|
*/
|
|
25
26
|
get<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Searches a connector's own record of files/folders at a path — for connectors (SharePoint, and
|
|
29
|
+
* any future file/folder-hierarchy connector) that track more than the AI knowledge base ledger
|
|
30
|
+
* does. Returns `{ supported: false }` when the integration's type doesn't support this. The
|
|
31
|
+
* connector's own executable requires an API key, so this call fails unless the `Squid` instance
|
|
32
|
+
* is authenticated with one.
|
|
33
|
+
*
|
|
34
|
+
* @param integrationId - The ID of the integration to search.
|
|
35
|
+
* @param path - The path, folder, or filename to search for.
|
|
36
|
+
* @returns A promise that resolves to the connector's path-status result.
|
|
37
|
+
*/
|
|
38
|
+
getPathStatus(integrationId: IntegrationId, path: string): Promise<ConnectorPathStatusResult>;
|
|
26
39
|
/**
|
|
27
40
|
* Enables a disabled integration. The integration becomes available again for runtime access and sync jobs.
|
|
28
41
|
*
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* System-level OpenAI-compatible backends ("slots") for Squid's own internal AI calls.
|
|
3
|
-
*
|
|
4
|
-
* Generic plumbing for pointing an internal model at ANY OpenAI-compatible HTTP endpoint —
|
|
5
|
-
* primarily Squid's own self-hosted models, but any OpenAI-compatible backend works. The
|
|
6
|
-
* non-secret part of a slot (base URL, optional headers/extra body) is hardcoded here on purpose
|
|
7
|
-
* (changing a backend is a reviewed code change); only the API key lives in Vault under
|
|
8
|
-
* `SystemSecrets['openai-compatible'][slotName].apiKey`.
|
|
9
|
-
*
|
|
10
|
-
* NOT the customer-facing `openai_compatible` Integration (per-app, console-configured). Models
|
|
11
|
-
* served through these slots are declared in `AI_CHAT_MODEL_REGISTRY` with
|
|
12
|
-
* `providerType: 'openai-compatible'` + `openAiCompatibleSlot`, and resolve only with
|
|
13
|
-
* `keyType: 'system'` (see `AiProviderFactory.getChatProviderForModel`) — never customer-reachable.
|
|
14
|
-
*
|
|
15
|
-
* No slots are defined yet (foundation only). To wire one up:
|
|
16
|
-
* 1. add a slot below, e.g. `'my-model': { baseUrl: 'https://llm.internal.squid/v1' }`;
|
|
17
|
-
* 2. seed its key in `SystemSecrets['openai-compatible']['my-model'].apiKey`;
|
|
18
|
-
* 3. add a model entry in ai-model.registry.ts pointing `openAiCompatibleSlot: 'my-model'`.
|
|
19
|
-
*/
|
|
20
|
-
/** Non-secret configuration of one system OpenAI-compatible backend. */
|
|
21
|
-
export interface SystemOpenAiCompatibleSlotConfig {
|
|
22
|
-
/** Base URL of the OpenAI-compatible API, e.g. a self-hosted 'https://llm.internal.squid/v1'. */
|
|
23
|
-
baseUrl: string;
|
|
24
|
-
/** Extra HTTP headers sent with every request. */
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
|
-
/** Extra JSON body fields merged into every request — reserved wire fields are dropped by the provider. */
|
|
27
|
-
extraBody?: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
/** Name of a system OpenAI-compatible slot (a key of `SYSTEM_OPENAI_COMPATIBLE_SLOTS`). */
|
|
30
|
-
export type SystemOpenAiCompatibleSlotName = string;
|
|
31
|
-
/**
|
|
32
|
-
* Registered system OpenAI-compatible slots, keyed by name. Empty by design — add a self-hosted
|
|
33
|
-
* (or any other) OpenAI-compatible backend here; see the module doc above.
|
|
34
|
-
*/
|
|
35
|
-
export declare const SYSTEM_OPENAI_COMPATIBLE_SLOTS: Record<SystemOpenAiCompatibleSlotName, SystemOpenAiCompatibleSlotConfig>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Names of the Squid metrics; dashboards and metric queries key on these exact strings. */
|
|
2
|
-
export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatReasoningTokens_count", "squid_aiChatbotChatCacheReadInputTokens_count", "squid_aiChatbotChatCacheWriteInputTokens_count", "squid_aiChatbotChatCostUsd_count", "squid_aiChatbotChatOutcome_count", "squid_aiSpendInputTokens_count", "squid_aiSpendOutputTokens_count", "squid_aiSpendReasoningTokens_count", "squid_aiSpendCacheReadTokens_count", "squid_aiSpendCacheWriteTokens_count", "squid_aiSpendPages_count", "squid_aiSpendImages_count", "squid_aiSpendAudioSeconds_count", "squid_aiSpendCharacters_count", "squid_aiSpendSearches_count", "squid_aiSpendCostUsd_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiVoiceCreateSession_count", "squid_aiVoiceCreateSession_time", "squid_aiVoiceAnswerOpenAiCall_count", "squid_aiVoiceAnswerOpenAiCall_time", "squid_aiVoiceStartOpenAiWebCall_count", "squid_aiVoiceStartOpenAiWebCall_time", "squid_aiOpenAiChatCompletions_count", "squid_aiOpenAiChatCompletions_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_sourceCodeAnalysis_count", "squid_sourceCodeAnalysis_time", "squid_sourceCodeWorkspaceBytes_value", "squid_sourceCodeInputTokens_count", "squid_sourceCodeOutputTokens_count", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_queueMessageHandler_count", "squid_queueMessageHandler_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_eventHandler_count", "squid_eventHandler_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_tenantDependencyResolved_count", "squid_tenantBrowserSpawnAttempt_count", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time", "squid_acquireLock_count", "squid_acquireLock_time", "squid_releaseLock_count", "squid_releaseLock_time"];
|
|
3
|
-
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
4
|
-
/** Common prefix for all Squid metrics. */
|
|
5
|
-
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ApiOptions } from '../public-types/api-client.public-types';
|
|
2
|
-
import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types';
|
|
3
|
-
import { IntegrationId } from '../public-types/communication.public-types';
|
|
4
|
-
/** The headers of an API call. */
|
|
5
|
-
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
6
|
-
/** The context of an API call. */
|
|
7
|
-
export declare class ApiCallContext {
|
|
8
|
-
readonly integrationId: IntegrationId;
|
|
9
|
-
readonly endpointId: ApiEndpointId;
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly method: HttpMethod;
|
|
12
|
-
readonly body: unknown;
|
|
13
|
-
readonly options: ApiOptions;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents a request to call an API through a specified integration and endpoint.
|
|
17
|
-
* Includes optional method override and additional request options.
|
|
18
|
-
*/
|
|
19
|
-
export interface CallApiRequest<BodyType = any> {
|
|
20
|
-
/** The identifier of the integration through which the API is called. */
|
|
21
|
-
integrationId: IntegrationId;
|
|
22
|
-
/** Target API endpoint to invoke. */
|
|
23
|
-
endpointId: ApiEndpointId;
|
|
24
|
-
/** Optional request payload. */
|
|
25
|
-
body?: BodyType;
|
|
26
|
-
/** Optional HTTP method override. Default is POST. */
|
|
27
|
-
overrideMethod?: HttpMethod;
|
|
28
|
-
/** Additional request options. */
|
|
29
|
-
options: ApiOptions;
|
|
30
|
-
}
|