@dataworks-technology/cli 1.2.0 → 1.3.0

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.
Files changed (48) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +16 -0
  3. package/README.md +69 -0
  4. package/bin/mcp.js +9 -0
  5. package/bin/postinstall.js +23 -0
  6. package/dist/commands/agents/install.d.ts +17 -0
  7. package/dist/commands/agents/install.d.ts.map +1 -0
  8. package/dist/commands/agents/install.js +57 -0
  9. package/dist/commands/agents/install.js.map +1 -0
  10. package/dist/commands/agents/reminder.d.ts +16 -0
  11. package/dist/commands/agents/reminder.d.ts.map +1 -0
  12. package/dist/commands/agents/reminder.js +45 -0
  13. package/dist/commands/agents/reminder.js.map +1 -0
  14. package/dist/commands/commands.d.ts.map +1 -1
  15. package/dist/commands/commands.js +2 -0
  16. package/dist/commands/commands.js.map +1 -1
  17. package/dist/lib/agent-install.d.ts +24 -0
  18. package/dist/lib/agent-install.d.ts.map +1 -0
  19. package/dist/lib/agent-install.js +196 -0
  20. package/dist/lib/agent-install.js.map +1 -0
  21. package/dist/lib/agent-reminder.d.ts +17 -0
  22. package/dist/lib/agent-reminder.d.ts.map +1 -0
  23. package/dist/lib/agent-reminder.js +81 -0
  24. package/dist/lib/agent-reminder.js.map +1 -0
  25. package/dist/lib/command.d.ts +1 -0
  26. package/dist/lib/command.d.ts.map +1 -1
  27. package/dist/lib/command.js +5 -0
  28. package/dist/lib/command.js.map +1 -1
  29. package/dist/lib/query-metrics.d.ts +72 -0
  30. package/dist/lib/query-metrics.d.ts.map +1 -0
  31. package/dist/lib/query-metrics.js +383 -0
  32. package/dist/lib/query-metrics.js.map +1 -0
  33. package/dist/mcp/main.d.ts +2 -0
  34. package/dist/mcp/main.d.ts.map +1 -0
  35. package/dist/mcp/main.js +7 -0
  36. package/dist/mcp/main.js.map +1 -0
  37. package/dist/mcp/server.d.ts +85 -0
  38. package/dist/mcp/server.d.ts.map +1 -0
  39. package/dist/mcp/server.js +235 -0
  40. package/dist/mcp/server.js.map +1 -0
  41. package/oclif.manifest.json +977 -864
  42. package/package.json +15 -4
  43. package/plugins/dataworks/.claude-plugin/plugin.json +17 -0
  44. package/plugins/dataworks/.codex-plugin/plugin.json +37 -0
  45. package/plugins/dataworks/.mcp.json +8 -0
  46. package/plugins/dataworks/skills/query-dataworks-metrics/SKILL.md +48 -0
  47. package/plugins/dataworks/skills/query-dataworks-metrics/agents/openai.yaml +13 -0
  48. package/skills/dataworks-cli/SKILL.md +18 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataworks-technology/cli",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "The official command-line interface for the Dataworks Data Engine",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,12 +11,16 @@
11
11
  "homepage": "https://github.com/Dataworks-Technology/Dataworks-CLI#readme",
12
12
  "bugs": "https://github.com/Dataworks-Technology/Dataworks-CLI/issues",
13
13
  "bin": {
14
- "dw": "./bin/run.js"
14
+ "dw": "./bin/run.js",
15
+ "dw-mcp": "./bin/mcp.js"
15
16
  },
16
17
  "files": [
17
18
  ".github/.assets",
19
+ ".agents/plugins/marketplace.json",
20
+ ".claude-plugin/marketplace.json",
18
21
  "bin",
19
22
  "dist",
23
+ "plugins",
20
24
  "schema",
21
25
  "skills",
22
26
  "oclif.manifest.json",
@@ -27,7 +31,7 @@
27
31
  "node": ">=22"
28
32
  },
29
33
  "scripts": {
30
- "build": "bun run generate && tsc -p tsconfig.build.json && node node_modules/oclif/bin/run.js manifest",
34
+ "build": "bun run sync:plugin-version && bun run generate && tsc -p tsconfig.build.json && node node_modules/oclif/bin/run.js manifest",
31
35
  "commands": "node ./bin/run.js commands --json",
32
36
  "dev": "node --import tsx ./bin/dev.js",
33
37
  "format": "prettier --write .",
@@ -37,9 +41,11 @@
37
41
  "lint": "tsc --noEmit",
38
42
  "typecheck": "tsc --noEmit",
39
43
  "maintain:sdk": "bun scripts/maintenance/update-sdk.ts",
44
+ "postinstall": "node ./bin/postinstall.js",
40
45
  "prepack": "bun run build && bun run test",
41
46
  "prepare": "husky",
42
47
  "smoke:litellm": "bun scripts/maintenance/smoke-agent.ts",
48
+ "sync:plugin-version": "bun scripts/sync-plugin-version.ts",
43
49
  "test": "vitest run",
44
50
  "test:watch": "vitest"
45
51
  },
@@ -50,6 +56,9 @@
50
56
  "helpClass": "./dist/help.js",
51
57
  "topicSeparator": " ",
52
58
  "topics": {
59
+ "agents": {
60
+ "description": "Install Dataworks skills and tools for supported AI coding agents"
61
+ },
53
62
  "tenant": {
54
63
  "description": "List available tenants or select the tenant used by subsequent commands"
55
64
  }
@@ -64,11 +73,13 @@
64
73
  "dependencies": {
65
74
  "@apollo/client": "4.2.1",
66
75
  "@dataworks-technology/data": "0.6.1",
76
+ "@modelcontextprotocol/sdk": "1.30.0",
67
77
  "@napi-rs/keyring": "1.3.0",
68
78
  "@oclif/core": "4.13.3",
69
79
  "@oclif/plugin-autocomplete": "3.2.50",
70
80
  "aws-appsync-subscription-link": "4.0.3",
71
- "graphql": "16.14.1"
81
+ "graphql": "16.14.1",
82
+ "zod": "4.4.3"
72
83
  },
73
84
  "devDependencies": {
74
85
  "@commitlint/cli": "19.8.1",
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "dataworks",
3
+ "version": "1.3.0",
4
+ "description": "Query athlete metrics from Dataworks using the authenticated local CLI session.",
5
+ "author": {
6
+ "name": "Dataworks Technology"
7
+ },
8
+ "homepage": "https://github.com/Dataworks-Technology/Dataworks-CLI",
9
+ "repository": "https://github.com/Dataworks-Technology/Dataworks-CLI",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "dataworks",
13
+ "metrics",
14
+ "sport",
15
+ "data-explorer"
16
+ ]
17
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "dataworks",
3
+ "version": "1.3.0",
4
+ "description": "Query athlete metrics from Dataworks using the authenticated local CLI session.",
5
+ "author": {
6
+ "name": "Dataworks Technology",
7
+ "url": "https://dataworks.live/"
8
+ },
9
+ "homepage": "https://github.com/Dataworks-Technology/Dataworks-CLI",
10
+ "repository": "https://github.com/Dataworks-Technology/Dataworks-CLI",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "dataworks",
14
+ "metrics",
15
+ "sport",
16
+ "data-explorer"
17
+ ],
18
+ "skills": "./skills/",
19
+ "mcpServers": "./.mcp.json",
20
+ "interface": {
21
+ "displayName": "Dataworks",
22
+ "shortDescription": "Query athlete metrics safely",
23
+ "longDescription": "Resolve athletes and return normalized GPS, heart-rate, and other Dataworks metric values through one read-only tool.",
24
+ "developerName": "Dataworks Technology",
25
+ "category": "Data",
26
+ "capabilities": [
27
+ "Read"
28
+ ],
29
+ "websiteURL": "https://dataworks.live/",
30
+ "defaultPrompt": [
31
+ "Give me the last 30 GPS values for James Haigh",
32
+ "Show the latest heart rate for athlete ID X",
33
+ "Query speed values for this athlete since noon"
34
+ ],
35
+ "brandColor": "#111827"
36
+ }
37
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "dataworks": {
4
+ "command": "dw-mcp",
5
+ "args": []
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: query-dataworks-metrics
3
+ description: Query historical Dataworks athlete metrics such as GPS, heart rate, speed, altitude, cadence, power, timing, or custom metrics. Use when a user asks for latest, last, recent, or time-bounded metric values for an athlete by ID or name.
4
+ ---
5
+
6
+ # Query Dataworks metrics
7
+
8
+ Use the `query_metrics` tool. It is read-only and uses the current authenticated
9
+ `dw` session and selected tenant.
10
+
11
+ If `query_metrics` is unavailable, tell the user to run `dw agents install`
12
+ once in their terminal, then start a new Codex thread or run `/reload-plugins`
13
+ in Claude Code. Do not substitute raw GraphQL or guess that setup succeeded.
14
+
15
+ ## Construct the request
16
+
17
+ - Pass `athlete_id` when the user provides a Dataworks athlete public ID.
18
+ - Otherwise pass `athlete_name`; let the tool resolve it and surface ambiguity.
19
+ - Pass the user's metric wording directly. The tool understands GPS/location and
20
+ heart-rate/HR/BPM aliases, plus common speed, altitude, cadence, power, and
21
+ timing names.
22
+ - Default to `limit: 30` and `order: newest` only when the user did not specify
23
+ a count or order.
24
+ - Preserve explicit `from` and `to` times as ISO 8601 date-times.
25
+ - Pass `event_id`, `dataset_datasource_id`, or `tenant_id` only when explicitly
26
+ supplied or already resolved. Never guess an ID.
27
+ - For an unknown custom metric, pass its exact name and explicit
28
+ `metric_category`.
29
+
30
+ Examples:
31
+
32
+ - “Give me the last 30 GPS values for James Haigh” → `athlete_name: "James
33
+ Haigh"`, `metric: "GPS"`, `limit: 30`, `order: "newest"`.
34
+ - “Latest heart rate for athlete ID X” → `athlete_id: "X"`, `metric: "heart
35
+ rate"`, `limit: 1`.
36
+ - “Cadence for Sam since noon” → `athlete_name: "Sam"`, `metric: "cadence"`,
37
+ `from: <the unambiguous ISO 8601 time requested>`.
38
+
39
+ ## Handle results
40
+
41
+ Use `structuredContent`, not the human summary. Report the resolved athlete ID,
42
+ environment, tenant, canonical metric, order, and returned count. GPS rows include
43
+ decoded `position.latitude` and `position.longitude`; heart-rate values are
44
+ numeric with unit `bpm` when the source value is valid.
45
+
46
+ If the tool reports `ATHLETE_AMBIGUOUS`, present its candidates and ask the user
47
+ to choose. For `AUTH_REQUIRED` or `TENANT_REQUIRED`, follow the recovery command
48
+ in the error and retry. Never expose credentials or session material.
@@ -0,0 +1,13 @@
1
+ interface:
2
+ display_name: "Query Dataworks metrics"
3
+ short_description: "Query athlete metrics by name or ID"
4
+ default_prompt: "Use $query-dataworks-metrics to give me the last 30 GPS values for James Haigh."
5
+
6
+ dependencies:
7
+ tools:
8
+ - type: "mcp"
9
+ value: "dataworks"
10
+ description: "Read-only Dataworks metric query server"
11
+
12
+ policy:
13
+ allow_implicit_invocation: true
@@ -5,9 +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 every Dataworks action. Do not call a
8
+ Use `dw` as the operational interface for Dataworks actions. When the
9
+ `query_metrics` tool is available, use it for historical athlete metric requests;
10
+ it is the read-only, CLI-authenticated interface over Data Explorer. Do not call a
9
11
  Dataworks HTTP or GraphQL endpoint directly, or use an SDK instead, when the CLI
10
- can perform the action.
12
+ or this tool can perform the action.
13
+
14
+ If a request needs `query_metrics` but the tool is unavailable, tell the user to
15
+ run `dw agents install` once, then start a new Codex thread or run
16
+ `/reload-plugins` in Claude Code. Do not claim the MCP server is registered until
17
+ the restarted or reloaded agent exposes the tool.
11
18
 
12
19
  ## Route the request
13
20
 
@@ -16,6 +23,7 @@ can perform the action.
16
23
  2. Run `dw commands --json` to discover the installed command contract.
17
24
  3. Run `dw <command> --help` before constructing the exact call.
18
25
  4. Prefer the narrowest matching command:
26
+ - Historical athlete metrics: `query_metrics` when available
19
27
  - Data Engine entities: `dw data ...`
20
28
  - Authentication and session state: `dw auth ...`
21
29
  - Tenant discovery and persistence: `dw tenant list` and `dw tenant select ...`
@@ -113,6 +121,14 @@ return to the shell; do not leave orphaned subscription processes.
113
121
 
114
122
  ## Query Data Explorer
115
123
 
124
+ Prefer `query_metrics` for requests framed in human terms, such as “the last 30
125
+ GPS values for James Haigh” or “the latest heart rate for athlete ID X”. Pass
126
+ exactly one of `athlete_name` and `athlete_id`. The tool resolves names without
127
+ guessing, infers common metric categories, polls asynchronous queries, decodes
128
+ AWSJSON, and returns normalized structured rows. Use the raw command workflow
129
+ below only when the tool is unavailable or the request needs unsupported advanced
130
+ Data Explorer fields or aggregation.
131
+
116
132
  Use `dw data data-explorer execute --help` to inspect the installed contract.
117
133
  Data Explorer queries require a JSON array of lowercase `columns` and a metric
118
134
  category. Use `METRICS_TYPE_A` for GPS/position/timing metrics,