@lightward/mechanic-cli 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -60,20 +60,29 @@ Pull existing Mechanic tasks into local JSON files:
60
60
  mechanic tasks pull
61
61
  ```
62
62
 
63
+ To start from scratch instead, create a new blank local task. This writes a
64
+ starter JSON file and matching helper directory:
65
+
66
+ ```bash
67
+ mechanic tasks new order-tagger
68
+ ```
69
+
63
70
  For most Liquid or documentation edits, unbundle one task into helper files,
64
71
  edit those files, then bundle the helper directory back into its canonical JSON
65
72
  file. The JSON file remains the deployable source of truth; the helper directory
66
- is the comfortable editing view beside it.
73
+ is the comfortable editing view beside it. Tasks created with `tasks new`
74
+ already have both files, so you can start editing the helper directory
75
+ immediately.
67
76
 
68
77
  ```bash
69
- mechanic tasks unbundle tasks/order-tagger.json
78
+ mechanic tasks unbundle order-tagger
70
79
  # edit tasks/order-tagger/script.liquid, docs.md, or task.json
71
- mechanic tasks bundle tasks/order-tagger.json
80
+ mechanic tasks bundle order-tagger
72
81
  mechanic tasks status
73
- mechanic tasks preview tasks/order-tagger.json
74
- mechanic tasks diff tasks/order-tagger.json
75
- mechanic tasks publish tasks/order-tagger.json --dry-run
76
- mechanic tasks publish tasks/order-tagger.json
82
+ mechanic tasks preview order-tagger
83
+ mechanic tasks diff order-tagger
84
+ mechanic tasks publish order-tagger --dry-run
85
+ mechanic tasks publish order-tagger
77
86
  ```
78
87
 
79
88
  For normal setup, paste the token into the masked prompt or run
@@ -102,8 +111,9 @@ mechanic auth logout
102
111
  mechanic github init [--force]
103
112
  mechanic shop status [--json]
104
113
  mechanic tasks list [--verbose] [--json]
114
+ mechanic tasks new <name> [--force] [--json]
105
115
  mechanic tasks open <task>
106
- mechanic tasks status [task] [--remote] [--json]
116
+ mechanic tasks status [task] [--local] [--json]
107
117
  mechanic tasks pull [--force]
108
118
  mechanic tasks pull <task> [--force]
109
119
  mechanic tasks pull --all [--force]
@@ -113,38 +123,60 @@ mechanic tasks diff --all [--exit-code] [--json]
113
123
  mechanic tasks publish <task> [--force] [--dry-run] [--json]
114
124
  mechanic tasks publish --all [--force] [--dry-run] [--json]
115
125
  mechanic tasks unbundle <task> [--out <dir>] [--json]
116
- mechanic tasks bundle <dir|file> [--out <file>] [--json]
126
+ mechanic tasks bundle <task|dir|file> [--out <file>] [--json]
117
127
  mechanic tasks validate <file|dir> [--json]
118
128
  ```
119
129
 
120
- Most task commands accept a `<task>` selector. A task selector can be a local
121
- JSON file, a helper directory, a linked remote task ID, or a unique local task
122
- slug:
130
+ Most task commands accept a `<task>` selector. In day-to-day use, prefer the
131
+ short local task slug:
132
+
133
+ ```bash
134
+ mechanic tasks preview order-tagger
135
+ ```
136
+
137
+ The CLI also accepts a full task JSON path, matching helper directory, or linked
138
+ remote task ID:
123
139
 
124
140
  ```bash
125
141
  mechanic tasks preview tasks/order-tagger.json
126
142
  mechanic tasks preview tasks/order-tagger
127
- mechanic tasks preview order-tagger
128
143
  mechanic tasks preview 171578bf-79e2-46af-857a-dbd71c6b7b2b
129
144
  ```
130
145
 
131
146
  The local file is the working copy. The remote task ID is the Mechanic app's
132
147
  address for that task. `tasks list` shows linked local files when the CLI knows
133
- them. If a short selector matches more than one local file, the CLI asks for the
134
- full file path.
148
+ them. If a short slug matches more than one local file, the CLI asks for the
149
+ full file path; that is the main reason to use `tasks/<name>.json` directly.
150
+
151
+ Task names and local file names are related, but they are not the same identity.
152
+ When the CLI first pulls or creates a task, it uses the task name to choose a
153
+ readable local slug like `order-tagger`, which becomes `tasks/order-tagger.json`.
154
+ After that, the remote task ID stored in `.mechanic/links.json` is the sync
155
+ identity. If you rename the task in Mechanic, the next pull keeps the existing
156
+ local file name and updates the `name` field inside the JSON. If you rename the
157
+ local JSON file or helper directory by hand, the CLI treats that as a new local
158
+ slug and the task may appear unlinked. Keep local filenames stable unless you
159
+ also intentionally update `.mechanic/links.json` and verify with `tasks status`
160
+ and `tasks publish --dry-run`.
135
161
 
136
162
  `tasks pull` pulls every task when you run it without arguments. Pass a task
137
163
  selector when you only want one task. `tasks diff` and `tasks publish` operate
138
164
  on one task when you pass a selector. They operate on every task only when you
139
165
  explicitly pass `--all`.
140
166
 
167
+ `tasks new` creates a new blank local starter task. It writes both
168
+ `tasks/<slug>.json` and `tasks/<slug>/`, so you can edit the helper files first
169
+ and bundle them into the JSON file before publishing. It does not create
170
+ anything in Mechanic until you run `tasks publish`; new published tasks are
171
+ created disabled.
172
+
141
173
  `shop status` shows the current Mechanic run queue for the configured shop:
142
174
  running runs, waiting runs, queue lag, and the largest backlog groups by task,
143
175
  action, and event topic.
144
176
 
145
- `tasks status` shows whether local task JSON files are linked to remote Mechanic
146
- tasks and ready to publish. It is local-only by default; add `--remote` to check
147
- whether linked remote tasks are unchanged, locally changed, or conflicted.
177
+ `tasks status` shows whether local task JSON files are linked, ready to publish,
178
+ and in sync with their remote Mechanic tasks. Use `--local` when you only want
179
+ the fast offline check for JSON validity, link state, and helper-folder drift.
148
180
  Add `--json` when an editor integration needs task readiness, link state, and
149
181
  remote sync state without parsing table output.
150
182
 
@@ -165,21 +197,22 @@ or enabling the task.
165
197
 
166
198
  `tasks publish` sends local task JSON back to Mechanic.
167
199
 
168
- `tasks publish --dry-run` validates the selected files, checks for unbundled
169
- helper changes, fetches linked remote tasks, checks unlinked files against
170
- existing remote task names, and prints what would create, update, stay
171
- unchanged, or conflict. It does not write to Mechanic, `.mechanic/links.json`,
172
- or local task JSON. New tasks created by `tasks publish` are created disabled;
173
- review and enable them in Mechanic when they are ready to run.
200
+ `tasks publish --dry-run` is a publish preflight. It checks whether publishing
201
+ would be safe, including helper-folder drift, linked remote task changes, and
202
+ unlinked files that look like existing remote tasks. It then prints what would
203
+ create, update, stay unchanged, or stop as a conflict. It does not write to
204
+ Mechanic, `.mechanic/links.json`, or local task JSON. New tasks created by
205
+ `tasks publish` are created disabled; review and enable them in Mechanic when
206
+ they are ready to run.
174
207
 
175
208
  For automation or editor integrations, add `--json` to `tasks list`, `tasks
176
209
  status`, `tasks diff`, `tasks validate`, `tasks bundle`, `tasks unbundle`,
177
210
  `tasks publish`, or `shop status`.
178
211
 
179
212
  `tasks unbundle` and `tasks bundle` operate on one task at a time. By default,
180
- `mechanic tasks unbundle tasks/order-tagger.json` writes to
181
- `tasks/order-tagger/`, and `mechanic tasks bundle tasks/order-tagger.json`
182
- writes back to `tasks/order-tagger.json`.
213
+ `mechanic tasks unbundle order-tagger` writes to `tasks/order-tagger/`, and
214
+ `mechanic tasks bundle order-tagger` writes back to `tasks/order-tagger.json`.
215
+ You can pass the full JSON path when you want to be explicit.
183
216
 
184
217
  When a task has `subscriptions_template`, the editable helper file is
185
218
  `subscriptions.liquid`. Mechanic renders that template into `subscriptions`, so
@@ -207,8 +240,7 @@ open a task explicitly. Use `--app-url` or `MECHANIC_APP_URL` if your shop uses
207
240
  a non-production Shopify app alias.
208
241
 
209
242
  Use `mechanic tasks open <task>` to open a task in the Mechanic app from its
210
- remote ID, linked local task JSON file, helper directory, or unique local task
211
- slug.
243
+ local task slug, linked local task JSON file, helper directory, or remote ID.
212
244
 
213
245
  ## Advanced: GitHub Actions Task Workflows
214
246
 
@@ -322,7 +354,7 @@ inside JSON is unpleasant. The helper workflow splits a task into separate
322
354
  editable files:
323
355
 
324
356
  ```bash
325
- mechanic tasks unbundle tasks/order-tagger.json --out order-tagger
357
+ mechanic tasks unbundle order-tagger --out order-tagger
326
358
  ```
327
359
 
328
360
  `tasks unbundle` also accepts the same local task selectors as preview, diff,
@@ -330,6 +362,7 @@ and publish:
330
362
 
331
363
  ```bash
332
364
  mechanic tasks unbundle order-tagger
365
+ mechanic tasks unbundle tasks/order-tagger.json
333
366
  mechanic tasks unbundle tasks/order-tagger
334
367
  mechanic tasks unbundle 171578bf-79e2-46af-857a-dbd71c6b7b2b
335
368
  ```
@@ -347,14 +380,15 @@ order-tagger/
347
380
  After editing, bundle the helper directory back to canonical JSON:
348
381
 
349
382
  ```bash
350
- mechanic tasks bundle tasks/order-tagger.json
383
+ mechanic tasks bundle order-tagger
351
384
  mechanic tasks validate tasks/order-tagger.json
352
385
  ```
353
386
 
354
- `tasks bundle` accepts either side of the pair. `mechanic tasks bundle
355
- tasks/order-tagger` writes `tasks/order-tagger.json`, and `mechanic tasks bundle
356
- tasks/order-tagger.json` reads `tasks/order-tagger/` and writes back to that JSON
357
- file.
387
+ `tasks bundle` accepts the local task slug or either side of the pair.
388
+ `mechanic tasks bundle order-tagger` and `mechanic tasks bundle
389
+ tasks/order-tagger` both write `tasks/order-tagger.json`. `mechanic tasks bundle
390
+ tasks/order-tagger.json` reads `tasks/order-tagger/` and writes back to that
391
+ JSON file.
358
392
 
359
393
  When unbundling, helper files are written only for string fields. `null` fields
360
394
  stay in `task.json`, and stale helper files for non-string fields are removed.
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,OAAgB,WAAW,SAAkD;IAE7E,OAAgB,KAAK;;;;;;MAQnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6D3B"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,OAAgB,WAAW,SAAkD;IAE7E,OAAgB,KAAK;;;;;;MAQnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+D3B"}
@@ -61,11 +61,13 @@ export default class Init extends BaseCommand {
61
61
  this.log(` ${this.taskName("mechanic auth login")}`);
62
62
  }
63
63
  this.log(` ${this.taskName("mechanic tasks pull")}`);
64
+ this.log(" or, to start from scratch:");
65
+ this.log(` ${this.taskName("mechanic tasks new <task-slug>")}`);
64
66
  this.log(` ${this.taskName("mechanic tasks status")}`);
65
- this.log(` ${this.taskName("mechanic tasks preview tasks/<task>.json")}`);
66
- this.log(` ${this.taskName("mechanic tasks diff tasks/<task>.json")}`);
67
- this.log(` ${this.taskName("mechanic tasks publish tasks/<task>.json --dry-run")}`);
68
- this.log(` ${this.taskName("mechanic tasks publish tasks/<task>.json")}`);
67
+ this.log(` ${this.taskName("mechanic tasks preview <task-slug>")}`);
68
+ this.log(` ${this.taskName("mechanic tasks diff <task-slug>")}`);
69
+ this.log(` ${this.taskName("mechanic tasks publish <task-slug> --dry-run")}`);
70
+ this.log(` ${this.taskName("mechanic tasks publish <task-slug>")}`);
69
71
  this.log("");
70
72
  this.log(this.lightwardAiLine());
71
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,OAAgB,OAAO,SAA+D;IACtF,OAAgB,WAAW,SAAkF;IAC7G,OAAgB,QAAQ,WAItB;IAEF,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAOnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAgCZ,kBAAkB;CAuCjC"}
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASpD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,OAAgB,OAAO,SAA+D;IACtF,OAAgB,WAAW,SAAqG;IAChI,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAOnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAgCZ,kBAAkB;CAuEjC"}
@@ -3,17 +3,21 @@ import path from "node:path";
3
3
  import { BaseCommand } from "../../base-command.js";
4
4
  import { CliError } from "../../errors.js";
5
5
  import { pathExists } from "../../fs.js";
6
- import { bundleTask } from "../../tasks.js";
6
+ import { bundleTask, displayTaskPath, resolveTaskSelector } from "../../tasks.js";
7
+ function looksLikeTaskPath(input) {
8
+ return input.includes("/") || input.includes("\\") || input.toLowerCase().endsWith(".json");
9
+ }
7
10
  export default class TasksBundle extends BaseCommand {
8
11
  static summary = "Bundle one helper task directory into one task JSON file.";
9
- static description = "Bundle one editable helper task directory into one canonical task JSON file.";
12
+ static description = "Bundle one local task slug or editable helper task directory into one canonical task JSON file.";
10
13
  static examples = [
14
+ "$ mechanic tasks bundle order-tagger",
11
15
  "$ mechanic tasks bundle tasks/order-tagger",
12
16
  "$ mechanic tasks bundle tasks/order-tagger.json",
13
- "$ mechanic tasks bundle tasks/order-tagger --out tasks/order-tagger.json",
17
+ "$ mechanic tasks bundle order-tagger --out tasks/order-tagger.json",
14
18
  ];
15
19
  static args = {
16
- dir: Args.string({ required: false, description: "Helper task directory, or its matching task JSON file." }),
20
+ dir: Args.string({ required: false, description: "Local task slug, helper task directory, or matching task JSON file." }),
17
21
  };
18
22
  static flags = {
19
23
  json: Flags.boolean({
@@ -30,7 +34,7 @@ export default class TasksBundle extends BaseCommand {
30
34
  "Choose one helper task directory to bundle.",
31
35
  "",
32
36
  "Example:",
33
- " mechanic tasks bundle tasks/order-tagger",
37
+ " mechanic tasks bundle order-tagger",
34
38
  "",
35
39
  "By default this writes to tasks/order-tagger.json. Use --out <file> to choose another task JSON file.",
36
40
  ].join("\n"), 2);
@@ -59,6 +63,34 @@ export default class TasksBundle extends BaseCommand {
59
63
  outputDisplay: out || `${input}.json`,
60
64
  };
61
65
  }
66
+ if (!looksLikeTaskPath(input)) {
67
+ let project = null;
68
+ try {
69
+ project = await this.loadProject();
70
+ }
71
+ catch (error) {
72
+ if (!(error instanceof CliError) || !error.message.startsWith("No mechanic.json found")) {
73
+ throw error;
74
+ }
75
+ }
76
+ if (project) {
77
+ const selector = await resolveTaskSelector(project, input, { allowHelperDir: true });
78
+ const filePath = selector.file ? path.resolve(selector.file) : null;
79
+ const helperPath = selector.helperDir
80
+ ? path.resolve(selector.helperDir)
81
+ : filePath?.replace(/\.json$/i, "");
82
+ if (helperPath && await pathExists(path.join(helperPath, "task.json"))) {
83
+ const outputPath = out
84
+ ? path.resolve(out)
85
+ : filePath || `${helperPath}.json`;
86
+ return {
87
+ dirPath: helperPath,
88
+ inputDisplay: displayTaskPath(project, helperPath),
89
+ outputDisplay: displayTaskPath(project, outputPath),
90
+ };
91
+ }
92
+ }
93
+ }
62
94
  if (!input.toLowerCase().endsWith(".json")) {
63
95
  return {
64
96
  dirPath: inputPath,
@@ -6,7 +6,7 @@ export default class TasksDiff extends BaseCommand {
6
6
  static summary = "Diff one task, or use --all to diff every local task.";
7
7
  static description = "Compare one local task with its linked remote task, or use --all to compare every local task JSON file.";
8
8
  static args = {
9
- file: Args.string({ required: false, description: "Task file, helper directory, linked task ID, or unique local task slug." }),
9
+ file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
10
10
  };
11
11
  static flags = {
12
12
  all: Flags.boolean({ description: "Diff every task JSON file in this project." }),
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class TasksNew extends BaseCommand {
3
+ static summary: string;
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ private checkExistingPaths;
15
+ }
16
+ //# sourceMappingURL=new.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/new.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAuCpD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,OAAgB,OAAO,SAAoC;IAC3D,OAAgB,WAAW,SAAiJ;IAC5K,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAGnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA0CZ,kBAAkB;CA2BjC"}
@@ -0,0 +1,103 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import path from "node:path";
3
+ import { BaseCommand } from "../../base-command.js";
4
+ import { CliError } from "../../errors.js";
5
+ import { pathExists } from "../../fs.js";
6
+ import { displayTaskPath, taskPath, taskSlug, unbundleTask, writeTaskFilePath } from "../../tasks.js";
7
+ function taskNameFromInput(input) {
8
+ const cleaned = input.trim().replace(/\s+/g, " ");
9
+ if (cleaned.includes(" ")) {
10
+ return cleaned;
11
+ }
12
+ return taskSlug(cleaned)
13
+ .split("-")
14
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
15
+ .join(" ");
16
+ }
17
+ function starterTask(name) {
18
+ return {
19
+ halt_action_run_sequence_on_error: false,
20
+ name,
21
+ options: {},
22
+ perform_action_runs_in_sequence: false,
23
+ preview_event_definitions: [],
24
+ script: [
25
+ "{% comment %}",
26
+ " Start writing your Mechanic task here.",
27
+ "{% endcomment %}",
28
+ "",
29
+ '{% log message: "Hello from Mechanic" %}',
30
+ "",
31
+ ].join("\n"),
32
+ subscriptions_template: "mechanic/user/text\n",
33
+ tags: [],
34
+ };
35
+ }
36
+ export default class TasksNew extends BaseCommand {
37
+ static summary = "Create a new blank local task.";
38
+ static description = "Create one blank local starter task JSON file and its matching editable helper directory. Nothing is created in Mechanic until you publish.";
39
+ static examples = [
40
+ "$ mechanic tasks new order-tagger",
41
+ "$ mechanic tasks new \"Order tagger\"",
42
+ ];
43
+ static args = {
44
+ name: Args.string({ required: true, description: "Task name or slug for the new local task." }),
45
+ };
46
+ static flags = {
47
+ force: Flags.boolean({ description: "Overwrite the local starter task JSON file and helper directory files." }),
48
+ json: Flags.boolean({ description: "Print created paths as JSON for agents, scripts, or editor integrations." }),
49
+ };
50
+ async run() {
51
+ const { args, flags } = await this.parse(TasksNew);
52
+ const project = await this.loadProject();
53
+ const requestedName = args.name.trim();
54
+ if (!requestedName) {
55
+ throw new CliError("Task name cannot be blank.", 2);
56
+ }
57
+ const slug = taskSlug(requestedName);
58
+ const name = taskNameFromInput(requestedName);
59
+ const filePath = taskPath(project, slug);
60
+ const helperDir = filePath.replace(/\.json$/i, "");
61
+ await this.checkExistingPaths(project, filePath, helperDir, Boolean(flags.force));
62
+ await writeTaskFilePath(filePath, starterTask(name));
63
+ await unbundleTask(filePath, helperDir);
64
+ const fileDisplay = displayTaskPath(project, filePath);
65
+ const helperDisplay = displayTaskPath(project, helperDir);
66
+ if (flags.json) {
67
+ this.outputJson({
68
+ ok: true,
69
+ name,
70
+ slug,
71
+ file: fileDisplay,
72
+ helper_dir: helperDisplay,
73
+ });
74
+ return;
75
+ }
76
+ this.log(`Created ${this.taskName(fileDisplay)}`);
77
+ this.log(`Created ${this.taskName(helperDisplay)}`);
78
+ this.log("");
79
+ this.log("Next steps:");
80
+ this.log(` edit ${this.taskName(displayTaskPath(project, path.join(helperDir, "script.liquid")))}`);
81
+ this.log(` mechanic tasks preview ${this.taskName(slug)}`);
82
+ this.log(` mechanic tasks bundle ${this.taskName(slug)}`);
83
+ this.log(` mechanic tasks publish ${this.taskName(slug)} --dry-run`);
84
+ }
85
+ async checkExistingPaths(project, filePath, helperDir, force) {
86
+ if (force) {
87
+ return;
88
+ }
89
+ const existing = [];
90
+ if (await pathExists(filePath)) {
91
+ existing.push(displayTaskPath(project, filePath));
92
+ }
93
+ if (await pathExists(helperDir)) {
94
+ existing.push(displayTaskPath(project, helperDir));
95
+ }
96
+ if (existing.length > 0) {
97
+ throw new CliError([
98
+ `${existing.join(" and ")} already exists.`,
99
+ "Choose another task name, or re-run with --force to overwrite the local starter files.",
100
+ ].join("\n"), 2);
101
+ }
102
+ }
103
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/open.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAc9C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,OAAO,SAAqC;IAC5D,OAAgB,WAAW,SAAuH;IAElJ,OAAgB,IAAI;;MAElB;IAEI,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBlE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBnC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB3B"}
1
+ {"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/open.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAc9C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,OAAO,SAAqC;IAC5D,OAAgB,WAAW,SAAgH;IAE3I,OAAgB,IAAI;;MAElB;IAEI,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBlE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBnC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB3B"}
@@ -15,9 +15,9 @@ function openerCommand(url) {
15
15
  }
16
16
  export default class TasksOpen extends BaseCommand {
17
17
  static summary = "Open a remote task in Mechanic.";
18
- static description = "Open a remote Mechanic task by task ID, linked local task JSON file, helper directory, or unique local task slug.";
18
+ static description = "Open a remote Mechanic task by local task slug, task ID, linked local task JSON file, or helper directory.";
19
19
  static args = {
20
- target: Args.string({ required: true, description: "Remote task ID, linked local task JSON file, helper directory, or unique local task slug." }),
20
+ target: Args.string({ required: true, description: "Local task slug, remote task ID, linked local task JSON file, or helper directory." }),
21
21
  };
22
22
  async taskIdForTarget(project, target) {
23
23
  const selector = await resolveTaskSelector(project, target, {
@@ -1,6 +1,7 @@
1
1
  import { BaseCommand } from "../../base-command.js";
2
2
  import type { MechanicClient } from "../../client.js";
3
3
  import type { JsonObject, Project, TaskPreviewResponse } from "../../types.js";
4
+ type PreviewDiagnostic = NonNullable<TaskPreviewResponse["diagnostics"]>[number];
4
5
  type PreparedPreview = {
5
6
  label: string;
6
7
  slug?: string;
@@ -28,6 +29,9 @@ export default class TasksPreview extends BaseCommand {
28
29
  renderPreview(project: Project, prepared: PreparedPreview, response: TaskPreviewResponse, options: PreviewRenderOptions): void;
29
30
  renderVerboseDetails(response: TaskPreviewResponse): void;
30
31
  renderRunDetails(response: TaskPreviewResponse): void;
32
+ renderDiagnostics(response: TaskPreviewResponse, options: PreviewRenderOptions): void;
33
+ diagnosticSeverityLabel(severity: PreviewDiagnostic["severity"]): string;
34
+ diagnosticDetails(diagnostic: PreviewDiagnostic): string[];
31
35
  renderPreviewValue(label: string, value: unknown, indent: number): void;
32
36
  formatPreviewValue(value: unknown): string | null;
33
37
  runStatusLabel(ok: boolean | null): string;
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/preview.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAYpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,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OAAO,GAAG,MAAM,GAAG,IAAI;IAgBjD,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM;IAY1C,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IA4BtD,sBAAsB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAmB3D,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAI9E,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IA+BjG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAIxC,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAWlD,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAapC,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,MAAM;CAU3D"}
@@ -2,7 +2,7 @@ import { Args, Flags } from "@oclif/core";
2
2
  import { BaseCommand } from "../../base-command.js";
3
3
  import { HttpError, CliError } from "../../errors.js";
4
4
  import { pathExists } from "../../fs.js";
5
- import { displayTaskPath, readRawTaskFile, resolveTaskSelector, rawTaskFromHelperDir, taskForPush, unbundledHelperDirForTaskFile, validateTaskForPush, } from "../../tasks.js";
5
+ import { displayTaskPath, readRawTaskFile, resolveTaskSelector, rawTaskFromHelperDir, taskForPush, slugFromTaskFile, unbundledHelperDirForTaskFile, validateTaskForPush, } from "../../tasks.js";
6
6
  function errorBodyAsPreview(body) {
7
7
  if (!body || typeof body !== "object") {
8
8
  return null;
@@ -18,7 +18,7 @@ export default class TasksPreview extends BaseCommand {
18
18
  "Use --remote to preview the current task already in Mechanic, or --json for agents, scripts, and CI.",
19
19
  ].join("\n");
20
20
  static args = {
21
- target: Args.string({ required: true, description: "Task file, helper directory, linked task ID, or unique local task slug." }),
21
+ target: Args.string({ required: true, description: "Local task slug, task file, helper directory, or linked task ID." }),
22
22
  };
23
23
  static flags = {
24
24
  json: Flags.boolean({ description: "Print the raw preview response as JSON for agents or CI." }),
@@ -134,6 +134,7 @@ export default class TasksPreview extends BaseCommand {
134
134
  if (options.verbose) {
135
135
  this.renderVerboseDetails(response);
136
136
  }
137
+ this.renderDiagnostics(response, options);
137
138
  this.renderPermissions(response);
138
139
  if (response.status === "invalid") {
139
140
  this.renderValidationErrors(response);
@@ -217,6 +218,45 @@ export default class TasksPreview extends BaseCommand {
217
218
  this.table(rows);
218
219
  }
219
220
  }
221
+ renderDiagnostics(response, options) {
222
+ const diagnostics = response.diagnostics || [];
223
+ const visibleDiagnostics = options.verbose
224
+ ? diagnostics
225
+ : diagnostics.filter((diagnostic) => diagnostic.severity === "warning" || diagnostic.severity === "error");
226
+ if (visibleDiagnostics.length === 0) {
227
+ return;
228
+ }
229
+ this.log("");
230
+ this.log(this.accent("Notes"));
231
+ for (const diagnostic of visibleDiagnostics) {
232
+ const details = options.verbose ? this.diagnosticDetails(diagnostic) : [];
233
+ const suffix = details.length ? ` ${this.muted(`(${details.join(", ")})`)}` : "";
234
+ const code = options.verbose ? ` ${this.muted(`[${diagnostic.code}]`)}` : "";
235
+ this.log(` ${this.diagnosticSeverityLabel(diagnostic.severity)}${code} ${diagnostic.message}${suffix}`);
236
+ if (options.verbose && diagnostic.docs_url) {
237
+ this.log(` ${this.muted(`Docs: ${diagnostic.docs_url}`)}`);
238
+ }
239
+ }
240
+ }
241
+ diagnosticSeverityLabel(severity) {
242
+ switch (severity) {
243
+ case "error":
244
+ return this.color("red", "error");
245
+ case "warning":
246
+ return this.color("yellow", "warning");
247
+ case "info":
248
+ return this.muted("info");
249
+ }
250
+ }
251
+ diagnosticDetails(diagnostic) {
252
+ return [
253
+ diagnostic.event_topic ? `event ${diagnostic.event_topic}` : null,
254
+ typeof diagnostic.event_index === "number" ? `event #${diagnostic.event_index + 1}` : null,
255
+ typeof diagnostic.task_run_index === "number" ? `task run #${diagnostic.task_run_index + 1}` : null,
256
+ typeof diagnostic.action_run_index === "number" ? `action run #${diagnostic.action_run_index + 1}` : null,
257
+ diagnostic.action_type ? `action ${diagnostic.action_type}` : null,
258
+ ].filter((detail) => Boolean(detail));
259
+ }
220
260
  renderPreviewValue(label, value, indent) {
221
261
  const formatted = this.formatPreviewValue(value);
222
262
  if (!formatted) {
@@ -345,7 +385,7 @@ export default class TasksPreview extends BaseCommand {
345
385
  `${relativeFile} is out of date with ${relativeHelperDir}.`,
346
386
  "",
347
387
  "Bundle the helper directory before previewing this JSON file:",
348
- ` mechanic tasks bundle ${relativeHelperDir}`,
388
+ ` mechanic tasks bundle ${slugFromTaskFile(filePath)}`,
349
389
  ].join("\n"), 2);
350
390
  }
351
391
  approvalHint(action) {
@@ -5,7 +5,7 @@ export default class TasksPublish extends TasksPush {
5
5
  static summary = "Publish one local task to Mechanic.";
6
6
  static description = "Publish one local task to Mechanic, or use --all to publish every local task JSON file.";
7
7
  static args = {
8
- file: Args.string({ required: false, description: "Task file, helper directory, linked task ID, or unique local task slug." }),
8
+ file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
9
9
  };
10
10
  static flags = {
11
11
  all: Flags.boolean({ description: "Publish every task JSON file in this project." }),
@@ -1 +1 @@
1
- {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/pull.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAmBpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,OAAO,SAAmD;IAC1E,OAAgB,WAAW,SAAmI;IAE9J,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAGnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2F3B"}
1
+ {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/pull.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoBpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,OAAO,SAAmD;IAC1E,OAAgB,WAAW,SAAmI;IAE9J,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAGnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4F3B"}
@@ -6,12 +6,12 @@ import { pathExists } from "../../fs.js";
6
6
  import { contentHash } from "../../hash.js";
7
7
  import { stableStringify } from "../../json.js";
8
8
  import { CliError } from "../../errors.js";
9
- import { displayTaskPath, nextAvailableSlug, readRawTaskFile, resolveTaskSelector, taskForPush, taskPath, taskSlug, unbundledHelperDirForTaskFile, writeTaskFilePathAndRefreshHelper, } from "../../tasks.js";
9
+ import { displayTaskPath, nextAvailableSlug, readRawTaskFile, resolveTaskSelector, slugFromTaskFile, taskForPush, taskPath, taskSlug, unbundledHelperDirForTaskFile, writeTaskFilePathAndRefreshHelper, } from "../../tasks.js";
10
10
  export default class TasksPull extends BaseCommand {
11
11
  static summary = "Pull remote tasks into local task JSON files.";
12
12
  static description = "Pull every remote task into local canonical task JSON files, or pass a task ID, linked file, or linked slug to pull one task.";
13
13
  static args = {
14
- task: Args.string({ required: false, description: "Remote task ID, linked local task JSON file, or linked local task slug." }),
14
+ task: Args.string({ required: false, description: "Local task slug, remote task ID, or linked local task JSON file." }),
15
15
  };
16
16
  static flags = {
17
17
  all: Flags.boolean({ description: "Pull every remote task for this shop. This is the default when no task ID is passed." }),
@@ -45,13 +45,14 @@ export default class TasksPull extends BaseCommand {
45
45
  if (helperDir) {
46
46
  const relativeFile = displayTaskPath(project, filePath);
47
47
  const relativeHelperDir = displayTaskPath(project, helperDir);
48
+ const slug = slugFromTaskFile(filePath);
48
49
  throw new CliError([
49
50
  `${relativeFile} is out of date with ${relativeHelperDir}.`,
50
51
  "",
51
52
  "The helper directory has changes that are not bundled into the JSON file.",
52
53
  "",
53
54
  "Bundle first:",
54
- ` mechanic tasks bundle ${relativeHelperDir}`,
55
+ ` mechanic tasks bundle ${slug}`,
55
56
  "",
56
57
  "Then pull:",
57
58
  ` mechanic tasks pull ${envelope.id}`,
@@ -22,7 +22,7 @@ export default class TasksPush extends BaseCommand {
22
22
  static summary = "Publish one local task, or use --all to publish every local task.";
23
23
  static description = "Publish one local task to Mechanic, or use --all to publish every local task JSON file in this project.";
24
24
  static args = {
25
- file: Args.string({ required: false, description: "Task file, helper directory, linked task ID, or unique local task slug." }),
25
+ file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
26
26
  };
27
27
  static flags = {
28
28
  all: Flags.boolean({ description: "Publish every task JSON file in this project." }),
@@ -249,10 +249,10 @@ export default class TasksPush extends BaseCommand {
249
249
  "The helper directory has changes that are not bundled into the JSON file.",
250
250
  "",
251
251
  "Bundle first:",
252
- ` mechanic tasks bundle ${relativeHelperDir}`,
252
+ ` mechanic tasks bundle ${slug}`,
253
253
  "",
254
254
  "Then publish:",
255
- ` mechanic tasks publish ${relativeFile}`,
255
+ ` mechanic tasks publish ${slug}`,
256
256
  ].join("\n");
257
257
  if (!collectBlockedRows) {
258
258
  throw new CliError(message, 2);
@@ -263,7 +263,7 @@ export default class TasksPush extends BaseCommand {
263
263
  status: "blocked",
264
264
  task_id: null,
265
265
  content_hash: null,
266
- details: `bundle ${relativeHelperDir} first`,
266
+ details: `bundle ${slug} first`,
267
267
  });
268
268
  continue;
269
269
  }
@@ -15,6 +15,7 @@ export default class TasksStatus extends BaseCommand {
15
15
  };
16
16
  static flags: {
17
17
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ local: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
19
  remote: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
20
  };
20
21
  run(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAe9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,OAAgB,OAAO,SAAuE;IAC9F,OAAgB,WAAW,SAA0H;IAErJ,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAQnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAsGpB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IA4BrF,YAAY,CAChB,MAAM,EAAE,cAAc,GAAG,IAAI,EAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,GACnC,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAsB/C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAejC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAgBnC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD,OAAgB,OAAO,SAAwE;IAC/F,OAAgB,WAAW,SAAkJ;IAE7K,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;;MAYnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA2GpB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;IA4BrF,YAAY,CAChB,MAAM,EAAE,cAAc,GAAG,IAAI,EAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,GACnC,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAsB/C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAejC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAgBnC"}
@@ -2,6 +2,7 @@ import { Args, Flags } from "@oclif/core";
2
2
  import path from "node:path";
3
3
  import { BaseCommand } from "../../base-command.js";
4
4
  import { linkForSlug } from "../../config.js";
5
+ import { CliError } from "../../errors.js";
5
6
  import { pathExists } from "../../fs.js";
6
7
  import { stableStringify } from "../../json.js";
7
8
  import { displayTaskPath, helperDirForTaskFile, readRawTaskFile, remoteChangedSinceLastPull, remoteChangedSinceLastPullDetails, selectedTaskFiles, slugFromTaskFile, taskForPush, unbundledHelperDirForTaskFile, validateTaskForPush, } from "../../tasks.js";
@@ -9,26 +10,34 @@ function errorMessage(error) {
9
10
  return error instanceof Error ? error.message : String(error);
10
11
  }
11
12
  export default class TasksStatus extends BaseCommand {
12
- static summary = "Show local task link, readiness, and optional remote sync status.";
13
- static description = "Show whether local task files are linked, ready to publish, and optionally in sync with their remote Mechanic tasks.";
13
+ static summary = "Show whether local task files are ready and in sync with Mechanic.";
14
+ static description = "Show whether local task files are linked, ready to publish, and in sync with their remote Mechanic tasks. Use --local to skip remote checks.";
14
15
  static args = {
15
- file: Args.string({ required: false, description: "Task file, helper directory, linked task ID, or unique local task slug. Defaults to every task JSON file." }),
16
+ file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID. Defaults to every task JSON file." }),
16
17
  };
17
18
  static flags = {
18
19
  json: Flags.boolean({
19
20
  description: "Print task status as JSON for agents, scripts, or editor integrations.",
20
21
  }),
22
+ local: Flags.boolean({
23
+ description: "Only check local files and links; do not call Mechanic.",
24
+ }),
21
25
  remote: Flags.boolean({
22
26
  char: "r",
23
- description: "Check linked remote tasks and report no-change, local-change, or conflict state.",
27
+ description: "Check linked remote tasks. This is the default; kept for compatibility.",
28
+ hidden: true,
24
29
  }),
25
30
  };
26
31
  async run() {
27
32
  const { args, flags } = await this.parse(TasksStatus);
33
+ if (flags.local && flags.remote) {
34
+ throw new CliError("Use either --local or --remote, not both.", 2);
35
+ }
28
36
  const project = await this.loadProject();
29
37
  const files = await selectedTaskFiles(project, args.file, !args.file);
30
38
  const statuses = [];
31
39
  let client = null;
40
+ const checkRemote = !flags.local;
32
41
  const getClient = async () => {
33
42
  client ||= await this.verifiedClientForProject(project);
34
43
  return client;
@@ -64,9 +73,9 @@ export default class TasksStatus extends BaseCommand {
64
73
  if (helperStatus.details) {
65
74
  details.push(helperStatus.details);
66
75
  }
67
- const remote = flags.remote && task && !helperStatus.blocked
76
+ const remote = checkRemote && task && !helperStatus.blocked
68
77
  ? await this.remoteStatus(link ? await getClient() : null, task, link)
69
- : flags.remote ? { label: "skipped", details: undefined } : null;
78
+ : checkRemote ? { label: "skipped", details: undefined } : null;
70
79
  if (remote?.details) {
71
80
  details.push(remote.details);
72
81
  }
@@ -88,12 +97,12 @@ export default class TasksStatus extends BaseCommand {
88
97
  if (flags.json) {
89
98
  this.outputJson({
90
99
  shop_domain: project.shopDomain,
91
- remote_checked: Boolean(flags.remote),
100
+ remote_checked: checkRemote,
92
101
  tasks: statuses,
93
102
  });
94
103
  return;
95
104
  }
96
- const rows = flags.remote
105
+ const rows = checkRemote
97
106
  ? [["File", "Link", "Local", "Remote", "Task ID", "Details"]]
98
107
  : [["File", "Link", "Local", "Task ID", "Details"]];
99
108
  for (const status of statuses) {
@@ -102,7 +111,7 @@ export default class TasksStatus extends BaseCommand {
102
111
  status.link.linked ? this.success("linked") : this.color("yellow", "unlinked"),
103
112
  this.localLabel(status.local.label),
104
113
  ];
105
- if (flags.remote) {
114
+ if (checkRemote) {
106
115
  row.push(this.remoteLabel(status.remote?.label || "not checked"));
107
116
  }
108
117
  row.push(status.link.remote_id ? this.taskId(project, status.link.remote_id) : "--", status.details.join("; "));
@@ -121,7 +130,7 @@ export default class TasksStatus extends BaseCommand {
121
130
  return {
122
131
  label: "needs bundle",
123
132
  blocked: true,
124
- details: `run mechanic tasks bundle ${displayTaskPath(project, driftDir)}`,
133
+ details: `run mechanic tasks bundle ${slugFromTaskFile(file)}`,
125
134
  };
126
135
  }
127
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unbundle.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/unbundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD,OAAgB,OAAO,SAAkD;IACzE,OAAgB,WAAW,SAAiJ;IAC5K,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAOnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BZ,oBAAoB;CA2CnC"}
1
+ {"version":3,"file":"unbundle.d.ts","sourceRoot":"","sources":["../../../src/commands/tasks/unbundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD,OAAgB,OAAO,SAAkD;IACzE,OAAgB,WAAW,SAA0I;IACrK,OAAgB,QAAQ,WAKtB;IAEF,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;;MAOnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BZ,oBAAoB;CA2CnC"}
@@ -6,15 +6,15 @@ import { pathExists } from "../../fs.js";
6
6
  import { displayTaskPath, resolveTaskSelector, unbundleTask } from "../../tasks.js";
7
7
  export default class TasksUnbundle extends BaseCommand {
8
8
  static summary = "Unbundle one task into one helper directory.";
9
- static description = "Unbundle one canonical task JSON file, linked task ID, helper directory, or unique local task slug into one editable helper task directory.";
9
+ static description = "Unbundle one local task slug, canonical task JSON file, linked task ID, or helper directory into one editable helper task directory.";
10
10
  static examples = [
11
- "$ mechanic tasks unbundle tasks/order-tagger.json",
12
11
  "$ mechanic tasks unbundle order-tagger",
12
+ "$ mechanic tasks unbundle tasks/order-tagger.json",
13
13
  "$ mechanic tasks unbundle 171578bf-79e2-46af-857a-dbd71c6b7b2b",
14
- "$ mechanic tasks unbundle tasks/order-tagger.json --out helpers/order-tagger",
14
+ "$ mechanic tasks unbundle order-tagger --out helpers/order-tagger",
15
15
  ];
16
16
  static args = {
17
- file: Args.string({ required: false, description: "Task file, helper directory, linked task ID, or unique local task slug." }),
17
+ file: Args.string({ required: false, description: "Local task slug, task file, helper directory, or linked task ID." }),
18
18
  };
19
19
  static flags = {
20
20
  json: Flags.boolean({
@@ -31,7 +31,7 @@ export default class TasksUnbundle extends BaseCommand {
31
31
  "Choose one task to unbundle.",
32
32
  "",
33
33
  "Example:",
34
- " mechanic tasks unbundle tasks/order-tagger.json",
34
+ " mechanic tasks unbundle order-tagger",
35
35
  "",
36
36
  "By default this writes to tasks/order-tagger/. Use --out <dir> to choose another helper directory.",
37
37
  ].join("\n"), 2);
package/dist/tasks.js CHANGED
@@ -217,7 +217,7 @@ async function resolveExistingPathSelector(project, input, allowHelperDir) {
217
217
  }
218
218
  throw new CliError([
219
219
  `No canonical task JSON file found for helper directory ${displayTaskPath(project, candidate)}.`,
220
- `Run "mechanic tasks bundle ${displayTaskPath(project, candidate)}" first.`,
220
+ `Run "mechanic tasks bundle ${taskSlug(path.basename(candidate))}" first.`,
221
221
  ].join("\n"), 2);
222
222
  }
223
223
  return null;
package/dist/types.d.ts CHANGED
@@ -76,6 +76,17 @@ export type TaskPreviewResponse = {
76
76
  };
77
77
  warnings: string[];
78
78
  };
79
+ diagnostics?: Array<{
80
+ code: string;
81
+ severity: "info" | "warning" | "error";
82
+ message: string;
83
+ event_index?: number;
84
+ event_topic?: string | null;
85
+ task_run_index?: number;
86
+ action_run_index?: number;
87
+ action_type?: string | null;
88
+ docs_url?: string;
89
+ }>;
79
90
  events: Array<{
80
91
  topic: string;
81
92
  shopify_topic?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAA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C;QAC3B,cAAc,EAAE;YAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAChE,OAAO,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACzE,SAAS,EAAE;YAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACxG,CAAC;IACF,GAAG,EAAE;QACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightward/mechanic-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Develop, preview, diff, and publish Mechanic Shopify automation tasks from local files",
5
5
  "type": "module",
6
6
  "keywords": [