monday-cli 0.3.0 → 0.4.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 (107) hide show
  1. package/CHANGELOG.md +351 -0
  2. package/README.md +130 -36
  3. package/dist/api/assets.d.ts +326 -0
  4. package/dist/api/assets.d.ts.map +1 -0
  5. package/dist/api/assets.js +519 -0
  6. package/dist/api/assets.js.map +1 -0
  7. package/dist/api/column-types.d.ts +11 -7
  8. package/dist/api/column-types.d.ts.map +1 -1
  9. package/dist/api/column-types.js +5 -3
  10. package/dist/api/column-types.js.map +1 -1
  11. package/dist/api/column-values.d.ts +7 -1
  12. package/dist/api/column-values.d.ts.map +1 -1
  13. package/dist/api/column-values.js +15 -6
  14. package/dist/api/column-values.js.map +1 -1
  15. package/dist/api/documents.d.ts +519 -0
  16. package/dist/api/documents.d.ts.map +1 -0
  17. package/dist/api/documents.js +586 -0
  18. package/dist/api/documents.js.map +1 -0
  19. package/dist/api/item-watch.d.ts +263 -0
  20. package/dist/api/item-watch.d.ts.map +1 -0
  21. package/dist/api/item-watch.js +709 -0
  22. package/dist/api/item-watch.js.map +1 -0
  23. package/dist/api/multipart-transport.d.ts +223 -0
  24. package/dist/api/multipart-transport.d.ts.map +1 -0
  25. package/dist/api/multipart-transport.js +274 -0
  26. package/dist/api/multipart-transport.js.map +1 -0
  27. package/dist/api/parallel-dispatch.d.ts +155 -0
  28. package/dist/api/parallel-dispatch.d.ts.map +1 -0
  29. package/dist/api/parallel-dispatch.js +243 -0
  30. package/dist/api/parallel-dispatch.js.map +1 -0
  31. package/dist/api/partial-success-bulk.d.ts +118 -60
  32. package/dist/api/partial-success-bulk.d.ts.map +1 -1
  33. package/dist/api/partial-success-bulk.js +137 -79
  34. package/dist/api/partial-success-bulk.js.map +1 -1
  35. package/dist/api/partial-success-mutation.d.ts +13 -1
  36. package/dist/api/partial-success-mutation.d.ts.map +1 -1
  37. package/dist/api/partial-success-mutation.js +5 -1
  38. package/dist/api/partial-success-mutation.js.map +1 -1
  39. package/dist/api/raw-write.d.ts +12 -4
  40. package/dist/api/raw-write.d.ts.map +1 -1
  41. package/dist/api/raw-write.js +21 -11
  42. package/dist/api/raw-write.js.map +1 -1
  43. package/dist/api/resolve-client.d.ts +11 -0
  44. package/dist/api/resolve-client.d.ts.map +1 -1
  45. package/dist/api/resolve-client.js +9 -1
  46. package/dist/api/resolve-client.js.map +1 -1
  47. package/dist/cli/run.d.ts +20 -0
  48. package/dist/cli/run.d.ts.map +1 -1
  49. package/dist/cli/run.js +1 -0
  50. package/dist/cli/run.js.map +1 -1
  51. package/dist/commands/board/column-create.d.ts +6 -5
  52. package/dist/commands/board/column-create.d.ts.map +1 -1
  53. package/dist/commands/board/column-create.js +9 -6
  54. package/dist/commands/board/column-create.js.map +1 -1
  55. package/dist/commands/completion.d.ts +188 -0
  56. package/dist/commands/completion.d.ts.map +1 -0
  57. package/dist/commands/completion.js +418 -0
  58. package/dist/commands/completion.js.map +1 -0
  59. package/dist/commands/doc/get.d.ts +46 -0
  60. package/dist/commands/doc/get.d.ts.map +1 -0
  61. package/dist/commands/doc/get.js +95 -0
  62. package/dist/commands/doc/get.js.map +1 -0
  63. package/dist/commands/doc/list.d.ts +83 -0
  64. package/dist/commands/doc/list.d.ts.map +1 -0
  65. package/dist/commands/doc/list.js +248 -0
  66. package/dist/commands/doc/list.js.map +1 -0
  67. package/dist/commands/index.d.ts.map +1 -1
  68. package/dist/commands/index.js +46 -0
  69. package/dist/commands/index.js.map +1 -1
  70. package/dist/commands/item/create.js +2 -2
  71. package/dist/commands/item/update.d.ts +1 -0
  72. package/dist/commands/item/update.d.ts.map +1 -1
  73. package/dist/commands/item/update.js +61 -0
  74. package/dist/commands/item/update.js.map +1 -1
  75. package/dist/commands/item/upload.d.ts +108 -0
  76. package/dist/commands/item/upload.d.ts.map +1 -0
  77. package/dist/commands/item/upload.js +370 -0
  78. package/dist/commands/item/upload.js.map +1 -0
  79. package/dist/commands/item/watch.d.ts +90 -0
  80. package/dist/commands/item/watch.d.ts.map +1 -0
  81. package/dist/commands/item/watch.js +342 -0
  82. package/dist/commands/item/watch.js.map +1 -0
  83. package/dist/commands/update/upload.d.ts +69 -0
  84. package/dist/commands/update/upload.d.ts.map +1 -0
  85. package/dist/commands/update/upload.js +235 -0
  86. package/dist/commands/update/upload.js.map +1 -0
  87. package/dist/types/ids.d.ts +2 -0
  88. package/dist/types/ids.d.ts.map +1 -1
  89. package/dist/types/ids.js +9 -2
  90. package/dist/types/ids.js.map +1 -1
  91. package/dist/utils/mime.d.ts +24 -0
  92. package/dist/utils/mime.d.ts.map +1 -0
  93. package/dist/utils/mime.js +64 -0
  94. package/dist/utils/mime.js.map +1 -0
  95. package/dist/utils/output/envelope.d.ts +30 -0
  96. package/dist/utils/output/envelope.d.ts.map +1 -1
  97. package/dist/utils/output/envelope.js +26 -0
  98. package/dist/utils/output/envelope.js.map +1 -1
  99. package/dist/utils/output/ndjson.d.ts +25 -0
  100. package/dist/utils/output/ndjson.d.ts.map +1 -1
  101. package/dist/utils/output/ndjson.js +12 -0
  102. package/dist/utils/output/ndjson.js.map +1 -1
  103. package/dist/utils/signal.d.ts +42 -0
  104. package/dist/utils/signal.d.ts.map +1 -0
  105. package/dist/utils/signal.js +45 -0
  106. package/dist/utils/signal.js.map +1 -0
  107. package/package.json +1 -1
@@ -0,0 +1,188 @@
1
+ /**
2
+ * `monday completion <bash|zsh|fish>` — emit a shell-completion script
3
+ * for the named shell flavour (cli-design.md §3.1 #2 carve-out + §4.3
4
+ * COMPLETION section + §13 v0.4 entry; v0.4-plan.md §3 M33).
5
+ *
6
+ * **What this verb answers:** "give me a shell-completion script I can
7
+ * `eval` / `source` to get tab-completion for `monday <noun> <verb>`
8
+ * + flags in my shell". Standard install flow:
9
+ *
10
+ * monday completion bash >> ~/.bashrc
11
+ * monday completion zsh >> ~/.zshrc
12
+ * monday completion fish > ~/.config/fish/completions/monday.fish
13
+ *
14
+ * **Empirical-probe finding (M33 pre-flight Decision 1).** Commander
15
+ * 14.0.3 (the SDK-pinned version) ships NO completion machinery —
16
+ * `grep -rn 'completion\|complete' node_modules/commander/lib/
17
+ * node_modules/commander/typings/` returned zero hits at 2026-05-14.
18
+ * The verb hand-rolls per-shell script templates instead of shelling
19
+ * out to a commander-provided emitter. No runtime dep added (the
20
+ * cli-design §1 "minimum deps" principle is binding); the runtime
21
+ * walks `program.commands` + each command's options at emit time so
22
+ * completions stay in sync with the registry as new verbs land.
23
+ *
24
+ * **Output discipline carve-out (M33 pre-flight Decision 3, cli-design
25
+ * §3.1 raw-bytes carve-out).** This is the FIRST non-envelope stdout
26
+ * surface in the CLI. Default behaviour (no `--json` flag) emits the
27
+ * raw script bytes on stdout regardless of TTY / pipe context — the
28
+ * standard install flow above pipes to a file and an envelope wrap
29
+ * would defeat the purpose. Three modes:
30
+ *
31
+ * - **Default (no `--json` / no `--output` / no `MONDAY_OUTPUT`)**:
32
+ * raw script bytes. Sticky `MONDAY_OUTPUT` is load-bearing in
33
+ * the carve-out — a non-empty env value opts the caller into
34
+ * the same dispatch path the `--output <fmt>` flag would
35
+ * (envelope when `MONDAY_OUTPUT=json`, rejection for
36
+ * `table` / `text` / `ndjson`).
37
+ * - **`--json` / `--output json` / `MONDAY_OUTPUT=json`**: standard
38
+ * §6 envelope with `data: { shell, script }`. Useful for agent
39
+ * introspection (e.g., `monday completion bash --json | jq -r
40
+ * '.data.script'` extracts the same bytes the default mode
41
+ * prints).
42
+ * - **`--table` / `--output table` / `--output text` / `--output
43
+ * ndjson` / `MONDAY_OUTPUT=<non-json>`**: rejected as
44
+ * `usage_error` (no sensible non-JSON envelope view of a multi-
45
+ * line script blob). The `--text` and `--ndjson` shorthand
46
+ * flags don't exist on this CLI (only `--json` and `--table`
47
+ * are global shorthands per cli-design §4.4); text / ndjson
48
+ * are accessible only via `--output <fmt>`.
49
+ *
50
+ * **`shell` argv (Decision 4).** Single positional, required. Closed
51
+ * 3-value enum `bash` / `zsh` / `fish` validated at the parse
52
+ * boundary. Unknown values reject with `usage_error.details.issues[]`
53
+ * carrying a `{path: 'shell', message: 'Invalid option: expected one
54
+ * of "bash"|"zsh"|"fish"'}` entry (the shared `parseArgv` boundary
55
+ * shape per `src/commands/parse-argv.ts:SummarisedIssue` — NOT a
56
+ * completion-specific `details.shell` slot; the boundary's
57
+ * `SummarisedIssue` carries only `path` + `message` + optional
58
+ * `params`, NOT a Zod `code` field). Agents key on
59
+ * `details.issues[].path === 'shell'` to disambiguate from other
60
+ * parse-boundary rejections.
61
+ *
62
+ * **No wire surface (Decision 5).** Verb is CLI-internal — no Monday
63
+ * API call, no `resolveClient`, no auth requirement. `meta.source:
64
+ * "none"` (only applies to the `--json` envelope path).
65
+ *
66
+ * **No `--dry-run` (Decision 6).** Verb is fundamentally a "show
67
+ * script" verb, not a mutation. The cli-design §3.1 #6 dry-run rule
68
+ * binds mutating commands; completion has no Monday-side side-effect
69
+ * to preview.
70
+ *
71
+ * **No GraphQL operation (Decision 7).** R-NEW-37 W2 audit-point
72
+ * returns "nothing flagged" for M33 — there's no `client.raw` call to
73
+ * pair an `operationName` against.
74
+ *
75
+ * **Idempotent: yes** (deterministic per shell flavour — same argv
76
+ * against the same registry produces byte-identical scripts).
77
+ */
78
+ import type { Command } from 'commander';
79
+ import { z } from 'zod';
80
+ import type { CommandModule } from './types.js';
81
+ /**
82
+ * Closed 3-value enum of shell flavours the CLI knows how to emit a
83
+ * completion script for. Adding a 4th value (e.g. `powershell`,
84
+ * `nushell`) is a SemVer-minor expansion at the M33 contract + a
85
+ * matching hand-rolled template below.
86
+ */
87
+ export declare const COMPLETION_SHELLS: readonly ["bash", "zsh", "fish"];
88
+ export type CompletionShell = (typeof COMPLETION_SHELLS)[number];
89
+ /**
90
+ * zod enum binding for the closed 3-value shell flavour. Exported so
91
+ * downstream `monday schema completion` introspection consumers can
92
+ * pin against the same enum the argv parse boundary uses.
93
+ */
94
+ export declare const shellSchema: z.ZodEnum<{
95
+ bash: "bash";
96
+ zsh: "zsh";
97
+ fish: "fish";
98
+ }>;
99
+ declare const inputSchema: z.ZodObject<{
100
+ shell: z.ZodEnum<{
101
+ bash: "bash";
102
+ zsh: "zsh";
103
+ fish: "fish";
104
+ }>;
105
+ }, z.core.$strict>;
106
+ /**
107
+ * `--json` envelope shape. The default mode emits raw script bytes
108
+ * with NO envelope (see module-level carve-out note); this schema
109
+ * applies only when `--json` / `--output json` / `MONDAY_OUTPUT=json`
110
+ * opts into the envelope path.
111
+ *
112
+ * `shell` echoes the input flavour; `script` is the per-shell
113
+ * completion script body as a single string (including trailing
114
+ * newlines). Agents extract via `jq -r '.data.script'`.
115
+ */
116
+ export declare const completionOutputSchema: z.ZodObject<{
117
+ shell: z.ZodEnum<{
118
+ bash: "bash";
119
+ zsh: "zsh";
120
+ fish: "fish";
121
+ }>;
122
+ script: z.ZodString;
123
+ }, z.core.$strict>;
124
+ export type CompletionOutput = z.infer<typeof completionOutputSchema>;
125
+ /**
126
+ * Snapshot of the commander tree at script-emit time. Each node
127
+ * carries the bare verb name (positional placeholders stripped) +
128
+ * recursive children + the long-form option names declared on the
129
+ * commander Command instance (parent-scope options + global flags
130
+ * are folded in at template-emit time per shell flavour).
131
+ *
132
+ * The tree is rebuilt on every invocation — emit is cheap (one walk
133
+ * over ~100 commander nodes) and rebuilding keeps the scripts in
134
+ * lockstep with the registry as new verbs land at v0.5+ without any
135
+ * per-template maintenance.
136
+ */
137
+ interface CompletionNode {
138
+ readonly name: string;
139
+ readonly children: readonly CompletionNode[];
140
+ readonly options: readonly string[];
141
+ }
142
+ /**
143
+ * Walk every command path from `root` down to each terminal verb,
144
+ * yielding the dotted-path key (e.g., `''` for root, `'item'` for
145
+ * the `item` noun, `'item get'` for the leaf verb) + the merged
146
+ * option list at that scope (the node's own options plus root-level
147
+ * global flags). The list is sorted lexicographically by path so
148
+ * the emitted scripts are deterministic across runs.
149
+ */
150
+ interface FlatPath {
151
+ readonly path: readonly string[];
152
+ readonly children: readonly string[];
153
+ /**
154
+ * Merged option list (locals + program-root globals). Used by the
155
+ * bash + zsh templates where every depth's flag suggestions are
156
+ * self-contained ("at `monday item get <TAB>`, suggest `--json`
157
+ * even though `--json` lives on the root commander instance, not
158
+ * on `get`").
159
+ */
160
+ readonly options: readonly string[];
161
+ /**
162
+ * Node-scoped option list ONLY (no globals folded in). Used by
163
+ * the fish template, which registers globals via `complete -c
164
+ * monday -l <name>` at the root and per-depth local flags via
165
+ * `complete -c monday -n '__fish_seen_subcommand_from ...'
166
+ * -l <name>`. Without the local-vs-merged split, fish would
167
+ * either duplicate every global flag at every depth (loud + ugly
168
+ * tab-completion suggestions) or drop every per-verb local flag
169
+ * (e.g. `doc list --workspace`, `dev sprint list --state`). The
170
+ * dedicated `localOptions` slot keeps fish's per-depth emit
171
+ * precise without forcing bash/zsh to lose merged globals.
172
+ */
173
+ readonly localOptions: readonly string[];
174
+ }
175
+ /**
176
+ * Exposed for unit-test access — lets the test suite build a tree
177
+ * against a synthetic commander program (without spinning the full
178
+ * runner) and assert structural properties.
179
+ */
180
+ export declare const _internals: {
181
+ buildCompletionTree: (program: Command) => CompletionNode;
182
+ flattenPaths: (root: CompletionNode) => readonly FlatPath[];
183
+ buildCompletionScript: (shell: CompletionShell, program: Command) => string;
184
+ stripPlaceholders: (raw: string) => string;
185
+ };
186
+ export declare const completionCommand: CommandModule<z.infer<typeof inputSchema>, CompletionOutput>;
187
+ export {};
188
+ //# sourceMappingURL=completion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MA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,0 +1,418 @@
1
+ import { z } from 'zod';
2
+ import { parseArgv } from './parse-argv.js';
3
+ import { emitSuccess } from './emit.js';
4
+ import { parseGlobalFlags } from '../types/global-flags.js';
5
+ import { UsageError } from '../utils/errors.js';
6
+ /**
7
+ * Closed 3-value enum of shell flavours the CLI knows how to emit a
8
+ * completion script for. Adding a 4th value (e.g. `powershell`,
9
+ * `nushell`) is a SemVer-minor expansion at the M33 contract + a
10
+ * matching hand-rolled template below.
11
+ */
12
+ export const COMPLETION_SHELLS = ['bash', 'zsh', 'fish'];
13
+ /**
14
+ * zod enum binding for the closed 3-value shell flavour. Exported so
15
+ * downstream `monday schema completion` introspection consumers can
16
+ * pin against the same enum the argv parse boundary uses.
17
+ */
18
+ export const shellSchema = z.enum(COMPLETION_SHELLS);
19
+ const inputSchema = z
20
+ .object({
21
+ shell: shellSchema,
22
+ })
23
+ .strict();
24
+ /**
25
+ * `--json` envelope shape. The default mode emits raw script bytes
26
+ * with NO envelope (see module-level carve-out note); this schema
27
+ * applies only when `--json` / `--output json` / `MONDAY_OUTPUT=json`
28
+ * opts into the envelope path.
29
+ *
30
+ * `shell` echoes the input flavour; `script` is the per-shell
31
+ * completion script body as a single string (including trailing
32
+ * newlines). Agents extract via `jq -r '.data.script'`.
33
+ */
34
+ export const completionOutputSchema = z
35
+ .object({
36
+ shell: shellSchema,
37
+ script: z.string().min(1),
38
+ })
39
+ .strict();
40
+ /**
41
+ * Strip placeholder syntax (`get <itemId>` → `get`, `set <iid>
42
+ * [setExpr]` → `set`) so the completion script enumerates bare
43
+ * verbs. Commander's `Command.name()` already strips this in v14
44
+ * but the defensive helper keeps the templates resilient to any
45
+ * future commander shape change.
46
+ */
47
+ const stripPlaceholders = (raw) =>
48
+ // `String.prototype.split` always returns at least one element so
49
+ // the `?? raw` arm is unreachable from a non-empty input. The
50
+ // commander `Command.name()` source is non-empty by construction;
51
+ // the defensive guard stays so a future commander shape change
52
+ // doesn't surface as an unhandled `undefined` first-token.
53
+ /* c8 ignore next */
54
+ raw.split(/\s+/u)[0] ?? raw;
55
+ const collectLongOptions = (cmd) => {
56
+ const out = [];
57
+ for (const opt of cmd.options) {
58
+ // Commander v14 stores the long form on `opt.long`. Every option
59
+ // declared via `program.option('--foo …', …)` carries a non-empty
60
+ // long-form string; the `length > 0` guard is defensive against
61
+ // a hypothetical short-only option (not currently used anywhere
62
+ // in `src/cli/program.ts`'s global-flag set or any verb's
63
+ // per-command options).
64
+ /* c8 ignore next */
65
+ if (typeof opt.long === 'string' && opt.long.length > 0) {
66
+ out.push(opt.long);
67
+ }
68
+ }
69
+ return out;
70
+ };
71
+ const buildCompletionTree = (program) => {
72
+ const visit = (cmd) => ({
73
+ name: stripPlaceholders(cmd.name()),
74
+ children: cmd.commands.map(visit),
75
+ options: collectLongOptions(cmd),
76
+ });
77
+ return visit(program);
78
+ };
79
+ const flattenPaths = (root) => {
80
+ const globalOptions = root.options;
81
+ const acc = [];
82
+ const recur = (node, path) => {
83
+ const merged = new Set([...globalOptions, ...node.options]);
84
+ acc.push({
85
+ path,
86
+ children: node.children.map((c) => c.name).sort(),
87
+ options: [...merged].sort(),
88
+ localOptions: [...node.options].sort(),
89
+ });
90
+ for (const child of node.children) {
91
+ recur(child, [...path, child.name]);
92
+ }
93
+ };
94
+ recur(root, []);
95
+ acc.sort((a, b) => a.path.join(' ').localeCompare(b.path.join(' ')));
96
+ return acc;
97
+ };
98
+ /**
99
+ * Encode a value for safe interpolation inside POSIX-shell
100
+ * single-quoted strings. The only metachar to escape is the
101
+ * single quote itself — close, escape, reopen.
102
+ */
103
+ const shSingleQuote = (raw) => `'${raw.replace(/'/gu, `'\\''`)}'`;
104
+ const buildBashScript = (paths) => {
105
+ const cases = [];
106
+ for (const entry of paths) {
107
+ const key = entry.path.join(' ');
108
+ const completions = [...entry.children, ...entry.options].join(' ');
109
+ cases.push(` ${shSingleQuote(key)})\n` +
110
+ ` COMPREPLY=( $(compgen -W ${shSingleQuote(completions)} -- "$cur") )\n` +
111
+ ` return 0\n` +
112
+ ` ;;`);
113
+ }
114
+ return [
115
+ '# monday-cli bash completion',
116
+ '# Generated by `monday completion bash` — do not edit by hand.',
117
+ '# Install: append the output to your bashrc, e.g.',
118
+ '# monday completion bash >> ~/.bashrc',
119
+ '',
120
+ '_monday_completion() {',
121
+ ' local cur prev words cword',
122
+ ' COMPREPLY=()',
123
+ ' cur="${COMP_WORDS[COMP_CWORD]}"',
124
+ ' prev="${COMP_WORDS[COMP_CWORD-1]}"',
125
+ ' words=("${COMP_WORDS[@]}")',
126
+ ' cword=$COMP_CWORD',
127
+ '',
128
+ ' # Build the command path from the words BEFORE the current',
129
+ ' # cursor position. Flags (anything starting with `-`) and the',
130
+ ' # binary name itself are skipped — only positional verbs',
131
+ ' # contribute to the path lookup.',
132
+ ' local path=""',
133
+ ' local i=1',
134
+ ' while [ $i -lt $cword ]; do',
135
+ ' local w="${words[$i]}"',
136
+ ' case "$w" in',
137
+ ' -*) ;;',
138
+ ' *)',
139
+ ' if [ -z "$path" ]; then',
140
+ ' path="$w"',
141
+ ' else',
142
+ ' path="$path $w"',
143
+ ' fi',
144
+ ' ;;',
145
+ ' esac',
146
+ ' i=$((i+1))',
147
+ ' done',
148
+ '',
149
+ ' case "$path" in',
150
+ ...cases,
151
+ ' *)',
152
+ ' COMPREPLY=()',
153
+ ' return 0',
154
+ ' ;;',
155
+ ' esac',
156
+ '}',
157
+ '',
158
+ 'complete -F _monday_completion monday',
159
+ '',
160
+ ].join('\n');
161
+ };
162
+ const buildZshScript = (paths) => {
163
+ // compadd takes one shell word per completion candidate after `--`,
164
+ // so we single-quote each item individually rather than pre-joining
165
+ // into a single space-delimited string. Quoting per-item keeps the
166
+ // emitted compadd line resilient to verb / flag names that ever
167
+ // contain whitespace or quoting metacharacters (none today, but
168
+ // future v0.5+ verbs added by other agents shouldn't have to know
169
+ // the script-emit invariant to stay correct).
170
+ const cases = paths.map((entry) => {
171
+ const key = entry.path.join(' ');
172
+ const items = [...entry.children, ...entry.options]
173
+ .map(shSingleQuote)
174
+ .join(' ');
175
+ return (` ${shSingleQuote(key)})\n` +
176
+ ` compadd -- ${items}\n` +
177
+ ` return 0\n` +
178
+ ` ;;`);
179
+ });
180
+ return [
181
+ '#compdef monday',
182
+ '# monday-cli zsh completion',
183
+ '# Generated by `monday completion zsh` — do not edit by hand.',
184
+ '# Install: append the output to your zshrc, e.g.',
185
+ '# monday completion zsh >> ~/.zshrc',
186
+ '',
187
+ '_monday() {',
188
+ ' local -a words_arr',
189
+ ' words_arr=("${words[@]}")',
190
+ ' local cword=$CURRENT',
191
+ '',
192
+ ' # Build the command path from the words BEFORE the current',
193
+ ' # cursor position. Flags and the binary name itself are',
194
+ ' # skipped — only positional verbs feed the lookup.',
195
+ ' local path=""',
196
+ ' local i=2',
197
+ ' while [ $i -lt $cword ]; do',
198
+ ' local w="${words_arr[$i]}"',
199
+ ' case "$w" in',
200
+ ' -*) ;;',
201
+ ' *)',
202
+ ' if [ -z "$path" ]; then',
203
+ ' path="$w"',
204
+ ' else',
205
+ ' path="$path $w"',
206
+ ' fi',
207
+ ' ;;',
208
+ ' esac',
209
+ ' i=$((i+1))',
210
+ ' done',
211
+ '',
212
+ ' case "$path" in',
213
+ ...cases,
214
+ ' *)',
215
+ ' return 0',
216
+ ' ;;',
217
+ ' esac',
218
+ '}',
219
+ '',
220
+ '_monday "$@"',
221
+ '',
222
+ ].join('\n');
223
+ };
224
+ const buildFishScript = (paths) => {
225
+ const lines = [
226
+ '# monday-cli fish completion',
227
+ '# Generated by `monday completion fish` — do not edit by hand.',
228
+ '# Install: write the output to your fish completions dir, e.g.',
229
+ '# monday completion fish > ~/.config/fish/completions/monday.fish',
230
+ '',
231
+ '# Disable file completion globally for the monday command; per-',
232
+ '# scope rules below re-enable suggestions where appropriate.',
233
+ 'complete -c monday -f',
234
+ '',
235
+ ];
236
+ for (const entry of paths) {
237
+ const depth = entry.path.length;
238
+ // The condition predicate enumerates how to detect "we are at',
239
+ // this command depth": at depth 0, no subcommand seen; at depth
240
+ // N, every prior path token has been seen AND the next token
241
+ // has not.
242
+ const seenChain = entry.path
243
+ .map((p) => `__fish_seen_subcommand_from ${p}`)
244
+ .join('; and ');
245
+ const cond = depth === 0
246
+ ? '__fish_use_subcommand'
247
+ : seenChain;
248
+ // Emit one `complete -c monday -n '<cond>' -a 'name' -d 'description'`
249
+ // per direct child (sub-noun / sub-verb).
250
+ for (const child of entry.children) {
251
+ const desc = `(${entry.path.length === 0 ? 'top-level' : entry.path.join(' ')} ${child})`;
252
+ lines.push(`complete -c monday -n ${shSingleQuote(cond)} -a ${shSingleQuote(child)} -d ${shSingleQuote(desc)}`);
253
+ }
254
+ // Emit one `complete -c monday -n '<cond>' -l <flag>` per option
255
+ // long-form. The fish completion model is per-condition: globals
256
+ // register at the root (no `-n` predicate so they apply
257
+ // everywhere); per-verb locals register at their specific depth
258
+ // with the matching `__fish_seen_subcommand_from ...` predicate
259
+ // so the suggestion only fires inside the right command scope.
260
+ // Without the per-depth local-flag emission, fish would lose
261
+ // every verb-specific flag (e.g. `doc list --workspace`,
262
+ // `dev sprint list --state`) — Codex IMPL round-1 P2-1 catch.
263
+ const flagsToEmit = depth === 0 ? entry.options : entry.localOptions;
264
+ for (const flag of flagsToEmit) {
265
+ // Strip the leading `--` from the long form for fish's -l.
266
+ // Commander's long-form always starts with `--`; the `: flag`
267
+ // arm is defensive against a hypothetical bare-name input.
268
+ /* c8 ignore next */
269
+ const long = flag.startsWith('--') ? flag.slice(2) : flag;
270
+ if (depth === 0) {
271
+ lines.push(`complete -c monday -l ${shSingleQuote(long)}`);
272
+ }
273
+ else {
274
+ lines.push(`complete -c monday -n ${shSingleQuote(cond)} -l ${shSingleQuote(long)}`);
275
+ }
276
+ }
277
+ }
278
+ lines.push('');
279
+ return lines.join('\n');
280
+ };
281
+ const buildCompletionScript = (shell, program) => {
282
+ const tree = buildCompletionTree(program);
283
+ const paths = flattenPaths(tree);
284
+ switch (shell) {
285
+ case 'bash':
286
+ return buildBashScript(paths);
287
+ case 'zsh':
288
+ return buildZshScript(paths);
289
+ case 'fish':
290
+ return buildFishScript(paths);
291
+ }
292
+ };
293
+ /**
294
+ * Exposed for unit-test access — lets the test suite build a tree
295
+ * against a synthetic commander program (without spinning the full
296
+ * runner) and assert structural properties.
297
+ */
298
+ export const _internals = {
299
+ buildCompletionTree,
300
+ flattenPaths,
301
+ buildCompletionScript,
302
+ stripPlaceholders,
303
+ };
304
+ export const completionCommand = {
305
+ name: 'completion',
306
+ summary: 'Emit a shell-completion script (bash | zsh | fish)',
307
+ examples: [
308
+ 'monday completion bash >> ~/.bashrc',
309
+ 'monday completion zsh >> ~/.zshrc',
310
+ 'monday completion fish > ~/.config/fish/completions/monday.fish',
311
+ 'monday completion bash --json',
312
+ ],
313
+ idempotent: true,
314
+ inputSchema,
315
+ outputSchema: completionOutputSchema,
316
+ attach: (program, ctx) => {
317
+ program
318
+ .command('completion <shell>')
319
+ .description(completionCommand.summary)
320
+ .addHelpText('after', [
321
+ '',
322
+ 'Examples:',
323
+ ...completionCommand.examples.map((e) => ` ${e}`),
324
+ '',
325
+ 'Notes:',
326
+ ' - Default output is the raw shell script on stdout (no envelope).',
327
+ ' The standard install pipes to your rc file (see examples).',
328
+ ' - --json wraps the script in the §6 envelope (data: { shell, script }).',
329
+ ' - --table / --output table|text|ndjson are rejected (not applicable to a script).',
330
+ '',
331
+ ].join('\n'))
332
+ .action((shellArg) => {
333
+ // Argv parse boundary — validates the positional against
334
+ // the closed 3-value enum BEFORE the output-format dispatch
335
+ // runs, so a premature `monday completion floppy` invocation
336
+ // surfaces `usage_error` from the parse boundary (NOT a
337
+ // confusing "format not applicable" message).
338
+ const parsed = parseArgv(completionCommand.inputSchema, {
339
+ shell: shellArg,
340
+ });
341
+ const globalFlags = parseGlobalFlags(program.opts(), ctx.env);
342
+ // Detect whether the caller explicitly opted into an output
343
+ // format. The cli-design §3.1 #2 raw-bytes carve-out is
344
+ // explicit: default behaviour (no flag, no env) emits raw
345
+ // bytes regardless of TTY / pipe context. Going through
346
+ // `selectOutput` would silently collapse "no opt-in" to
347
+ // either `table` (TTY) or `json` (pipe) — neither matches
348
+ // the carve-out's "raw bytes by default" contract.
349
+ const envOutput = ctx.env.MONDAY_OUTPUT;
350
+ const envOptIn = envOutput !== undefined && envOutput !== '';
351
+ const optedIn = globalFlags.json ||
352
+ globalFlags.table ||
353
+ globalFlags.output !== undefined ||
354
+ envOptIn;
355
+ if (!optedIn) {
356
+ // Default raw-bytes mode. Writes the script directly to
357
+ // stdout with NO envelope wrap — the standard install flow
358
+ // `monday completion bash >> ~/.bashrc` relies on this. No
359
+ // secret-redaction pass is needed: the script bytes are
360
+ // built from `program.commands` + global option names,
361
+ // both compile-time constants with no env interpolation.
362
+ // The integration test suite pins a LEAK_CANARY assertion
363
+ // to catch future drift.
364
+ const script = buildCompletionScript(parsed.shell, program);
365
+ ctx.stdout.write(script);
366
+ return;
367
+ }
368
+ // Reject inapplicable formats BEFORE building the script.
369
+ // The cli-design §3.1 #2 carve-out documents three modes:
370
+ // default raw bytes, `--json` envelope, and rejection for
371
+ // every other format. `text` and `ndjson` are accessible
372
+ // only via `--output <fmt>` (NOT as standalone `--text` /
373
+ // `--ndjson` shorthand flags — only `--json` and `--table`
374
+ // are shorthands per §4.4).
375
+ if (globalFlags.table) {
376
+ throw new UsageError('output format not applicable to monday completion: ' +
377
+ '--table is rejected (the verb emits a shell script — ' +
378
+ 'raw bytes by default, JSON envelope via --json).');
379
+ }
380
+ if (globalFlags.output === 'table' ||
381
+ globalFlags.output === 'text' ||
382
+ globalFlags.output === 'ndjson') {
383
+ throw new UsageError(`output format not applicable to monday completion: ` +
384
+ `--output ${globalFlags.output} is rejected (the verb emits ` +
385
+ `a shell script — raw bytes by default, JSON envelope via --json).`);
386
+ }
387
+ // Reject MONDAY_OUTPUT=<non-json> on the env path too. The
388
+ // env opt-in is symmetric with the flag opt-in: only
389
+ // MONDAY_OUTPUT=json maps onto the envelope mode; everything
390
+ // else routes through this rejection.
391
+ if (globalFlags.output === undefined &&
392
+ !globalFlags.json &&
393
+ envOptIn &&
394
+ envOutput !== 'json') {
395
+ throw new UsageError(`output format not applicable to monday completion: ` +
396
+ `MONDAY_OUTPUT=${envOutput} is rejected (the verb emits ` +
397
+ `a shell script — raw bytes by default, JSON envelope via --json).`);
398
+ }
399
+ // At this point the caller opted INTO the `--json` envelope
400
+ // path (either `--json`, `--output json`, or
401
+ // `MONDAY_OUTPUT=json`). Build the script + emit through
402
+ // the standard §6 envelope. `source: 'none'` mirrors
403
+ // `monday config show` / `monday config path` cadence for
404
+ // CLI-internal verbs — no Monday API call, no cache, so the
405
+ // data-source field carries the same "no upstream" value.
406
+ const script = buildCompletionScript(parsed.shell, program);
407
+ emitSuccess({
408
+ ctx,
409
+ data: { shell: parsed.shell, script },
410
+ schema: completionCommand.outputSchema,
411
+ programOpts: program.opts(),
412
+ source: 'none',
413
+ cacheAgeSeconds: null,
414
+ });
415
+ });
416
+ },
417
+ };
418
+ //# sourceMappingURL=completion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAqFA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AAGlE;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAErD,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,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