@squidcloud/slack-client 1.0.420 → 1.0.421

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,3 +1,4 @@
1
+ import { JSONSchema } from 'json-schema-typed';
1
2
  import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiEmbeddingsModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, GeminiChatModelName, GrokChatModelName, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat } from './ai-common.public-types';
2
3
  import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
3
4
  import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
@@ -146,9 +147,76 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
146
147
  */
147
148
  export type ApiKeySource = 'user' | 'system';
148
149
  /**
150
+ * Structured output format configuration for AI models that support schema-constrained responses.
151
+ *
152
+ * When used with supported Anthropic models (claude-sonnet-4-5-20250929, claude-opus-4-1-20250805),
153
+ * this guarantees that responses will strictly conform to the provided JSON schema through
154
+ * constrained decoding - the model cannot generate tokens that violate the schema.
155
+ *
156
+ * **Example:**
157
+ * ```typescript
158
+ * {
159
+ * type: 'json_schema',
160
+ * schema: {
161
+ * type: 'object',
162
+ * properties: {
163
+ * name: { type: 'string' },
164
+ * age: { type: 'number' }
165
+ * },
166
+ * required: ['name', 'age'],
167
+ * additionalProperties: false
168
+ * }
169
+ * }
170
+ * ```
171
+ *
172
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs
149
173
  * @category AI
150
174
  */
151
- export type AiAgentResponseFormat = 'text' | 'json_object';
175
+ export interface AiStructuredOutputFormat {
176
+ /**
177
+ * The type of structured output.
178
+ * Currently only 'json_schema' is supported by Anthropic models.
179
+ */
180
+ type: 'json_schema';
181
+ /**
182
+ * The JSON schema that the AI response must strictly conform to.
183
+ * Uses constrained decoding to guarantee schema compliance.
184
+ */
185
+ schema: JSONSchema;
186
+ }
187
+ /**
188
+ * Response format for AI agent responses.
189
+ *
190
+ * **Available formats:**
191
+ * - `'text'`: Plain text response (default) - standard conversational output
192
+ * - `'json_object'`: JSON response - model attempts to return valid JSON, but without strict schema validation
193
+ * - `AiStructuredOutputFormat`: Structured output with schema (Anthropic only) - guarantees JSON conforms exactly to provided schema
194
+ *
195
+ * **Structured outputs (Anthropic-specific):**
196
+ * For Anthropic models that support structured outputs, you can pass an object with `type: 'json_schema'`
197
+ * and a JSON schema. This uses constrained decoding to guarantee the response matches your schema perfectly,
198
+ * eliminating parsing errors and validation issues.
199
+ *
200
+ * **Example with structured output:**
201
+ * ```typescript
202
+ * {
203
+ * responseFormat: {
204
+ * type: 'json_schema',
205
+ * schema: {
206
+ * type: 'object',
207
+ * properties: {
208
+ * sentiment: { type: 'string', enum: ['positive', 'negative', 'neutral'] },
209
+ * confidence: { type: 'number', minimum: 0, maximum: 1 }
210
+ * },
211
+ * required: ['sentiment', 'confidence']
212
+ * }
213
+ * }
214
+ * }
215
+ * ```
216
+ *
217
+ * @category AI
218
+ */
219
+ export type AiAgentResponseFormat = 'text' | 'json_object' | AiStructuredOutputFormat;
152
220
  /**
153
221
  * @category AI
154
222
  */
@@ -429,6 +497,32 @@ export type AiReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
429
497
  export type AiVerbosityLevel = 'low' | 'medium' | 'high';
430
498
  /**
431
499
  * Chat options specific to Anthropic models, extending base options.
500
+ *
501
+ * **Structured Outputs:**
502
+ * Anthropic models (claude-sonnet-4-5-20250929, claude-opus-4-1-20250805) support structured outputs
503
+ * through the `responseFormat` field. Pass an object with `type: 'json_schema'` and a JSON schema
504
+ * to guarantee the response conforms exactly to your schema.
505
+ *
506
+ * **Example:**
507
+ * ```typescript
508
+ * {
509
+ * model: 'claude-sonnet-4-5-20250929',
510
+ * responseFormat: {
511
+ * type: 'json_schema',
512
+ * schema: {
513
+ * type: 'object',
514
+ * properties: {
515
+ * name: { type: 'string' },
516
+ * age: { type: 'number' }
517
+ * },
518
+ * required: ['name', 'age'],
519
+ * additionalProperties: false
520
+ * }
521
+ * }
522
+ * }
523
+ * ```
524
+ *
525
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs
432
526
  * @category AI
433
527
  */
434
528
  export interface AnthropicChatOptions extends BaseAiChatOptions {
@@ -764,4 +858,42 @@ export type AiSessionContext = {
764
858
  /** The ID of the job associated with the session. */
765
859
  jobId: JobId;
766
860
  };
861
+ /**
862
+ * API request to delete an AI agent
863
+ * @category AI
864
+ */
865
+ export interface DeleteAgentRequest {
866
+ /** The ID of the agent to delete */
867
+ agentId: string;
868
+ }
869
+ /**
870
+ * API response from agent ask methods
871
+ * @category AI
872
+ */
873
+ export interface AiAskResponse {
874
+ /** The response string from the agent */
875
+ responseString: string;
876
+ /** Optional annotations (e.g., file references) in the response */
877
+ annotations?: Record<string, AiAnnotation>;
878
+ }
879
+ /**
880
+ * API request to create speech from text
881
+ * @category AI
882
+ */
883
+ export interface AiAudioCreateSpeechRequest {
884
+ /** The text input to convert to speech */
885
+ input: string;
886
+ /** Options for speech generation */
887
+ options: AiAudioCreateSpeechOptions;
888
+ }
889
+ /**
890
+ * API request to generate an image
891
+ * @category AI
892
+ */
893
+ export interface AiGenerateImageRequest {
894
+ /** The prompt describing the image to generate */
895
+ prompt: string;
896
+ /** Options for image generation */
897
+ options?: AiGenerateImageOptions;
898
+ }
767
899
  export {};
@@ -36,16 +36,16 @@ export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemin
36
36
  *
37
37
  * @category AI
38
38
  */
39
- export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning"];
39
+ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
40
40
  /**
41
41
  * @category AI
42
42
  */
43
- export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
43
+ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
44
44
  /**
45
45
  * The supported AI model names.
46
46
  * @category AI
47
47
  */
48
- export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning"];
48
+ export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
49
49
  /**
50
50
  * Check if the given model name is a global AI chat model name.
51
51
  */
@@ -386,4 +386,46 @@ export type AiKnowledgeBaseWithOptionalChatModel = Omit<AiKnowledgeBase, 'chatMo
386
386
  chatModel?: AiKnowledgeBase['chatModel'];
387
387
  name?: string;
388
388
  };
389
+ /**
390
+ * API request for deleting an AiKnowledgeBase
391
+ * @category AI
392
+ */
393
+ export interface DeleteAiKnowledgeBaseRequest {
394
+ /** The id of the AiKnowledgeBase */
395
+ id: string;
396
+ }
397
+ /**
398
+ * API request for upserting an AiKnowledgeBase
399
+ * @category AI
400
+ */
401
+ export interface UpsertAiKnowledgeBaseRequest {
402
+ /** The AiKnowledgeBase to upsert */
403
+ knowledgeBase: Omit<AiKnowledgeBaseWithOptionalChatModel, 'appId' | 'updatedAt'>;
404
+ }
405
+ /**
406
+ * API request for deleting AiKnowledgeBaseContexts
407
+ * @category AI
408
+ */
409
+ export interface DeleteAiKnowledgeBaseContextsRequest {
410
+ /** The id of the AiKnowledgeBase */
411
+ knowledgeBaseId: string;
412
+ /** An array of AiKnowledgeBaseContext ids */
413
+ contextIds: Array<string>;
414
+ }
415
+ /**
416
+ * API response to list AiKnowledgeBaseContexts
417
+ * @category AI
418
+ */
419
+ export interface ListAiKnowledgeBaseContextsResponse {
420
+ /** The list of AiKnowledgeBaseContexts */
421
+ contexts: Array<AiKnowledgeBaseContext>;
422
+ }
423
+ /**
424
+ * API response for searching an AiKnowledgeBase
425
+ * @category AI
426
+ */
427
+ export interface AiKnowledgeBaseSearchResponse {
428
+ /** Array of result chunks from the search */
429
+ chunks: Array<AiKnowledgeBaseSearchResultChunk>;
430
+ }
389
431
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/slack-client",
3
- "version": "1.0.420",
3
+ "version": "1.0.421",
4
4
  "description": "Squid Slack Client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/client/src/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "assertic": "^1.3.0",
21
21
  "lodash": "^4.17.21",
22
- "@squidcloud/client": "^1.0.420",
22
+ "@squidcloud/client": "^1.0.421",
23
23
  "@slack/bolt": "^4.5.0"
24
24
  },
25
25
  "engines": {