Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/tools-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Open the target project workspace before you upload. Upload works from the proje
}
```

The result gives `project_id`, `count`, and `assets`. Each asset gives its `id`, `name`, `kind`, and `primary_media_id` when available.
The `list` result gives `project_id`, `project_title`, `count`, and `assets`. The `upload` result gives `project_id`, `count`, and `assets`. Each asset gives its `id`, `name`, `kind`, and `primary_media_id` when available.

If the batch stops, the error gives the assets that Flow confirms before the failure. It also gives `file` if the tool can identify the file in progress. If you get `outcome_unknown`, check the project before you retry.

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/tools-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Flow シーンタイムラインの一覧表示、作成、クリップ追加、
}
```

結果には `project_id`、`count`、`assets` が含まれます。各アセットには `id`、`name`、`kind`、取得できる場合は `primary_media_id` が含まれます。
`list` の結果には `project_id`、`project_title`、`count`、`assets` が含まれます。`upload` の結果には `project_id`、`count`、`assets` が含まれます。各アセットには `id`、`name`、`kind`、取得できる場合は `primary_media_id` が含まれます。

途中で失敗した場合、エラーには Flow が確認済みのアセットが含まれます。処理中のファイルを特定できる場合は `file` も返ります。`outcome_unknown` が返った場合は、再試行の前にプロジェクトを確認してください。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/tools-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ flow-mcp [OPTIONS] <COMMAND>
}
```

返回 `project_id`、`count` 和 `assets`。每项包含 `id`、`name`、`kind`,并在可用时返回 `primary_media_id`。
`list` 返回 `project_id`、`project_title`、`count` 和 `assets`。`upload` 返回 `project_id`、`count` 和 `assets`。每项包含 `id`、`name`、`kind`,并在可用时返回 `primary_media_id`。

批次中途失败时,错误包含 Flow 已确认的资源。若能确定处理到哪个文件,也会返回 `file`。收到 `outcome_unknown` 时,请检查项目后再重试。

Expand Down
22 changes: 17 additions & 5 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ async fn read_project_assets(engine: &ChromeEngine) -> Result<ProjectAssetsSnaps
.map(str::to_string);
let project_title = snap
.get("projectTitle")
.and_then(|v| v.as_str())
.and_then(Value::as_str)
.map(str::trim)
.filter(|s| !s.is_empty())
.map(str::to_string);
Expand Down Expand Up @@ -325,11 +325,11 @@ pub(crate) async fn resolve_asset(
Ok((target, snap.project_id, snap.project_title))
}

/// Lists assets in the active Flow project matching optional query, kind, collection, and limit filters.
pub(crate) async fn list_assets(
/// Lists filtered assets together with the active project ID and authoritative project title.
pub(crate) async fn list_assets_snapshot(
engine: &ChromeEngine,
request: &AssetsParams,
) -> Result<Vec<FlowAsset>> {
) -> Result<ProjectAssetsSnapshot> {
let snap = read_project_assets(engine).await?;
let all = snap.assets;

Expand Down Expand Up @@ -396,7 +396,19 @@ pub(crate) async fn list_assets(
filtered.truncate(lim);
}
}
Ok(filtered)
Ok(ProjectAssetsSnapshot {
project_id: snap.project_id,
project_title: snap.project_title,
assets: filtered,
})
}

/// Lists assets in the active Flow project matching optional query, kind, collection, and limit filters.
pub(crate) async fn list_assets(
engine: &ChromeEngine,
request: &AssetsParams,
) -> Result<Vec<FlowAsset>> {
Ok(list_assets_snapshot(engine, request).await?.assets)
}

/// Checks whether the asset snapshot shows the requested name.
Expand Down
Loading
Loading