feat: add Harness File Store support#197
Conversation
Add File Store resources for metadata, uploads, and content reads through the existing registry-backed MCP tools. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
- Extract shared isFormDataBody into src/utils/type-guards.ts, removing
duplicate definitions from harness-client.ts and registry/index.ts
- Refactor registry body-validation ternary to if/else for readability
- Fix create/update risk levels to match convention (low_write)
- Add missing delete operation (DELETE /ng/api/file-store/{identifier})
- Fix hydrateFileStoreUpdate leaking body/content fields into the GET
request by filtering input to just identifier and scope fields
- Add diagnosticHint and relatedResources for agent discoverability
- Add delete and preflight-leak regression tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AI-Session-Id: 5fee2ab6-dab8-4e3f-b487-d2c5eb3ff91c
AI-Tool: claude-code
AI-Model: unknown
There was a problem hiding this comment.
- Medium —
src/registry/toolsets/file-store.ts,src/tools/harness-create.ts,src/tools/harness-update.ts,src/tools/harness-delete.ts,src/tools/harness-describe.ts:file_store_itemnow advertisessupportedScopes: ["account", "org", "project"]on a write-capable resource, but the public write tools still do not exposeresource_scopeand do not opt into URL-derived scope. That meansharness_describetells agents to setresource_scope, yetharness_create/harness_update/harness_deletecan only hit account/org File Store writes through undocumentedparams.resource_scope; with configured defaults they otherwise fall back to project scope. This is a structured discoverability/runtime contract mismatch. - Low —
src/utils/url-parser.ts,src/registry/toolsets/file-store.ts,tests/utils/url-parser.test.ts: the PR adds File Store URL parsing, but the resource definition still has nodeepLinkTemplate, so File Store responses cannot emitopenInHarnesslinks even though pasted URLs now parse. There is also no matchingurl-parserregression coverage for the newfile-storesegment / URL-default merge path, so this new discoverability surface is one-way and unverified. - Low —
src/registry/index.ts,README.md: the branch is currently red onpnpm docs:checkbecause adding the new toolset changed the generated resource/toolset counts without regeneratingREADME.md. CI’spnpm testandpnpm typechecksteps passed on the PR head; docs sync is the remaining failure.
Overall, the File Store endpoint wiring itself is mostly aligned with the repo standards: declarative toolset registration, clean GET vs multipart-body separation, no body leakage in the update preflight, appropriate risk policies, and guarded output shaping for file downloads. The gaps are in shared-tool discoverability / round-trip UX rather than the endpoint mappings themselves.
Sent by Cursor Automation: Sunil On Demand Architecture Review
| description: "Harness File Store file or folder metadata. Supports listing, metadata lookup, create, and update.", | ||
| toolset: "file-store", | ||
| scope: "project", | ||
| supportedScopes: ["account", "org", "project"], |
There was a problem hiding this comment.
file_store_item is now a write-capable resource that advertises account/org/project scope, but the public write tools still do not publish a top-level resource_scope input and they intentionally ignore URL-derived scope on create/update/delete. That means harness_describe(resource_type='file_store_item') now tells agents they can set resource_scope, while harness_create / harness_update / harness_delete can only reach those paths through undocumented params.resource_scope and otherwise fall back to configured project scope. I think this should either be made schema-visible on the write tools or kept out of the advertised multi-scope contract.
| "experiments": { type: "chaos_experiment", contextField: "resource_id" }, | ||
| "registries": { type: "registry", contextField: "registry_id" }, | ||
| "artifacts": { type: "artifact", contextField: "artifact_id" }, | ||
| "file-store": { type: "file_store_item", contextField: "file_id" }, |
There was a problem hiding this comment.
This adds File Store URL parsing, but I don't see the corresponding round-trip discoverability follow-through: file_store_item still has no deepLinkTemplate, so responses won't include openInHarness, and there are no matching tests/utils/url-parser.test.ts cases for the new file-store segment / applyUrlDefaults() path. Since URL parsing is a cross-cutting agent-discovery surface, I'd expect the parser, deep links, and regression coverage to land together.


Add File Store resources for metadata, uploads, and content reads through the existing registry-backed MCP tools.
Description
add file store support.
you can now