@squidcloud/jira-jsm-client 1.0.503 → 1.0.504
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/internal-common/src/ai/kb-version-rules.d.ts +2 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +28 -2
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +3 -3
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +30 -8
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +2 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/langgraph.public-types.d.ts +86 -0
- package/dist/internal-common/src/public-types/session.public-types.d.ts +82 -0
- package/dist/internal-common/src/public-types-backend/ai-agent.public-context.d.ts +16 -0
- package/dist/internal-common/src/public-types-backend/langgraph.public-context.d.ts +11 -0
- package/dist/internal-common/src/public-types-backend/storage.public-types.d.ts +5 -1
- package/dist/internal-common/src/types/langgraph.types.d.ts +2 -1
- package/dist/internal-common/src/utils/object.d.ts +11 -2
- package/dist/internal-common/src/utils/serialization.d.ts +7 -3
- package/dist/internal-common/src/utils/string.d.ts +18 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Version-family rules for knowledge-base sources that keep every draft of a document (`Deck v01 … v05, vF`).
|
|
3
|
-
*
|
|
3
|
+
* Imports only the dependency-free `utils/string` on purpose: connectors bundle it, and the console preview runs
|
|
4
|
+
* the exact same code.
|
|
4
5
|
*/
|
|
5
6
|
/** Overridable rules. A list that is present replaces the default list; an absent one keeps the default. */
|
|
6
7
|
export interface KbVersionRules {
|
|
@@ -7,6 +7,7 @@ import { DocumentExtractionMethod } from './extraction.public-types';
|
|
|
7
7
|
import { IntegrationType } from './integration.public-types';
|
|
8
8
|
import { JobId } from './job.public-types';
|
|
9
9
|
import { SecretKey } from './secret.public-types';
|
|
10
|
+
import { UpsertSessionRequest } from './session.public-types';
|
|
10
11
|
/**
|
|
11
12
|
* @category AI
|
|
12
13
|
*/
|
|
@@ -653,6 +654,9 @@ export interface BaseAiChatOptions {
|
|
|
653
654
|
* conversation, not only the one that fell back — tuning meant for one model is not evidence of
|
|
654
655
|
* what another should use.
|
|
655
656
|
*
|
|
657
|
+
* A turn the primary's safety classifier declines outright — no text at all came back — falls
|
|
658
|
+
* back the same way, since another model may well answer the same prompt.
|
|
659
|
+
*
|
|
656
660
|
* Applies to models served through Squid's own provider SDKs — the vendor models and
|
|
657
661
|
* `openai_compatible`, Bedrock and Vertex integrations. A model you serve yourself from backend
|
|
658
662
|
* code reports its failures as plain errors that carry no provider status, so a turn on one is
|
|
@@ -863,6 +867,19 @@ export interface AiChatRequestCredentials {
|
|
|
863
867
|
*/
|
|
864
868
|
integrationAccessTokens?: Record<IntegrationId, string>;
|
|
865
869
|
}
|
|
870
|
+
/**
|
|
871
|
+
* The session (`squid.sessions()`) a chat request runs in. It is part of the request only: never stored with the agent.
|
|
872
|
+
* @category AI
|
|
873
|
+
*/
|
|
874
|
+
export interface AiChatRequestSession {
|
|
875
|
+
/**
|
|
876
|
+
* Every AI function the request calls gets the session as `context.session`. With the app API key, the request
|
|
877
|
+
* creates the session or updates the one with the same id. Without it, a new id creates the session with its data
|
|
878
|
+
* and a live one is attached as it is; the agent's `@secureAiAgent` rules see both and can refuse them. A call that
|
|
879
|
+
* skips the rules, to a public agent or with the agent's API key, cannot attach one.
|
|
880
|
+
*/
|
|
881
|
+
session?: UpsertSessionRequest;
|
|
882
|
+
}
|
|
866
883
|
/**
|
|
867
884
|
* Configuration for exposing an AI agent as an MCP server at `/mcp/<agentId>`.
|
|
868
885
|
* @category AI
|
|
@@ -1279,6 +1296,14 @@ export type BaseAiContextOptions = {
|
|
|
1279
1296
|
ragType?: AiRagType;
|
|
1280
1297
|
/** Amount of chunk overlap, in characters. */
|
|
1281
1298
|
chunkOverlap?: number;
|
|
1299
|
+
/**
|
|
1300
|
+
* Contextual RAG only. On a re-upsert, a chunk whose text is unchanged keeps its stored blurb and
|
|
1301
|
+
* embedding, and only chunks with new text are sent to the LLM; with GraphRAG it also keeps its graph
|
|
1302
|
+
* entities and is not extracted again. A chunk that carries an image is always written anew. A reused blurb
|
|
1303
|
+
* was written against the previous version of the document; set false when an edit can change the meaning
|
|
1304
|
+
* of text elsewhere in it. Defaults to true.
|
|
1305
|
+
*/
|
|
1306
|
+
reuseChunkContext?: boolean;
|
|
1282
1307
|
};
|
|
1283
1308
|
/**
|
|
1284
1309
|
* @category AI
|
|
@@ -1331,8 +1356,9 @@ export type AiPiiOptions = {
|
|
|
1331
1356
|
/** App-specific PII in plain language, e.g. `'internal case numbers like CASE-12345'`. */
|
|
1332
1357
|
customRules?: Array<string>;
|
|
1333
1358
|
/**
|
|
1334
|
-
* Model performing the screening. Defaults to {@link DEFAULT_PII_CLASSIFIER_MODEL}
|
|
1335
|
-
* bounded at a minute, so an override has
|
|
1359
|
+
* Model performing the screening. Defaults to {@link DEFAULT_PII_CLASSIFIER_MODEL}, or the app's best
|
|
1360
|
+
* available model when that one is unavailable. Each attempt is bounded at a minute, so an override has
|
|
1361
|
+
* to answer within it.
|
|
1336
1362
|
*/
|
|
1337
1363
|
classifierModel?: AiChatModelSelection;
|
|
1338
1364
|
/** Literal values that never count as PII, e.g. a shared support address. */
|
|
@@ -51,7 +51,7 @@ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-
|
|
|
51
51
|
* Public Gemini chat model names (active models only).
|
|
52
52
|
* @category AI
|
|
53
53
|
*/
|
|
54
|
-
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-
|
|
54
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-4-argon", "gemini-3.8-flash", "gemini-3.5-flash-lite"];
|
|
55
55
|
/**
|
|
56
56
|
* Public Grok chat model names (active models only).
|
|
57
57
|
* @category AI
|
|
@@ -61,12 +61,12 @@ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.6", "grok-4-1-fast
|
|
|
61
61
|
* Public Anthropic chat model names (active models only).
|
|
62
62
|
* @category AI
|
|
63
63
|
*/
|
|
64
|
-
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-
|
|
64
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-5-5", "claude-opus-5-5", "claude-sonnet-5-5"];
|
|
65
65
|
/**
|
|
66
66
|
* The supported AI model names.
|
|
67
67
|
* @category AI
|
|
68
68
|
*/
|
|
69
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol", "claude-fable-5", "claude-fable-5-1", "claude-haiku-
|
|
69
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol", "claude-fable-5", "claude-fable-5-1", "claude-haiku-5-5", "claude-opus-5-5", "claude-sonnet-5-5", "gemini-4-argon", "gemini-3.8-flash", "gemini-3.5-flash-lite", "grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
70
70
|
/** Checks if the given model name is a global AI chat model name. */
|
|
71
71
|
export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
|
|
72
72
|
/**
|
|
@@ -220,6 +220,13 @@ export interface AiKnowledgeBaseGraphConfig {
|
|
|
220
220
|
extractionModel?: AiChatModelSelection;
|
|
221
221
|
/** Optional domain taxonomy hint (entity types) injected into the extraction prompt. */
|
|
222
222
|
entityTypes?: string[];
|
|
223
|
+
/**
|
|
224
|
+
* How hard per-chunk extraction works. `'thorough'` allows about 40 entities per chunk instead of 15 and runs
|
|
225
|
+
* at high reasoning effort on OpenAI extraction models: more entities and relationships, a bigger graph (a
|
|
226
|
+
* listing yields ~40 entities per chunk) and about 1.5x the extraction cost. Like `extractionModel`, a change
|
|
227
|
+
* reaches already-indexed content on the next `full` rebuild. Defaults to `'standard'`.
|
|
228
|
+
*/
|
|
229
|
+
extractionDepth?: 'standard' | 'thorough';
|
|
223
230
|
/**
|
|
224
231
|
* Quiet window (milliseconds) after the last graph activity before the sweep auto-builds the
|
|
225
232
|
* structure. Must be a positive integer, and is floored at 3 seconds — a shorter window is not
|
|
@@ -528,6 +535,11 @@ export interface AiKnowledgeBaseContext {
|
|
|
528
535
|
* carry none; their reupsert takes the defaults.
|
|
529
536
|
*/
|
|
530
537
|
requestConfig?: AiKnowledgeBaseContextRequestConfig;
|
|
538
|
+
/**
|
|
539
|
+
* Set on an attachment of a OneNote section or email that the knowledge base indexed as its own context: the
|
|
540
|
+
* id of that container. Such contexts are managed with their container and left out of context listings.
|
|
541
|
+
*/
|
|
542
|
+
parentContextId?: string;
|
|
531
543
|
}
|
|
532
544
|
/**
|
|
533
545
|
* The ingestion request's options only. Everything else a reupsert needs lives on the context itself —
|
|
@@ -709,6 +721,14 @@ export type BaseAiKnowledgeBaseContextOptions = {
|
|
|
709
721
|
ragType?: AiRagType;
|
|
710
722
|
/** Amount of chunk overlap, in characters. */
|
|
711
723
|
chunkOverlap?: number;
|
|
724
|
+
/**
|
|
725
|
+
* Contextual RAG only. On a re-upsert, a chunk whose text is unchanged keeps its stored blurb and
|
|
726
|
+
* embedding, and only chunks with new text are sent to the LLM; with GraphRAG it also keeps its graph
|
|
727
|
+
* entities and is not extracted again. A chunk that carries an image is always written anew. A reused blurb
|
|
728
|
+
* was written against the previous version of the document; set false when an edit can change the meaning
|
|
729
|
+
* of text elsewhere in it. Defaults to true.
|
|
730
|
+
*/
|
|
731
|
+
reuseChunkContext?: boolean;
|
|
712
732
|
};
|
|
713
733
|
/**
|
|
714
734
|
* Specific options for the AI knowledgebase search method.
|
|
@@ -795,9 +815,10 @@ export interface UpsertKnowledgeBaseContextResponse {
|
|
|
795
815
|
/** List of the upsert status of each item sent in the request. */
|
|
796
816
|
failure?: UpsertContextStatusError;
|
|
797
817
|
/**
|
|
798
|
-
* Set when the context was stored (and is fully searchable via vector/keyword) but NOT graph-indexed
|
|
799
|
-
*
|
|
800
|
-
*
|
|
818
|
+
* Set when the context was stored (and is fully searchable via vector/keyword) but NOT graph-indexed by
|
|
819
|
+
* this upsert: the knowledge base is over its per-KB graph chunk cap, or its stale graph data could not be
|
|
820
|
+
* pruned, which a later graph rebuild repairs. Only GraphRAG coverage is absent; the singular counterpart
|
|
821
|
+
* of {@link UpsertKnowledgeBaseContextsResponse.graphIndexingSkippedContextIds}.
|
|
801
822
|
*/
|
|
802
823
|
graphIndexingSkipped?: boolean;
|
|
803
824
|
/**
|
|
@@ -838,9 +859,10 @@ export interface UpsertKnowledgeBaseContextsResponse {
|
|
|
838
859
|
*/
|
|
839
860
|
contextIds?: Array<AiContextId>;
|
|
840
861
|
/**
|
|
841
|
-
* Contexts that were stored (and are fully searchable via vector/keyword) but NOT graph-indexed
|
|
842
|
-
* the knowledge base is over its per-KB graph chunk cap
|
|
843
|
-
*
|
|
862
|
+
* Contexts that were stored (and are fully searchable via vector/keyword) but NOT graph-indexed by this
|
|
863
|
+
* upsert: the knowledge base is over its per-KB graph chunk cap, or their stale graph data could not be
|
|
864
|
+
* pruned, which a later graph rebuild repairs. Only GraphRAG coverage is absent; surfaced so a caller can
|
|
865
|
+
* report the graph-coverage gap. Absent/empty when nothing was skipped or graph is disabled.
|
|
844
866
|
*/
|
|
845
867
|
graphIndexingSkippedContextIds?: Array<AiContextId>;
|
|
846
868
|
/**
|
|
@@ -1549,8 +1571,8 @@ export interface KnowledgeBaseGraphFacetValueStatus {
|
|
|
1549
1571
|
* documents into topics/facets.
|
|
1550
1572
|
* - `'full'` — wipes the graph and re-extracts entities/relationships from every chunk with an LLM,
|
|
1551
1573
|
* then rebuilds the concept layer. The expensive deep-clean: re-extraction dominates its cost.
|
|
1552
|
-
* Only needed when the extraction itself must be redone, e.g. after changing `entityTypes
|
|
1553
|
-
* `extractionModel`.
|
|
1574
|
+
* Only needed when the extraction itself must be redone, e.g. after changing `entityTypes`,
|
|
1575
|
+
* `extractionModel` or `extractionDepth`.
|
|
1554
1576
|
* @category AI
|
|
1555
1577
|
*/
|
|
1556
1578
|
export type KnowledgeBaseGraphRebuildMode = 'full' | 'structural';
|
|
@@ -24,6 +24,11 @@ export interface AiQueryOptions {
|
|
|
24
24
|
instructions?: string;
|
|
25
25
|
/** Whether to enable raw results output. */
|
|
26
26
|
enableRawResults?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* When the results are too large to analyze in the answer, skips the analysis and returns the raw results as
|
|
29
|
+
* files instead, for a caller that processes them itself (e.g. an agent with `executePythonCode`). Default: false.
|
|
30
|
+
*/
|
|
31
|
+
largeResultsAsFiles?: boolean;
|
|
27
32
|
/** Options for the collection selection stage. */
|
|
28
33
|
selectCollectionsOptions?: AiQuerySelectCollectionsOptions;
|
|
29
34
|
/** Options for the query generation stage. */
|
|
@@ -62,6 +62,8 @@ export interface RunContext {
|
|
|
62
62
|
headers?: Record<string, any>;
|
|
63
63
|
/** Additional context for OpenAPI requests */
|
|
64
64
|
openApiContext?: OpenApiContext;
|
|
65
|
+
/** The id of the session (`squid.sessions()`) this request runs in, when the AI agent or LangGraph call attached one. */
|
|
66
|
+
sessionId?: string;
|
|
65
67
|
}
|
|
66
68
|
/** In the case of OpenAPI, the context of the request is provided in a separate object. */
|
|
67
69
|
export interface OpenApiContext {
|
|
@@ -399,7 +399,7 @@ export interface DocumentMetadata {
|
|
|
399
399
|
docModifiedAt?: string;
|
|
400
400
|
/**
|
|
401
401
|
* Source document type: `pdf` | `docx` | `doc` | `pptx` | `ppt` | `xlsx` | `xlsm` | `xls` | `xlsb` |
|
|
402
|
-
* `eml` | `msg` | `csv` | `tsv` | `md` | `html` | `txt`.
|
|
402
|
+
* `eml` | `msg` | `one` | `csv` | `tsv` | `md` | `html` | `txt`.
|
|
403
403
|
*/
|
|
404
404
|
docType?: string;
|
|
405
405
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntegrationId } from './communication.public-types';
|
|
2
2
|
/** List of all integration types supported by Squid. */
|
|
3
|
-
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "azure-entra-external-id", "azure-entra-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "generic_site_ingester", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "twilio", "elevenlabs", "openai_voice", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "sharepoint", "vertex"];
|
|
3
|
+
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "azure-entra-external-id", "azure-entra-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "generic_site_ingester", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "twilio", "elevenlabs", "openai_voice", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "bedrock_embedding", "sharepoint", "vertex"];
|
|
4
4
|
/**
|
|
5
5
|
* @category Database
|
|
6
6
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UpsertSessionRequest } from './session.public-types';
|
|
1
2
|
/**
|
|
2
3
|
* Options for starting a new LangGraph run.
|
|
3
4
|
* @category AI
|
|
@@ -14,6 +15,13 @@ export interface InvokeLangGraphOptions {
|
|
|
14
15
|
* passes its own.
|
|
15
16
|
*/
|
|
16
17
|
context?: Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* The session (`squid.sessions()`) the run runs in: nodes read its id from `RunContext.sessionId`. With the app API
|
|
20
|
+
* key, the run creates the session or updates the one with the same id. Without it, a new id creates the session
|
|
21
|
+
* with its data and a live one is attached as it is; the graph's `@secureLangGraph` rules see both and can refuse
|
|
22
|
+
* them.
|
|
23
|
+
*/
|
|
24
|
+
session?: UpsertSessionRequest;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
27
|
* Options for resuming an interrupted LangGraph thread.
|
|
@@ -24,6 +32,24 @@ export interface ResumeLangGraphOptions {
|
|
|
24
32
|
timeoutMs?: number;
|
|
25
33
|
/** Context of the resumed run, which every node reads as LangGraph's `runtime.context`. */
|
|
26
34
|
context?: Record<string, unknown>;
|
|
35
|
+
/** The session the resumed run runs in, as for {@link InvokeLangGraphOptions.session}. */
|
|
36
|
+
session?: UpsertSessionRequest;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Options for streaming a new LangGraph run.
|
|
40
|
+
* @category AI
|
|
41
|
+
*/
|
|
42
|
+
export interface StreamLangGraphOptions extends InvokeLangGraphOptions {
|
|
43
|
+
/** Streams only the tokens of LLM calls with one of these tags, such as those set with `model.withConfig({ tags })`. */
|
|
44
|
+
tokenTags?: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for streaming the resume of an interrupted LangGraph thread.
|
|
48
|
+
* @category AI
|
|
49
|
+
*/
|
|
50
|
+
export interface StreamResumeLangGraphOptions extends ResumeLangGraphOptions {
|
|
51
|
+
/** Streams only the tokens of LLM calls with one of these tags, such as those set with `model.withConfig({ tags })`. */
|
|
52
|
+
tokenTags?: string[];
|
|
27
53
|
}
|
|
28
54
|
/**
|
|
29
55
|
* Successful result of a LangGraph invocation.
|
|
@@ -55,3 +81,63 @@ export interface GetLangGraphStateSuccessResult {
|
|
|
55
81
|
/** Next nodes to execute. Empty if the graph has completed. */
|
|
56
82
|
next: string[];
|
|
57
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Data a node wrote to LangGraph's stream: `config.writer(data)` in TypeScript, `get_stream_writer()(data)` in Python.
|
|
86
|
+
* @category AI
|
|
87
|
+
*/
|
|
88
|
+
export interface LangGraphCustomEvent {
|
|
89
|
+
/** Always `custom`. */
|
|
90
|
+
type: 'custom';
|
|
91
|
+
/** What the node wrote, as JSON. */
|
|
92
|
+
data: unknown;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Text that an LLM call made by a node streamed. Consecutive tokens of one message can arrive merged.
|
|
96
|
+
* @category AI
|
|
97
|
+
*/
|
|
98
|
+
export interface LangGraphTokenEvent {
|
|
99
|
+
/** Always `token`. */
|
|
100
|
+
type: 'token';
|
|
101
|
+
/** The id of the message the text belongs to, which is also its id in the graph state. */
|
|
102
|
+
messageId?: string;
|
|
103
|
+
/** The node that made the LLM call. */
|
|
104
|
+
node: string;
|
|
105
|
+
/** The tags of the LLM call, such as those set with `model.withConfig({ tags })`. */
|
|
106
|
+
tags: string[];
|
|
107
|
+
/** The streamed text. */
|
|
108
|
+
text: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The text of an AI message that a node wrote whole, without streaming it from an LLM call.
|
|
112
|
+
* @category AI
|
|
113
|
+
*/
|
|
114
|
+
export interface LangGraphMessageEvent {
|
|
115
|
+
/** Always `message`. */
|
|
116
|
+
type: 'message';
|
|
117
|
+
/** The id of the message in the graph state. */
|
|
118
|
+
messageId?: string;
|
|
119
|
+
/** The node that wrote the message. */
|
|
120
|
+
node: string;
|
|
121
|
+
/** The text of the message. */
|
|
122
|
+
text: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The result of a streamed run, which is the stream's last event.
|
|
126
|
+
* @category AI
|
|
127
|
+
*/
|
|
128
|
+
export interface LangGraphResultEvent {
|
|
129
|
+
/** Always `result`. */
|
|
130
|
+
type: 'result';
|
|
131
|
+
/** The result of the run, as `invoke` returns it. */
|
|
132
|
+
result: InvokeLangGraphSuccessResult;
|
|
133
|
+
/**
|
|
134
|
+
* Set when some of the run's events may be missing from the stream: they were lost on the way or arrived too late.
|
|
135
|
+
* The result itself is complete.
|
|
136
|
+
*/
|
|
137
|
+
incomplete?: boolean;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* An event of a streamed LangGraph run.
|
|
141
|
+
* @category AI
|
|
142
|
+
*/
|
|
143
|
+
export type LangGraphStreamEvent = LangGraphCustomEvent | LangGraphTokenEvent | LangGraphMessageEvent | LangGraphResultEvent;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An app-scoped record of JSON data under an id the app chooses, which expires. See `squid.sessions()`.
|
|
3
|
+
* @category Sessions
|
|
4
|
+
*/
|
|
5
|
+
export interface Session {
|
|
6
|
+
/** The id of the session. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The data of the session. */
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
/** When the session was created. */
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
/** When the session was last written. */
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
/** When the session expires, or `null` when it never does. */
|
|
15
|
+
expiresAt: Date | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How long a session lives after its last write: a TTL, or `'never'` to keep it until it is deleted.
|
|
19
|
+
* @category Sessions
|
|
20
|
+
*/
|
|
21
|
+
export type SessionExpiration = SessionTtl | 'never';
|
|
22
|
+
/**
|
|
23
|
+
* An expiration a fixed time after the session's last write.
|
|
24
|
+
* @category Sessions
|
|
25
|
+
*/
|
|
26
|
+
export interface SessionTtl {
|
|
27
|
+
/** Milliseconds from the last write to the expiration. At least 1000. */
|
|
28
|
+
ttlMs: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates a session, or updates the one with the same id.
|
|
32
|
+
* @category Sessions
|
|
33
|
+
*/
|
|
34
|
+
export interface UpsertSessionRequest {
|
|
35
|
+
/** The id of the session: 1-256 characters, without control characters. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Top-level keys to set; other keys keep their values. The session's data is at most 64 KB. */
|
|
38
|
+
data?: Record<string, unknown>;
|
|
39
|
+
/** Top-level keys to remove. */
|
|
40
|
+
deleteKeys?: string[];
|
|
41
|
+
/** Replaces the session's expiration. A new session expires one day after its last write. */
|
|
42
|
+
expiration?: SessionExpiration;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A value a session listing matches a data key against.
|
|
46
|
+
* @category Sessions
|
|
47
|
+
*/
|
|
48
|
+
export type SessionFilterValue = string | number | boolean | null;
|
|
49
|
+
/**
|
|
50
|
+
* Filters of a session listing.
|
|
51
|
+
* @category Sessions
|
|
52
|
+
*/
|
|
53
|
+
export interface ListSessionsFilter {
|
|
54
|
+
/** Top-level data keys that must equal the given values. */
|
|
55
|
+
data?: Record<string, SessionFilterValue>;
|
|
56
|
+
/** Only sessions created after this time. */
|
|
57
|
+
createdAfter?: Date;
|
|
58
|
+
/** Only sessions created before this time. */
|
|
59
|
+
createdBefore?: Date;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Asks for a page of sessions, newest first.
|
|
63
|
+
* @category Sessions
|
|
64
|
+
*/
|
|
65
|
+
export interface ListSessionsRequest {
|
|
66
|
+
/** The page size: 100 by default, at most 1000. */
|
|
67
|
+
limit?: number;
|
|
68
|
+
/** The `nextCursor` of the previous page. */
|
|
69
|
+
cursor?: string;
|
|
70
|
+
/** Filters of the listing. */
|
|
71
|
+
where?: ListSessionsFilter;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A page of sessions.
|
|
75
|
+
* @category Sessions
|
|
76
|
+
*/
|
|
77
|
+
export interface ListSessionsResponse {
|
|
78
|
+
/** The sessions of the page, newest first. */
|
|
79
|
+
sessions: Session[];
|
|
80
|
+
/** Pass it as `cursor` to get the next page. Absent on the last page. */
|
|
81
|
+
nextCursor?: string;
|
|
82
|
+
}
|
|
@@ -3,6 +3,7 @@ import { AiFunctionId } from '../public-types/backend.public-types';
|
|
|
3
3
|
import { AiAgentId, IntegrationId } from '../public-types/communication.public-types';
|
|
4
4
|
import { AuthWithBearer } from '../public-types/context.public-types';
|
|
5
5
|
import { IntegrationType } from '../public-types/integration.public-types';
|
|
6
|
+
import { Session, UpsertSessionRequest } from '../public-types/session.public-types';
|
|
6
7
|
/**
|
|
7
8
|
* Context object passed as a second parameter to every AI function call,
|
|
8
9
|
* providing both agent-specific and function-specific context.
|
|
@@ -24,6 +25,11 @@ export interface AiFunctionCallContext<FunctionContextType = unknown, AgentConte
|
|
|
24
25
|
functionContext: FunctionContextType;
|
|
25
26
|
/** The session associated with this AI function call. */
|
|
26
27
|
sessionContext: AiSessionContext;
|
|
28
|
+
/**
|
|
29
|
+
* The session (`squid.sessions()`) the agent call attached, read right before this function call. Absent when the
|
|
30
|
+
* call attached none, or when the session was deleted or expired.
|
|
31
|
+
*/
|
|
32
|
+
session?: Session;
|
|
27
33
|
/**
|
|
28
34
|
* Instructions of the calling AI agent, when the function runs an AI sub-agent that should
|
|
29
35
|
* honor them (e.g. formatting rules or domain conventions). For integration-connected functions
|
|
@@ -49,6 +55,16 @@ export declare class SecureAiAgentContext {
|
|
|
49
55
|
* `'models' in model` before reading it as a concrete model selection.
|
|
50
56
|
*/
|
|
51
57
|
readonly options?: AiChatRequestOptions;
|
|
58
|
+
/**
|
|
59
|
+
* The session the call asks to attach. Without the app API key, a new id creates it with the caller's `data`, and a
|
|
60
|
+
* live one is attached as it is: a rule that rejects it refuses the call.
|
|
61
|
+
*/
|
|
62
|
+
readonly session?: UpsertSessionRequest;
|
|
63
|
+
/**
|
|
64
|
+
* The live session stored under `session.id`, which a caller without the app API key attaches as it is: check that
|
|
65
|
+
* the caller may use it. Absent with the API key, which skips the rules.
|
|
66
|
+
*/
|
|
67
|
+
readonly storedSession?: Session;
|
|
52
68
|
}
|
|
53
69
|
/**
|
|
54
70
|
* Provides context to a knowledge base's `accessControl.scopeResolver` function, which turns the caller
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Session, UpsertSessionRequest } from '../public-types/session.public-types';
|
|
1
2
|
/**
|
|
2
3
|
* Which client-facing LangGraph action triggered this security check.
|
|
3
4
|
* @category AI
|
|
@@ -17,4 +18,14 @@ export declare class SecureLangGraphContext {
|
|
|
17
18
|
readonly resumePayload?: unknown;
|
|
18
19
|
/** The context the caller passed for the run (`invoke` and `resume`), which nodes read as `runtime.context`. */
|
|
19
20
|
readonly graphContext?: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* The session the call asks to attach (`invoke` and `resume`). Without the app API key, a new id creates it with the
|
|
23
|
+
* caller's `data`, and a live one is attached as it is: a rule that rejects it refuses the call.
|
|
24
|
+
*/
|
|
25
|
+
readonly session?: UpsertSessionRequest;
|
|
26
|
+
/**
|
|
27
|
+
* The live session stored under `session.id`, which a caller without the app API key attaches as it is: check that
|
|
28
|
+
* the caller may use it. Absent with the API key, which skips the rules.
|
|
29
|
+
*/
|
|
30
|
+
readonly storedSession?: Session;
|
|
20
31
|
}
|
|
@@ -6,7 +6,11 @@ export type StorageFunctionality = 'fileUpload' | 'getFileMetadata' | 'getDownlo
|
|
|
6
6
|
export interface StorageContext {
|
|
7
7
|
/** Identifier of the integration performing the storage action. */
|
|
8
8
|
integrationId: IntegrationId;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The keys the action runs on, as the bucket is accessed: each client path trimmed and stripped of one
|
|
11
|
+
* leading and one trailing '/', an uploaded file joined to its directory, a listed directory ending in
|
|
12
|
+
* '/' ('' for the bucket root). A path with a `.` or `..` segment is refused before any rule runs.
|
|
13
|
+
*/
|
|
10
14
|
pathsInBucket: Array<string>;
|
|
11
15
|
/** Type of action being performed on the storage. */
|
|
12
16
|
action: StorageActionType;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { LangGraphRunEvent } from '../public-types/langgraph.public-types';
|
|
2
|
+
export type { LangGraphRunEvent };
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/** Splits a field path into the segments `getInPath` walks: a dot or a bracket separates them. */
|
|
2
2
|
export declare const SPLIT_REGEX_FOR_GET_IN_PATH: RegExp;
|
|
3
|
-
/**
|
|
3
|
+
/** Reads [key] from [obj] itself; an inherited property, `__proto__` included, reads as undefined. */
|
|
4
|
+
export declare function getOwnProperty(obj: object, key: PropertyKey): unknown;
|
|
5
|
+
/**
|
|
6
|
+
* Sets [key] of [obj] as its own property. `__proto__` is defined rather than assigned, which would set the object's
|
|
7
|
+
* prototype instead; `JSON.parse` and bson make it an own key too.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setOwnProperty(obj: object, key: PropertyKey, value: unknown): void;
|
|
10
|
+
/** Returns a value by the `path`, reading own properties only. Works with array indexes, like a.b[0]. */
|
|
4
11
|
export declare function getInPath(obj: unknown, path: string): any;
|
|
5
12
|
export declare function isDateObject(value: unknown): value is Date;
|
|
6
|
-
/** Sets a value by path . Does not support array indexes. */
|
|
13
|
+
/** Sets a value by path, as own properties of the objects on it. Does not support array indexes. */
|
|
7
14
|
export declare function setInPath(obj: object, path: string, value: unknown, delimiter?: string): void;
|
|
8
15
|
export declare function deleteInPath(obj: object, path: string, delimiter?: string): void;
|
|
9
16
|
export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
|
|
@@ -31,6 +38,8 @@ export declare function cloneShallow<T>(value: T): T;
|
|
|
31
38
|
export declare function deepMerge<T extends object, U extends object>(target: T, source: U): T & U;
|
|
32
39
|
/** Returns true if the `value` is a defined object and is not an array. */
|
|
33
40
|
export declare function isPlainObject(value: unknown): value is object;
|
|
41
|
+
/** Returns true if the `value` is a defined object and is not an array, typed as a record of its fields. */
|
|
42
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
34
43
|
/**
|
|
35
44
|
* Returns true if the `value` is an object that JSON can hold as it is: a plain object whose values are JSON at any
|
|
36
45
|
* depth, with no `__proto__` key. A `Date` or another class instance is not one.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Sorts the keys of [json] at every depth. An own `__proto__` key is skipped unless [keepPrototypeKey]: the ids and
|
|
3
|
+
* subscription keys stored from {@link normalizeJsonAsString} carry no such key, while a comparison has to see it.
|
|
4
|
+
*/
|
|
5
|
+
export declare function sortKeys(json: unknown, keepPrototypeKey?: boolean): any;
|
|
2
6
|
export declare function normalizeJsonAsString(json: unknown): string;
|
|
3
7
|
export declare function serializeObj(obj: unknown): string;
|
|
4
8
|
/**
|
|
@@ -17,13 +21,13 @@ export declare function deserializeMultipartBody<T>(request: T): T;
|
|
|
17
21
|
export declare function encodeValueForMapping(value: unknown): string;
|
|
18
22
|
export declare function decodeValueForMapping(encodedString: string): any;
|
|
19
23
|
/**
|
|
20
|
-
* Compares 2 objects by their normalized JSON value.
|
|
24
|
+
* Compares 2 objects by their normalized JSON value, own `__proto__` keys included.
|
|
21
25
|
* This function should not be used with objects with circular references.
|
|
22
26
|
* Returns true if the object are equal.
|
|
23
27
|
*/
|
|
24
28
|
export declare function compareByNormalizedJsonValue<T>(v1: T | undefined, v2: T | undefined): boolean;
|
|
25
29
|
/**
|
|
26
|
-
* Compares 2 objects by their normalized JSON value for specific fields only.
|
|
30
|
+
* Compares 2 objects by their normalized JSON value for specific fields only, own `__proto__` keys included.
|
|
27
31
|
* This function should not be used with objects with circular references.
|
|
28
32
|
* Returns true if the specified fields are equal.
|
|
29
33
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function numberString(number: number): string;
|
|
2
|
+
export declare function plural(string: string, count: number, options?: {
|
|
3
|
+
suffix?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function titleCase(string: string): string;
|
|
7
|
+
export declare function abbreviate(text: string, maxLength: number, suffix?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Abbreviates a block of text into a single short line for logging.
|
|
10
|
+
*
|
|
11
|
+
* This function will:
|
|
12
|
+
* 1. Replace all runs of whitespace (spaces, tabs, line breaks) with a single space.
|
|
13
|
+
* 2. Trim leading and trailing whitespace.
|
|
14
|
+
* 3. Truncate to at most `maxLength` characters, appending `suffix` if the text was cut.
|
|
15
|
+
*/
|
|
16
|
+
export declare function shortify(text: string, maxLength?: number, suffix?: string): string;
|
|
17
|
+
/** Hashes the text with 32-bit FNV-1a, starting from `seed` (the standard offset basis by default). */
|
|
18
|
+
export declare function hashFnv1a32(text: string, seed?: number): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/jira-jsm-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.504",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"assertic": "^1.3.0",
|
|
28
|
-
"@squidcloud/client": "^1.0.
|
|
28
|
+
"@squidcloud/client": "^1.0.504"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=20.0.0"
|