@squidcloud/backend 1.0.289 → 1.0.291

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.
@@ -11,17 +11,17 @@ export declare class AiChatbotMutationContext {
11
11
  * Context object passed as a second parameter to every AI function call,
12
12
  * providing both agent-specific and function-specific context.
13
13
  */
14
- export interface AiFunctionContext {
14
+ export interface AiFunctionContext<AgentContextType = unknown, FunctionContextType = unknown> {
15
15
  /** Unique identifier for the AI agent making the call. */
16
16
  agentId?: AiAgentId;
17
17
  /**
18
18
  * Persistent context for the specific AI agent.
19
19
  * Remains constant across all AI functions used by this agent.
20
20
  */
21
- agentContext: Record<string, unknown>;
21
+ agentContext: AgentContextType;
22
22
  /**
23
23
  * Context specific to each individual AI function call.
24
24
  * Can contain parameters or data unique to the current function invocation.
25
25
  */
26
- functionContext: Record<string, unknown>;
26
+ functionContext: FunctionContextType;
27
27
  }
@@ -25,7 +25,7 @@ export type SecureGraphQLAction = ((context: GraphqlContext) => boolean | Promis
25
25
  export type SecureAiChatbotAction<T extends AiChatbotActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'chat' ? ((context: AiChatbotChatContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: AiChatbotMutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
26
26
  export type ClientConnectionStateChangeAction = (clientId: ClientId, clientConnectionState: ClientConnectionState) => Promise<void> | void;
27
27
  export type ExecutableAction = (...args: any[]) => any;
28
- export type AiFunctionAction<T extends Record<string, any> = any> = (params: T, context: AiFunctionContext) => any;
28
+ export type AiFunctionAction<T extends Record<string, any> = any> = (params: T, context: AiFunctionContext<any, any>) => any;
29
29
  export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
30
30
  /** The context provided to a trigger function. */
31
31
  export interface TriggerRequest<T extends DocumentData = any> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/backend",
3
- "version": "1.0.289",
3
+ "version": "1.0.291",
4
4
  "description": "Squid Cloud's backend SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/backend/src/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "graphql": "^16.9.0"
27
27
  },
28
28
  "peerDependencies": {
29
- "@squidcloud/client": "^1.0.289"
29
+ "@squidcloud/client": "^1.0.291"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=20.0.0"