@zibby/skills 0.1.44 → 0.1.45
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/codebaseMemory.d.ts +31 -0
- package/dist/codebaseMemory.js +14 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +94 -81
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export namespace codebaseMemorySkill {
|
|
2
|
+
let id: string;
|
|
3
|
+
let serverName: string;
|
|
4
|
+
let allowedTools: string[];
|
|
5
|
+
let description: string;
|
|
6
|
+
let promptFragment: string;
|
|
7
|
+
/**
|
|
8
|
+
* stdio MCP server = the BARE binary with NO subcommand (verified for
|
|
9
|
+
* v0.8.1). Never returns { command: null } — the binary is baked into the
|
|
10
|
+
* image; if it's somehow absent the server simply fails to spawn and its
|
|
11
|
+
* tools are unavailable, which does not crash the run.
|
|
12
|
+
*/
|
|
13
|
+
function resolve(): {
|
|
14
|
+
type: string;
|
|
15
|
+
command: any;
|
|
16
|
+
args: any[];
|
|
17
|
+
env: {
|
|
18
|
+
CBM_CACHE_DIR: any;
|
|
19
|
+
};
|
|
20
|
+
description: string;
|
|
21
|
+
alwaysLoad: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Pre-run hook (graph.js calls this for every skill declared on the node,
|
|
25
|
+
* before the agent runs). Index the checked-out repo ONCE per run with the
|
|
26
|
+
* imperative `cli index_repository` path. Idempotent via a per-repo marker
|
|
27
|
+
* under CBM_CACHE_DIR; fully wrapped so it NEVER throws into the run.
|
|
28
|
+
* Returns {} — it contributes no agent-visible options.
|
|
29
|
+
*/
|
|
30
|
+
function invokeAgentOptions(): {};
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{spawnSync as d}from"node:child_process";import{existsSync as s,mkdirSync as c,readdirSync as h,writeFileSync as u}from"node:fs";import{createHash as m}from"node:crypto";import{join as n}from"node:path";function i(){return process.env.CBM_BIN||"/usr/local/bin/codebase-memory-mcp"}function a(){if(process.env.CBM_CACHE_DIR)return process.env.CBM_CACHE_DIR;let e=process.env.WORKSPACE||process.env.ZIBBY_WORKSPACE;return e?n(e,".zibby","cbm-cache"):"/tmp/zibby-cbm-cache"}function y(){let e=process.env.WORKSPACE||process.env.ZIBBY_WORKSPACE||"/workspace",r=n(e,".zibby","repos");try{if(s(r)){let t=h(r,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>n(r,o.name));if(t.length===1)return t[0];if(t.length>1)return r}}catch{}return s(e)?e:null}function l(e){return m("sha256").update(e).digest("hex").slice(0,16)}var v={id:"codebase-memory",serverName:"codebase_memory",allowedTools:["mcp__codebase_memory__*"],description:"Codebase memory \u2014 code-graph + semantic index over the checked-out repo (architecture, graph search, dependency trace, change detection)",promptFragment:`## Codebase Memory (code-graph + semantic index over THIS repo)
|
|
2
|
+
The checked-out repository is indexed into a queryable code graph + semantic
|
|
3
|
+
index. Reach for these instead of blindly grepping when you need structure,
|
|
4
|
+
relationships, or "where does X live / what depends on Y":
|
|
5
|
+
- get_architecture: high-level architecture / module map \u2014 START HERE to orient.
|
|
6
|
+
- search_graph: semantic-ish search over the code graph (symbols, files, concepts).
|
|
7
|
+
- query_graph: structured query against the graph schema (use get_graph_schema first).
|
|
8
|
+
- trace_path: trace a dependency / call path between two nodes (impact analysis).
|
|
9
|
+
- detect_changes: what changed vs the indexed baseline \u2014 scope your work.
|
|
10
|
+
- get_code_snippet / search_code: pull the exact code for a node / text match.
|
|
11
|
+
- index_status / list_projects: confirm the index is present before querying.
|
|
12
|
+
The repo is indexed for you at the start of the run; if a query comes back
|
|
13
|
+
empty, call index_status, and only re-index (index_repository) if needed.`,resolve(){let e=a();try{c(e,{recursive:!0})}catch{}let r={CBM_CACHE_DIR:e};return process.env.WORKSPACE&&(r.WORKSPACE=process.env.WORKSPACE),{type:"stdio",command:i(),args:[],env:r,description:this.description,alwaysLoad:!0}},invokeAgentOptions(){try{let e=y();if(!e)return{};let r=a();try{c(r,{recursive:!0})}catch{}let t=n(r,`.cbm-indexed-${l(e)}`);if(s(t))return{};let o=i();if(!s(o)&&!process.env.CBM_BIN)return{};let p=d(o,["cli","index_repository",JSON.stringify({repo_path:e})],{env:{...process.env,CBM_CACHE_DIR:r},encoding:"utf-8",timeout:300*1e3,maxBuffer:32*1024*1024});try{u(t,`${new Date().toISOString()} status=${p.status}
|
|
14
|
+
`)}catch{}}catch{}return{}}};export{v as codebaseMemorySkill};
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export namespace SKILLS {
|
|
|
19
19
|
let CORE_TOOLS: string;
|
|
20
20
|
let CHAT_MEMORY: string;
|
|
21
21
|
let KV_MEMORY: string;
|
|
22
|
+
let CODEBASE_MEMORY: string;
|
|
22
23
|
let WORKFLOW_BUILDER: string;
|
|
23
24
|
let OPENAI_BILLING: string;
|
|
24
25
|
let ANTHROPIC_BILLING: string;
|
|
@@ -41,11 +42,12 @@ import { sentrySkill } from './sentry.js';
|
|
|
41
42
|
import { memorySkill } from './memory.js';
|
|
42
43
|
import { chatMemorySkill } from './chat-memory.js';
|
|
43
44
|
import { kvMemorySkill } from './kvMemory.js';
|
|
45
|
+
import { codebaseMemorySkill } from './codebaseMemory.js';
|
|
44
46
|
import { testRunnerSkill } from './test-runner.js';
|
|
45
47
|
import { skillInstallerSkill } from './skill-installer.js';
|
|
46
48
|
import { coreToolsSkill } from './core-tools.js';
|
|
47
49
|
import { workflowBuilderSkill } from './workflow-builder.js';
|
|
48
|
-
export { browserSkill, jiraSkill, githubSkill, gitlabSkill, figmaSkill, linearSkill, planeSkill, opendesignSkill, gitSkill, slackSkill, larkSkill, notionSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, kvMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
|
|
50
|
+
export { browserSkill, jiraSkill, githubSkill, gitlabSkill, figmaSkill, linearSkill, planeSkill, opendesignSkill, gitSkill, slackSkill, larkSkill, notionSkill, chatNotifySkill, sentrySkill, memorySkill, chatMemorySkill, kvMemorySkill, codebaseMemorySkill, testRunnerSkill, testRunnerSkill as runnerSkill, skillInstallerSkill, coreToolsSkill, workflowBuilderSkill };
|
|
49
51
|
export { openaiBillingSkill, anthropicBillingSkill, cursorAdminSkill, fetchOpenAICosts, fetchOpenAIProjects, fetchAnthropicCosts, fetchAnthropicWorkspaces, fetchCursorSpend, fetchAllProviders, groupByKey, meanStddev } from "./llm-billing.js";
|
|
50
52
|
export { reportObjectSchema, reportToBlockKit, reportToLarkCard, SEVERITIES as REPORT_SEVERITIES } from "./report.js";
|
|
51
53
|
export { skill, functionSkill } from "./function-skill.js";
|