Skip to content

Commit 6e6842b

Browse files
committed
Merge remote-tracking branch 'origin/staging' into wip/platform-org-wiring
# Conflicts: # .agents/skills/add-integration/SKILL.md
2 parents 0542cd1 + c7a4966 commit 6e6842b

8 files changed

Lines changed: 23 additions & 17 deletions

File tree

‎.agents/skills/add-integration/SKILL.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ service id:
8080
`server.ts`). Make one cheap, documented read on the tools' own host with the tools' own auth,
8181
reusing their header and URL builders. `domain` and `workspaceId` normalize to exactly the form
8282
the tools build URLs from and throw for anything that could steer the host or path
83-
(`normalizeHttpBaseUrl`, `allowedDomain`, and a refusal of credentials in the URL); the normalized domain is what
83+
(`normalizeHttpBaseUrl`, `allowedDomain`, `refuseUnsafeTypedUrl`); the normalized domain is what
8484
the credential stores. Set `egress` when the user chooses the host. Add `forbiddenMeansScoped`,
8585
`rejectsKey`, or `provesKey` only for documented replies (probe a fake key to see how a bad one
8686
answers), and `errorBodyEchoesToken` when an error body echoes the token.
@@ -359,7 +359,7 @@ export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
359359

360360
### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist
361361

362-
```typescript illustrative
362+
```typescript
363363
// Add import (alphabetically)
364364
import {
365365
{service}EventATrigger,
@@ -423,9 +423,7 @@ a resolvable capability must fail validation; an independent service account use
423423
## Step 8: Generate and Validate the Catalog
424424

425425
Run `bun run generate:tool-metadata`, `bun run scripts/generate-docs.ts`,
426-
`bun run generate:deployment-config`, `bun scripts/sync-platform-integration-metadata.ts` (the
427-
Platform integration catalog; `check:platform-integration-metadata` is in `check:audits`), then
428-
`bun run check:audits` (see the `validate-integration`
426+
`bun run generate:deployment-config`, then `bun run check:audits` (see the `validate-integration`
429427
skill → Regenerate Derived Artifacts for the full list and what each check verifies).
430428

431429
The docs generator creates `apps/docs/content/docs/integrations/{service}.mdx` — one page per service carrying the block's Actions and, if it has one, its Triggers section. Never hand-edit generated pages; the only editable region is the `{/* MANUAL-CONTENT */}` block (see `scripts/README.md`).
@@ -654,7 +652,7 @@ tools: {
654652

655653
#### 3. Define and register the in-process operation
656654

657-
```typescript illustrative
655+
```typescript
658656
export const {service}UploadTool: InternalToolConfig<Params, Response> = {
659657
id: '{service}_upload',
660658
// ...

‎apps/docs/content/docs/integrations/mistral_parse.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import { ReferenceDetails } from "@sim/emcn-docs/reference-details"
1010

1111

1212
{/* MANUAL-CONTENT-START:intro */}
13-
Use [Mistral's OCR API](https://mistral.ai/) to extract text and page structure from a PDF uploaded to Sim or supplied by URL. The current parser returns page Markdown, image metadata, the model, and usage information. **Specific Pages** accepts zero-based indices such as `0,1,2`; leave it empty to process all pages. The block offers Markdown, plain-text, and JSON format values, but its current result uses the structured page output documented below. Turn on **Extract Images** to get the images Mistral finds in the document (figures, logos, photos) as files on the `images` output, up to 100 per parse; each page's image entry carries a `file_name` matching its file. **Max Images** and **Min Image Size** (advanced) narrow what is extracted. **Tables** keeps tables inline in the page Markdown by default, or returns them separately as Markdown or HTML in each page's `tables` list.
13+
Use [Mistral's OCR API](https://mistral.ai/) to extract text and page structure from a PDF uploaded to Sim or passed in as a file from a previous block. The current parser returns page Markdown, image metadata, the model, and usage information. **Specific Pages** accepts zero-based indices such as `0,1,2`; leave it empty to process all pages. The block offers Markdown, plain-text, and JSON format values, but its current result uses the structured page output documented below. Turn on **Extract Images** to get the images Mistral finds in the document (figures, logos, photos) as files on the `images` output, up to 100 per parse; each page's image entry carries a `file_name` matching its file. **Max Images** and **Min Image Size** (advanced) narrow what is extracted. **Tables** keeps tables inline in the page Markdown by default, or returns them separately as Markdown or HTML in each page's `tables` list.
1414
{/* MANUAL-CONTENT-END */}
1515

1616
## Use the block [#usage-instructions]
1717

18-
Extract text, tables, and images from uploaded PDF documents, or from a URL. Images come back as files an agent can pass on.
18+
Extract text, tables, and images from an uploaded PDF or a file from a previous block. Images come back as files an agent can pass on.
1919

2020
## Actions
2121

‎apps/sim/blocks/blocks/mistral_parse.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
normalizeFileInput,
1313
parseOptionalNumberInput,
1414
} from '@/blocks/utils'
15+
import { MAX_OCR_EXTRACTED_IMAGES } from '@/tools/mistral/types'
1516

1617
export const MistralParseBlock: BlockConfig = {
1718
type: 'mistral_parse',
@@ -310,7 +311,7 @@ export const MistralParseV3Block: BlockConfig = {
310311
name: 'Mistral Parser',
311312
description: 'Extract text, tables, and images from PDF documents',
312313
longDescription:
313-
'Extract text, tables, and images from uploaded PDF documents, or from a URL. Images come back as files an agent can pass on.',
314+
'Extract text, tables, and images from an uploaded PDF or a file from a previous block. Images come back as files an agent can pass on.',
314315
hideFromToolbar: false,
315316
/* v3 renamed the canonical pair's advanced member `filePath` -> `fileReference`,
316317
so the inherited sentence would reference a subblock this block lacks. */
@@ -464,6 +465,7 @@ export const MistralParseV3Block: BlockConfig = {
464465
parameters.imageLimit = parseOptionalNumberInput(params.imageLimit, 'Max Images', {
465466
integer: true,
466467
min: 0,
468+
max: MAX_OCR_EXTRACTED_IMAGES,
467469
})
468470
parameters.imageMinSize = parseOptionalNumberInput(
469471
params.imageMinSize,

‎apps/sim/lib/internal/mistral/images.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, it } from 'vitest'
2-
import { extractOcrImageFiles, MAX_OCR_EXTRACTED_IMAGES } from '@/lib/internal/mistral/images'
2+
import { extractOcrImageFiles } from '@/lib/internal/mistral/images'
3+
import { MAX_OCR_EXTRACTED_IMAGES } from '@/tools/mistral/types'
34

45
const JPEG = Buffer.concat([Buffer.from([0xff, 0xd8, 0xff]), Buffer.from('synthetic jpeg body')])
56
const dataUri = (bytes: Buffer) => `data:image/jpeg;base64,${bytes.toString('base64')}`

‎apps/sim/lib/internal/mistral/images.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import type { InternalToolFile } from '@/lib/internal/tool-operations/file-resul
55
import { MAX_BUFFERED_TRANSFER_BYTES } from '@/lib/uploads/shared/types'
66
import { resolveEffectiveMimeType } from '@/lib/uploads/utils/file'
77
import { resolveStoredFileMetadata } from '@/lib/uploads/utils/stored-file-metadata'
8-
9-
/** Most images one parse stores; Mistral's `image_limit` is clamped to it. */
10-
export const MAX_OCR_EXTRACTED_IMAGES = 100
8+
import { MAX_OCR_EXTRACTED_IMAGES } from '@/tools/mistral/types'
119

1210
/** Largest single image kept; a bigger one is a page scan, not a figure. */
1311
const MAX_OCR_IMAGE_BYTES = 20 * 1024 * 1024

‎apps/sim/lib/internal/mistral/operations.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { decodeDataUriWithinLimit } from '@/lib/file-parsers/data-uri'
77
import { isFileParserError } from '@/lib/file-parsers/errors'
88
import { submitMistralOcr } from '@/lib/internal/mistral/client'
99
import { MistralOperationError } from '@/lib/internal/mistral/errors'
10-
import { extractOcrImageFiles, MAX_OCR_EXTRACTED_IMAGES } from '@/lib/internal/mistral/images'
10+
import { extractOcrImageFiles } from '@/lib/internal/mistral/images'
1111
import type { MistralParseInput } from '@/lib/internal/mistral/input'
1212
import { countMistralPdfPages } from '@/lib/internal/mistral/page-count'
1313
import {
@@ -31,6 +31,7 @@ import {
3131
type ServableFile,
3232
} from '@/lib/uploads/utils/file.server'
3333
import { assertToolFileAccess } from '@/app/api/files/authorization'
34+
import { MAX_OCR_EXTRACTED_IMAGES } from '@/tools/mistral/types'
3435

3536
const logger = createLogger('MistralOperations')
3637
const IMAGE_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.avif'] as const

‎apps/sim/tools/mistral/types.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import type { RawFileInput } from '@/lib/uploads/utils/file'
22
import type { UserFile } from '@/executor/types'
33
import type { OutputProperty, ToolResponse } from '@/tools/types'
44

5+
/**
6+
* Most images one Mistral Parser run extracts. Bounds the block's Max Images field, the
7+
* server's `image_limit` clamp, and the extraction loop.
8+
*/
9+
export const MAX_OCR_EXTRACTED_IMAGES = 100
10+
511
/**
612
* Shared output property definitions for Mistral OCR API responses.
713
* Based on Mistral API documentation: https://docs.mistral.ai/api/endpoint/ocr

‎packages/deployment-config/src/integrations.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updatedAt": "2026-11-10",
2+
"updatedAt": "2026-11-11",
33
"integrations": [
44
{
55
"type": "onepassword",
@@ -18362,7 +18362,7 @@
1836218362
"slug": "mistral-parser",
1836318363
"name": "Mistral Parser",
1836418364
"description": "Extract text, tables, and images from PDF documents",
18365-
"longDescription": "Extract text, tables, and images from uploaded PDF documents, or from a URL. Images come back as files an agent can pass on.",
18365+
"longDescription": "Extract text, tables, and images from an uploaded PDF or a file from a previous block. Images come back as files an agent can pass on.",
1836618366
"bgColor": "#000000",
1836718367
"iconName": "MistralIcon",
1836818368
"docsUrl": "https://docs.sim.ai/integrations/mistral_parse",
@@ -18379,7 +18379,7 @@
1837918379
"category": "tools",
1838018380
"integrationType": "ai",
1838118381
"tags": ["document-processing", "ocr"],
18382-
"updatedAt": "2026-11-10"
18382+
"updatedAt": "2026-11-11"
1838318383
},
1838418384
{
1838518385
"type": "modal",

0 commit comments

Comments
 (0)