docbridge 0.6.1 → 0.7.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/CHANGELOG.md +95 -1
- package/README.md +62 -23
- package/dist/bin/darwin-arm64/SHA256SUMS +3 -2
- package/dist/bin/darwin-arm64/docbridge-rust-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge-swift-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge_dart_scanner +0 -0
- package/dist/bin/linux-x64/SHA256SUMS +3 -2
- package/dist/bin/linux-x64/docbridge-rust-scanner +0 -0
- package/dist/bin/linux-x64/docbridge-swift-scanner +0 -0
- package/dist/bin/linux-x64/docbridge_dart_scanner +0 -0
- package/dist/index.js +8513 -970
- package/docs/user/agent-integration.md +70 -0
- package/docs/user/annotations.md +52 -0
- package/docs/user/commands.md +56 -0
- package/docs/user/configuration.md +68 -0
- package/docs/user/getting-started.md +71 -0
- package/docs/user/troubleshooting.md +53 -0
- package/package.json +4 -2
- package/schemas/common-output.schema.json +56 -0
- package/schemas/context-output.schema.json +2 -32
- package/schemas/docbridge.schema.json +77 -7
- package/schemas/graph-output.schema.json +6 -52
- package/schemas/scanner-worker.schema.json +122 -0
- package/templates/skills/README.md +5 -6
- package/templates/skills/docbridge-adopt/SKILL.md +9 -9
- package/templates/skills/docbridge-link/SKILL.md +1 -1
- package/templates/skills/docbridge-sync/SKILL.md +3 -3
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
},
|
|
32
32
|
"language": {
|
|
33
33
|
"type": "string",
|
|
34
|
-
"enum": ["typescript", "swift", "dart"],
|
|
34
|
+
"enum": ["typescript", "swift", "dart", "rust"],
|
|
35
35
|
"description": "Code language for code nodes."
|
|
36
36
|
},
|
|
37
|
-
"location": { "$ref": "#/$defs/location" },
|
|
38
|
-
"range": { "$ref": "#/$defs/range" },
|
|
37
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
38
|
+
"range": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
39
39
|
"content": {
|
|
40
40
|
"oneOf": [
|
|
41
41
|
{
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"type": "string",
|
|
86
86
|
"description": "Resolved target endpoint of the annotation edge."
|
|
87
87
|
},
|
|
88
|
-
"location": { "$ref": "#/$defs/location" },
|
|
89
|
-
"range": { "$ref": "#/$defs/range" }
|
|
88
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
89
|
+
"range": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
},
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
"diagnostics": {
|
|
114
114
|
"type": "array",
|
|
115
|
-
"items": { "$ref": "#/$defs/diagnostic" }
|
|
115
|
+
"items": { "$ref": "common-output.schema.json#/$defs/diagnostic" }
|
|
116
116
|
},
|
|
117
117
|
"summary": {
|
|
118
118
|
"type": "object",
|
|
@@ -136,51 +136,5 @@
|
|
|
136
136
|
"diagnostics": { "type": "integer", "minimum": 0 }
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
"$defs": {
|
|
141
|
-
"location": {
|
|
142
|
-
"type": "object",
|
|
143
|
-
"additionalProperties": false,
|
|
144
|
-
"required": ["filePath", "line", "column"],
|
|
145
|
-
"properties": {
|
|
146
|
-
"filePath": { "type": "string" },
|
|
147
|
-
"line": { "type": "integer", "minimum": 1 },
|
|
148
|
-
"column": { "type": "integer", "minimum": 1 }
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"position": {
|
|
152
|
-
"type": "object",
|
|
153
|
-
"additionalProperties": false,
|
|
154
|
-
"required": ["line", "column"],
|
|
155
|
-
"properties": {
|
|
156
|
-
"line": { "type": "integer", "minimum": 1 },
|
|
157
|
-
"column": { "type": "integer", "minimum": 1 }
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"range": {
|
|
161
|
-
"type": "object",
|
|
162
|
-
"additionalProperties": false,
|
|
163
|
-
"required": ["start", "end"],
|
|
164
|
-
"properties": {
|
|
165
|
-
"start": { "$ref": "#/$defs/position" },
|
|
166
|
-
"end": { "$ref": "#/$defs/position" }
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
"diagnostic": {
|
|
170
|
-
"type": "object",
|
|
171
|
-
"required": ["severity", "code", "target", "message"],
|
|
172
|
-
"properties": {
|
|
173
|
-
"severity": {
|
|
174
|
-
"type": "string",
|
|
175
|
-
"enum": ["error", "warning"]
|
|
176
|
-
},
|
|
177
|
-
"code": { "type": "string" },
|
|
178
|
-
"target": { "type": "string" },
|
|
179
|
-
"source": { "type": "string" },
|
|
180
|
-
"message": { "type": "string" },
|
|
181
|
-
"location": { "$ref": "#/$defs/location" },
|
|
182
|
-
"range": { "$ref": "#/$defs/range" }
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
139
|
}
|
|
186
140
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "scanner-worker.schema.json",
|
|
4
|
+
"title": "DocBridge Scanner Worker Protocol",
|
|
5
|
+
"description": "Request and response payloads exchanged with scanner workers.",
|
|
6
|
+
"oneOf": [{ "$ref": "#/$defs/request" }, { "$ref": "#/$defs/response" }],
|
|
7
|
+
"$defs": {
|
|
8
|
+
"language": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["typescript", "swift", "dart", "rust"]
|
|
11
|
+
},
|
|
12
|
+
"codeSymbol": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": [
|
|
16
|
+
"kind",
|
|
17
|
+
"language",
|
|
18
|
+
"filePath",
|
|
19
|
+
"symbolName",
|
|
20
|
+
"canonicalId",
|
|
21
|
+
"endpoint",
|
|
22
|
+
"location"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"kind": { "const": "code" },
|
|
26
|
+
"language": { "$ref": "#/$defs/language" },
|
|
27
|
+
"filePath": { "type": "string" },
|
|
28
|
+
"symbolName": { "type": "string" },
|
|
29
|
+
"canonicalId": { "type": "string" },
|
|
30
|
+
"endpoint": { "type": "string" },
|
|
31
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
32
|
+
"nameRange": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
33
|
+
"declarationRange": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
34
|
+
"signatureRange": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"link": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": ["source", "target", "location"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"source": { "type": "string" },
|
|
43
|
+
"target": { "type": "string" },
|
|
44
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
45
|
+
"targetRange": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"requestFile": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["filePath", "content"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"filePath": { "type": "string" },
|
|
54
|
+
"content": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"options": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"properties": {
|
|
61
|
+
"visibility": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": { "type": "string" }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"request": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["schemaVersion", "requestId", "language", "projectRoot", "files", "options"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"schemaVersion": { "const": 1 },
|
|
73
|
+
"requestId": { "type": "string" },
|
|
74
|
+
"language": { "$ref": "#/$defs/language" },
|
|
75
|
+
"projectRoot": { "type": "string" },
|
|
76
|
+
"files": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "$ref": "#/$defs/requestFile" }
|
|
79
|
+
},
|
|
80
|
+
"options": { "$ref": "#/$defs/options" }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"responseFile": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["filePath", "symbols", "undocumentedSymbols", "links", "diagnostics"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"filePath": { "type": "string" },
|
|
89
|
+
"symbols": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": { "$ref": "#/$defs/codeSymbol" }
|
|
92
|
+
},
|
|
93
|
+
"undocumentedSymbols": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": { "$ref": "#/$defs/codeSymbol" }
|
|
96
|
+
},
|
|
97
|
+
"links": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": { "$ref": "#/$defs/link" }
|
|
100
|
+
},
|
|
101
|
+
"diagnostics": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "$ref": "common-output.schema.json#/$defs/diagnostic" }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"response": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"required": ["schemaVersion", "requestId", "language", "files"],
|
|
111
|
+
"properties": {
|
|
112
|
+
"schemaVersion": { "const": 1 },
|
|
113
|
+
"requestId": { "type": "string" },
|
|
114
|
+
"language": { "$ref": "#/$defs/language" },
|
|
115
|
+
"files": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": { "$ref": "#/$defs/responseFile" }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -15,9 +15,9 @@ nothing unless your DocBridge invocation differs from the examples inside.
|
|
|
15
15
|
findings: fetch the flagged counterpart content with `docbridge context`,
|
|
16
16
|
then update the counterpart or justify leaving it unchanged.
|
|
17
17
|
- [`docbridge-adopt`](docbridge-adopt/SKILL.md) — adopt DocBridge in an existing
|
|
18
|
-
TypeScript, Swift, or
|
|
19
|
-
or improving config, installing companion skills, and handling simple CI
|
|
20
|
-
setup.
|
|
18
|
+
TypeScript, Swift, Dart, or Rust project by confirming docs/code scope, creating
|
|
19
|
+
or improving config, installing companion skills, and handling simple CI or
|
|
20
|
+
Git-hook setup.
|
|
21
21
|
- [`docbridge-link`](docbridge-link/SKILL.md) — link existing docs sections to
|
|
22
22
|
existing supported code declarations through docs-first candidate discovery
|
|
23
23
|
and section-level confirmation.
|
|
@@ -30,6 +30,5 @@ directory. The template is the source of truth; do not edit the symlinked
|
|
|
30
30
|
copies in place. In-repository dogfood links require symlink-capable checkouts;
|
|
31
31
|
external projects should use the copy-based installation above.
|
|
32
32
|
|
|
33
|
-
The hook
|
|
34
|
-
[`
|
|
35
|
-
[`docs/integrations/`](../../docs/integrations/).
|
|
33
|
+
The Git-hook and CI integration that complements these skills is described
|
|
34
|
+
under [`docs/integrations/`](../../docs/integrations/).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docbridge-adopt
|
|
3
|
-
description: Adopt DocBridge in an existing TypeScript, Swift, or
|
|
3
|
+
description: Adopt DocBridge in an existing TypeScript, Swift, Dart, or Rust project. Use when asked to introduce DocBridge into a repository, choose docs/code scope, create or improve docbridge.config.json, and optionally wire simple CI or Git hooks.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# docbridge-adopt
|
|
@@ -22,17 +22,17 @@ repo recipe such as `just check`, or
|
|
|
22
22
|
1. **Survey the repository.** Inspect:
|
|
23
23
|
- existing `docbridge.config.json`
|
|
24
24
|
- Markdown docs structure and likely specification directories
|
|
25
|
-
- TypeScript, Swift, or
|
|
25
|
+
- TypeScript, Swift, Dart, or Rust source structure and public API locations
|
|
26
26
|
- existing `@doc` / `@code` annotations
|
|
27
|
-
- package scripts, CI files,
|
|
27
|
+
- package scripts, CI files, and Git hooks
|
|
28
28
|
|
|
29
29
|
2. **Recommend scope, then ask for confirmation.** Present concise options and
|
|
30
30
|
your recommendation for:
|
|
31
31
|
- docs scope: directories/files whose sections are likely specifications,
|
|
32
32
|
contracts, behavior, constraints, or design decisions
|
|
33
|
-
- code scope: language-keyed TypeScript, Swift, or
|
|
33
|
+
- code scope: language-keyed TypeScript, Swift, Dart, or Rust directories/files
|
|
34
34
|
whose supported declarations should be linkable
|
|
35
|
-
- CI/hook mode: if any integration should be added now
|
|
35
|
+
- CI/Git-hook mode: if any integration should be added now
|
|
36
36
|
|
|
37
37
|
Do not ask the user to rediscover obvious facts from the repository. Show
|
|
38
38
|
your recommendation and the tradeoff, then wait for confirmation.
|
|
@@ -42,8 +42,8 @@ repo recipe such as `just check`, or
|
|
|
42
42
|
`include.code` and `include.docs` globs.
|
|
43
43
|
- Use the language-keyed `include.code` object. Do not write the old
|
|
44
44
|
array form; for example, use `{ "typescript": { "patterns": [...] } }`,
|
|
45
|
-
`{ "swift": { "patterns": [...] } }`,
|
|
46
|
-
`{ "
|
|
45
|
+
`{ "swift": { "patterns": [...] } }`, `{ "dart": { "patterns": [...] } }`,
|
|
46
|
+
or `{ "rust": { "patterns": [...] } }`.
|
|
47
47
|
- If config exists, read it, explain the current scope, propose any
|
|
48
48
|
improvement, and edit only after confirmation.
|
|
49
49
|
- Never replace a user-authored config blindly.
|
|
@@ -65,7 +65,7 @@ repo recipe such as `just check`, or
|
|
|
65
65
|
copy target paths from `templates/skills/docbridge-*` instead of silently
|
|
66
66
|
skipping this step.
|
|
67
67
|
|
|
68
|
-
5. **Handle CI
|
|
68
|
+
5. **Handle CI and Git hooks conservatively.**
|
|
69
69
|
- If the existing setup is simple and the user confirmed the mode, implement
|
|
70
70
|
it.
|
|
71
71
|
- If the setup is complex or ambiguous, provide a concrete patch plan or
|
|
@@ -90,7 +90,7 @@ repo recipe such as `just check`, or
|
|
|
90
90
|
notes as exclusions by default unless the user identifies specific sections
|
|
91
91
|
as specifications.
|
|
92
92
|
- Prefer supported public API declarations as link targets. TypeScript starts
|
|
93
|
-
with top-level exported declarations; Swift and
|
|
93
|
+
with top-level exported declarations; Swift, Dart, and Rust also support member
|
|
94
94
|
endpoints with scanner-produced canonical IDs.
|
|
95
95
|
- Do not decide project workflow policy such as branch or PR strategy. Mention
|
|
96
96
|
only what affects DocBridge adoption.
|
|
@@ -7,7 +7,7 @@ description: Link existing Markdown specification sections to existing supported
|
|
|
7
7
|
|
|
8
8
|
Create DocBridge annotations for existing docs and code. Work docs-first: choose
|
|
9
9
|
Markdown sections that look like specifications, then propose supported
|
|
10
|
-
TypeScript, Swift, or
|
|
10
|
+
TypeScript, Swift, Dart, or Rust declarations that implement or represent each
|
|
11
11
|
section.
|
|
12
12
|
|
|
13
13
|
Run DocBridge with the project's native invocation: `docbridge` on `PATH`, a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docbridge-sync
|
|
3
|
-
description: Triage DocBridge related-gate findings — linked counterparts of changed files that were not themselves updated. Use when a
|
|
3
|
+
description: Triage DocBridge related-gate findings — linked counterparts of changed files that were not themselves updated. Use when a Git hook, CI comment, or docbridge related --gate run flags unchanged counterparts, to judge divergence with docbridge context and then update or justify each one.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# docbridge-sync
|
|
@@ -16,8 +16,8 @@ repo recipe such as `just related-gate`, or
|
|
|
16
16
|
|
|
17
17
|
## Procedure
|
|
18
18
|
|
|
19
|
-
1. **Collect the violations.** Use the gate report you were given (
|
|
20
|
-
|
|
19
|
+
1. **Collect the violations.** Use the gate report you were given (a Git
|
|
20
|
+
hook's output, a CI comment), or produce one over the change set:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
git diff --name-only HEAD | docbridge related --stdin --gate
|