@weftlet/core 0.3.0 → 0.4.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/README.md +18 -0
- package/dist/core.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/repository-nodes.d.ts +7 -0
- package/dist/repository-nodes.js +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,4 +8,22 @@ AI development agents.
|
|
|
8
8
|
The core package has no runtime dependencies. Install `@weftlet/toolkit` for the CLI,
|
|
9
9
|
MCP server, extraction, storage and graph queries.
|
|
10
10
|
|
|
11
|
+
Repository adapters should construct physical-file nodes with the public factory:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { repositoryFileNode } from '@weftlet/core';
|
|
15
|
+
|
|
16
|
+
const file = repositoryFileNode('src/worker.spec.ts');
|
|
17
|
+
// { id: 'component:file:src/worker.spec.ts', label: 'src/worker.spec.ts', kind: 'Evidence' }
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Markdown/MDX/text documents use `document:<path>` and `Document`; `.spec.<extension>` and
|
|
21
|
+
`.test.<extension>` files use `component:file:<path>` and `Evidence`; other files use that
|
|
22
|
+
file prefix and `Component`. Extension matching ignores case, while path spelling is retained.
|
|
23
|
+
Supply a repository-relative path using the repository's canonical spelling. This pure mapping
|
|
24
|
+
does not resolve paths, read files, detect every testing convention or approve product intent.
|
|
25
|
+
Keep business-concept identities separate. Adapters can add attributes without changing the
|
|
26
|
+
factory's `id` or `kind`; use the same node for mocked/DI/decorator-bearing tests and production
|
|
27
|
+
sources. This API is available starting with 0.4.0; it is absent from 0.3.0.
|
|
28
|
+
|
|
11
29
|
Licensed under Apache-2.0; see LICENSE and NOTICE for attribution.
|
package/dist/core.d.ts
CHANGED
|
@@ -171,7 +171,7 @@ export interface ImpactScanRequest {
|
|
|
171
171
|
readonly continuation?: string;
|
|
172
172
|
}
|
|
173
173
|
export interface ContextPack {
|
|
174
|
-
readonly snapshot: Pick<SnapshotManifest, 'snapshotId' | 'commitSha' | 'contentDigest' | 'configurationDigest' | 'scope' | 'baseSha' | 'overlayDigest' | 'overlayCapture'
|
|
174
|
+
readonly snapshot: Pick<SnapshotManifest, 'snapshotId' | 'commitSha' | 'contentDigest' | 'configurationDigest' | 'scope' | 'baseSha' | 'overlayDigest' | 'overlayCapture'> & Partial<Pick<SnapshotManifest, 'extractorVersions'>>;
|
|
175
175
|
readonly evidenceState?: {
|
|
176
176
|
readonly currentCommit?: string;
|
|
177
177
|
readonly excludedWorkingChanges: readonly string[];
|
|
@@ -180,6 +180,8 @@ export interface ContextPack {
|
|
|
180
180
|
readonly overlayFreshness?: 'current' | 'stale' | 'unknown';
|
|
181
181
|
readonly stale: boolean;
|
|
182
182
|
readonly configurationMatches: boolean;
|
|
183
|
+
readonly extractionCompatible?: boolean;
|
|
184
|
+
readonly incompatibleExtractors?: readonly string[];
|
|
183
185
|
readonly eligibleForCurrentDiffValidation: false;
|
|
184
186
|
};
|
|
185
187
|
readonly capabilities: readonly GraphNode[];
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GraphNode } from './core.js';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical physical-file identity, shared by toolkit extractors and repository adapters.
|
|
4
|
+
* The caller supplies a repository-relative path with its intended spelling. This pure
|
|
5
|
+
* mapping does not resolve paths or establish existence, intent, ownership or approval.
|
|
6
|
+
*/
|
|
7
|
+
export declare function repositoryFileNode(path: string): GraphNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical physical-file identity, shared by toolkit extractors and repository adapters.
|
|
3
|
+
* The caller supplies a repository-relative path with its intended spelling. This pure
|
|
4
|
+
* mapping does not resolve paths or establish existence, intent, ownership or approval.
|
|
5
|
+
*/
|
|
6
|
+
export function repositoryFileNode(path) {
|
|
7
|
+
if (/\.(?:md|mdx|txt)$/i.test(path))
|
|
8
|
+
return { id: `document:${path}`, kind: 'Document', label: path };
|
|
9
|
+
return { id: `component:file:${path}`, label: path,
|
|
10
|
+
kind: /\.(spec|test)\.[^.]+$/i.test(path) ? 'Evidence' : 'Component' };
|
|
11
|
+
}
|