Skip to content

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs

Comment 1, line 1

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:1

//! Cline detection: legacy ui_messages.json array fingerprints, with separate SDK dispatch.

Comment 2, line 2

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:2

//!

Comment 3, line 3

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:3

//! Legacy ui_messages.json has no version field; its format uses the document-level

Comment 4, line 4

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:4

//! [`super::versions::CLINE_FORMAT_VERSION`] (fixed source dcf8c3c). This branch

Comment 5, line 5

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:5

//! does not dispatch unknown versions; SDK files use sdk_messages_v1::detect.

Comment 6, line 6

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:6

//!

Comment 7, line 7

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:7

//! Detection rules (V17 rejects unrecognized shapes):

Comment 8, line 8

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:8

//! - Read the first 64 KiB, strip UTF-8 BOM; a nonarray prefix is UnknownFormat.

Comment 9, line 9

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:9

//! Unrecognized files are not parsed by guessing their format.

Comment 10, line 10

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:10

//! - Missing say/type fingerprint is UnknownFormat.

Comment 11, line 11

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:11

//! - Empty content is Pending and is probed again next round.

Comment 12, line 12

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:12

//! - A matching fingerprint is Supported with the registered document format;

Comment 13, line 13

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:13

//! basis is KnownVersion. Scanning checks each message kind separately.

Comment 14, line 24

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:24

/// Detection window: first 64 KiB, without parsing the entire file.

Comment 15, line 27

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:27

/// Detect an SDK file separately, or a legacy task ui_messages.json file.

Comment 16, line 28

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:28

/// A legacy fingerprint selects the fixed document format with KnownVersion.

Comment 17, line 33

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:33

// Transient read failure (lock/timeout/disappearance) is Pending for the next probe.

Comment 18, line 47

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:47

// Fingerprint: say/type markers; getApiMetrics.ts consumes type="say" messages.

Comment 19, line 57

desktop/src-tauri/crates/core/src/adapters/cline/detect.rs:57

// Typed messages without say in this window do not establish a Cline array.