@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
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "dataworks-cli",
3
+ "interface": {
4
+ "displayName": "Dataworks CLI"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "dataworks",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/dataworks"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Data"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "dataworks-cli",
3
+ "owner": {
4
+ "name": "Dataworks Technology"
5
+ },
6
+ "metadata": {
7
+ "description": "Official Dataworks CLI integrations for Claude Code"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "dataworks",
12
+ "source": "./plugins/dataworks",
13
+ "description": "Query Dataworks athlete metrics using the authenticated local CLI session"
14
+ }
15
+ ]
16
+ }
package/README.md CHANGED
@@ -22,6 +22,7 @@ The `dw` binary turns the public GraphQL contract published by `@dataworks-techn
22
22
 
23
23
  | Command | Description |
24
24
  | --------------------- | ----------------------------------------------------------- |
25
+ | `dw agents install` | Install the Dataworks skill and MCP tools for AI agents |
25
26
  | `dw auth ...` | Log in, log out, and inspect the active UAT or Live session |
26
27
  | `dw autocomplete` | Install shell completion for commands and flags |
27
28
  | `dw data ...` | Run schema-derived queries, mutations, and subscriptions |
@@ -86,6 +87,23 @@ The `dw` binary turns the public GraphQL contract published by `@dataworks-techn
86
87
 
87
88
  Generated command documentation is available in [`docs/commands`](./docs/commands/README.md).
88
89
 
90
+ 5. **Enable Dataworks in Codex or Claude Code:**
91
+
92
+ ```sh
93
+ dw agents install
94
+ ```
95
+
96
+ This detects supported clients and installs the complete Dataworks plugin:
97
+ the metric-query skill plus its read-only `query_metrics` MCP server. Start a
98
+ new Codex thread after installation. In Claude Code, run `/reload-plugins` or
99
+ start a new session. To configure only one client, use
100
+ `dw agents install codex` or `dw agents install claude-code`.
101
+
102
+ Until setup is completed, interactive CLI use prints this reminder at most
103
+ once every 24 hours. It never appears with `--json`. Permanently hide it with
104
+ `dw agents reminder disable`, restore it with `dw agents reminder enable`, or
105
+ set `DW_NO_AGENT_REMINDER=1` for a single process or automation environment.
106
+
89
107
  ---
90
108
 
91
109
  ## Bash autocomplete
@@ -96,10 +114,61 @@ Generate the completion cache and print the one-time Bash setup instructions:
96
114
  dw autocomplete bash
97
115
  ```
98
116
 
117
+ Global npm installs and upgrades run this command automatically. It prepares the
118
+ latest completion cache and prints the setup instruction, but does not edit your
119
+ shell startup files. If npm cannot access the shell cache, installation still
120
+ succeeds and you can retry with `dw autocomplete bash`.
121
+
99
122
  After following the displayed instruction and reloading Bash, press Tab to
100
123
  complete `dw` command names and flags. Run `dw autocomplete --refresh-cache`
101
124
  after installing a release that adds commands.
102
125
 
126
+ ## AI agent metric queries
127
+
128
+ The package includes a focused, read-only MCP server with one tool:
129
+ `query_metrics`. It uses the same OS-backed login session and selected tenant as
130
+ `dw`, resolves an athlete by exact ID or unique name, maps common metric aliases,
131
+ polls asynchronous Data Explorer queries, and returns normalized structured
132
+ rows. GPS values include decoded latitude and longitude; heart-rate values use
133
+ numeric BPM when valid.
134
+
135
+ The simplest setup for Codex and Claude Code is:
136
+
137
+ ```sh
138
+ dw agents install
139
+ ```
140
+
141
+ The command is safe to rerun after upgrades. It installs or updates the complete
142
+ Dataworks plugin for each detected client and reports the reload or restart step.
143
+ If an old marketplace registration points to a different CLI installation, rerun
144
+ with `--force`.
145
+
146
+ Successful setup automatically disables the periodic CLI reminder. To opt out
147
+ without installing an agent integration, run `dw agents reminder disable`.
148
+
149
+ Other MCP clients can launch the installed `dw-mcp` binary directly:
150
+
151
+ ```json
152
+ {
153
+ "mcpServers": {
154
+ "dataworks": {
155
+ "command": "dw-mcp",
156
+ "args": []
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ The npm package ships a cross-compatible Codex and Claude Code plugin at
163
+ `plugins/dataworks`. Its focused skill turns requests such as “give me the last
164
+ 30 GPS values for James Haigh” into a `query_metrics` call. The tool accepts
165
+ exactly one of `athlete_id` or `athlete_name`, plus `metric`; optional inputs are
166
+ `limit`, `order`, `from`, `to`, `event_id`, `dataset_datasource_id`,
167
+ `tenant_id`, `metric_category`, and `timeout_ms`.
168
+
169
+ The server never performs mutations. If name resolution is ambiguous, it
170
+ returns candidates and requires an explicit athlete ID rather than guessing.
171
+
103
172
  ---
104
173
 
105
174
  ## Output and Safety
package/bin/mcp.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runDataworksMcpServer } from "../dist/mcp/main.js";
3
+
4
+ runDataworksMcpServer().catch((error) => {
5
+ process.stderr.write(
6
+ `Dataworks MCP server failed: ${error instanceof Error ? error.message : String(error)}\n`,
7
+ );
8
+ process.exitCode = 1;
9
+ });
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ // npm runs postinstall for both first-time global installs and global upgrades.
6
+ // Avoid writing shell caches when this package is only a project dependency.
7
+ if (
8
+ process.env.npm_config_global === "true" ||
9
+ process.env.npm_config_location === "global"
10
+ ) {
11
+ const runPath = fileURLToPath(new URL("./run.js", import.meta.url));
12
+ const result = spawnSync(process.execPath, [runPath, "autocomplete", "bash"], {
13
+ stdio: "inherit",
14
+ });
15
+ if (result.error || result.status !== 0) {
16
+ process.stderr.write(
17
+ "Dataworks CLI installed, but Bash autocomplete setup could not be prepared. Run `dw autocomplete bash` to retry.\n",
18
+ );
19
+ }
20
+ process.stdout.write(
21
+ "To use Dataworks from Codex or Claude Code, run `dw agents install` once.\n",
22
+ );
23
+ }
@@ -0,0 +1,17 @@
1
+ import { DataworksCommand } from "../../lib/command.js";
2
+ export default class AgentsInstall extends DataworksCommand {
3
+ static description: string;
4
+ static examples: {
5
+ description: string;
6
+ command: string;
7
+ }[];
8
+ static args: {
9
+ client: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
10
+ };
11
+ static flags: {
12
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/install.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AASxD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,gBAAgB;IACzD,OAAgB,WAAW,SAC2D;IACtF,OAAgB,QAAQ;;;QAiBtB;IACF,OAAgB,IAAI;;MAMlB;IACF,OAAgB,KAAK;;;MAKnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4BlC"}
@@ -0,0 +1,57 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { DataworksCommand } from "../../lib/command.js";
3
+ import { installAgentIntegration, supportedAgentClients, } from "../../lib/agent-install.js";
4
+ import { writeResult } from "../../lib/output.js";
5
+ import { configureAgentReminder } from "../../lib/agent-reminder.js";
6
+ export default class AgentsInstall extends DataworksCommand {
7
+ static description = "Install the Dataworks skill and query_metrics MCP server for Codex or Claude Code";
8
+ static examples = [
9
+ {
10
+ description: "Set up every supported agent client found on this machine",
11
+ command: "dw agents install",
12
+ },
13
+ {
14
+ description: "Set up Codex only",
15
+ command: "dw agents install codex",
16
+ },
17
+ {
18
+ description: "Set up Claude Code only",
19
+ command: "dw agents install claude-code",
20
+ },
21
+ {
22
+ description: "Replace a stale Dataworks marketplace registration",
23
+ command: "dw agents install codex --force",
24
+ },
25
+ ];
26
+ static args = {
27
+ client: Args.string({
28
+ description: "Agent client to configure; omit to detect and configure both",
29
+ options: ["codex", "claude-code"],
30
+ required: false,
31
+ }),
32
+ };
33
+ static flags = {
34
+ force: Flags.boolean({
35
+ description: "Replace an existing Dataworks marketplace registration",
36
+ }),
37
+ json: Flags.boolean({ description: "Emit stable JSON output" }),
38
+ };
39
+ async run() {
40
+ const { args, flags } = await this.parse(AgentsInstall);
41
+ const clients = args.client ? [args.client] : supportedAgentClients;
42
+ const results = clients.map((client) => installAgentIntegration(client, { force: flags.force }));
43
+ if (results.some(({ status }) => status === "installed" || status === "updated")) {
44
+ await configureAgentReminder("configured");
45
+ }
46
+ writeResult({ integrations: results }, {
47
+ json: flags.json,
48
+ meta: {
49
+ restartRequired: results.some(({ status }) => status === "installed" || status === "updated"),
50
+ },
51
+ });
52
+ if (results.every(({ status }) => status === "unavailable" || status === "failed")) {
53
+ process.exitCode = 1;
54
+ }
55
+ }
56
+ }
57
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/agents/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,gBAAgB;IACzD,MAAM,CAAU,W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KAAK,SAAS,CAAC,EAAE,CAAC;YACjF,MAAM,sBAAsB,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;QAED,WAAW,CACT,EAAE,YAAY,EAAE,OAAO,EAAE,EACzB;YACE,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE;gBACJ,eAAe,EAAE,OAAO,CAAC,IAAI,CAC3B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,SAAS,CAC/D;aACF;SACF,CACF,CAAC;QAEF,IACE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,aAAa,IAAI,MAAM,KAAK,QAAQ,CAAC,EAC9E,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { DataworksCommand } from "../../lib/command.js";
2
+ export default class AgentsReminder extends DataworksCommand {
3
+ static description: string;
4
+ static examples: {
5
+ description: string;
6
+ command: string;
7
+ }[];
8
+ static args: {
9
+ action: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
10
+ };
11
+ static flags: {
12
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=reminder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminder.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/reminder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AASxD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,gBAAgB;IAC1D,OAAgB,WAAW,SACwC;IACnE,OAAgB,QAAQ;;;QAatB;IACF,OAAgB,IAAI;;MAMlB;IACF,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiBlC"}
@@ -0,0 +1,45 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { DataworksCommand } from "../../lib/command.js";
3
+ import { configureAgentReminder, readAgentReminderPreferences, } from "../../lib/agent-reminder.js";
4
+ import { writeResult } from "../../lib/output.js";
5
+ export default class AgentsReminder extends DataworksCommand {
6
+ static description = "Inspect, disable, or enable the Dataworks agent setup reminder";
7
+ static examples = [
8
+ {
9
+ description: "Permanently hide the agent setup reminder",
10
+ command: "dw agents reminder disable",
11
+ },
12
+ {
13
+ description: "Show the reminder again when setup is incomplete",
14
+ command: "dw agents reminder enable",
15
+ },
16
+ {
17
+ description: "Inspect the current reminder state",
18
+ command: "dw agents reminder status --json",
19
+ },
20
+ ];
21
+ static args = {
22
+ action: Args.string({
23
+ description: "Reminder action",
24
+ options: ["status", "disable", "enable"],
25
+ default: "status",
26
+ }),
27
+ };
28
+ static flags = {
29
+ json: Flags.boolean({ description: "Emit stable JSON output" }),
30
+ };
31
+ async run() {
32
+ const { args, flags } = await this.parse(AgentsReminder);
33
+ const action = args.action;
34
+ const reminder = action === "status"
35
+ ? await readAgentReminderPreferences()
36
+ : await configureAgentReminder(action);
37
+ writeResult({
38
+ reminder: {
39
+ ...reminder,
40
+ enabled: !reminder.disabled && !reminder.configured,
41
+ },
42
+ }, { json: flags.json });
43
+ }
44
+ }
45
+ //# sourceMappingURL=reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminder.js","sourceRoot":"","sources":["../../../src/commands/agents/reminder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,gBAAgB;IAC1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gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAoBrD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACpD,OAAgB,WAAW,SACgC;IAC3D,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiBlC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAsBrD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACpD,OAAgB,WAAW,SACgC;IAC3D,OAAgB,KAAK;;MAEnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiBlC"}
@@ -3,6 +3,8 @@ import { DataworksCommand } from "../lib/command.js";
3
3
  import { operations } from "../generated/operations.js";
4
4
  import { writeResult } from "../lib/output.js";
5
5
  const builtIns = [
6
+ "agents install",
7
+ "agents reminder",
6
8
  "auth login",
7
9
  "auth logout",
8
10
  "auth status",
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,QAAQ,GAAG;IACf,YAAY;IACZ,aAAa;IACb,aAAa;IACb,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,mBAAmB;IACnB,QAAQ;IACR,cAAc;IACd,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACpD,MAAM,CAAU,WAAW,GACzB,wDAAwD,CA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ACd,UAAU;IACV,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,mBAAmB;IACnB,QAAQ;IACR,cAAc;IACd,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACpD,MAAM,CAAU,WAAW,GACzB,wDAAwD,CAAC;IAC3D,MAAM,CAAU,KAAK,GAAG;QACtB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;KAChE,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG;YACX,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,EAAE,EAAE,CAAC,CAAC;YACnE,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;gBACxC,OAAO,EAAE,MAAM,SAAS,CAAC,OAAO,EAAE;gBAClC,SAAS,EAAE,SAAS,CAAC,IAAI;gBACzB,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,SAAS,EAAE,SAAS,CAAC,SAAS;aAC/B,CAAC,CAAC;SACJ,CAAC;QACF,WAAW,CAAC,IAAI,EAAE;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,EAAE,cAAc,EAAE,UAAU,CAAC,MAAM,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,24 @@
1
+ export type AgentClient = "codex" | "claude-code";
2
+ export type AgentInstallStatus = "installed" | "updated" | "unavailable" | "failed";
3
+ export interface AgentInstallResult {
4
+ client: AgentClient;
5
+ status: AgentInstallStatus;
6
+ message: string;
7
+ nextStep: string;
8
+ }
9
+ export interface ProcessResult {
10
+ status: number | null;
11
+ stdout: string;
12
+ stderr: string;
13
+ error?: Error;
14
+ }
15
+ export type ProcessRunner = (command: string, args: readonly string[]) => ProcessResult;
16
+ export interface AgentInstallOptions {
17
+ force?: boolean;
18
+ packageRoot?: string;
19
+ run?: ProcessRunner;
20
+ }
21
+ export declare const supportedAgentClients: readonly AgentClient[];
22
+ export declare function dataworksPackageRoot(): string;
23
+ export declare function installAgentIntegration(client: AgentClient, options?: AgentInstallOptions): AgentInstallResult;
24
+ //# sourceMappingURL=agent-install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-install.d.ts","sourceRoot":"","sources":["../../src/lib/agent-install.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,CAAC;AAClD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,aAAa,CAAC;AAExF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAKD,eAAO,MAAM,qBAAqB,EAAE,SAAS,WAAW,EAA6B,CAAC;AAEtF,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AA0PD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAUpB"}
@@ -0,0 +1,196 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const marketplaceName = "dataworks-cli";
5
+ const pluginId = `dataworks@${marketplaceName}`;
6
+ export const supportedAgentClients = ["codex", "claude-code"];
7
+ export function dataworksPackageRoot() {
8
+ return fileURLToPath(new URL("../../", import.meta.url));
9
+ }
10
+ function defaultRunner(command, args) {
11
+ const result = spawnSync(command, [...args], {
12
+ encoding: "utf8",
13
+ stdio: ["ignore", "pipe", "pipe"],
14
+ });
15
+ return {
16
+ status: result.status,
17
+ stdout: result.stdout ?? "",
18
+ stderr: result.stderr ?? "",
19
+ error: result.error,
20
+ };
21
+ }
22
+ function executable(client) {
23
+ return client === "codex" ? "codex" : "claude";
24
+ }
25
+ function failureMessage(result) {
26
+ return (result.stderr.trim() ||
27
+ result.stdout.trim() ||
28
+ result.error?.message ||
29
+ "The client command failed without an error message.");
30
+ }
31
+ function parseJson(value) {
32
+ try {
33
+ return JSON.parse(value);
34
+ }
35
+ catch {
36
+ return undefined;
37
+ }
38
+ }
39
+ function codexMarketplaceRoot(payload) {
40
+ if (!payload || typeof payload !== "object")
41
+ return undefined;
42
+ const marketplaces = payload.marketplaces;
43
+ if (!Array.isArray(marketplaces))
44
+ return undefined;
45
+ const entry = marketplaces.find((candidate) => !!candidate &&
46
+ typeof candidate === "object" &&
47
+ candidate.name === marketplaceName);
48
+ return entry?.root;
49
+ }
50
+ function claudeMarketplace(payload) {
51
+ if (!Array.isArray(payload))
52
+ return { exists: false };
53
+ const entry = payload.find((candidate) => !!candidate &&
54
+ typeof candidate === "object" &&
55
+ candidate.name === marketplaceName);
56
+ return {
57
+ exists: !!entry,
58
+ root: entry?.path ?? entry?.installLocation,
59
+ };
60
+ }
61
+ function pluginIsInstalled(client, payload) {
62
+ const entries = client === "codex" && payload && typeof payload === "object"
63
+ ? payload.installed
64
+ : payload;
65
+ if (!Array.isArray(entries))
66
+ return false;
67
+ return entries.some((entry) => {
68
+ if (!entry || typeof entry !== "object")
69
+ return false;
70
+ const item = entry;
71
+ return (item.id === pluginId ||
72
+ item.pluginId === pluginId ||
73
+ (item.name === "dataworks" &&
74
+ (item.marketplace === marketplaceName ||
75
+ item.marketplaceName === marketplaceName)));
76
+ });
77
+ }
78
+ function unavailable(client) {
79
+ const binary = executable(client);
80
+ return {
81
+ client,
82
+ status: "unavailable",
83
+ message: `${binary} is not installed or is not available on PATH.`,
84
+ nextStep: `Install ${client === "codex" ? "Codex" : "Claude Code"}, then run \`dw agents install ${client}\` again.`,
85
+ };
86
+ }
87
+ function failed(client, result, nextStep) {
88
+ return {
89
+ client,
90
+ status: "failed",
91
+ message: failureMessage(result),
92
+ nextStep,
93
+ };
94
+ }
95
+ function installCodex(options) {
96
+ const { run, packageRoot, force } = options;
97
+ const list = run("codex", ["plugin", "marketplace", "list", "--json"]);
98
+ if (list.status !== 0) {
99
+ return failed("codex", list, "Run `codex plugin marketplace list` to inspect the Codex plugin configuration, then retry.");
100
+ }
101
+ const listedRoot = codexMarketplaceRoot(parseJson(list.stdout));
102
+ const currentRoot = listedRoot ? resolve(listedRoot) : undefined;
103
+ if (currentRoot && currentRoot !== packageRoot) {
104
+ if (!force) {
105
+ return {
106
+ client: "codex",
107
+ status: "failed",
108
+ message: `The ${marketplaceName} marketplace already points to ${currentRoot}.`,
109
+ nextStep: "Run `dw agents install codex --force` to replace the stale marketplace registration.",
110
+ };
111
+ }
112
+ const remove = run("codex", ["plugin", "marketplace", "remove", marketplaceName]);
113
+ if (remove.status !== 0) {
114
+ return failed("codex", remove, "Run `codex plugin marketplace list` to inspect the conflicting registration.");
115
+ }
116
+ }
117
+ if (!currentRoot || currentRoot !== packageRoot) {
118
+ const addMarketplace = run("codex", [
119
+ "plugin",
120
+ "marketplace",
121
+ "add",
122
+ packageRoot,
123
+ "--json",
124
+ ]);
125
+ if (addMarketplace.status !== 0) {
126
+ return failed("codex", addMarketplace, `Run \`codex plugin marketplace add ${packageRoot}\`, then retry.`);
127
+ }
128
+ }
129
+ const before = run("codex", ["plugin", "list", "--json"]);
130
+ const alreadyInstalled = before.status === 0 && pluginIsInstalled("codex", parseJson(before.stdout));
131
+ const install = run("codex", ["plugin", "add", pluginId, "--json"]);
132
+ if (install.status !== 0) {
133
+ return failed("codex", install, `Run \`codex plugin add ${pluginId}\`, then retry.`);
134
+ }
135
+ return {
136
+ client: "codex",
137
+ status: alreadyInstalled ? "updated" : "installed",
138
+ message: "The Dataworks skill and query_metrics MCP server are enabled.",
139
+ nextStep: "Start a new Codex thread before asking a Dataworks metrics question.",
140
+ };
141
+ }
142
+ function installClaudeCode(options) {
143
+ const { run, packageRoot, force } = options;
144
+ const list = run("claude", ["plugin", "marketplace", "list", "--json"]);
145
+ if (list.status !== 0) {
146
+ return failed("claude-code", list, "Run `claude plugin marketplace list --json` to inspect the Claude Code plugin configuration, then retry.");
147
+ }
148
+ const marketplace = claudeMarketplace(parseJson(list.stdout));
149
+ const currentRoot = marketplace.root ? resolve(marketplace.root) : undefined;
150
+ if (marketplace.exists && currentRoot && currentRoot !== packageRoot && !force) {
151
+ return {
152
+ client: "claude-code",
153
+ status: "failed",
154
+ message: `The ${marketplaceName} marketplace already points to ${currentRoot}.`,
155
+ nextStep: "Run `dw agents install claude-code --force` to replace the stale marketplace registration.",
156
+ };
157
+ }
158
+ if (marketplace.exists && force) {
159
+ const remove = run("claude", ["plugin", "marketplace", "remove", marketplaceName]);
160
+ if (remove.status !== 0) {
161
+ return failed("claude-code", remove, "Run `claude plugin marketplace list --json` to inspect the conflicting registration.");
162
+ }
163
+ }
164
+ if (!marketplace.exists || force) {
165
+ const addMarketplace = run("claude", ["plugin", "marketplace", "add", packageRoot]);
166
+ if (addMarketplace.status !== 0) {
167
+ return failed("claude-code", addMarketplace, `Run \`claude plugin marketplace add ${packageRoot}\`, then retry.`);
168
+ }
169
+ }
170
+ const before = run("claude", ["plugin", "list", "--json"]);
171
+ const alreadyInstalled = before.status === 0 && pluginIsInstalled("claude-code", parseJson(before.stdout));
172
+ const action = alreadyInstalled ? "update" : "install";
173
+ const install = run("claude", ["plugin", action, pluginId, "--scope", "user"]);
174
+ if (install.status !== 0) {
175
+ return failed("claude-code", install, `Run \`claude plugin ${action} ${pluginId} --scope user\`, then retry.`);
176
+ }
177
+ return {
178
+ client: "claude-code",
179
+ status: alreadyInstalled ? "updated" : "installed",
180
+ message: "The Dataworks skill and query_metrics MCP server are enabled.",
181
+ nextStep: "Run `/reload-plugins` in Claude Code, or start a new session.",
182
+ };
183
+ }
184
+ export function installAgentIntegration(client, options = {}) {
185
+ const resolved = {
186
+ force: options.force ?? false,
187
+ packageRoot: resolve(options.packageRoot ?? dataworksPackageRoot()),
188
+ run: options.run ?? defaultRunner,
189
+ };
190
+ const binary = executable(client);
191
+ const detected = resolved.run(binary, ["--version"]);
192
+ if (detected.status !== 0 || detected.error)
193
+ return unavailable(client);
194
+ return client === "codex" ? installCodex(resolved) : installClaudeCode(resolved);
195
+ }
196
+ //# sourceMappingURL=agent-install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-install.js","sourceRoot":"","sources":["../../src/lib/agent-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA2BzC,MAAM,eAAe,GAAG,eAAe,CAAC;AACxC,MAAM,QAAQ,GAAG,aAAa,eAAe,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAA2B,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAEtF,MAAM,UAAU,oBAAoB;IAClC,OAAO,aA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ACrB,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QAClD,OAAO,EAAE,+DAA+D;QACxE,QAAQ,EAAE,+DAA+D;KAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAmB,EACnB,UAA+B,EAAE;IAEjC,MAAM,QAAQ,GAAkC;QAC9C,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;QAC7B,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,IAAI,oBAAoB,EAAE,CAAC;QACnE,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,aAAa;KAClC,CAAC;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IACxE,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface AgentReminderPreferences {
2
+ disabled: boolean;
3
+ configured: boolean;
4
+ lastShownAt?: string;
5
+ }
6
+ export interface AgentReminderContext {
7
+ argv: readonly string[];
8
+ isTTY: boolean;
9
+ now?: Date;
10
+ disabledByEnvironment?: boolean;
11
+ }
12
+ export declare function agentReminderPath(): string;
13
+ export declare function readAgentReminderPreferences(): Promise<AgentReminderPreferences>;
14
+ export declare function shouldShowAgentReminder(preferences: AgentReminderPreferences, context: AgentReminderContext): boolean;
15
+ export declare function maybeShowAgentReminder(argv: readonly string[]): Promise<void>;
16
+ export declare function configureAgentReminder(action: "disable" | "enable" | "configured"): Promise<AgentReminderPreferences>;
17
+ //# sourceMappingURL=agent-reminder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-reminder.d.ts","sourceRoot":"","sources":["../../src/lib/agent-reminder.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAOD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAetF;AAYD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,wBAAwB,EACrC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAUT;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBnF;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,YAAY,GAC1C,OAAO,CAAC,wBAAwB,CAAC,CAUnC"}