ai-code-map 0.0.0-stage → 0.1.0-alpha.3

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.
@@ -0,0 +1,192 @@
1
+ {
2
+ "$defs": {
3
+ "__schema0": {
4
+ "minLength": 1,
5
+ "type": "string"
6
+ },
7
+ "__schema1": {
8
+ "$ref": "#/$defs/__schema0"
9
+ },
10
+ "__schema2": {
11
+ "minLength": 1,
12
+ "type": "string"
13
+ }
14
+ },
15
+ "$id": "urn:ai-code-map:project:4",
16
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "compilerUnits": {
20
+ "items": {
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "config": {
24
+ "$ref": "#/$defs/__schema1"
25
+ },
26
+ "extends": {
27
+ "items": {
28
+ "$ref": "#/$defs/__schema1"
29
+ },
30
+ "type": "array"
31
+ },
32
+ "id": {
33
+ "minLength": 1,
34
+ "type": "string"
35
+ },
36
+ "kind": {
37
+ "enum": [
38
+ "configured",
39
+ "fallback"
40
+ ],
41
+ "type": "string"
42
+ },
43
+ "pathAliases": {
44
+ "additionalProperties": {
45
+ "items": {
46
+ "$ref": "#/$defs/__schema0"
47
+ },
48
+ "type": "array"
49
+ },
50
+ "propertyNames": {
51
+ "$ref": "#/$defs/__schema2"
52
+ },
53
+ "type": "object"
54
+ },
55
+ "references": {
56
+ "items": {
57
+ "$ref": "#/$defs/__schema1"
58
+ },
59
+ "type": "array"
60
+ },
61
+ "root": {
62
+ "$ref": "#/$defs/__schema0"
63
+ }
64
+ },
65
+ "required": [
66
+ "id",
67
+ "kind",
68
+ "root",
69
+ "references",
70
+ "extends",
71
+ "pathAliases"
72
+ ],
73
+ "type": "object"
74
+ },
75
+ "type": "array"
76
+ },
77
+ "counts": {
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "diagnostics": {
81
+ "maximum": 9007199254740991,
82
+ "minimum": 0,
83
+ "type": "integer"
84
+ },
85
+ "files": {
86
+ "maximum": 9007199254740991,
87
+ "minimum": 0,
88
+ "type": "integer"
89
+ },
90
+ "relations": {
91
+ "maximum": 9007199254740991,
92
+ "minimum": 0,
93
+ "type": "integer"
94
+ },
95
+ "symbols": {
96
+ "maximum": 9007199254740991,
97
+ "minimum": 0,
98
+ "type": "integer"
99
+ }
100
+ },
101
+ "required": [
102
+ "files",
103
+ "symbols",
104
+ "relations",
105
+ "diagnostics"
106
+ ],
107
+ "type": "object"
108
+ },
109
+ "entryPoints": {
110
+ "items": {
111
+ "$ref": "#/$defs/__schema1"
112
+ },
113
+ "type": "array"
114
+ },
115
+ "frameworks": {
116
+ "items": {
117
+ "enum": [
118
+ "typescript",
119
+ "node",
120
+ "react",
121
+ "nextjs",
122
+ "nestjs"
123
+ ],
124
+ "type": "string"
125
+ },
126
+ "type": "array"
127
+ },
128
+ "name": {
129
+ "type": "string"
130
+ },
131
+ "packageManager": {
132
+ "type": "string"
133
+ },
134
+ "pathAliases": {
135
+ "additionalProperties": {
136
+ "items": {
137
+ "$ref": "#/$defs/__schema0"
138
+ },
139
+ "type": "array"
140
+ },
141
+ "propertyNames": {
142
+ "$ref": "#/$defs/__schema2"
143
+ },
144
+ "type": "object"
145
+ },
146
+ "schemaVersion": {
147
+ "const": 4,
148
+ "type": "number"
149
+ },
150
+ "tsconfig": {
151
+ "$ref": "#/$defs/__schema1"
152
+ },
153
+ "workspaces": {
154
+ "items": {
155
+ "additionalProperties": false,
156
+ "properties": {
157
+ "entryPoints": {
158
+ "items": {
159
+ "$ref": "#/$defs/__schema1"
160
+ },
161
+ "type": "array"
162
+ },
163
+ "name": {
164
+ "type": "string"
165
+ },
166
+ "path": {
167
+ "$ref": "#/$defs/__schema1"
168
+ }
169
+ },
170
+ "required": [
171
+ "name",
172
+ "path",
173
+ "entryPoints"
174
+ ],
175
+ "type": "object"
176
+ },
177
+ "type": "array"
178
+ }
179
+ },
180
+ "required": [
181
+ "schemaVersion",
182
+ "name",
183
+ "frameworks",
184
+ "compilerUnits",
185
+ "pathAliases",
186
+ "entryPoints",
187
+ "workspaces",
188
+ "counts"
189
+ ],
190
+ "title": "ai-code-map project record",
191
+ "type": "object"
192
+ }
@@ -0,0 +1,142 @@
1
+ {
2
+ "$defs": {
3
+ "__schema0": {
4
+ "exclusiveMinimum": 0,
5
+ "maximum": 9007199254740991,
6
+ "type": "integer"
7
+ },
8
+ "__schema1": {
9
+ "exclusiveMinimum": 0,
10
+ "maximum": 9007199254740991,
11
+ "type": "integer"
12
+ },
13
+ "__schema2": {
14
+ "exclusiveMinimum": 0,
15
+ "maximum": 9007199254740991,
16
+ "type": "integer"
17
+ },
18
+ "__schema3": {
19
+ "exclusiveMinimum": 0,
20
+ "maximum": 9007199254740991,
21
+ "type": "integer"
22
+ }
23
+ },
24
+ "$id": "urn:ai-code-map:relation:4",
25
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "confidence": {
29
+ "maximum": 1,
30
+ "minimum": 0,
31
+ "type": "number"
32
+ },
33
+ "from": {
34
+ "minLength": 1,
35
+ "type": "string"
36
+ },
37
+ "origin": {
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "analyzer": {
41
+ "minLength": 1,
42
+ "type": "string"
43
+ },
44
+ "classification": {
45
+ "enum": [
46
+ "exact",
47
+ "framework-derived",
48
+ "heuristic",
49
+ "derived"
50
+ ],
51
+ "type": "string"
52
+ },
53
+ "explanation": {
54
+ "minLength": 1,
55
+ "type": "string"
56
+ },
57
+ "file": {
58
+ "minLength": 1,
59
+ "type": "string"
60
+ },
61
+ "line": {
62
+ "exclusiveMinimum": 0,
63
+ "maximum": 9007199254740991,
64
+ "type": "integer"
65
+ },
66
+ "range": {
67
+ "additionalProperties": false,
68
+ "properties": {
69
+ "endColumn": {
70
+ "$ref": "#/$defs/__schema3"
71
+ },
72
+ "endLine": {
73
+ "$ref": "#/$defs/__schema2"
74
+ },
75
+ "startColumn": {
76
+ "$ref": "#/$defs/__schema1"
77
+ },
78
+ "startLine": {
79
+ "$ref": "#/$defs/__schema0"
80
+ }
81
+ },
82
+ "required": [
83
+ "startLine",
84
+ "startColumn",
85
+ "endLine",
86
+ "endColumn"
87
+ ],
88
+ "type": "object"
89
+ }
90
+ },
91
+ "required": [
92
+ "file",
93
+ "line",
94
+ "range",
95
+ "explanation",
96
+ "classification",
97
+ "analyzer"
98
+ ],
99
+ "type": "object"
100
+ },
101
+ "schemaVersion": {
102
+ "const": 4,
103
+ "type": "number"
104
+ },
105
+ "to": {
106
+ "minLength": 1,
107
+ "type": "string"
108
+ },
109
+ "type": {
110
+ "enum": [
111
+ "imports",
112
+ "exports",
113
+ "reexports",
114
+ "calls",
115
+ "instantiates",
116
+ "renders",
117
+ "uses-hook",
118
+ "reads-state",
119
+ "depends-on",
120
+ "used-by",
121
+ "contains",
122
+ "references",
123
+ "injects",
124
+ "handles-route",
125
+ "consumes-dto",
126
+ "belongs-to-module",
127
+ "uses-layout"
128
+ ],
129
+ "type": "string"
130
+ }
131
+ },
132
+ "required": [
133
+ "schemaVersion",
134
+ "from",
135
+ "type",
136
+ "to",
137
+ "confidence",
138
+ "origin"
139
+ ],
140
+ "title": "ai-code-map relation record",
141
+ "type": "object"
142
+ }
@@ -0,0 +1,165 @@
1
+ {
2
+ "$defs": {
3
+ "__schema0": {
4
+ "exclusiveMinimum": 0,
5
+ "maximum": 9007199254740991,
6
+ "type": "integer"
7
+ },
8
+ "__schema1": {
9
+ "exclusiveMinimum": 0,
10
+ "maximum": 9007199254740991,
11
+ "type": "integer"
12
+ },
13
+ "__schema2": {
14
+ "exclusiveMinimum": 0,
15
+ "maximum": 9007199254740991,
16
+ "type": "integer"
17
+ },
18
+ "__schema3": {
19
+ "exclusiveMinimum": 0,
20
+ "maximum": 9007199254740991,
21
+ "type": "integer"
22
+ },
23
+ "__schema4": {
24
+ "anyOf": [
25
+ {
26
+ "type": "string"
27
+ },
28
+ {
29
+ "type": "number"
30
+ },
31
+ {
32
+ "type": "boolean"
33
+ },
34
+ {
35
+ "type": "null"
36
+ },
37
+ {
38
+ "items": {
39
+ "$ref": "#/$defs/__schema4"
40
+ },
41
+ "type": "array"
42
+ },
43
+ {
44
+ "additionalProperties": {
45
+ "$ref": "#/$defs/__schema4"
46
+ },
47
+ "propertyNames": {
48
+ "type": "string"
49
+ },
50
+ "type": "object"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ "$id": "urn:ai-code-map:symbol:4",
56
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
57
+ "additionalProperties": false,
58
+ "properties": {
59
+ "defaultExport": {
60
+ "type": "boolean"
61
+ },
62
+ "documentation": {
63
+ "type": "string"
64
+ },
65
+ "exported": {
66
+ "type": "boolean"
67
+ },
68
+ "facts": {
69
+ "additionalProperties": {
70
+ "$ref": "#/$defs/__schema4"
71
+ },
72
+ "propertyNames": {
73
+ "type": "string"
74
+ },
75
+ "type": "object"
76
+ },
77
+ "file": {
78
+ "minLength": 1,
79
+ "type": "string"
80
+ },
81
+ "id": {
82
+ "minLength": 1,
83
+ "type": "string"
84
+ },
85
+ "kind": {
86
+ "enum": [
87
+ "function",
88
+ "class",
89
+ "method",
90
+ "interface",
91
+ "type-alias",
92
+ "variable",
93
+ "react-component",
94
+ "react-hook",
95
+ "react-context",
96
+ "next-page",
97
+ "next-layout",
98
+ "next-route-handler",
99
+ "next-special-file",
100
+ "nest-module",
101
+ "nest-controller",
102
+ "nest-provider",
103
+ "nest-guard",
104
+ "nest-interceptor",
105
+ "nest-pipe",
106
+ "nest-filter",
107
+ "nest-gateway",
108
+ "dto",
109
+ "route"
110
+ ],
111
+ "type": "string"
112
+ },
113
+ "name": {
114
+ "type": "string"
115
+ },
116
+ "range": {
117
+ "additionalProperties": false,
118
+ "properties": {
119
+ "endColumn": {
120
+ "$ref": "#/$defs/__schema3"
121
+ },
122
+ "endLine": {
123
+ "$ref": "#/$defs/__schema2"
124
+ },
125
+ "startColumn": {
126
+ "$ref": "#/$defs/__schema1"
127
+ },
128
+ "startLine": {
129
+ "$ref": "#/$defs/__schema0"
130
+ }
131
+ },
132
+ "required": [
133
+ "startLine",
134
+ "startColumn",
135
+ "endLine",
136
+ "endColumn"
137
+ ],
138
+ "type": "object"
139
+ },
140
+ "schemaVersion": {
141
+ "const": 4,
142
+ "type": "number"
143
+ },
144
+ "signature": {
145
+ "type": "string"
146
+ },
147
+ "sourceHash": {
148
+ "pattern": "^[a-f0-9]{64}$",
149
+ "type": "string"
150
+ }
151
+ },
152
+ "required": [
153
+ "schemaVersion",
154
+ "id",
155
+ "name",
156
+ "kind",
157
+ "file",
158
+ "range",
159
+ "exported",
160
+ "facts",
161
+ "sourceHash"
162
+ ],
163
+ "title": "ai-code-map symbol record",
164
+ "type": "object"
165
+ }
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: ai-code-map
3
+ description: Use when tracing TypeScript or JavaScript behavior in a project indexed by ai-code-map, or when the user requests map-guided navigation.
4
+ ---
5
+
6
+ # Retrieve source through the map
7
+
8
+ Run from the source project root with its installed CLI. Do not install or upgrade
9
+ it just to navigate. Source establishes behavior; graph relations are navigation
10
+ hints, and missing edges do not prove absence.
11
+
12
+ For an unknown flow, start with `ai-code-map context 'action subject words'`.
13
+ Include the action as well as the subject, for example `notification mark read`.
14
+ This command checks freshness and returns matching
15
+ source plus direct neighbors, merging ranges under one shared budget. A separate
16
+ `check` or overview is unnecessary before it. Partial matches name unmatched words;
17
+ judge relevance from the returned source.
18
+
19
+ Use that packet to answer or identify a specific missing fact. Reuse its source.
20
+ Read a printed omitted range only if it matters. For one dependency outside the
21
+ packet, use `read '<stable-id>'` or its bounded source range. If its ID and source
22
+ location are unknown, use `find 'qualified symbol name'` first. Do not use another
23
+ `context` call merely to read a helper: it also expands callers and neighbors.
24
+ Batch independent
25
+ reads; combine needed ranges in the same file. Avoid traversing every neighbor or
26
+ splitting one useful file window into many tiny symbol reads.
27
+
28
+ Use targeted `rg` for file-level facts such as route registration, configuration
29
+ and test discovery, or for a failed/irrelevant lookup. Discover paths with
30
+ `rg --files -g 'pattern'` before reading them. Use
31
+ `show '<id>'` only for an unresolved relation question. Do not dump the complete
32
+ map for an ordinary source task. Stop when the requested claims have evidence.
33
+ In the answer, connect each requested entry point to its inputs, state changes,
34
+ error path and caller effects. Keep navigation-status commentary brief.
35
+
36
+ If `context` is unavailable, check freshness once, then use `find` and `read` or
37
+ bounded source ranges. If stale, scan only when writing generated artifacts is
38
+ allowed; otherwise use source search. Cite original file and line numbers.
39
+ Do not claim token savings without a measured comparison.