@dataworks-technology/cli 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/generated/metrics.d.ts +10 -0
- package/dist/generated/metrics.d.ts.map +1 -1
- package/dist/generated/metrics.js +51 -0
- package/dist/generated/metrics.js.map +1 -1
- package/dist/lib/discover.d.ts +9 -3
- package/dist/lib/discover.d.ts.map +1 -1
- package/dist/lib/discover.js +43 -6
- package/dist/lib/discover.js.map +1 -1
- package/dist/lib/metric-names.d.ts +2 -2
- package/dist/lib/metric-names.d.ts.map +1 -1
- package/dist/lib/metric-names.js +2 -2
- package/dist/lib/metric-names.js.map +1 -1
- package/dist/lib/query-metrics.d.ts +40 -0
- package/dist/lib/query-metrics.d.ts.map +1 -1
- package/dist/lib/query-metrics.js +147 -15
- package/dist/lib/query-metrics.js.map +1 -1
- package/dist/mcp/server.d.ts +32 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +113 -8
- package/dist/mcp/server.js.map +1 -1
- package/oclif.manifest.json +159 -159
- package/package.json +1 -2
- package/plugins/dataworks/.claude-plugin/plugin.json +2 -2
- package/plugins/dataworks/.codex-plugin/plugin.json +3 -3
- package/{skills → plugins/dataworks/skills}/dataworks-cli/SKILL.md +13 -6
- package/plugins/dataworks/skills/query-dataworks-metrics/SKILL.md +48 -6
- /package/{skills → plugins/dataworks/skills}/dataworks-cli/agents/openai.yaml +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataworks-technology/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "The official command-line interface for the Dataworks Data Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"plugins",
|
|
24
24
|
"schema",
|
|
25
|
-
"skills",
|
|
26
25
|
"oclif.manifest.json",
|
|
27
26
|
"README.md",
|
|
28
27
|
"LICENSE"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataworks",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Query athlete metrics
|
|
3
|
+
"version": "1.6.1",
|
|
4
|
+
"description": "Query Dataworks athlete metrics and operate the Dataworks platform using the authenticated local CLI session.",
|
|
5
5
|
"author": { "name": "Dataworks Technology" },
|
|
6
6
|
"homepage": "https://github.com/Dataworks-Technology/Dataworks-CLI",
|
|
7
7
|
"repository": "https://github.com/Dataworks-Technology/Dataworks-CLI",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataworks",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Query athlete metrics
|
|
3
|
+
"version": "1.6.1",
|
|
4
|
+
"description": "Query Dataworks athlete metrics and operate the Dataworks platform using the authenticated local CLI session.",
|
|
5
5
|
"author": { "name": "Dataworks Technology", "url": "https://dataworks.live/" },
|
|
6
6
|
"homepage": "https://github.com/Dataworks-Technology/Dataworks-CLI",
|
|
7
7
|
"repository": "https://github.com/Dataworks-Technology/Dataworks-CLI",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"interface": {
|
|
13
13
|
"displayName": "Dataworks",
|
|
14
14
|
"shortDescription": "Query athlete metrics safely",
|
|
15
|
-
"longDescription": "Resolve athletes and return normalized
|
|
15
|
+
"longDescription": "Resolve athletes and events, return normalized metric values and server-side aggregates through read-only tools, and drive the full Dataworks CLI for everything else.",
|
|
16
16
|
"developerName": "Dataworks Technology",
|
|
17
17
|
"category": "Data",
|
|
18
18
|
"capabilities": ["Read"],
|
|
@@ -5,11 +5,16 @@ description: Route operational requests to inspect, query, create, update, delet
|
|
|
5
5
|
|
|
6
6
|
# Dataworks CLI
|
|
7
7
|
|
|
8
|
-
Use `dw` as the operational interface for Dataworks actions.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
Use `dw` as the operational interface for Dataworks actions. Do not call a
|
|
9
|
+
Dataworks HTTP or GraphQL endpoint directly, or use an SDK, when the CLI or the
|
|
10
|
+
Dataworks MCP tools can perform the action.
|
|
11
|
+
|
|
12
|
+
The MCP tools, when available, own a narrow slice: `query_metrics` for historical
|
|
13
|
+
metric values and aggregates, and `list_athletes` / `list_events` for resolving
|
|
14
|
+
the IDs those queries need. Everything else is the CLI's job — full entity
|
|
15
|
+
records, teams, datasets, participants, ingestion, subscriptions, and every
|
|
16
|
+
create, update or delete. Use the CLI for those directly; it is not a fallback
|
|
17
|
+
for when a tool fails.
|
|
13
18
|
|
|
14
19
|
If a request needs `query_metrics` but the tool is unavailable, tell the user to
|
|
15
20
|
run `dw agents install` once, then start a new Codex thread or run
|
|
@@ -23,7 +28,9 @@ the restarted or reloaded agent exposes the tool.
|
|
|
23
28
|
2. Run `dw commands --json` to discover the installed command contract.
|
|
24
29
|
3. Run `dw <command> --help` before constructing the exact call.
|
|
25
30
|
4. Prefer the narrowest matching command:
|
|
26
|
-
- Historical
|
|
31
|
+
- Historical metric values or aggregates: `query_metrics` when available
|
|
32
|
+
- An athlete or event ID for such a query: `list_athletes` / `list_events`
|
|
33
|
+
- A full athlete, event, dataset or participant record: `dw data ...`
|
|
27
34
|
- Data Engine entities: `dw data ...`
|
|
28
35
|
- Authentication and session state: `dw auth ...`
|
|
29
36
|
- Tenant discovery and persistence: `dw tenant list` and `dw tenant select ...`
|
|
@@ -9,7 +9,18 @@ Three read-only tools use the current authenticated `dw` session and tenant:
|
|
|
9
9
|
|
|
10
10
|
- `query_metrics` — metric values, scoped to an athlete, an event, or a datasource.
|
|
11
11
|
- `list_athletes` — find an athlete ID, or confirm someone is not in this tenant.
|
|
12
|
-
- `list_events` — find an event ID for a race.
|
|
12
|
+
- `list_events` — find an event ID for a race, by name.
|
|
13
|
+
|
|
14
|
+
These cover historical metrics and the IDs needed to ask for them, and nothing
|
|
15
|
+
else. They are deliberately narrow: `list_athletes` returns only an ID, a name
|
|
16
|
+
and an external ID. For anything beyond that — an athlete's full record, teams,
|
|
17
|
+
datasets, participants, events as entities, ingestion, live subscriptions, or any
|
|
18
|
+
create, update or delete — use the `dw` CLI, which covers the whole Data Engine
|
|
19
|
+
API. See the `dataworks-cli` skill, and run `dw commands --json` to discover the
|
|
20
|
+
exact command rather than exploring with `dw help`.
|
|
21
|
+
|
|
22
|
+
Reach for the CLI as readily as these tools; it is the same authenticated
|
|
23
|
+
session, not a fallback.
|
|
13
24
|
|
|
14
25
|
If `query_metrics` is unavailable, tell the user to run `dw agents install`
|
|
15
26
|
once in their terminal, then start a new Codex thread or run `/reload-plugins`
|
|
@@ -25,6 +36,10 @@ in Claude Code. Do not substitute raw GraphQL or guess that setup succeeded.
|
|
|
25
36
|
- For a question about a race or feed — "the latest heart rate at T100 San
|
|
26
37
|
Francisco" — omit the athlete entirely and pass `event_id`. Do not invent an
|
|
27
38
|
athlete to satisfy the call. Rows still carry `athlete_id` per value.
|
|
39
|
+
- To compare people, pass `athlete_ids` rather than one query each; combined
|
|
40
|
+
with `aggregate` it returns one value per athlete. Use `event_ids` likewise to
|
|
41
|
+
span a series of races. Resolve names to IDs with `list_athletes` first, and
|
|
42
|
+
note an athlete with no data simply has no rows rather than an error.
|
|
28
43
|
- Map the user's wording onto a canonical metric name from the catalogue below.
|
|
29
44
|
Case, spaces, hyphens and underscores are ignored, so "Heart Rate" resolves to
|
|
30
45
|
`heartrate`. Do not invent a metric name.
|
|
@@ -36,6 +51,19 @@ in Claude Code. Do not substitute raw GraphQL or guess that setup succeeded.
|
|
|
36
51
|
pattern, or a row count is a guess: say you could not resolve it instead.
|
|
37
52
|
- For a genuinely custom metric absent from the catalogue, pass its exact name
|
|
38
53
|
and an explicit `metric_category`.
|
|
54
|
+
- Rows carry every column the metric's category provides. Heart rate and power
|
|
55
|
+
add rolling `max`, `min`, `avg` and a seven-zone breakdown, all under `extra`
|
|
56
|
+
on each row — read zones from there rather than computing them.
|
|
57
|
+
- To find high or low readings, pass `min_value` or `max_value` rather than
|
|
58
|
+
fetching everything and filtering; the server applies the bound.
|
|
59
|
+
- To rank by value rather than recency, pass `order_by: "current"`. It defaults
|
|
60
|
+
to `timestamp`, and `order` controls the direction either way.
|
|
61
|
+
- For a maximum, minimum, average, sum, or count, pass `aggregate` instead of
|
|
62
|
+
fetching rows and computing it yourself. The server aggregates over every
|
|
63
|
+
matching sample; taking a maximum over returned rows only covers the rows
|
|
64
|
+
`limit` allowed through. Results arrive in `aggregate.groups` and `rows` is
|
|
65
|
+
empty. `group_by` defaults to `athletepublicid`, so an event-scoped aggregate
|
|
66
|
+
returns one value per athlete; pass `eventpublicid` for one value per event.
|
|
39
67
|
|
|
40
68
|
## Metric catalogue
|
|
41
69
|
|
|
@@ -68,6 +96,17 @@ Haigh"`, `metric: "GPS"`, `limit: 30`, `order: "newest"`.
|
|
|
68
96
|
- “Latest 10 heart rate values for T100 San Francisco” → `list_events` with
|
|
69
97
|
`search: "T100 San Francisco"` to get the ID, then `query_metrics` with
|
|
70
98
|
`event_id: <that ID>`, `metric: "heartrate"`, `limit: 10`, and no athlete.
|
|
99
|
+
- “Hayden Wilde's maximum heart rate” → `query_metrics` with
|
|
100
|
+
`athlete_name: "Hayden Wilde"`, `metric: "heartrate"`, `aggregate: "max"`.
|
|
101
|
+
Read the answer from `aggregate.groups`; do not fetch rows and compare them.
|
|
102
|
+
- “When was Sam above 180bpm?” → `metric: "heartrate"`, `min_value: 180`.
|
|
103
|
+
- “Sam's highest heart rate readings” → `metric: "heartrate"`,
|
|
104
|
+
`order_by: "current"`, which ranks by value instead of recency.
|
|
105
|
+
- “Sam's heart rate zones” → an ordinary query; read `extra.z1_percentage`
|
|
106
|
+
through `extra.z7_percentage` from any returned row.
|
|
107
|
+
- “Compare Hayden and Sam's peak heart rate” → `list_athletes` for both IDs,
|
|
108
|
+
then one call with `athlete_ids: [<both>]`, `metric: "heartrate"`,
|
|
109
|
+
`aggregate: "max"`; each athlete appears once in `aggregate.groups`.
|
|
71
110
|
|
|
72
111
|
## Handle results
|
|
73
112
|
|
|
@@ -76,8 +115,10 @@ environment, tenant, canonical metric, order, and returned count. GPS rows inclu
|
|
|
76
115
|
decoded `position.latitude` and `position.longitude`; heart-rate values are
|
|
77
116
|
numeric with unit `bpm` when the source value is valid.
|
|
78
117
|
|
|
79
|
-
Every error carries a `recovery` field. Follow it rather than improvising
|
|
80
|
-
|
|
118
|
+
Every error carries a `recovery` field. Follow it rather than improvising. Do not
|
|
119
|
+
reach for raw GraphQL to work around a metric failure — but the `dw` CLI is a
|
|
120
|
+
first-class route for anything these tools do not cover, and the `dataworks-cli`
|
|
121
|
+
skill explains how to drive it.
|
|
81
122
|
|
|
82
123
|
- `ATHLETE_AMBIGUOUS` — present the candidates and ask the user to choose.
|
|
83
124
|
- `ATHLETE_NOT_FOUND` — the athlete is not in this tenant. Do not retry with
|
|
@@ -86,9 +127,10 @@ never fall back to raw GraphQL or `dw data ...` to work around a failure.
|
|
|
86
127
|
`dataset_datasource_id`.
|
|
87
128
|
- `METRIC_CATEGORY_REQUIRED` — retry with one of the returned `suggestions`.
|
|
88
129
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
130
|
+
`list_events` reports where its results came from in `source`: the events API,
|
|
131
|
+
or each dataset's event relation. Either is authoritative. Only when
|
|
132
|
+
`unavailable: true` did both routes yield nothing — report that and stop rather
|
|
133
|
+
than identifying an event some other way. For `AUTH_REQUIRED` or `TENANT_REQUIRED`, follow the recovery command
|
|
92
134
|
in the error and retry. For `METRIC_CATEGORY_REQUIRED`, the error's `suggestions`
|
|
93
135
|
list the closest canonical names — retry with one rather than asking the user to
|
|
94
136
|
spell the metric. Never expose credentials or session material.
|
|
File without changes
|