@c4a/extract-contract 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 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,16 @@
1
+ # @c4a/extract-contract
2
+
3
+ Static OpenAPI and GraphQL contract catalog adapter for Context.
4
+
5
+ The package parses only the caller-provided source map. OpenAPI external references must resolve to registered relative files. GraphQL files in one invocation form one schema scope so type extensions resolve to an exact base definition. Missing, escaping, ambiguous, cyclic, or unsupported dependencies make the affected file unsupported; unsupported files publish no partial facts.
6
+
7
+ It emits the common `context.indexer.evidence-adapter-result/v1` ABI with endpoint, operation, type, reference, generated-source boundary, locator, disposition, and diagnostic evidence. It does not fetch remote schemas, execute GraphQL operations, generate clients, or publish source prose.
8
+
9
+ ```ts
10
+ import { parseContractSources } from "@c4a/extract-contract";
11
+
12
+ const catalogs = parseContractSources({
13
+ "api/openapi.yaml": "openapi: '3.1.0'\ninfo: { title: API, version: '1' }\npaths: {}",
14
+ "graphql/schema.graphql": "type Query { ready: Boolean! }",
15
+ });
16
+ ```
@@ -0,0 +1,7 @@
1
+ # @c4a/extract-contract
2
+
3
+ 面向 Context 的 OpenAPI 与 GraphQL 静态 contract catalog adapter。
4
+
5
+ 该包只解析调用方登记的 source map。OpenAPI 外部引用只能解析到已登记的相对路径;同一次调用中的 GraphQL 文件构成一个 schema scope,使 type extension 能解析到唯一且精确的基础定义。依赖缺失、逃逸、歧义、循环或不受支持时,受影响文件记为 `unsupported`,且不发布部分 facts。
6
+
7
+ 输出统一的 `context.indexer.evidence-adapter-result/v1` ABI,包含 endpoint、operation、type、reference、生成代码边界、locator、disposition 和 diagnostic evidence。不会拉取远程 schema、执行 GraphQL operation、生成客户端,也不会发布源码描述正文。