Compare Files
file.compare_files
Overview
You pass two managed file references and we compare them deterministically. Choose size (byte length), hash (default SHA-256), binary (first differing byte offset), or text (first differing line, with optional line-ending normalization). We always return each file's size and hash. Read-only — we never modify your files. Do not use this when you need a full unified diff or patch.
You need a deterministic answer to "are these files the same?" without pulling bytes into your agent context or building diff logic yourself.
Reliability
Deterministic: the same two files always give the same answer for size, hash, byte-offset, and line comparisons. We read at most 100 MiB per file, and anything larger fails validation — split or trim the file before you retry. A file reference resolves only inside your own tenant, so a reference belonging to someone else, or one that has already expired, comes back as a validation error telling you the reference is not accessible; upload the file again and call us with the fresh reference. An unsupported hashAlgorithm or textEncoding also fails validation, and retrying the same request will not help — fix the parameter first.
Context footprint
Returns equal, per-file size and hash, and the first difference when they diverge. A successful call costs 5 execution credits.
When to use it
When you have two managed file references and need equality or the first difference.
When you need a full line-by-line patch or side-by-side diff view.
Scope
Non-goals
- Does not produce a full diff patch
- Does not modify either file
- Does not fetch external URLs
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 50 MiB | Platform maximum |
How we handle your data
What this means
This skill may temporarily store files or intermediate data only to complete execution. Temporary data is protected and automatically deleted.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Temporary execution only storage
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| leftFileRef | string | Yes | Managed left-hand file reference resolved inside the current tenant, read up to 100 MiB. |
| rightFileRef | string | Yes | Managed right-hand file reference resolved inside the current tenant, read up to 100 MiB. |
| mode | string | No | Comparison mode; omit it for hash. |
| hashAlgorithm | string | No | Digest used for per-file hash fields and hash mode; omit it for SHA-256. |
| textEncoding | string | No | Character encoding for text mode; omit it for UTF-8. |
| normalizeLineEndings | boolean | No | Whether CRLF and CR become LF before text comparison; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| equal | boolean | Yes | True when the files match under the chosen mode. |
| mode | string | Yes | Comparison mode that was applied. |
| left | object | Yes | Closed file summary with size and digest under the chosen hashAlgorithm. |
| right | object | Yes | Closed file summary with size and digest under the chosen hashAlgorithm. |
| differences | array | Yes | Bounded array of 0 or 1 closed first-difference objects; empty when equal is true. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"file.compare_files","input":{"leftFileRef":"squillify://files/f-a","rightFileRef":"squillify://files/f-b"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("file.compare_files", {"rightFileRef":"squillify://files/f-b","leftFileRef":"squillify://files/f-a","mode":"hash"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not produce a full diff patch
- Does not modify either file
- Does not fetch external URLs
- Generating a human-readable unified diff
- Comparing files outside your managed file references
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "file.compare_files",
"input": {
"rightFileRef": "squillify://files/f-b",
"leftFileRef": "squillify://files/f-a",
"mode": "hash"
}
}Examples
Identical files match by SHA-256 hash
{
"rightFileRef": "squillify://files/f-b",
"leftFileRef": "squillify://files/f-a",
"mode": "hash"
}{
"equal": true,
"left": {
"sizeBytes": 5,
"hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
},
"mode": "hash",
"right": {
"sizeBytes": 5,
"hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
},
"differences": []
}Text mode reports the first differing line
{
"rightFileRef": "squillify://files/f-c",
"leftFileRef": "squillify://files/f-a",
"mode": "text"
}{
"equal": false,
"left": {
"sizeBytes": 5,
"hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
},
"mode": "text",
"right": {
"sizeBytes": 5,
"hash": "486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7"
},
"differences": [
{
"type": "text",
"firstDifferingLine": 1
}
]
}Recommended use cases
- Integrity checks before handoff
- Duplicate detection across uploads
- Regression comparisons in CI
Avoid for
- Generating a human-readable unified diff
- Comparing files outside your managed file references
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.