@c4a/extract-go 0.6.4

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 context4ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @c4a/extract-go
2
+
3
+ Go extraction plugin for Context's `ExtractionResult v2` protocol. It extracts
4
+ declarations, signatures, documentation, imports, calls, and common HTTP route
5
+ registrations without applying product-specific classifications.
6
+
7
+ ```ts
8
+ import { GoPlugin, indexGoRepository, indexGoSource } from "@c4a/extract-go";
9
+ ```
10
+
11
+ Use `GoPlugin` with `@c4a/extract`, or use `indexGoSource()` when a project-owned
12
+ extractor needs detailed Go facts before building its own candidates.
13
+ `indexGoRepository()` provides the same structural facts for a repository tree,
14
+ with deterministic controls for include roots, tests, generated files, and
15
+ excluded directories.
16
+
17
+ This package is optional. Context CLI does not bundle it or add a Go lifecycle
18
+ phase. A knowledge project opts in from its own `extractCustom()` callback.
@@ -0,0 +1,15 @@
1
+ # @c4a/extract-go
2
+
3
+ 面向 Context `ExtractionResult v2` 协议的 Go 提取插件。它提取声明、签名、
4
+ 文档、导入、调用关系和常见 HTTP 路由注册,不加入任何业务分类。
5
+
6
+ ```ts
7
+ import { GoPlugin, indexGoRepository, indexGoSource } from "@c4a/extract-go";
8
+ ```
9
+
10
+ 标准代码图谱使用 `GoPlugin`;项目自有提取器需要先读取细粒度 Go 事实时,
11
+ 可以直接使用 `indexGoSource()`。`indexGoRepository()` 提供仓库级结构事实,
12
+ 并通过确定性参数控制扫描根目录、测试文件、生成文件和排除目录。
13
+
14
+ 这是可选包。Context CLI 不会内置它,也不会新增 Go 生命周期阶段;知识项目
15
+ 需要在自己的 `extractCustom()` 回调中显式使用。