@squidcloud/backend 1.0.351 → 1.0.353

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,17 +1,28 @@
1
- import { AiAgentId } from '@squidcloud/client';
1
+ import { AiAgentId, IntegrationId } from '@squidcloud/client';
2
+ import { IntegrationType } from '@squidcloud/client';
2
3
  /**
3
4
  * Context object passed as a second parameter to every AI function call,
4
5
  * providing both agent-specific and function-specific context.
5
6
  * @category AI
6
7
  */
7
- export interface AiFunctionContext<AgentContextType = unknown, FunctionContextType = unknown> {
8
+ export interface AiFunctionContext<FunctionContextType = unknown, AgentContextType = unknown> {
8
9
  /** Unique identifier for the AI agent making the call. */
9
- agentId?: AiAgentId;
10
+ agentId: AiAgentId;
10
11
  /**
11
- * Persistent context for the specific AI agent.
12
- * Remains constant across all AI functions used by this agent.
12
+ * Persistent context of the AI agent that calls the function.
13
+ * Same for all AI functions used by this agent.
13
14
  */
14
15
  agentContext: AgentContextType;
16
+ /**
17
+ * Unique ID of the integration instance.
18
+ * Defined only for functions with an integration type specified.
19
+ */
20
+ integrationId: IntegrationId;
21
+ /**
22
+ * Type of the integration, such as 'mysql', 'mail', etc...
23
+ * Defined only for functions with an integration type specified.
24
+ */
25
+ integrationType: IntegrationType;
15
26
  /**
16
27
  * Context specific to each individual AI function call.
17
28
  * Can contain parameters or data unique to the current function invocation.
@@ -10,7 +10,7 @@ import { GraphqlContext } from './graphql.public-context';
10
10
  import { NativeQueryContext } from './native-query.public-context';
11
11
  import { SecureMetricContext } from './metric.public-context';
12
12
  import { DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from './bundle-data.public-types';
13
- import { StorageContext } from './storage.types';
13
+ import { StorageContext } from './storage.public-types';
14
14
  import { AiFunctionContext, SecureAiAgentContext } from './ai-agent.public-context';
15
15
  /**
16
16
  * @category Database
@@ -46,7 +46,7 @@ export type ExecutableAction = (...args: any[]) => any;
46
46
  * A type defining an AI function action with parameters and context.
47
47
  * @category AI
48
48
  */
49
- export type AiFunctionAction<T extends Record<string, any> = any> = (params: T, context: AiFunctionContext<any, any>) => any;
49
+ export type AiFunctionAction<T extends Record<string, any> = any> = (params: T, context: AiFunctionContext<any>) => any;
50
50
  /** A type defining a trigger function that responds to document changes. */
51
51
  export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
52
52
  /** The context provided to a trigger function. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/backend",
3
- "version": "1.0.351",
3
+ "version": "1.0.353",
4
4
  "description": "Squid Cloud's backend SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/backend/src/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "typedoc-plugin-markdown": "^4.5.2"
34
34
  },
35
35
  "peerDependencies": {
36
- "@squidcloud/client": "^1.0.351"
36
+ "@squidcloud/client": "^1.0.353"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=20.0.0"