remimem 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +213 -2
- package/dist/chunker/index.js +129 -0
- package/dist/cli/commands.js +256 -0
- package/dist/cli/index.js +18 -0
- package/dist/cli/program.js +206 -0
- package/dist/config/index.js +108 -0
- package/dist/embedder/index.js +196 -0
- package/dist/errors.js +15 -0
- package/dist/graph/describe.js +90 -0
- package/dist/graph/index.js +224 -0
- package/dist/indexer/index.js +183 -0
- package/dist/indexer/overview.js +75 -0
- package/dist/indexer/watch.js +55 -0
- package/dist/log.js +16 -0
- package/dist/mcp/server.js +68 -0
- package/dist/mcp/tools.js +272 -0
- package/dist/memory/index.js +259 -0
- package/dist/packer/index.js +149 -0
- package/dist/parser/index.js +294 -0
- package/dist/retriever/index.js +186 -0
- package/dist/scanner/index.js +129 -0
- package/dist/stats/index.js +32 -0
- package/dist/store/fts.js +26 -0
- package/dist/store/index.js +633 -0
- package/dist/tokens.js +8 -0
- package/grammars/README.md +15 -0
- package/grammars/ecma.scm +42 -0
- package/grammars/go.scm +37 -0
- package/grammars/go.wasm +0 -0
- package/grammars/javascript.scm +6 -0
- package/grammars/javascript.wasm +0 -0
- package/grammars/python.scm +21 -0
- package/grammars/python.wasm +0 -0
- package/grammars/tsx.wasm +0 -0
- package/grammars/typescript.scm +20 -0
- package/grammars/typescript.wasm +0 -0
- package/package.json +69 -4
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
; Shared by JavaScript, TypeScript, and TSX. Earlier patterns win when two match the same name.
|
|
2
|
+
|
|
3
|
+
; functions
|
|
4
|
+
(function_declaration name: (_) @name body: (_) @body) @def.function
|
|
5
|
+
(generator_function_declaration name: (_) @name body: (_) @body) @def.function
|
|
6
|
+
(lexical_declaration
|
|
7
|
+
(variable_declarator name: (identifier) @name
|
|
8
|
+
value: [(arrow_function body: (_) @body) (function_expression body: (_) @body)])) @def.function
|
|
9
|
+
(variable_declaration
|
|
10
|
+
(variable_declarator name: (identifier) @name
|
|
11
|
+
value: [(arrow_function body: (_) @body) (function_expression body: (_) @body)])) @def.function
|
|
12
|
+
(expression_statement
|
|
13
|
+
(assignment_expression left: (member_expression property: (property_identifier) @name)
|
|
14
|
+
right: [(arrow_function body: (_) @body) (function_expression body: (_) @body)])) @def.function
|
|
15
|
+
|
|
16
|
+
; classes and methods
|
|
17
|
+
(class_declaration name: (_) @name body: (_) @body) @def.class
|
|
18
|
+
(method_definition name: (_) @name body: (_) @body) @def.method
|
|
19
|
+
|
|
20
|
+
; top-level constants
|
|
21
|
+
(program (lexical_declaration (variable_declarator name: (identifier) @name)) @def.constant)
|
|
22
|
+
(program (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name)) @def.constant))
|
|
23
|
+
|
|
24
|
+
; calls
|
|
25
|
+
(call_expression function: (identifier) @callee) @call
|
|
26
|
+
(call_expression function: (member_expression object: (_) @recv property: (property_identifier) @callee)) @call
|
|
27
|
+
(new_expression constructor: (identifier) @callee) @call
|
|
28
|
+
|
|
29
|
+
; imports: @source names the module; @idefault, @iname (+ @ialias), and @inamespace are bindings
|
|
30
|
+
(import_statement source: (string (string_fragment) @source)) @import
|
|
31
|
+
(import_statement (import_clause (identifier) @idefault)) @import
|
|
32
|
+
(import_statement (import_clause (named_imports (import_specifier name: (_) @iname alias: (_)? @ialias)))) @import
|
|
33
|
+
(import_statement (import_clause (namespace_import (identifier) @inamespace))) @import
|
|
34
|
+
; CommonJS: const x = require('./y') and const { a, b } = require('./y')
|
|
35
|
+
((variable_declarator name: (identifier) @inamespace
|
|
36
|
+
value: (call_expression function: (identifier) @_require
|
|
37
|
+
arguments: (arguments (string (string_fragment) @source)))) @import
|
|
38
|
+
(#eq? @_require "require"))
|
|
39
|
+
((variable_declarator name: (object_pattern (shorthand_property_identifier_pattern) @iname)
|
|
40
|
+
value: (call_expression function: (identifier) @_require
|
|
41
|
+
arguments: (arguments (string (string_fragment) @source)))) @import
|
|
42
|
+
(#eq? @_require "require"))
|
package/grammars/go.scm
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
; Earlier patterns win when two match the same name.
|
|
2
|
+
|
|
3
|
+
(function_declaration name: (identifier) @name body: (block) @body) @def.function
|
|
4
|
+
(method_declaration
|
|
5
|
+
receiver: (parameter_list (parameter_declaration type: [
|
|
6
|
+
(type_identifier) @receiver
|
|
7
|
+
(pointer_type (type_identifier) @receiver)
|
|
8
|
+
(generic_type type: (type_identifier) @receiver)
|
|
9
|
+
(pointer_type (generic_type type: (type_identifier) @receiver))]))
|
|
10
|
+
name: (field_identifier) @name body: (block) @body) @def.method
|
|
11
|
+
|
|
12
|
+
; a type declared on its own: the symbol covers the whole declaration
|
|
13
|
+
(type_declaration . (type_spec name: (type_identifier) @name type: (struct_type (field_declaration_list) @body)) .) @def.class
|
|
14
|
+
(type_declaration . (type_spec name: (type_identifier) @name type: (interface_type) @body) .) @def.interface
|
|
15
|
+
(type_declaration . (type_spec name: (type_identifier) @name) .) @def.type
|
|
16
|
+
(type_declaration . (type_alias name: (type_identifier) @name) .) @def.type
|
|
17
|
+
|
|
18
|
+
; types inside a grouped `type ( ... )` block: one symbol per spec
|
|
19
|
+
(type_spec name: (type_identifier) @name type: (struct_type (field_declaration_list) @body)) @def.class
|
|
20
|
+
(type_spec name: (type_identifier) @name type: (interface_type) @body) @def.interface
|
|
21
|
+
(type_spec name: (type_identifier) @name) @def.type
|
|
22
|
+
(type_alias name: (type_identifier) @name) @def.type
|
|
23
|
+
|
|
24
|
+
; top-level constants and variables
|
|
25
|
+
(source_file (const_declaration (const_spec name: (identifier) @name) @def.constant))
|
|
26
|
+
(source_file (var_declaration (var_spec name: (identifier) @name) @def.constant))
|
|
27
|
+
|
|
28
|
+
; calls
|
|
29
|
+
(call_expression function: (identifier) @callee) @call
|
|
30
|
+
(call_expression function: (selector_expression operand: (_) @recv field: (field_identifier) @callee)) @call
|
|
31
|
+
|
|
32
|
+
; referenced types
|
|
33
|
+
(type_identifier) @ref.type
|
|
34
|
+
|
|
35
|
+
; imports: the local name is the alias, or the last segment of the path
|
|
36
|
+
(import_spec name: (package_identifier)? @ialias
|
|
37
|
+
path: (interpreted_string_literal (interpreted_string_literal_content) @imodule)) @import
|
package/grammars/go.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
; JavaScript only: arrow functions and function expressions assigned to class fields.
|
|
2
|
+
(field_definition property: (_) @name
|
|
3
|
+
value: [(arrow_function body: (_) @body) (function_expression body: (_) @body)]) @def.method
|
|
4
|
+
|
|
5
|
+
; inheritance
|
|
6
|
+
(class_heritage (identifier) @ref.extends)
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
; A function directly inside a class becomes a method in the parser.
|
|
2
|
+
(function_definition name: (identifier) @name body: (block) @body) @def.function
|
|
3
|
+
(class_definition name: (identifier) @name body: (block) @body) @def.class
|
|
4
|
+
|
|
5
|
+
; top-level constants
|
|
6
|
+
(module (expression_statement (assignment left: (identifier) @name)) @def.constant)
|
|
7
|
+
|
|
8
|
+
; calls
|
|
9
|
+
(call function: (identifier) @callee) @call
|
|
10
|
+
(call function: (attribute object: (_) @recv attribute: (identifier) @callee)) @call
|
|
11
|
+
|
|
12
|
+
; inheritance and annotated types
|
|
13
|
+
(class_definition superclasses: (argument_list (identifier) @ref.extends))
|
|
14
|
+
(type (identifier) @ref.type)
|
|
15
|
+
|
|
16
|
+
; imports: @imodule is a whole-module import; @source with @iname is a from-import
|
|
17
|
+
(import_statement name: (dotted_name) @imodule) @import
|
|
18
|
+
(import_statement name: (aliased_import name: (dotted_name) @imodule alias: (identifier) @ialias)) @import
|
|
19
|
+
(import_from_statement module_name: (_) @source) @import
|
|
20
|
+
(import_from_statement name: (dotted_name) @iname) @import
|
|
21
|
+
(import_from_statement name: (aliased_import name: (dotted_name) @iname alias: (identifier) @ialias)) @import
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
; TypeScript and TSX only, appended to ecma.scm.
|
|
2
|
+
|
|
3
|
+
; overload signatures: merged into the implementation that follows them
|
|
4
|
+
(function_signature name: (_) @name) @def.overload
|
|
5
|
+
(class_body (method_signature name: (_) @name) @def.overload)
|
|
6
|
+
(class_body (abstract_method_signature name: (_) @name) @def.overload)
|
|
7
|
+
|
|
8
|
+
(abstract_class_declaration name: (_) @name body: (_) @body) @def.class
|
|
9
|
+
(public_field_definition name: (_) @name
|
|
10
|
+
value: [(arrow_function body: (_) @body) (function_expression body: (_) @body)]) @def.method
|
|
11
|
+
(interface_declaration name: (_) @name body: (_) @body) @def.interface
|
|
12
|
+
(type_alias_declaration name: (_) @name) @def.type
|
|
13
|
+
(enum_declaration name: (_) @name body: (_) @body) @def.enum
|
|
14
|
+
|
|
15
|
+
; inheritance and referenced types. Earlier patterns win, so an implemented interface is
|
|
16
|
+
; not also counted as a plain type reference.
|
|
17
|
+
(class_heritage (extends_clause value: (identifier) @ref.extends))
|
|
18
|
+
(class_heritage (implements_clause (type_identifier) @ref.implements))
|
|
19
|
+
(extends_type_clause type: (type_identifier) @ref.extends)
|
|
20
|
+
(type_identifier) @ref.type
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remimem",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Codebase memory for coding agents: a local-first MCP server and CLI that serves only the code context an agent needs",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Jaswanth Remiel AG",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/JaswanthRemiel/remimem.git"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"remimem": "dist/cli/index.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"!dist/bench",
|
|
18
|
+
"grammars"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.13.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.build.json && node -e \"require('fs').chmodSync('dist/cli/index.js', 0o755)\"",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"lint": "eslint src test scripts eslint.config.js vitest.config.js",
|
|
27
|
+
"format": "prettier --write src scripts .github grammars/README.md \"docs/**/*.md\" \"test/*.{ts,mjs}\" \"*.{js,json}\" README.md DECISIONS.md PROGRESS.md SETUP.md CONTRIBUTING.md CHANGELOG.md RELEASING.md",
|
|
28
|
+
"format:check": "prettier --check src scripts .github grammars/README.md \"docs/**/*.md\" \"test/*.{ts,mjs}\" \"*.{js,json}\" README.md DECISIONS.md PROGRESS.md SETUP.md CONTRIBUTING.md CHANGELOG.md RELEASING.md",
|
|
29
|
+
"check:chars": "node scripts/check-chars.mjs",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"hooks": "git config core.hooksPath .githooks || exit 0",
|
|
32
|
+
"prepare": "npm run build && npm run -s hooks",
|
|
33
|
+
"coverage": "vitest run --coverage",
|
|
34
|
+
"pretest": "npm run -s build",
|
|
35
|
+
"precoverage": "npm run -s build"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@huggingface/transformers": "^4.3.2",
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
40
|
+
"better-sqlite3": "^13.1.1",
|
|
41
|
+
"chokidar": "^5.0.0",
|
|
42
|
+
"commander": "^15.1.0",
|
|
43
|
+
"js-tiktoken": "^1.0.21",
|
|
44
|
+
"sqlite-vec": "^0.1.9",
|
|
45
|
+
"web-tree-sitter": "^0.27.2",
|
|
46
|
+
"zod": "^4.6.7"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/better-sqlite3": "^9.6.0",
|
|
50
|
+
"@types/node": "^22.20.5",
|
|
51
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
52
|
+
"eslint": "^10.14.0",
|
|
53
|
+
"prettier": "^3.10.1",
|
|
54
|
+
"typescript": "~6.0.3",
|
|
55
|
+
"typescript-eslint": "^8.72.2",
|
|
56
|
+
"vitest": "^5.1.0"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/JaswanthRemiel/remimem#readme",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/JaswanthRemiel/remimem/issues"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"mcp",
|
|
64
|
+
"rag",
|
|
65
|
+
"ai-agents",
|
|
66
|
+
"code-search",
|
|
67
|
+
"developer-tools",
|
|
68
|
+
"model-context-protocol",
|
|
69
|
+
"tree-sitter"
|
|
70
|
+
]
|
|
71
|
+
}
|