auden 0.1.0-alpha.2 → 0.1.0-alpha.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 +48 -5
- package/dist/auden-paths.d.ts +1 -0
- package/dist/auden-paths.d.ts.map +1 -1
- package/dist/auden-paths.js +1 -0
- package/dist/auden-paths.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +99 -24
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/guides/active.d.ts.map +1 -1
- package/dist/commands/guides/active.js +3 -16
- package/dist/commands/guides/active.js.map +1 -1
- package/dist/commands/guides/index.d.ts.map +1 -1
- package/dist/commands/guides/index.js +6 -0
- package/dist/commands/guides/index.js.map +1 -1
- package/dist/commands/guides/search.d.ts.map +1 -1
- package/dist/commands/guides/search.js +3 -16
- package/dist/commands/guides/search.js.map +1 -1
- package/dist/commands/init.d.ts +11 -8
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +220 -128
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +2 -2
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/pull.js +2 -2
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/rules/export.d.ts.map +1 -1
- package/dist/commands/rules/export.js +6 -18
- package/dist/commands/rules/export.js.map +1 -1
- package/dist/commands/rules/import.d.ts.map +1 -1
- package/dist/commands/rules/import.js +9 -25
- package/dist/commands/rules/import.js.map +1 -1
- package/dist/commands/rules/index.d.ts.map +1 -1
- package/dist/commands/rules/index.js +1 -1
- package/dist/commands/rules/index.js.map +1 -1
- package/dist/commands/rules/watch.d.ts.map +1 -1
- package/dist/commands/rules/watch.js +3 -6
- package/dist/commands/rules/watch.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +10 -3
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/update.d.ts +18 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +113 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config.d.ts +61 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +135 -36
- package/dist/config.js.map +1 -1
- package/dist/context/pull.d.ts +3 -3
- package/dist/context/pull.d.ts.map +1 -1
- package/dist/context/pull.js +5 -11
- package/dist/context/pull.js.map +1 -1
- package/dist/dashboard-health.d.ts +3 -1
- package/dist/dashboard-health.d.ts.map +1 -1
- package/dist/dashboard-health.js +44 -3
- package/dist/dashboard-health.js.map +1 -1
- package/dist/eval-provider.d.ts.map +1 -1
- package/dist/eval-provider.js +2 -4
- package/dist/eval-provider.js.map +1 -1
- package/dist/guides-cache.d.ts +8 -0
- package/dist/guides-cache.d.ts.map +1 -0
- package/dist/guides-cache.js +31 -0
- package/dist/guides-cache.js.map +1 -0
- package/dist/hook-bin.d.ts +3 -0
- package/dist/hook-bin.d.ts.map +1 -0
- package/dist/hook-bin.js +37 -0
- package/dist/hook-bin.js.map +1 -0
- package/dist/hook-logger.d.ts +24 -0
- package/dist/hook-logger.d.ts.map +1 -0
- package/dist/hook-logger.js +68 -0
- package/dist/hook-logger.js.map +1 -0
- package/dist/hook-script.d.ts +27 -0
- package/dist/hook-script.d.ts.map +1 -0
- package/dist/hook-script.js +74 -0
- package/dist/hook-script.js.map +1 -0
- package/dist/hooks-settings.d.ts +82 -0
- package/dist/hooks-settings.d.ts.map +1 -0
- package/dist/hooks-settings.js +206 -0
- package/dist/hooks-settings.js.map +1 -0
- package/dist/http-retry.d.ts +8 -0
- package/dist/http-retry.d.ts.map +1 -1
- package/dist/http-retry.js +14 -1
- package/dist/http-retry.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +2 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/write-items.d.ts +12 -6
- package/dist/mcp/write-items.d.ts.map +1 -1
- package/dist/mcp/write-items.js +16 -9
- package/dist/mcp/write-items.js.map +1 -1
- package/dist/path-resolve.d.ts +11 -0
- package/dist/path-resolve.d.ts.map +1 -0
- package/dist/path-resolve.js +48 -0
- package/dist/path-resolve.js.map +1 -0
- package/dist/prompt.d.ts +3 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +22 -0
- package/dist/prompt.js.map +1 -0
- package/dist/rules/bundled-skills.d.ts +24 -0
- package/dist/rules/bundled-skills.d.ts.map +1 -0
- package/dist/rules/bundled-skills.js +27 -0
- package/dist/rules/bundled-skills.js.map +1 -0
- package/dist/rules/deletions-client.d.ts.map +1 -1
- package/dist/rules/deletions-client.js +1 -3
- package/dist/rules/deletions-client.js.map +1 -1
- package/dist/rules/discover.d.ts.map +1 -1
- package/dist/rules/discover.js +5 -0
- package/dist/rules/discover.js.map +1 -1
- package/dist/rules/import-client.d.ts.map +1 -1
- package/dist/rules/import-client.js +1 -3
- package/dist/rules/import-client.js.map +1 -1
- package/dist/rules/init-import.d.ts +24 -0
- package/dist/rules/init-import.d.ts.map +1 -0
- package/dist/rules/init-import.js +34 -0
- package/dist/rules/init-import.js.map +1 -0
- package/dist/rules/member-files-client.d.ts.map +1 -1
- package/dist/rules/member-files-client.js +2 -1
- package/dist/rules/member-files-client.js.map +1 -1
- package/dist/rules/pull-bundle.d.ts.map +1 -1
- package/dist/rules/pull-bundle.js +8 -1
- package/dist/rules/pull-bundle.js.map +1 -1
- package/dist/rules/watch.d.ts.map +1 -1
- package/dist/rules/watch.js +5 -0
- package/dist/rules/watch.js.map +1 -1
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +1 -3
- package/dist/sync-client.js.map +1 -1
- package/dist/sync-response.d.ts +0 -1
- package/dist/sync-response.d.ts.map +1 -1
- package/dist/sync-response.js.map +1 -1
- package/dist/token-verify.d.ts +9 -2
- package/dist/token-verify.d.ts.map +1 -1
- package/dist/token-verify.js +13 -3
- package/dist/token-verify.js.map +1 -1
- package/dist/update/assets.d.ts +65 -0
- package/dist/update/assets.d.ts.map +1 -0
- package/dist/update/assets.js +153 -0
- package/dist/update/assets.js.map +1 -0
- package/dist/update/cache.d.ts +46 -0
- package/dist/update/cache.d.ts.map +1 -0
- package/dist/update/cache.js +101 -0
- package/dist/update/cache.js.map +1 -0
- package/dist/update/install-manager.d.ts +51 -0
- package/dist/update/install-manager.d.ts.map +1 -0
- package/dist/update/install-manager.js +111 -0
- package/dist/update/install-manager.js.map +1 -0
- package/dist/update/notice.d.ts +120 -0
- package/dist/update/notice.d.ts.map +1 -0
- package/dist/update/notice.js +184 -0
- package/dist/update/notice.js.map +1 -0
- package/dist/update/perform.d.ts +76 -0
- package/dist/update/perform.d.ts.map +1 -0
- package/dist/update/perform.js +149 -0
- package/dist/update/perform.js.map +1 -0
- package/dist/update/registry.d.ts +32 -0
- package/dist/update/registry.d.ts.map +1 -0
- package/dist/update/registry.js +53 -0
- package/dist/update/registry.js.map +1 -0
- package/dist/update/version.d.ts +40 -0
- package/dist/update/version.d.ts.map +1 -0
- package/dist/update/version.js +101 -0
- package/dist/update/version.js.map +1 -0
- package/dist/url.d.ts +11 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/url.js +13 -0
- package/dist/url.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +16 -0
- package/dist/version.js.map +1 -0
- package/package.json +7 -6
- package/dist/commands/eval/index.d.ts +0 -2
- package/dist/commands/eval/index.d.ts.map +0 -1
- package/dist/commands/eval/index.js +0 -2
- package/dist/commands/eval/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,32 @@ The CLI is the on-device half of the product: it hooks into your agent's lifecyc
|
|
|
10
10
|
npm install -g auden
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
A global install is required (not just `npx`)
|
|
13
|
+
A global install is required (not just `npx`). Both hooks `auden init` registers run from your agent's session by name — `auden-hook` on every tool call, `auden eval` at session end — so both binaries must be on `PATH`. Node 20+ required.
|
|
14
|
+
|
|
15
|
+
## Staying up to date
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
auden update # update to the latest release
|
|
19
|
+
auden update --check # look, but don't install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`auden update` works out how you installed the CLI (npm, bun, pnpm, yarn) and runs the matching command, staying on whichever channel you're on — an `auden@alpha` install updates to the next alpha, not to stable. If it can't tell how you installed it, it prints the command instead of guessing.
|
|
23
|
+
|
|
24
|
+
**Auden never updates itself in the background.** New code is only ever installed when you ask for it. What the CLI does do on its own is keep its *own generated files* in step: `~/.auden/hooks/log-action.mjs` is rewritten from the installed package when it's out of date, since upgrading the package alone would leave the old hook script running. Bundled skills in your repo's `.claude/skills/` are never rewritten silently — you may have edited them, so `auden doctor` reports drift and leaves the fix to you:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
auden init --skills-only # rewrite just the bundled skills, nothing else
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use `--skills-only` rather than `--force` for this: `auden init --force` also resets `~/.auden/config.json` to defaults (discarding your stored API token) and replaces `AGENTS.md`.
|
|
31
|
+
|
|
32
|
+
Interactive commands check for a newer release at most once a day and print a one-line notice on stderr. The check is skipped entirely unless both stdout and stderr are terminals, so agent hooks, the MCP server, pipes, and CI never trigger it. To turn it off:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
export AUDEN_NO_UPDATE_CHECK=1 # or NO_UPDATE_NOTIFIER=1
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
…or set `"updateCheck": false` in `~/.auden/config.json`. The check reads npm's public registry for the published version number only; it sends nothing about you or your machine.
|
|
14
39
|
|
|
15
40
|
## Quick start
|
|
16
41
|
|
|
@@ -22,6 +47,8 @@ auden doctor # verify hooks + config
|
|
|
22
47
|
|
|
23
48
|
`auden init` detects Claude Code, registers a PostToolUse action-logging hook and a Stop hook that runs `auden eval` at session end, scaffolds `AGENTS.md` if missing, and installs a user-invocable Claude Code skill. Everything local — hooks, logging, on-device evaluation — works without an account.
|
|
24
49
|
|
|
50
|
+
The PostToolUse hook is written as the bare command `auden-hook`, a second binary this package installs alongside `auden`. It is a separate bin rather than an `auden hook` subcommand for two reasons: it runs once per tool call, where booting the full command tree would cost roughly 50ms every time; and a bare command resolved through `PATH` carries nothing machine-specific, so `.claude/settings.json` is identical on every machine and can be committed without churning. Settings from older versions named the hook by absolute path — `auden init` migrates those in place, and `auden doctor` reports which form a project is on.
|
|
51
|
+
|
|
25
52
|
To sync verdicts to your dashboard, connect once with a CLI token (dashboard → Settings → Developer → CLI Token):
|
|
26
53
|
|
|
27
54
|
```bash
|
|
@@ -34,19 +61,35 @@ auden sync --token <token> # remembered after the first successful sync
|
|
|
34
61
|
|
|
35
62
|
| Command | What it does |
|
|
36
63
|
|---|---|
|
|
37
|
-
| `auden init` | Set up hooks, config (`~/.auden/`), and the Claude Code skill |
|
|
64
|
+
| `auden init` | Set up hooks, config (`~/.auden/`), and the Claude Code skill (`--skills-only` rewrites just the bundled skills) |
|
|
38
65
|
| `auden doctor` | Check your environment for common setup issues |
|
|
39
66
|
| `auden eval` | Evaluate logged session actions against active guides (run by the Stop hook) |
|
|
40
67
|
| `auden sync` | Push queued verdicts + extracted feedback, pull the guide bundle |
|
|
41
68
|
| `auden pull <bundle>` | Pull a context bundle's canonical items into a local directory as Markdown (default `.auden/context/<bundle>/`) |
|
|
42
69
|
| `auden mcp` | Run the Auden MCP server, exposing your context layer (bundles + inbox) to any agent |
|
|
43
|
-
| `auden
|
|
44
|
-
| `auden
|
|
45
|
-
| `auden
|
|
70
|
+
| `auden guides import` | Send this repo's existing guide files (`AGENTS.md`, `.agents/`, `CLAUDE.md`, `.claude/rules/`, `.cursorrules`, `.cursor/rules/*.mdc`) to your dashboard |
|
|
71
|
+
| `auden guides export` | Write your dashboard guides back to disk (dry-run by default) |
|
|
72
|
+
| `auden guides watch` | Keep imported guide files in sync as they change |
|
|
46
73
|
| `auden guides active` / `search` | List or search your synced guides |
|
|
47
74
|
| `auden verdict record` | Record a manual verdict for an action |
|
|
48
75
|
| `auden suggest` | Review pending guide suggestions |
|
|
49
76
|
| `auden status` | Show queue + config status |
|
|
77
|
+
| `auden update` | Update the CLI to the latest release (`--check` to look without installing) |
|
|
78
|
+
|
|
79
|
+
`import` / `export` / `watch` are also spelled `auden rules <command>` — the older name, kept working.
|
|
80
|
+
|
|
81
|
+
### Bringing an existing repo's guides in
|
|
82
|
+
|
|
83
|
+
If the repo already has an `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, or skills, `auden init` finds them and offers to import them once a token is configured (`--import-guides` / `--no-import-guides` to answer without the prompt). To do it later, or after adding a new guide file:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
auden guides import # preview, then confirm
|
|
87
|
+
auden guides import --all # no prompt
|
|
88
|
+
auden guides import --global # also scan ~/.claude/CLAUDE.md
|
|
89
|
+
auden guides watch # keep pushing changes as you edit
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Both read the dashboard URL from `~/.auden/config.json`, so a `--dashboard-url` passed to `auden init` (e.g. a staging dashboard) carries over; `--dashboard-url` overrides it for a single call. Auden's own bundled skills (`.claude/skills/auden/`, `.claude/skills/auden-context/`) are never imported.
|
|
50
93
|
|
|
51
94
|
## Privacy
|
|
52
95
|
|
package/dist/auden-paths.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export declare const AUDEN_HOOK_SCRIPT: string;
|
|
|
5
5
|
export declare const AUDEN_RUNS_DIR: string;
|
|
6
6
|
export declare const AUDEN_QUEUE_DIR: string;
|
|
7
7
|
export declare const AUDEN_GUIDES_FILE: string;
|
|
8
|
+
export declare const AUDEN_UPDATE_CACHE: string;
|
|
8
9
|
//# sourceMappingURL=auden-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auden-paths.d.ts","sourceRoot":"","sources":["../src/auden-paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,QAA4B,CAAA;AACnD,eAAO,MAAM,YAAY,QAAkC,CAAA;AAC3D,eAAO,MAAM,eAAe,QAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,QAA0C,CAAA;AACxE,eAAO,MAAM,cAAc,QAA2B,CAAA;AACtD,eAAO,MAAM,eAAe,QAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,QAAkC,CAAA"}
|
|
1
|
+
{"version":3,"file":"auden-paths.d.ts","sourceRoot":"","sources":["../src/auden-paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,QAA4B,CAAA;AACnD,eAAO,MAAM,YAAY,QAAkC,CAAA;AAC3D,eAAO,MAAM,eAAe,QAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,QAA0C,CAAA;AACxE,eAAO,MAAM,cAAc,QAA2B,CAAA;AACtD,eAAO,MAAM,eAAe,QAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,QAAkC,CAAA;AAChE,eAAO,MAAM,kBAAkB,QAAwC,CAAA"}
|
package/dist/auden-paths.js
CHANGED
|
@@ -7,4 +7,5 @@ export const AUDEN_HOOK_SCRIPT = join(AUDEN_HOOKS_DIR, 'log-action.mjs');
|
|
|
7
7
|
export const AUDEN_RUNS_DIR = join(AUDEN_HOME, 'runs');
|
|
8
8
|
export const AUDEN_QUEUE_DIR = join(AUDEN_HOME, 'queue');
|
|
9
9
|
export const AUDEN_GUIDES_FILE = join(AUDEN_HOME, 'guides.json');
|
|
10
|
+
export const AUDEN_UPDATE_CACHE = join(AUDEN_HOME, 'update-check.json');
|
|
10
11
|
//# sourceMappingURL=auden-paths.js.map
|
package/dist/auden-paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auden-paths.js","sourceRoot":"","sources":["../src/auden-paths.ts"],"names":[],"mappings":"AAAA,OAAO,E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tD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAsGA,eAAO,MAAM,aAAa;;;;;;;;;;;EAiJxB,CAAA"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -2,10 +2,15 @@ import { spawnSync } from 'node:child_process';
|
|
|
2
2
|
import { access, readFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { defineCommand } from 'citty';
|
|
5
|
-
import {
|
|
6
|
-
import { readConfigToken, resolveDashboardUrl } from '../config.js';
|
|
5
|
+
import { AUDEN_TOKEN_ENV, readEnvToken, resolveDashboardUrl, resolveToken, } from '../config.js';
|
|
7
6
|
import { describeDashboardHealth } from '../dashboard-health.js';
|
|
7
|
+
import { AUDEN_HOOK_COMMAND, audenHookScriptPath, isAudenLoggerCommand, } from '../hooks-settings.js';
|
|
8
|
+
import { resolveOnPath } from '../path-resolve.js';
|
|
8
9
|
import { verifyDashboardToken } from '../token-verify.js';
|
|
10
|
+
import { detectBundledSkillDrift, refreshHookScriptIfStale } from '../update/assets.js';
|
|
11
|
+
import { checkForUpdate, formatUpdateNotice } from '../update/notice.js';
|
|
12
|
+
import { formatUpdateSuccess, performUpdate, syncGeneratedAssets, } from '../update/perform.js';
|
|
13
|
+
import { CLI_VERSION } from '../version.js';
|
|
9
14
|
function detectBunVersion() {
|
|
10
15
|
// When the CLI itself is running under Bun, the version is already available.
|
|
11
16
|
if (typeof process.versions['bun'] !== 'undefined') {
|
|
@@ -18,12 +23,12 @@ function detectBunVersion() {
|
|
|
18
23
|
}
|
|
19
24
|
return { found: false, version: 'not found' };
|
|
20
25
|
}
|
|
21
|
-
async function
|
|
22
|
-
return access(
|
|
26
|
+
async function fileExists(path) {
|
|
27
|
+
return access(path)
|
|
23
28
|
.then(() => true)
|
|
24
29
|
.catch(() => false);
|
|
25
30
|
}
|
|
26
|
-
async function
|
|
31
|
+
async function detectConfiguredHook() {
|
|
27
32
|
const settingsPath = join(process.cwd(), '.claude', 'settings.json');
|
|
28
33
|
try {
|
|
29
34
|
const raw = await readFile(settingsPath, 'utf8');
|
|
@@ -31,19 +36,35 @@ async function checkClaudeCodeHooksConfigured() {
|
|
|
31
36
|
const hooks = settings['hooks'];
|
|
32
37
|
const postToolUse = hooks?.['PostToolUse'];
|
|
33
38
|
if (!Array.isArray(postToolUse))
|
|
34
|
-
return
|
|
35
|
-
|
|
39
|
+
return { form: 'none' };
|
|
40
|
+
// Shares the recognizer with the merge so the two cannot disagree about
|
|
41
|
+
// what counts as configured — the substring match this replaced would miss
|
|
42
|
+
// the portable command and call a correctly wired repo unconfigured.
|
|
43
|
+
const commands = [];
|
|
44
|
+
for (const group of postToolUse) {
|
|
36
45
|
const groupHooks = group['hooks'];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
if (!Array.isArray(groupHooks))
|
|
47
|
+
continue;
|
|
48
|
+
for (const hook of groupHooks) {
|
|
49
|
+
if (typeof hook === 'object' && hook !== null) {
|
|
50
|
+
commands.push(hook['command']);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const audenCommands = commands.filter(isAudenLoggerCommand);
|
|
55
|
+
if (audenCommands.length === 0)
|
|
56
|
+
return { form: 'none' };
|
|
57
|
+
// A repo mid-migration can hold both; the portable one is what fires going
|
|
58
|
+
// forward, so report the state the user should act on last.
|
|
59
|
+
if (audenCommands.some((c) => c === AUDEN_HOOK_COMMAND))
|
|
60
|
+
return { form: 'portable' };
|
|
61
|
+
const scriptPath = audenCommands
|
|
62
|
+
.map((c) => audenHookScriptPath(c))
|
|
63
|
+
.find((path) => path !== null);
|
|
64
|
+
return scriptPath === undefined ? { form: 'none' } : { form: 'legacy', scriptPath };
|
|
44
65
|
}
|
|
45
66
|
catch {
|
|
46
|
-
return
|
|
67
|
+
return { form: 'none' };
|
|
47
68
|
}
|
|
48
69
|
}
|
|
49
70
|
export const doctorCommand = defineCommand({
|
|
@@ -65,8 +86,18 @@ export const doctorCommand = defineCommand({
|
|
|
65
86
|
},
|
|
66
87
|
async run({ args }) {
|
|
67
88
|
const bun = detectBunVersion();
|
|
68
|
-
const
|
|
69
|
-
const hooksConfigured =
|
|
89
|
+
const hook = await detectConfiguredHook();
|
|
90
|
+
const hooksConfigured = hook.form !== 'none';
|
|
91
|
+
// What "the hook can actually run" means depends on which form is wired up:
|
|
92
|
+
// PATH resolution for the portable command, or the existence of the exact
|
|
93
|
+
// script path a legacy entry names — which may belong to another machine.
|
|
94
|
+
const hookBinPath = resolveOnPath(AUDEN_HOOK_COMMAND);
|
|
95
|
+
const runnerOk = hook.form === 'legacy' ? await fileExists(hook.scriptPath) : hookBinPath !== null;
|
|
96
|
+
// Bring the machine-owned hook script back in step before reporting on it,
|
|
97
|
+
// so `doctor` fixes the common post-upgrade staleness rather than merely
|
|
98
|
+
// naming it. No-op when the script is absent or already current.
|
|
99
|
+
const hookRefresh = await refreshHookScriptIfStale();
|
|
100
|
+
const skillDrift = await detectBundledSkillDrift(process.cwd());
|
|
70
101
|
const checks = [
|
|
71
102
|
{
|
|
72
103
|
label: 'Node version',
|
|
@@ -79,18 +110,25 @@ export const doctorCommand = defineCommand({
|
|
|
79
110
|
detail: bun.version,
|
|
80
111
|
},
|
|
81
112
|
{
|
|
82
|
-
label: 'Hook script installed',
|
|
83
|
-
ok:
|
|
84
|
-
detail:
|
|
113
|
+
label: hook.form === 'legacy' ? 'Hook script installed' : 'auden-hook on PATH',
|
|
114
|
+
ok: runnerOk,
|
|
115
|
+
detail: hook.form === 'legacy'
|
|
116
|
+
? runnerOk
|
|
117
|
+
? `${hook.scriptPath} (legacy path — run \`auden init\` to migrate)`
|
|
118
|
+
: `${hook.scriptPath} does not exist on this machine — the hook silently never fires; run \`auden init\` to migrate this project to \`${AUDEN_HOOK_COMMAND}\``
|
|
119
|
+
: runnerOk
|
|
120
|
+
? (hookBinPath ?? AUDEN_HOOK_COMMAND)
|
|
121
|
+
: `${AUDEN_HOOK_COMMAND} not on PATH — reinstall globally (npm install -g auden)`,
|
|
85
122
|
},
|
|
86
123
|
{
|
|
87
124
|
label: 'Claude Code hooks configured',
|
|
88
125
|
ok: hooksConfigured,
|
|
89
126
|
detail: hooksConfigured
|
|
90
|
-
?
|
|
127
|
+
? `.claude/settings.json has PostToolUse hook (${hook.form})`
|
|
91
128
|
: 'not configured — run `auden init` in your project',
|
|
92
129
|
},
|
|
93
130
|
];
|
|
131
|
+
console.log(` auden ${CLI_VERSION}`);
|
|
94
132
|
let allOk = true;
|
|
95
133
|
for (const check of checks) {
|
|
96
134
|
const icon = check.ok ? '✓' : '✗';
|
|
@@ -104,21 +142,58 @@ export const doctorCommand = defineCommand({
|
|
|
104
142
|
// the dashboard so a silently-401ing (expired/revoked) token surfaces as a
|
|
105
143
|
// broken connection instead of a misleading "configured" — that gap is the
|
|
106
144
|
// activation-failure signal this check exists to close.
|
|
107
|
-
const token = await
|
|
145
|
+
const token = await resolveToken().catch(() => '');
|
|
108
146
|
if (!token) {
|
|
109
147
|
console.log(` i ${describeDashboardHealth('unconfigured', '')}`);
|
|
110
148
|
}
|
|
111
149
|
else {
|
|
150
|
+
// Name the source when it is the environment: in an ephemeral container
|
|
151
|
+
// "which token is this?" is the first question a failed sync raises, and
|
|
152
|
+
// an env var leaves no trace in ~/.auden/config.json to inspect.
|
|
153
|
+
if (readEnvToken()) {
|
|
154
|
+
console.log(` i token from $${AUDEN_TOKEN_ENV}`);
|
|
155
|
+
}
|
|
112
156
|
const dashboardUrl = await resolveDashboardUrl(args['dashboard-url']);
|
|
113
157
|
const verification = await verifyDashboardToken(dashboardUrl, token);
|
|
114
158
|
console.log(` i ${describeDashboardHealth(verification, dashboardUrl)}`);
|
|
115
159
|
}
|
|
160
|
+
// Generated-asset state. The hook script is machine-owned and was already
|
|
161
|
+
// refreshed above; repo-local skills are user-editable, so they are only
|
|
162
|
+
// reported (see update/assets.ts for why the two differ).
|
|
163
|
+
if (hookRefresh.status === 'refreshed') {
|
|
164
|
+
console.log(` i refreshed ~/.auden/hooks/log-action.mjs (${hookRefresh.from ?? 'unstamped'} → ${hookRefresh.to})`);
|
|
165
|
+
}
|
|
166
|
+
else if (hookRefresh.status === 'failed') {
|
|
167
|
+
console.log(` i could not refresh ~/.auden/hooks/log-action.mjs — ${hookRefresh.error}`);
|
|
168
|
+
}
|
|
169
|
+
if (skillDrift.length > 0) {
|
|
170
|
+
const paths = skillDrift.map((d) => d.path).join(', ');
|
|
171
|
+
console.log(` i bundled skills differ from this CLI's version: ${paths}\n` +
|
|
172
|
+
' run `auden init --skills-only` to rewrite them (this overwrites local edits)');
|
|
173
|
+
}
|
|
116
174
|
if (!allOk) {
|
|
117
175
|
console.error('\nSome checks failed. See above for details.');
|
|
118
176
|
process.exit(1);
|
|
119
177
|
}
|
|
120
|
-
|
|
121
|
-
|
|
178
|
+
console.log('\nAll checks passed.');
|
|
179
|
+
// Doctor is the "check and fix my setup" surface, so it is the one place
|
|
180
|
+
// that offers to run the update rather than just naming it. Suppressed
|
|
181
|
+
// exactly like the ambient notice (TTY, env, config) via checkForUpdate.
|
|
182
|
+
const update = await checkForUpdate();
|
|
183
|
+
if (!update)
|
|
184
|
+
return;
|
|
185
|
+
process.stderr.write(formatUpdateNotice(update));
|
|
186
|
+
if (!process.stdin.isTTY)
|
|
187
|
+
return;
|
|
188
|
+
const result = await performUpdate(update, { assumeYes: false });
|
|
189
|
+
if (result.status === 'updated') {
|
|
190
|
+
console.log(formatUpdateSuccess(update, result.installedVersion));
|
|
191
|
+
await syncGeneratedAssets(process.cwd());
|
|
192
|
+
}
|
|
193
|
+
else if (result.status === 'failed') {
|
|
194
|
+
// Reported, but never fails `doctor` — the environment checks above all
|
|
195
|
+
// passed, and that is what this command's exit code means.
|
|
196
|
+
console.warn(`\nUpdate failed: ${result.detail}\n Run it yourself: ${result.command}`);
|
|
122
197
|
}
|
|
123
198
|
},
|
|
124
199
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MA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KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAA;YACjE,MAAM,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC1C,CAAC;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACtC,wEAAwE;YACxE,2DAA2D;YAC3D,OAAO,CAAC,IAAI,CACV,oBAAoB,MAAM,CAAC,MAAM,wBAAwB,MAAM,CAAC,OAAO,EAAE,CAC1E,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/active.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/active.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,gCAwB9B,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { parseGuideBundleResponse } from '@auden.to/protocol';
|
|
3
1
|
import { defineCommand } from 'citty';
|
|
4
|
-
import {
|
|
2
|
+
import { readGuidesCache } from '../../guides-cache.js';
|
|
5
3
|
export const guidesActiveCommand = defineCommand({
|
|
6
4
|
meta: {
|
|
7
5
|
name: 'active',
|
|
@@ -9,20 +7,9 @@ export const guidesActiveCommand = defineCommand({
|
|
|
9
7
|
},
|
|
10
8
|
args: {},
|
|
11
9
|
async run() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const raw = await readFile(AUDEN_GUIDES_FILE, 'utf8');
|
|
15
|
-
bundle = parseGuideBundleResponse(JSON.parse(raw));
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
if (err.code === 'ENOENT') {
|
|
19
|
-
console.log(' No guides cache found. Run "auden sync" to pull the latest guides.');
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
console.log(' Guides cache is unreadable — run "auden sync" to refresh.');
|
|
23
|
-
}
|
|
10
|
+
const bundle = await readGuidesCache();
|
|
11
|
+
if (!bundle)
|
|
24
12
|
return;
|
|
25
|
-
}
|
|
26
13
|
const active = bundle.guides.filter((g) => g.enabled);
|
|
27
14
|
if (active.length === 0) {
|
|
28
15
|
console.log(' No active guides. Run "auden sync" to pull the latest guides.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active.js","sourceRoot":"","sources":["../../../src/commands/guides/active.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"active.js","sourceRoot":"","sources":["../../../src/commands/guides/active.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4CAA4C;KAC1D;IACD,IAAI,EAAE,EAAE;IACR,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAA;QACtC,IAAI,CAAC,MAAM;YAAE,OAAM;QAEnB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CACjC,CAAC,CAAuD,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CACvE,CAAA;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAA;YAC9E,OAAM;QACR,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,MAAM,IAAI,CAAC,CAAA;QAChD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;YACnC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,qDAgBxB,CAAA"}
|
|
@@ -5,6 +5,12 @@ export const guidesCommand = defineCommand({
|
|
|
5
5
|
description: 'Generate and manage project guides',
|
|
6
6
|
},
|
|
7
7
|
subCommands: {
|
|
8
|
+
// Same command object as `auden rules import`. "guides" is the noun the
|
|
9
|
+
// dashboard and the rest of the CLI use, so that is where people look for
|
|
10
|
+
// it first; `rules import` stays for anyone who already learned it.
|
|
11
|
+
import: () => import('../rules/import.js').then((m) => m.rulesImportCommand),
|
|
12
|
+
export: () => import('../rules/export.js').then((m) => m.rulesExportCommand),
|
|
13
|
+
watch: () => import('../rules/watch.js').then((m) => m.rulesWatchCommand),
|
|
8
14
|
project: () => import('./project.js').then((m) => m.guidesProjectCommand),
|
|
9
15
|
active: () => import('./active.js').then((m) => m.guidesActiveCommand),
|
|
10
16
|
search: () => import('./search.js').then((m) => m.guidesSearchCommand),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/guides/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oCAAoC;KACl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AAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC;QACzE,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACtE,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;KACvE;CACF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/guides/search.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;EAkC9B,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { parseGuideBundleResponse } from '@auden.to/protocol';
|
|
3
1
|
import { defineCommand } from 'citty';
|
|
4
|
-
import {
|
|
2
|
+
import { readGuidesCache } from '../../guides-cache.js';
|
|
5
3
|
export const guidesSearchCommand = defineCommand({
|
|
6
4
|
meta: {
|
|
7
5
|
name: 'search',
|
|
@@ -15,20 +13,9 @@ export const guidesSearchCommand = defineCommand({
|
|
|
15
13
|
},
|
|
16
14
|
},
|
|
17
15
|
async run({ args }) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const raw = await readFile(AUDEN_GUIDES_FILE, 'utf8');
|
|
21
|
-
bundle = parseGuideBundleResponse(JSON.parse(raw));
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
if (err.code === 'ENOENT') {
|
|
25
|
-
console.log(' No guides cache found. Run "auden sync" to pull the latest guides.');
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
console.log(' Guides cache is unreadable — run "auden sync" to refresh.');
|
|
29
|
-
}
|
|
16
|
+
const bundle = await readGuidesCache();
|
|
17
|
+
if (!bundle)
|
|
30
18
|
return;
|
|
31
|
-
}
|
|
32
19
|
const q = args.query.toLowerCase();
|
|
33
20
|
const matches = bundle.guides.filter((g) => g.enabled &&
|
|
34
21
|
(g.title.toLowerCase().includes(q) || g.content.toLowerCase().includes(q)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/guides/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/guides/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,iCAAiC;KAC/C;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAA;QACtC,IAAI,CAAC,MAAM;YAAE,OAAM;QAEnB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAClC,CAAC,CAAuD,EAAE,EAAE,CAC1D,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC7E,CAAA;QAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAA;YACjD,OAAM;QACR,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,KAAK,MAAM,OAAO,CAAC,MAAM,IAAI,CAAC,CAAA;QACnE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;YACnC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -4,30 +4,33 @@ export declare const initCommand: import("citty").CommandDef<{
|
|
|
4
4
|
description: string;
|
|
5
5
|
default: false;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
skill: {
|
|
8
8
|
type: "boolean";
|
|
9
9
|
description: string;
|
|
10
|
-
default:
|
|
10
|
+
default: true;
|
|
11
11
|
};
|
|
12
|
-
'
|
|
12
|
+
'skills-only': {
|
|
13
13
|
type: "boolean";
|
|
14
14
|
description: string;
|
|
15
15
|
default: false;
|
|
16
16
|
};
|
|
17
|
-
'
|
|
17
|
+
'eval-hook': {
|
|
18
18
|
type: "boolean";
|
|
19
19
|
description: string;
|
|
20
|
-
default:
|
|
20
|
+
default: true;
|
|
21
|
+
};
|
|
22
|
+
prompt: {
|
|
23
|
+
type: "boolean";
|
|
24
|
+
description: string;
|
|
25
|
+
default: true;
|
|
21
26
|
};
|
|
22
27
|
'pull-guides': {
|
|
23
28
|
type: "boolean";
|
|
24
29
|
description: string;
|
|
25
|
-
default: false;
|
|
26
30
|
};
|
|
27
|
-
'
|
|
31
|
+
'import-guides': {
|
|
28
32
|
type: "boolean";
|
|
29
33
|
description: string;
|
|
30
|
-
default: false;
|
|
31
34
|
};
|
|
32
35
|
'dashboard-url': {
|
|
33
36
|
type: "string";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA2EA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmiBtB,CAAA"}
|