@c4a/extract-proto 0.0.0-bootstrap.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 +22 -0
- package/README.zh-CN.md +16 -0
- package/index.js +12473 -0
- package/package.json +22 -0
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,22 @@
|
|
|
1
|
+
# Protocol Buffers Catalog for Context
|
|
2
|
+
|
|
3
|
+
[简体中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
`@c4a/extract-proto` parses caller-registered Protocol Buffers sources into deterministic package, import, option, message, enum, service, RPC, generated-boundary, locator, and disposition evidence.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { protoSourcesToEvidenceAdapterResult } from "@c4a/extract-proto";
|
|
9
|
+
|
|
10
|
+
const evidence = protoSourcesToEvidenceAdapterResult(files, invocation);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import resolution is limited to the provided source map and explicit import roots. Missing, absolute, or escaping imports make the importing file `unsupported`, and unsupported files publish no partial facts. The parser supports proto2/proto3 declarations and Editions syntax used by the public language grammar; it does not infer private code-generation platform state.
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun run --filter @c4a/extract-proto typecheck
|
|
19
|
+
bun run --filter @c4a/extract-proto lint
|
|
20
|
+
bun run --filter @c4a/extract-proto test
|
|
21
|
+
bun run --filter @c4a/extract-proto build
|
|
22
|
+
```
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Context Protocol Buffers 目录解析
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
`@c4a/extract-proto` 把调用方已登记的 Protocol Buffers 文件解析为确定性的 package、import、option、message、enum、service、RPC、generated boundary、locator 和 disposition Evidence。
|
|
6
|
+
|
|
7
|
+
import 解析只允许访问输入 source map 和显式 import root。import 缺失、使用绝对路径或越出登记范围时,引用文件整体标记为 `unsupported`,且不发布部分 facts。解析器覆盖公开语法中的 proto2/proto3 声明和 Editions syntax,不推断私有 codegen 平台状态。
|
|
8
|
+
|
|
9
|
+
## 开发
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run --filter @c4a/extract-proto typecheck
|
|
13
|
+
bun run --filter @c4a/extract-proto lint
|
|
14
|
+
bun run --filter @c4a/extract-proto test
|
|
15
|
+
bun run --filter @c4a/extract-proto build
|
|
16
|
+
```
|