caveat-cli 0.6.1 → 0.6.2
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/dist/caveat.js +0 -0
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/caveat.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -21237,6 +21237,12 @@ async function pushEntry(opts) {
|
|
|
21237
21237
|
detail: `entry id=${opts.id} not found under ${opts.entriesDir}`
|
|
21238
21238
|
};
|
|
21239
21239
|
}
|
|
21240
|
+
if (owned.visibility === "private") {
|
|
21241
|
+
return {
|
|
21242
|
+
status: "visibility-private",
|
|
21243
|
+
detail: `entry id=${opts.id} has visibility: private and cannot be pushed to the public community DB. Update the entry to visibility: public first (the user declared this entry local-only).`
|
|
21244
|
+
};
|
|
21245
|
+
}
|
|
21240
21246
|
const ghUser = resolveGhUser();
|
|
21241
21247
|
if (!ghUser) {
|
|
21242
21248
|
return { status: "failed", detail: "gh api user failed" };
|
|
@@ -21362,7 +21368,13 @@ function findOwnedEntry(entriesDir, id) {
|
|
|
21362
21368
|
const parsed = parseMarkdown(raw2);
|
|
21363
21369
|
if (parsed.frontmatter.id === id) {
|
|
21364
21370
|
const relPath = relative2(entriesDir, absPath).replace(/\\/g, "/");
|
|
21365
|
-
return {
|
|
21371
|
+
return {
|
|
21372
|
+
id,
|
|
21373
|
+
title: parsed.frontmatter.title,
|
|
21374
|
+
absPath,
|
|
21375
|
+
relPath,
|
|
21376
|
+
visibility: parsed.frontmatter.visibility
|
|
21377
|
+
};
|
|
21366
21378
|
}
|
|
21367
21379
|
} catch {
|
|
21368
21380
|
}
|
|
@@ -44680,7 +44692,9 @@ var recordInputShape = {
|
|
|
44680
44692
|
context: external_exports.string().optional(),
|
|
44681
44693
|
confidence: confidenceSchema2.optional(),
|
|
44682
44694
|
outcome: outcomeSchema.optional(),
|
|
44683
|
-
visibility: visibilitySchema.
|
|
44695
|
+
visibility: visibilitySchema.describe(
|
|
44696
|
+
'REQUIRED. Ask the user "public (share to community) or private (keep local only)?" before calling \u2014 never auto-classify. The user owns the knowledge; they decide its reach.'
|
|
44697
|
+
),
|
|
44684
44698
|
tags: external_exports.array(external_exports.string()).optional(),
|
|
44685
44699
|
environment: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
44686
44700
|
category: external_exports.string().optional().describe("Directory under entries/ (e.g., gpu, claude-code). Default: misc")
|
|
@@ -44788,7 +44802,7 @@ function registerAllTools(server, ctx) {
|
|
|
44788
44802
|
"caveat_search",
|
|
44789
44803
|
{
|
|
44790
44804
|
title: "caveat_search",
|
|
44791
|
-
description: "
|
|
44805
|
+
description: 'Search the "caveats" knowledge base \u2014 records of time-wasting traps in EXTERNAL specs (GPU/driver/CUDA versions, native-module builds, IDE/shell quirks, platform-specific behavior, library version incompatibilities) that someone already diagnosed. Call this FIRST when a problem smells environmental rather than a logic bug \u2014 before reading stack traces top-to-bottom or trying fixes. Query: 3+ chars, plain tokens only (no OR/NEAR/other FTS5 operators). Returns summary rows including `{id, source}` \u2014 pass BOTH to caveat_get for the full body.',
|
|
44792
44806
|
inputSchema: searchInputShape
|
|
44793
44807
|
},
|
|
44794
44808
|
async (args) => jsonResult(handleSearch(ctx, args))
|
|
@@ -44797,7 +44811,7 @@ function registerAllTools(server, ctx) {
|
|
|
44797
44811
|
"caveat_get",
|
|
44798
44812
|
{
|
|
44799
44813
|
title: "caveat_get",
|
|
44800
|
-
description:
|
|
44814
|
+
description: 'Fetch the full body (frontmatter + H2 sections + text) of a caveat by id. IMPORTANT: when the id came from caveat_search, you MUST pass the `source` field from that same result (e.g., "community/Caveat"). The default source is "own" only; omitting source for a community entry returns not-found.',
|
|
44801
44815
|
inputSchema: getInputShape
|
|
44802
44816
|
},
|
|
44803
44817
|
async (args) => jsonResult(handleGet(ctx, args))
|
|
@@ -44806,7 +44820,7 @@ function registerAllTools(server, ctx) {
|
|
|
44806
44820
|
"caveat_record",
|
|
44807
44821
|
{
|
|
44808
44822
|
title: "caveat_record",
|
|
44809
|
-
description: "Create a new caveat
|
|
44823
|
+
description: "Create a new caveat: a record of an external-spec trap that wasted real time (wrong driver, version mismatch, platform bug, IDE quirk, native-module issue, etc.) so future sessions can find it via caveat_search. REQUIRED BEFORE CALLING: (1) run caveat_search first to avoid duplicates, (2) ASK THE USER whether this should be `public` (shareable to the community DB) or `private` (kept local only) \u2014 never auto-classify visibility; the user owns the knowledge and decides its reach. Qualifies: specific symptom + diagnosed cause (or `outcome: impossible` verdict) + environment fingerprint. Does NOT qualify: project-internal bugs, user preferences, session summaries, ephemeral task notes. Auto-fills source_session and environment defaults; source_project is left null by design (shared knowledge must not leak per-user project names).",
|
|
44810
44824
|
inputSchema: recordInputShape
|
|
44811
44825
|
},
|
|
44812
44826
|
async (args) => jsonResult(handleRecord(ctx, args))
|
|
@@ -44815,7 +44829,7 @@ function registerAllTools(server, ctx) {
|
|
|
44815
44829
|
"caveat_update",
|
|
44816
44830
|
{
|
|
44817
44831
|
title: "caveat_update",
|
|
44818
|
-
description: "Patch an existing caveat. Frontmatter shallow-merges (
|
|
44832
|
+
description: "Patch an existing caveat \u2014 use when newer evidence extends or corrects one that already exists. Frontmatter shallow-merges, but array fields (tags etc.) REPLACE rather than append \u2014 to add one tag, read the current list first, then patch with the full new array. Sections match by case-insensitive H2 heading. Immutable keys: id, created_at, source_session, source_project. Common uses: bump `last_verified` after re-confirming, add a resolution when it was `tentative`, flip `outcome` to `impossible`.",
|
|
44819
44833
|
inputSchema: updateInputShape
|
|
44820
44834
|
},
|
|
44821
44835
|
async (args) => jsonResult(handleUpdate(ctx, args))
|
|
@@ -44824,7 +44838,7 @@ function registerAllTools(server, ctx) {
|
|
|
44824
44838
|
"caveat_list_recent",
|
|
44825
44839
|
{
|
|
44826
44840
|
title: "caveat_list_recent",
|
|
44827
|
-
description: "List caveats by updated_at DESC.",
|
|
44841
|
+
description: "List caveats ordered by updated_at DESC. Use for browsing recent additions \u2014 e.g., showing the user what is new after caveat_pull. Not for search; use caveat_search when you have a query.",
|
|
44828
44842
|
inputSchema: listRecentInputShape
|
|
44829
44843
|
},
|
|
44830
44844
|
async (args) => jsonResult(handleListRecent(ctx, args))
|
|
@@ -44833,7 +44847,7 @@ function registerAllTools(server, ctx) {
|
|
|
44833
44847
|
"caveat_pull",
|
|
44834
44848
|
{
|
|
44835
44849
|
title: "caveat_pull",
|
|
44836
|
-
description: "git-pull
|
|
44850
|
+
description: "git-pull the subscribed community caveat repos (the shared knowledge DB + any user-added remotes) and re-index. Call when: (a) the user explicitly asks about others' knowledge on a topic, or (b) caveat_search returned empty for a query that feels like it should have hits and the DB might be stale. Do NOT call reflexively at session start \u2014 it is cheap but not free, and stale-by-minutes is acceptable. Safe and idempotent.",
|
|
44837
44851
|
inputSchema: pullInputShape
|
|
44838
44852
|
},
|
|
44839
44853
|
async (args) => jsonResult(await handlePull(ctx, args))
|
|
@@ -44842,7 +44856,7 @@ function registerAllTools(server, ctx) {
|
|
|
44842
44856
|
"caveat_push",
|
|
44843
44857
|
{
|
|
44844
44858
|
title: "caveat_push",
|
|
44845
|
-
description: "Contribute a user-owned caveat to the shared
|
|
44859
|
+
description: "Contribute a user-owned caveat to the public shared DB via fork + PR on GitHub. This is a PUBLIC, externally-visible action (the PR appears on GitHub and is hard to fully retract). Confirm with the user before calling without dry_run \u2014 or call with dry_run=true first to show the plan. Only push entries that document a trap genuinely reusable by others (not project-specific ties, not duplicated by existing community entries). Entries with `visibility: private` are rejected (`status=visibility-private`) \u2014 the user has declared them local-only. Requires `gh` CLI authenticated; returns `status=gh-missing` / `gh-unauthed` on failure.",
|
|
44846
44860
|
inputSchema: pushInputShape
|
|
44847
44861
|
},
|
|
44848
44862
|
async (args) => jsonResult(await handlePush(ctx, args))
|