@squidcloud/backend 1.0.465 → 1.0.467

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.
@@ -153,17 +153,16 @@ export declare function onQueueMessage<T = unknown>(topicName: TopicName, integr
153
153
  */
154
154
  export declare function executable(): ActionMethodDecorator<ExecutableAction>;
155
155
  /**
156
- * Options for the `@aiFunction` annotation.
156
+ * Options common to every `@aiFunction` annotation, regardless of how the
157
+ * function's description is supplied. See {@link AiFunctionMetadataOptions}.
157
158
  * @category AI
158
159
  */
159
- export interface AiFunctionMetadataOptions {
160
+ export interface AiFunctionMetadataBaseOptions {
160
161
  /**
161
162
  * Unique AI function ID. If not set, the function name (excluding the class name) is used as the default ID.
162
163
  * If not provided the ID of the function is constructed as 'ClassName:FunctionName'.
163
164
  */
164
165
  id?: AiFunctionId;
165
- /** Describes the capabilities of the function. This is used by the AI agent to determine when to call it. */
166
- description: string;
167
166
  /** Parameters for the AI function. These parameters are passed to the function by the calling agent. */
168
167
  params: Array<AiFunctionParam>;
169
168
  /** Additional optional attributes for the function. Example: related integrations. */
@@ -181,6 +180,29 @@ export interface AiFunctionMetadataOptions {
181
180
  /** Mark the function as internal-only. Hides the function from appearing in the Studio. */
182
181
  internal?: boolean;
183
182
  }
183
+ /**
184
+ * Options for the `@aiFunction` annotation.
185
+ *
186
+ * You must provide a `description` — it tells the AI agent when to call the function. The alternative
187
+ * `promptId` form is an advanced option used only by Squid's built-in connectors to source the description
188
+ * from the central prompt registry; customer functions always use `description`.
189
+ * @category AI
190
+ */
191
+ export type AiFunctionMetadataOptions = AiFunctionMetadataBaseOptions & ({
192
+ /** Describes the capabilities of the function. This is used by the AI agent to determine when to call it. */
193
+ description: string;
194
+ /** Not used with `description`; supply one or the other. */
195
+ promptId?: never;
196
+ } | {
197
+ /**
198
+ * Id of a registered prompt that supplies this function's description, as an alternative to an inline
199
+ * `description`. Squid's built-in connectors use this to keep tool descriptions in the central prompt
200
+ * registry. The id is stored verbatim and resolved server-side — it is never resolved here in the SDK.
201
+ */
202
+ promptId: string;
203
+ /** Optional inline description; when omitted, the description comes from `promptId`. */
204
+ description?: string;
205
+ });
184
206
  /**
185
207
  * Options for the `@mcpTool` annotation.
186
208
  * @category AI