@cavelang/cli 0.5.0 → 0.13.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.
package/README.md CHANGED
@@ -28,11 +28,12 @@ Every command answers `--help` with its options and examples (also
28
28
  | Command | Flags | Behavior |
29
29
  |---|---|---|
30
30
  | `parse [file…]` | `--json` | Lint (stdin by default). Exit 1 when diagnostics exist; `--json` dumps the AST document. |
31
- | `add [--db p] [file…]` | `--strict`, `--no-prelude` | Ingest. Lenient by default (problems on stderr, valid lines land); `--strict` rolls back on any problem; `--no-prelude` starts from an empty registry instead of the standard §5.5 pairs. |
32
- | `import [--db p] [file…]` | `--strict`, `--no-prelude` | Restore/merge a database from CAVE text — same operation as `add`, because canonical text *is* the interchange format. |
31
+ | `add [--db p] [file…]` | `--strict`, `--check`, `--no-prelude`, `--no-src` | Ingest. Lenient by default (problems on stderr, valid lines land); `--strict` rolls back on any problem; `--check` is the shape gate (spec §20.3) — the append rolls back if it introduces new expectation violations; `--no-prelude` starts from an empty registry instead of the standard §5.5 pairs. Claims without a `@src:` context are stamped `@src:cli` (spec §9.5); `--no-src` opts out. |
32
+ | `import [--db p] [file…]` | `--strict`, `--no-prelude` | Restore/merge a database from CAVE text — `add` minus provenance stamping, because canonical text *is* the interchange format and replayed claims must keep their exported claim keys (spec §9.5). |
33
33
  | `query [--db p] <pattern…>` | `--json`, `--all`, `--no-prelude` | CAVE-Q. Extra positionals join as lines, so `WHERE` filters ride as separate arguments. Bindings print as `?x = value`; fully bound patterns print the matched raw line (or the pattern itself for transitive matches, which carry no row). `--no-prelude` aligns the read-time registry with a store written via `add --no-prelude`. |
34
+ | `check [--db p]` | `--stale <days>`, `--json`, `--no-prelude` | Knowledge health report (spec §20, see [`@cavelang/shape`](../shape)): shape violations against in-band `EXPECTS` declarations, stale current beliefs (default horizon 90 days), review candidates (conf 0.3–0.7), alias disagreements, coverage stats. Exit 1 on violations; everything else is advisory. |
34
35
  | `export [--db p]` | `--out <file>`, `--current`, `--no-prelude` | Canonical CAVE text — all rows in tx order, or current beliefs only. Stdout by default; `--out` writes a file and reports the claim count. |
35
- | `mcp [--db p]` | `--no-prelude` | Serve the engine as an MCP server on stdio (see [`@cavelang/mcp`](../mcp)) — tools for add/query/search/about/neighbors/reconstruct/export/lint, with the §22 spec card as server instructions. |
36
+ | `mcp [--db p]` | `--read-only`, `--tools <list>`, `--no-prelude`, `--src <ctx>`, `--no-src` | Serve the engine as an MCP server on stdio (see [`@cavelang/mcp`](../mcp)) — tools for add/query/search/about/neighbors/reconstruct/export/lint, with the §22 spec card as server instructions. `--read-only` / `--tools <list>` narrow the served tool surface (the agent permission boundary), composing by intersection. Appends are stamped `@src:agent/<client-name>` (spec §9.5); `--src` replaces the stamp, `--no-src` disables it. |
36
37
  | `ingest [--db p] <globs/urls…>` | see `cave ingest --help` | LLM-driven ingestion of files and web pages (fetched and readability-extracted) through any headless agent (see [`@cavelang/ingest`](../ingest)): batching, instructions markdown, hybrid knowledge context, MCP or stdout agents, incremental digests, `--plan` NDJSON for SDK drivers. |
37
38
  | `demo` | | The cave-loop multi-hop recovery demo (§18). |
38
39
  | `version` | | Print the cave version. |
package/dist/src/cli.d.ts CHANGED
@@ -7,9 +7,13 @@
7
7
  *
8
8
  * - `cave parse [file]` — lint / dump the AST (`--json`)
9
9
  * - `cave highlight [file]` — ANSI syntax colors (async, routed in `main.ts`)
10
- * - `cave add [--db <path>] [file…]` — ingest into a store (`--strict`)
11
- * - `cave query [--db <path>] '<pattern>'` — CAVE-Q (`--json`, `--all`)
10
+ * - `cave add [--db <path>] [file…]` — ingest into a store (`--strict`, `--check`)
11
+ * - `cave query [--db <path>] '<pattern>'` — CAVE-Q (`--json`, `--all`, `--aliases`, `--as-of`)
12
+ * - `cave derive [--db <path>] [rules.cave…]` — fire rules (`--dry-run`, `--full`, `--list`, `--retract`)
13
+ * - `cave act [--db <path>] <name> [param=value…]` — execute an action (spec §25; `--declare`, `--list`, `--retract`)
14
+ * - `cave check [--db <path>]` — knowledge health report (`--stale`, `--json`)
12
15
  * - `cave export [--db <path>]` — canonical text out (`--current`)
16
+ * - `cave connect [--db <path>] <source>` — deterministic structured ingestion (async, routed in `main.ts`)
13
17
  * - `cave demo` — the cave-loop multi-hop recovery demo
14
18
  * - `cave version` — print the cave version
15
19
  * - `cave help [command]` — overview, or one command's help
@@ -22,7 +26,7 @@ export type Output = {
22
26
  readonly out: string;
23
27
  readonly err: string;
24
28
  };
25
- export declare const usage = "cave \u2014 Compressed Atomic Verb Expressions\n\nUsage:\n cave parse [file...] [--json] lint CAVE text (stdin when no file)\n cave highlight [file...] print CAVE text with ANSI syntax colors\n cave add [--db <path>] [file...] ingest into a store [--strict] [--no-prelude]\n cave import [--db <path>] [file...] restore/merge from CAVE text (same as add)\n cave query [--db <path>] <pattern> run a CAVE-Q pattern [--json] [--all] [--no-prelude]\n cave export [--db <path>] [--out <file>] emit canonical CAVE text [--current] [--no-prelude]\n cave mcp [--db <path>] serve the engine as an MCP server on stdio [--no-prelude]\n cave ingest [--db <path>] <globs/urls..> LLM-driven ingestion of files and web pages\n cave demo run the cave-loop reconstruction demo\n cave version print the cave version\n cave help [command] this text, or one command's options and examples\n\nEvery command answers --help. --db defaults to $CAVE_DB, or cave.db in\nthe current directory. The spec lives in the .claude/skills/ directory at\nthe repository root (section index in README.md).";
29
+ export declare const usage = "cave \u2014 Compressed Atomic Verb Expressions\n\nUsage:\n cave parse [file...] [--json] lint CAVE text (stdin when no file)\n cave highlight [file...] print CAVE text with ANSI syntax colors\n cave add [--db <path>] [file...] ingest into a store [--strict] [--check] [--no-prelude] [--no-src]\n cave import [--db <path>] [file...] restore/merge from CAVE text (add without @src: stamping)\n cave query [--db <path>] <pattern> run a CAVE-Q pattern [--json] [--all] [--aliases] [--as-of <t>] [--no-prelude]\n cave derive [--db <path>] [rules.cave..] declare + fire rules (spec \u00A724) [--dry-run] [--full] [--list] [--retract <rule>]\n cave act [--db <path>] <name> [p=v...] execute an action (spec \u00A725) [--dry-run] [--no-check] [--hooks <file>]\n cave act --declare [file...] declare actions from a CAVE document; --list / --retract <name> manage them\n cave check [--db <path>] knowledge health report (spec \u00A720) [--stale <days>] [--json]\n cave export [--db <path>] [--out <file>] emit canonical CAVE text [--current] [--no-prelude]\n cave mcp [--db <path>] serve the engine as an MCP server on stdio [--no-prelude]\n cave ingest [--db <path>] <globs/urls..> LLM-driven ingestion of files and web pages\n cave connect <source> --map <file> deterministic structured ingestion (CSV/JSON/SQLite/URL, spec \u00A723)\n cave demo run the cave-loop reconstruction demo\n cave version print the cave version\n cave help [command] this text, or one command's options and examples\n\nEvery command answers --help. --db defaults to $CAVE_DB, or cave.db in\nthe current directory. The spec lives in the .claude/skills/ directory at\nthe repository root (section index in README.md).";
26
30
  /** Per-command help, printed for \`cave <command> --help\` and \`cave help <command>\`. */
27
31
  export declare const commandHelp: Record<string, string>;
28
32
  export declare const parseCommand: (argv: readonly string[]) => Output;
@@ -35,16 +39,21 @@ export declare const highlightCommand: (argv: readonly string[]) => Promise<Outp
35
39
  export declare const addCommand: (argv: readonly string[]) => Output;
36
40
  /**
37
41
  * `cave import` — restore/merge a knowledge database from CAVE text files.
38
- * Identical to `add` by design: canonical CAVE text *is* the interchange
42
+ * `add` minus provenance stamping: canonical CAVE text *is* the interchange
39
43
  * format (spec §2.2), so importing a file exported with `cave export`
40
- * replays its claims append-only. What the text round trip preserves:
41
- * every claim with metadata, full belief-series order (rows export in tx
42
- * order and re-ingest with fresh monotonic tx ids), qualifier/grouping
43
- * edges, and in-band registry declarations. Original tx timestamps are
44
- * re-minted — the text format carries no transaction identity.
44
+ * replays its claims append-only — and because contexts are part of claim
45
+ * identity, replay must not add a `@src:` stamp (spec §9.5). What the text
46
+ * round trip preserves: every claim with metadata, full belief-series order
47
+ * (rows export in tx order and re-ingest with fresh monotonic tx ids),
48
+ * qualifier/grouping edges, and in-band registry declarations. Original tx
49
+ * timestamps are re-minted — the text format carries no transaction
50
+ * identity.
45
51
  */
46
52
  export declare const importCommand: (argv: readonly string[]) => Output;
47
53
  export declare const queryCommand: (argv: readonly string[]) => Output;
54
+ export declare const deriveCommand: (argv: readonly string[]) => Output;
55
+ export declare const actCommand: (argv: readonly string[]) => Output;
56
+ export declare const checkCommand: (argv: readonly string[]) => Output;
48
57
  export declare const exportCommand: (argv: readonly string[]) => Output;
49
58
  export declare const demoCommand: () => Output;
50
59
  export declare const versionCommand: () => Output;
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB,CAAA;AAQD,eAAO,MAAM,KAAK,2sCAiBgC,CAAA;AAIlD,2FAA2F;AAC3F,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsH9C,CAAA;AAOD,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,MAAM,EAAE,KAAG,MAyBtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAU,MAAM,SAAS,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CAM9E,CAAA;AA+BD,eAAO,MAAM,UAAU,SA7BwB,SAAS,MAAM,EAAE,KAAG,MA6BrB,CAAA;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,SAzCqB,SAAS,MAAM,EAAE,KAAG,MAyCf,CAAA;AAEpD,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,MAAM,EAAE,KAAG,MAsCtD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,MAAM,EAAE,KAAG,MAuBvD,CAAA;AAED,eAAO,MAAM,WAAW,QAAO,MACS,CAAA;AAExC,eAAO,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