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
11 changes: 11 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# AGENTS.md

## Cross-client parity

This JavaScript client and [dClimate/dclimate-client-py](https://github.com/dClimate/dclimate-client-py) are sibling libraries. Keep their user-visible capabilities and behavior aligned unless a language or runtime difference makes a change inapplicable.

- For every public API or behavior change—especially STAC/IPFS resolution, dataset loading and selection, metadata, errors, and catalog listing—inspect the corresponding implementation, tests, documentation, and relevant open work in the Python client before finishing.
- Unless the user explicitly limits the task to one repository, treat an applicable sibling-library update as part of the same task. Add equivalent tests and documentation in both projects, using idiomatic APIs for each language rather than mechanically copying implementation details.
- If a change is not applicable to the sibling, or the sibling cannot be updated in the current task, state the reason and leave a concrete follow-up in the handoff or pull-request description. Do not silently allow accidental divergence.
- When reviewing either client, treat undocumented behavioral differences as possible defects and verify whether parity should be restored.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,22 @@ catalog.forEach(({ collection, datasets }) => {
});
```

### Resolving a CID directly

Use the public STAC resolver when you need the selected CID and variant without loading the dataset. The API is natively asynchronous and uses the platform's pooled `fetch` implementation.

```typescript
import { resolveCidFromStacServer } from "@dclimate/dclimate-client-js";

const resolved = await resolveCidFromStacServer(
"ecmwf_aifs",
"temperature_forecast",
"single"
);

console.log(resolved.cid, resolved.variant);
```

## Configuration

### Client options
Expand Down Expand Up @@ -357,6 +373,12 @@ Metric attributes include the gateway URL, store type, and status. The dataset C
- `listAvailableDatasets()` - Get the full dataset catalog
- `siren` - Namespaced Siren REST API client (getter; throws `SirenNotConfiguredError` unless `siren` is configured)

### STAC utilities

- `resolveCidFromStacServer(collection, dataset, variant?, serverUrl?)` - Resolve a CID and selected variant without loading the dataset
- `resolveDatasetCidFromStacServer(collection, dataset, variant?, serverUrl?)` - Resolve only the CID string
- `listAvailableDatasetsFromStacServer(serverUrl?)` - List collections, datasets, and variants directly from the paginated STAC API

### SirenClient (via `client.siren` or standalone)

- `getMetricData(query)` - Fetch metric data for a region over a date range
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dclimate/dclimate-client-js",
"version": "0.6.0",
"version": "0.7.0",
"description": "JavaScript client for dClimate datasets using jaxray and IPFS stores",
"type": "module",
"main": "./dist/node/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export {
getConcatenableItemsFromStac,
listAvailableDatasetsFromStac,
listAvailableDatasetsFromStacServer,
resolveCidFromStacServer,
resolveDatasetCidFromStacServer,
DEFAULT_STAC_SERVER_URL,
getRootCatalogCid,
resolveIpfsUri,
type StacCatalog,
Expand All @@ -25,6 +28,9 @@ export {
type StacOrganization,
type SpatialExtent,
type TemporalExtent,
type StacServerSearchResponse,
type StacServerItem,
type ResolvedCidFromServer,
StacCatalogError,
StacLoadError,
StacResolutionError,
Expand Down
Loading
Loading