@master4n/master-cli 3.0.2 → 3.0.4
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 +104 -21
- package/SECURITY.md +90 -0
- package/bin/catalog.agent.d.ts +3 -0
- package/bin/catalog.classic.d.ts +3 -0
- package/bin/catalog.d.ts +5 -1
- package/bin/catalog.os.d.ts +7 -0
- package/bin/catalog.power.d.ts +7 -0
- package/bin/commands/base.d.ts +7 -0
- package/bin/commands/calc.d.ts +7 -0
- package/bin/commands/case.d.ts +7 -0
- package/bin/commands/clip.d.ts +7 -0
- package/bin/commands/count.d.ts +7 -0
- package/bin/commands/cron.d.ts +7 -0
- package/bin/commands/cron.engine.d.ts +18 -0
- package/bin/commands/diff.d.ts +7 -0
- package/bin/commands/disk.d.ts +7 -0
- package/bin/commands/dns.d.ts +7 -0
- package/bin/commands/dotenv.d.ts +7 -0
- package/bin/commands/env.d.ts +7 -0
- package/bin/commands/epoch.interactive.d.ts +6 -0
- package/bin/commands/escape.d.ts +7 -0
- package/bin/commands/ext.d.ts +7 -0
- package/bin/commands/freq.d.ts +7 -0
- package/bin/commands/have.d.ts +7 -0
- package/bin/commands/http.d.ts +7 -0
- package/bin/commands/imports.d.ts +7 -0
- package/bin/commands/index.d.ts +39 -1
- package/bin/commands/ip.d.ts +7 -0
- package/bin/commands/json.d.ts +7 -0
- package/bin/commands/lines.d.ts +7 -0
- package/bin/commands/mcp.d.ts +7 -0
- package/bin/commands/notify.d.ts +7 -0
- package/bin/commands/open.d.ts +7 -0
- package/bin/commands/outline.d.ts +7 -0
- package/bin/commands/outline.engine.d.ts +13 -0
- package/bin/commands/pkg.d.ts +7 -0
- package/bin/commands/ports.d.ts +7 -0
- package/bin/commands/procs.d.ts +7 -0
- package/bin/commands/recent.d.ts +7 -0
- package/bin/commands/regex.d.ts +7 -0
- package/bin/commands/replace.d.ts +7 -0
- package/bin/commands/repo.d.ts +7 -0
- package/bin/commands/schema.d.ts +7 -0
- package/bin/commands/semver.d.ts +7 -0
- package/bin/commands/size.d.ts +7 -0
- package/bin/commands/sys.d.ts +7 -0
- package/bin/commands/trash.d.ts +7 -0
- package/bin/commands/url.d.ts +7 -0
- package/bin/commands/wait.d.ts +7 -0
- package/bin/index.js +6 -6
- package/bin/index.js.map +1 -1
- package/bin/interface/CliCommand.d.ts +15 -0
- package/bin/interface/index.d.ts +1 -0
- package/bin/utility/guard.d.ts +28 -0
- package/bin/utility/index.d.ts +1 -1
- package/bin/utility/mcp-server.d.ts +3 -0
- package/bin/utility/mcp-tools.d.ts +55 -0
- package/bin/utility/suggest.d.ts +6 -0
- package/llms.txt +120 -45
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
# @master4n/master-cli (`mfn`)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/Master4Novice/master-cli/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/Master4Novice/master-cli/actions/workflows/codeql.yml)
|
|
5
|
+
[](https://snyk.io/test/github/Master4Novice/master-cli)
|
|
6
|
+
[](https://socket.dev/npm/package/@master4n/master-cli)
|
|
4
7
|
[](https://www.npmjs.com/package/@master4n/master-cli)
|
|
5
8
|

|
|
6
9
|

|
|
7
10
|

|
|
8
11
|
|
|
9
|
-
**Master CLI for developers and AI agents.**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
**Master CLI for developers and AI agents.** 51 headless, JSON-first commands in
|
|
13
|
+
three families: **token savers** (extract exactly what you need — one JSON field,
|
|
14
|
+
a line range, a file outline — instead of dumping whole files into context),
|
|
15
|
+
**exact computation** (BigInt math, semver, cron, regex, timezones — verified
|
|
16
|
+
answers instead of guesses), and **one-call actions** (free a port, wait for a
|
|
17
|
+
server, bulk-replace with dry-run). Every command runs the same for a human at a
|
|
18
|
+
terminal and for an agent reading stdout, in ~60ms.
|
|
14
19
|
|
|
15
20
|
## Installation
|
|
16
21
|
|
|
@@ -20,6 +25,19 @@ npm install -g @master4n/master-cli
|
|
|
20
25
|
|
|
21
26
|
This installs the `mfn` command.
|
|
22
27
|
|
|
28
|
+
### Zero-install (agents & one-off use)
|
|
29
|
+
|
|
30
|
+
No global install needed — `npx` runs any command directly:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npx -y @master4n/master-cli capabilities --json # discover every command
|
|
34
|
+
npx -y @master4n/master-cli epoch 1622547800 --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> **For AI agents:** run `mfn capabilities --json` (or the npx form above) to get
|
|
38
|
+
> the machine-readable manifest, and read [`llms.txt`](./llms.txt) — it ships
|
|
39
|
+
> inside the npm package and documents the full agent contract.
|
|
40
|
+
|
|
23
41
|
## The contract (why it's agent-friendly)
|
|
24
42
|
|
|
25
43
|
- **Headless-first** — every command runs from flags/stdin. Interactive prompts
|
|
@@ -36,6 +54,27 @@ This installs the `mfn` command.
|
|
|
36
54
|
- **Self-describing** — `mfn capabilities --json` lists every command, and
|
|
37
55
|
[`llms.txt`](./llms.txt) documents the full agent contract.
|
|
38
56
|
|
|
57
|
+
## MCP server (built in)
|
|
58
|
+
|
|
59
|
+
For agent clients that can't run shell commands, `mfn mcp` serves the whole
|
|
60
|
+
toolkit over the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
61
|
+
(stdio transport, zero extra dependencies):
|
|
62
|
+
|
|
63
|
+
```jsonc
|
|
64
|
+
// e.g. .mcp.json / claude_desktop_config.json / any MCP client
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"mfn": { "command": "npx", "args": ["-y", "@master4n/master-cli", "mcp"] }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Three tools: `mfn_capabilities` (the manifest), `mfn_run` (`{command, args[]}` —
|
|
73
|
+
runs any catalogued command and returns its single JSON object, guardrails
|
|
74
|
+
included), and `mfn_help` (per-command flags). `update` is deny-listed so an
|
|
75
|
+
MCP-only client can never install packages. `mfn mcp --json` describes the
|
|
76
|
+
server without starting it.
|
|
77
|
+
|
|
39
78
|
## Quick start
|
|
40
79
|
|
|
41
80
|
```sh
|
|
@@ -45,25 +84,69 @@ mfn -v # version
|
|
|
45
84
|
mfn capabilities --json # machine-readable manifest of all commands
|
|
46
85
|
```
|
|
47
86
|
|
|
48
|
-
## Commands
|
|
87
|
+
## Commands (51)
|
|
88
|
+
|
|
89
|
+
Run `mfn capabilities` for the grouped list, `mfn <command> --help` for flags.
|
|
90
|
+
|
|
91
|
+
### OS-level — one call on macOS, Windows, and Linux
|
|
92
|
+
|
|
93
|
+
| Command | What it does | Example |
|
|
94
|
+
| ------- | ------------ | ------- |
|
|
95
|
+
| `clip` | Read/write the system clipboard | `git diff \| mfn clip --json` |
|
|
96
|
+
| `notify` | Desktop notification — ping the user when a task finishes | `mfn notify "build finished" --json` |
|
|
97
|
+
| `open` | Open a file/URL in the default app (validated first) | `mfn open coverage/index.html --json` |
|
|
98
|
+
| `procs` | Search processes by name: pid/cpu/mem | `mfn procs node --json` |
|
|
99
|
+
| `disk` | Per-mount disk usage without df parsing | `mfn disk --json` |
|
|
100
|
+
| `trash` | **Reversible** delete to the OS trash — never `rm -rf` | `mfn trash old-logs --json` |
|
|
101
|
+
| `dns` | A/AAAA/CNAME/MX/TXT/NS in one call | `mfn dns github.com --json` |
|
|
102
|
+
|
|
103
|
+
### Token savers — read less, extract exactly
|
|
104
|
+
|
|
105
|
+
| Command | What it does | Example |
|
|
106
|
+
| ------- | ------------ | ------- |
|
|
107
|
+
| `json` | One value from JSON by path — don't read the document | `mfn json scripts.build -f package.json --json` |
|
|
108
|
+
| `schema` | Infer JSON shape (paths + types); 10MB payload → ~20 lines | `mfn schema -f response.json --json` |
|
|
109
|
+
| `count` | Lines/words/chars/bytes + **LLM token estimate** | `git diff \| mfn count --json` |
|
|
110
|
+
| `lines` | Exact line range of a file (1-based), never the whole file | `mfn lines src/app.ts -s 120 -n 30 --json` |
|
|
111
|
+
| `outline` | Symbols + line numbers (.ts .js .py .go .md) | `mfn outline src/app.ts --json` |
|
|
112
|
+
| `diff` | Structured hunks of two files, counts first | `mfn diff old.json new.json -s --json` |
|
|
113
|
+
| `freq` | Most repeated lines — log triage in one call | `mfn freq error.log -t 5 --json` |
|
|
114
|
+
| `imports` | A file's imports, or who imports a module | `mfn imports --who utility --json` |
|
|
115
|
+
| `repo` | Git branch/dirty/ahead-behind/commits in one object | `mfn repo --json` |
|
|
116
|
+
| `sys` / `have` / `ip` | System facts · tool versions · local addresses | `mfn have node git docker --json` |
|
|
117
|
+
| `size` / `ext` / `recent` | Disk usage · composition by extension · newest files | `mfn size -t 5 --json` |
|
|
118
|
+
| `ports` | ALL listening TCP ports with owning processes | `mfn ports --json` |
|
|
119
|
+
| `pkg` | Declared vs installed dependency versions | `mfn pkg --json` |
|
|
120
|
+
| `env` / `dotenv` | Env inspection (secrets **always** redacted) · .env completeness | `mfn dotenv --json` |
|
|
121
|
+
|
|
122
|
+
### Exact computation — never guess
|
|
123
|
+
|
|
124
|
+
| Command | What it does | Example |
|
|
125
|
+
| ------- | ------------ | ------- |
|
|
126
|
+
| `calc` | BigInt-exact arithmetic — `2^53 + 1` comes out right | `mfn calc "2^53 + 1" --json` |
|
|
127
|
+
| `base` | hex/dec/bin/oct conversion, BigInt-safe | `mfn base 0xff --json` |
|
|
128
|
+
| `semver` | Validate/compare/sort/bump per semver.org | `mfn semver 1.10.0 1.9.2 --json` |
|
|
129
|
+
| `cron` | Validate + explain + next run times | `mfn cron "*/15 9-17 * * 1-5" --json` |
|
|
130
|
+
| `regex` | Test a pattern — matches with line/index/groups | `mfn regex "TODO" -f src/app.ts --json` |
|
|
131
|
+
| `url` | URL → components + decoded query params | `mfn url "https://x.com/a?b=1" --json` |
|
|
132
|
+
| `escape` | Context-exact escaping: shell, JSON, regex, HTML, URL | `mfn escape "it's" --json` |
|
|
133
|
+
| `case` | camel/snake/kebab/pascal/… conversion | `mfn case getUserName -t snake --json` |
|
|
134
|
+
| `epoch` / `date` | Epoch ↔ date (auto unit) · timezone conversion | `mfn epoch 1622547800 --json` |
|
|
135
|
+
| `decode` | JWT header + payload + expiry (signature not verified) | `mfn decode -t <jwt> --json` |
|
|
136
|
+
|
|
137
|
+
### Actions — do, don't script
|
|
49
138
|
|
|
50
139
|
| Command | What it does | Example |
|
|
51
140
|
| ------- | ------------ | ------- |
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `kill` | Kill the process(es) listening on given ports | `mfn kill -p 3000 8080 -y --json` |
|
|
62
|
-
| `sc` | Fuzzy-find files/folders under the current directory | `mfn sc service --json` |
|
|
63
|
-
| `cts` | Print (or export) a tree of the current directory | `mfn cts --json` · `mfn cts -t png` |
|
|
64
|
-
| `update` | Update the CLI (or a named package) to the latest version | `mfn update --json` |
|
|
65
|
-
|
|
66
|
-
Run `mfn <command> --help` for the full flag list and more examples.
|
|
141
|
+
| `replace` | Literal find/replace across files — **dry-run by default** | `mfn replace old new -g "src/**/*.ts" --json` |
|
|
142
|
+
| `wait` | Block until port/URL/file is ready — no sleep loops | `mfn wait -p 3000 -t 30 --json` |
|
|
143
|
+
| `kill` | Free the ports your dev server got stuck on | `mfn kill -p 3000 8080 -y --json` |
|
|
144
|
+
| `http` | Probe a URL: status/headers/timing, capped body preview | `mfn http localhost:3000/health --json` |
|
|
145
|
+
| `port` | Find a free port, or check one | `mfn port -c 3000 --json` |
|
|
146
|
+
| `id` / `hash` / `encode` / `random` | UUID v4/v7/nano · digests · codecs · CSPRNG | `mfn id -t uuid7 -n 3 --json` |
|
|
147
|
+
| `sc` / `cts` | Fuzzy file find · directory tree | `mfn sc service --json` |
|
|
148
|
+
| `capabilities` / `update` | Machine-readable manifest · self-update | `mfn capabilities --json` |
|
|
149
|
+
| `mcp` | Serve every command over the Model Context Protocol (stdio) | `mfn mcp` |
|
|
67
150
|
|
|
68
151
|
### Examples
|
|
69
152
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please open a private report via
|
|
6
|
+
[GitHub Security Advisories](https://github.com/Master4Novice/master-cli/security/advisories/new)
|
|
7
|
+
rather than a public issue. You should receive a response within a week.
|
|
8
|
+
|
|
9
|
+
## Threat model & design guarantees
|
|
10
|
+
|
|
11
|
+
`mfn` is a local developer tool. It is designed so that untrusted *input*
|
|
12
|
+
(strings, tokens, file contents, port numbers) can never escalate into code
|
|
13
|
+
execution or unintended process termination:
|
|
14
|
+
|
|
15
|
+
- **No shell interpolation.** Every external process (`npm`, `lsof`, `netstat`,
|
|
16
|
+
`kill`, `taskkill`) is spawned with `execFile` — arguments are passed as an
|
|
17
|
+
array, never interpolated into a shell string. A crafted package name or port
|
|
18
|
+
value cannot inject commands.
|
|
19
|
+
- **Strict input validation.** Ports must be integers in 1..65535; counts,
|
|
20
|
+
sizes, and byte lengths have hard upper bounds; PIDs parsed from `lsof`/
|
|
21
|
+
`netstat` output must be strictly numeric before being passed to `kill`.
|
|
22
|
+
- **JWTs are decoded, never verified or transmitted.** `mfn decode` performs
|
|
23
|
+
local base64url decoding only; the token never leaves the machine, and the
|
|
24
|
+
output explicitly states the signature is not verified.
|
|
25
|
+
- **Crypto uses Node's CSPRNG.** `random` and `id` use `node:crypto`
|
|
26
|
+
(`randomBytes`, `randomUUID`) with rejection sampling — no `Math.random`, no
|
|
27
|
+
modulo bias.
|
|
28
|
+
- **Local cache is private.** `~/.mfn/cache` (recent ports, ignore lists) is
|
|
29
|
+
created with mode `0700`.
|
|
30
|
+
- **No network calls** except `mfn update`, which delegates to `npm` itself.
|
|
31
|
+
- **No telemetry.** Nothing is collected or sent anywhere.
|
|
32
|
+
|
|
33
|
+
## Guardrails (active, no override flags)
|
|
34
|
+
|
|
35
|
+
`mfn` is built to be safe to hand to an AI agent. These guardrails are always
|
|
36
|
+
on — there are deliberately **no bypass flags**, because an agent will find and
|
|
37
|
+
use any flag that exists:
|
|
38
|
+
|
|
39
|
+
| Guardrail | Commands | What it prevents |
|
|
40
|
+
| --------- | -------- | ---------------- |
|
|
41
|
+
| **Sensitive-path refusal** (`SensitivePath`, exit 2) | `lines` `json` `schema` `diff` `freq` `regex -f` `hash -f` | Returning the CONTENT of credential stores: `~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.kube`, `.env*`, `*.pem`, `*.key`, `id_rsa*`, `.npmrc`, `.netrc`, `shadow`, … An agent's context window is a log that never rotates. `hash -f` is included because a digest of a low-entropy secrets file can be brute-forced offline. |
|
|
42
|
+
| **Clipboard secret redaction** | `clip` (read) | Passwords/tokens pasted through the clipboard (password managers). Secret-shaped content (private-key blocks, JWTs, AWS/GitHub/Slack/Google/npm/`sk-` tokens) is withheld with `redacted:true`. |
|
|
43
|
+
| **Env value scanning** | `env` | Redacts by NAME pattern (key/token/secret/…) **and** by VALUE shape — an innocently named variable holding a JWT is still redacted. `mfn env` with no names lists names only. |
|
|
44
|
+
| **Dotenv never reads values** | `dotenv` | Compares KEY presence between `.env` and `.env.example`; values are never parsed, stored, or returned. |
|
|
45
|
+
| **Cloud-metadata block** (`BlockedTarget`, exit 2) | `http` `wait -u` | SSRF credential theft via `169.254.169.254`, `metadata.google.internal`, Alibaba/AWS v6 endpoints. Localhost stays allowed — probing your own dev server is the point. |
|
|
46
|
+
| **Session-cookie redaction** | `http` | `set-cookie` response headers are replaced with `[redacted: session cookie]`. |
|
|
47
|
+
| **Scheme allow-list** | `open` | Only http(s) URLs or existing local paths; `javascript:`, `file:`, and custom protocol handlers are refused. |
|
|
48
|
+
| **Reversible delete only** | `trash` | Moves to the OS trash (never unlink); refuses `/`, home, cwd, and any parent of cwd — compared by realpath so symlinks can't fool it. |
|
|
49
|
+
| **PID floor + numeric check** | `kill` | A parsing surprise can never become `kill -9 0/1/-1`; ports validated 1..65535. |
|
|
50
|
+
| **Tool-name charset** | `have` | Probed names must be plain command names — no paths, no metacharacters. |
|
|
51
|
+
| **Dry-run by default** | `replace` | File modification requires explicit `--write`; scope is bounded to cwd. |
|
|
52
|
+
| **Body/range caps everywhere** | `http` (2KB preview) `lines` (2000) `diff` (20k lines) `clip` (1MB) … | One call can never flood a context window or memory. |
|
|
53
|
+
|
|
54
|
+
## Guardrail scope & known limits (honest)
|
|
55
|
+
|
|
56
|
+
The credential guardrail is **defense-in-depth, not a security boundary**. It is
|
|
57
|
+
two layers:
|
|
58
|
+
|
|
59
|
+
1. **Path layer** — refuses sensitive paths, resolving symlinks via realpath so
|
|
60
|
+
an innocently named symlink can't smuggle a secret file's content out.
|
|
61
|
+
2. **Content layer** — masks secret-*shaped* substrings (private-key blocks,
|
|
62
|
+
JWTs, AWS/GitHub/Slack/Google/npm/`sk-` tokens) in the content that
|
|
63
|
+
`lines`/`freq`/`regex`/`json` echo, **including content piped via stdin**
|
|
64
|
+
where there is no path to vet.
|
|
65
|
+
|
|
66
|
+
Known limits, stated plainly:
|
|
67
|
+
|
|
68
|
+
- **Hardlinks** to a sensitive file are not detected at the path layer (a
|
|
69
|
+
hardlink shares the file's inode but has no distinguishable path). The content
|
|
70
|
+
layer still masks recognised token shapes; and creating a hardlink requires
|
|
71
|
+
the same read access as reading the original, so it grants no new capability.
|
|
72
|
+
- The content layer matches **known token shapes**, not arbitrary `KEY=value`
|
|
73
|
+
secrets — over-broad redaction would break legitimate config/log processing.
|
|
74
|
+
- An agent that already has shell access can read any file directly with `cat`.
|
|
75
|
+
These guardrails reduce *accidental* exposure through `mfn`'s own output
|
|
76
|
+
(the common path by which secrets leak into an agent's context window); they
|
|
77
|
+
are not a sandbox and do not claim to be.
|
|
78
|
+
|
|
79
|
+
## Scope notes
|
|
80
|
+
|
|
81
|
+
- `mfn hash` supports `md5`/`sha1` for checksum interop with legacy systems —
|
|
82
|
+
they are not suitable for security purposes; use `sha256`/`sha512`.
|
|
83
|
+
- `mfn kill` sends `SIGKILL` to processes the invoking user owns; it cannot
|
|
84
|
+
affect other users' processes beyond what the OS already permits.
|
|
85
|
+
- `mfn update <package>` installs a named package globally via npm — only point
|
|
86
|
+
it at packages you trust, exactly as with `npm install -g`.
|
|
87
|
+
|
|
88
|
+
## Supported versions
|
|
89
|
+
|
|
90
|
+
Only the latest published major (3.x) receives security fixes.
|
package/bin/catalog.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Single source of truth for the command catalogue — consumed by the welcome
|
|
3
3
|
* banner (the "tools" line) and by `mfn capabilities` (the agent-facing
|
|
4
|
-
* manifest).
|
|
4
|
+
* manifest). Add new commands to the matching catalog.*.ts data module.
|
|
5
5
|
*/
|
|
6
6
|
export interface CommandInfo {
|
|
7
7
|
/** Invocation name, e.g. `epoch`. */
|
|
8
8
|
name: string;
|
|
9
|
+
/** Functional grouping an agent can filter on. */
|
|
10
|
+
category: 'discovery' | 'time' | 'crypto' | 'text' | 'data' | 'code' | 'net' | 'system';
|
|
9
11
|
/** One-line human summary. */
|
|
10
12
|
summary: string;
|
|
11
13
|
/** Copy-paste examples (headless, agent-friendly). */
|
|
12
14
|
examples: string[];
|
|
13
15
|
}
|
|
14
16
|
export declare const COMMANDS: readonly CommandInfo[];
|
|
17
|
+
/** Distinct categories in catalogue order (for grouped rendering). */
|
|
18
|
+
export declare const CATEGORIES: readonly string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandInfo } from './catalog';
|
|
2
|
+
/**
|
|
3
|
+
* Agent generation 3: OS-level commands — the things an agent normally needs
|
|
4
|
+
* platform-specific incantations (or a human's hands) for, made one-call and
|
|
5
|
+
* safe-by-default on macOS, Windows, and Linux.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OS_COMMANDS: readonly CommandInfo[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandInfo } from './catalog';
|
|
2
|
+
/**
|
|
3
|
+
* Agent generation 2: the commands an AI coding agent reaches for constantly —
|
|
4
|
+
* code navigation, dependency tracing, bulk edits, readiness waits, and
|
|
5
|
+
* environment drift checks.
|
|
6
|
+
*/
|
|
7
|
+
export declare const POWER_COMMANDS: readonly CommandInfo[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal, dependency-free 5-field cron engine (minute hour day-of-month month
|
|
3
|
+
* day-of-week). Supports * , - / lists, ranges, and steps. Standard semantics:
|
|
4
|
+
* when BOTH dom and dow are restricted, a date matches if EITHER matches (Vixie
|
|
5
|
+
* cron rule).
|
|
6
|
+
*/
|
|
7
|
+
export interface CronFields {
|
|
8
|
+
minute: Set<number>;
|
|
9
|
+
hour: Set<number>;
|
|
10
|
+
dayOfMonth: Set<number>;
|
|
11
|
+
month: Set<number>;
|
|
12
|
+
dayOfWeek: Set<number>;
|
|
13
|
+
domRestricted: boolean;
|
|
14
|
+
dowRestricted: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseCron(expression: string): CronFields;
|
|
17
|
+
/** Next `count` run times strictly after `from` (local time), bounded to 5 years. */
|
|
18
|
+
export declare function nextRuns(f: CronFields, from: Date, count: number): Date[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TTY-only fallback for `mfn epoch` when no flags/positional are supplied.
|
|
3
|
+
* Lives in its own module to keep epoch.ts focused on the headless paths
|
|
4
|
+
* (and under the 150-line file budget).
|
|
5
|
+
*/
|
|
6
|
+
export declare function epochInteractive(argv: any, epochToDate: (argv: any, value: number) => void, dateToEpoch: (argv: any, input: string, format?: string, tz?: string) => void): Promise<void>;
|
package/bin/commands/index.d.ts
CHANGED
|
@@ -11,4 +11,42 @@ import hash from './hash';
|
|
|
11
11
|
import encode from './encode';
|
|
12
12
|
import random from './random';
|
|
13
13
|
import port from './port';
|
|
14
|
-
|
|
14
|
+
import jsonCmd from './json';
|
|
15
|
+
import count from './count';
|
|
16
|
+
import lines from './lines';
|
|
17
|
+
import have from './have';
|
|
18
|
+
import sys from './sys';
|
|
19
|
+
import repo from './repo';
|
|
20
|
+
import calc from './calc';
|
|
21
|
+
import semver from './semver';
|
|
22
|
+
import caseCmd from './case';
|
|
23
|
+
import cron from './cron';
|
|
24
|
+
import diff from './diff';
|
|
25
|
+
import env from './env';
|
|
26
|
+
import size from './size';
|
|
27
|
+
import ext from './ext';
|
|
28
|
+
import freq from './freq';
|
|
29
|
+
import regex from './regex';
|
|
30
|
+
import url from './url';
|
|
31
|
+
import ip from './ip';
|
|
32
|
+
import escapeCmd from './escape';
|
|
33
|
+
import schema from './schema';
|
|
34
|
+
import outlineCmd from './outline';
|
|
35
|
+
import imports from './imports';
|
|
36
|
+
import replace from './replace';
|
|
37
|
+
import recent from './recent';
|
|
38
|
+
import pkgCmd from './pkg';
|
|
39
|
+
import dotenv from './dotenv';
|
|
40
|
+
import wait from './wait';
|
|
41
|
+
import ports from './ports';
|
|
42
|
+
import http from './http';
|
|
43
|
+
import base from './base';
|
|
44
|
+
import clip from './clip';
|
|
45
|
+
import notify from './notify';
|
|
46
|
+
import openCmd from './open';
|
|
47
|
+
import procs from './procs';
|
|
48
|
+
import disk from './disk';
|
|
49
|
+
import trash from './trash';
|
|
50
|
+
import dns from './dns';
|
|
51
|
+
import mcp from './mcp';
|
|
52
|
+
export { cts, sc, deco, date, epoch, killProcess, update, capabilities, mcp, id, hash, encode, random, port, jsonCmd, count, lines, have, sys, repo, calc, semver, caseCmd, cron, diff, env, size, ext, freq, regex, url, ip, escapeCmd, schema, outlineCmd, imports, replace, recent, pkgCmd, dotenv, wait, ports, http, base, clip, notify, openCmd, procs, disk, trash, dns, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regex-based source outliner. Not a real parser — it's the 95% answer in
|
|
3
|
+
* ~zero time: top-level symbols with line numbers, so an agent can read a
|
|
4
|
+
* 50-token outline and then fetch only the lines it needs (`mfn lines`).
|
|
5
|
+
*/
|
|
6
|
+
export interface Symbol {
|
|
7
|
+
line: number;
|
|
8
|
+
kind: string;
|
|
9
|
+
name: string;
|
|
10
|
+
exported: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const SUPPORTED_EXTENSIONS: string[];
|
|
13
|
+
export declare function outline(text: string, extension: string): Symbol[];
|