@moldea.ai/core 2.0.2 → 2.1.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 +20 -1
- package/dist/contracts/index.d.ts +11 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/exceptions/index.d.ts +1 -1
- package/dist/exceptions/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +484 -98
- package/dist/index.js.map +1 -1
- package/dist/manifest/index.d.ts +2 -2
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/scope-matching/index.d.ts +5 -0
- package/dist/scope-matching/index.d.ts.map +1 -0
- package/dist/scope-matching/matching.d.ts +20 -0
- package/dist/scope-matching/matching.d.ts.map +1 -0
- package/dist/scope-matching/scope.d.ts +14 -0
- package/dist/scope-matching/scope.d.ts.map +1 -0
- package/dist/scope-matching/types.d.ts +48 -0
- package/dist/scope-matching/types.d.ts.map +1 -0
- package/dist/scope-matching/validations.d.ts +21 -0
- package/dist/scope-matching/validations.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/manifest/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface IManifestDocumentInspectionResult extends IManifestParseResult
|
|
|
17
17
|
* - INVALID_ARGUMENT: The Core operation received an invalid argument.
|
|
18
18
|
* - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
|
|
19
19
|
*/
|
|
20
|
-
export declare const inspectManifestDocument: (input: ITextDocumentInput, options: ICoreOptionsSnapshot, operation?: Extract<ICoreOperation, "parse-manifest" | "inspect-project">) => Promise<IManifestDocumentInspectionResult>;
|
|
20
|
+
export declare const inspectManifestDocument: (input: ITextDocumentInput, options: ICoreOptionsSnapshot, operation?: Extract<ICoreOperation, "parse-manifest" | "match-manifest-scope" | "inspect-project">) => Promise<IManifestDocumentInspectionResult>;
|
|
21
21
|
/**
|
|
22
22
|
* Parses and validates one complete version 1 manifest document.
|
|
23
23
|
* @param input The canonical logical path and exact manifest text or bytes.
|
|
@@ -28,5 +28,5 @@ export declare const inspectManifestDocument: (input: ITextDocumentInput, option
|
|
|
28
28
|
* - INVALID_ARGUMENT: The Core operation received an invalid argument.
|
|
29
29
|
* - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
|
|
30
30
|
*/
|
|
31
|
-
export declare const parseManifestDocument: (input: ITextDocumentInput, options: ICoreOptionsSnapshot) => Promise<IManifestParseResult>;
|
|
31
|
+
export declare const parseManifestDocument: (input: ITextDocumentInput, options: ICoreOptionsSnapshot, operation?: Extract<ICoreOperation, "parse-manifest" | "match-manifest-scope">) => Promise<IManifestParseResult>;
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,KAAK,EAEV,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,iCAAkC,SAAQ,oBAAoB;IAC7E,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,kBAAkB,EACzB,SAAS,oBAAoB,EAC7B,YAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,KAAK,EAEV,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,iCAAkC,SAAQ,oBAAoB;IAC7E,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,kBAAkB,EACzB,SAAS,oBAAoB,EAC7B,YAAW,OAAO,CAChB,cAAc,EACd,gBAAgB,GAAG,sBAAsB,GAAG,iBAAiB,CAC3C,KACnB,OAAO,CAAC,iCAAiC,CA8D3C,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,kBAAkB,EACzB,SAAS,oBAAoB,EAC7B,YAAW,OAAO,CAAC,cAAc,EAAE,gBAAgB,GAAG,sBAAsB,CAAoB,KAC/F,OAAO,CAAC,oBAAoB,CAS9B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { IExactManifestScopeDeclaration, IGlobManifestScopeDeclaration, IManifestScopeCounts, IManifestScopeDeclaration, IManifestScopeInput, IManifestScopeMatch, IManifestScopeOwner, IManifestScopeOwnerKind, IManifestScopeRelationshipField, IManifestScopeResult, } from './types.js';
|
|
2
|
+
export { calculateManifestScopeInputDigest, matchParsedManifestScope } from './matching.js';
|
|
3
|
+
export { matchManifestScope } from './scope.js';
|
|
4
|
+
export { normalizeManifestScopeInput } from './validations.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope-matching/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IRepositoryPath } from '@moldea.ai/repository';
|
|
2
|
+
import type { IContentDigest, ICoreResourceLimits } from '../contracts/index.js';
|
|
3
|
+
import type { IMoldeaManifestV1 } from '../format/index.js';
|
|
4
|
+
import type { IManifestScopeCounts, IManifestScopeMatch } from './types.js';
|
|
5
|
+
/** Creates the canonical digest of the sorted unique changed-path set. */
|
|
6
|
+
export declare const calculateManifestScopeInputDigest: (paths: readonly IRepositoryPath[]) => Promise<IContentDigest>;
|
|
7
|
+
/**
|
|
8
|
+
* Matches normalized changed paths against one valid version 1 manifest.
|
|
9
|
+
* @param manifest The parsed and validated manifest value.
|
|
10
|
+
* @param paths Sorted unique repository-logical changed paths.
|
|
11
|
+
* @param limits The immutable Core operation limits.
|
|
12
|
+
* @returns Frozen content-free matches and stable aggregate counts.
|
|
13
|
+
* @throws
|
|
14
|
+
* - RESOURCE_LIMIT_EXCEEDED: The declaration or match count exceeded `maxEntries`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const matchParsedManifestScope: (manifest: IMoldeaManifestV1, paths: readonly IRepositoryPath[], limits: ICoreResourceLimits) => {
|
|
17
|
+
readonly counts: IManifestScopeCounts;
|
|
18
|
+
readonly matches: readonly IManifestScopeMatch[];
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matching.d.ts","sourceRoot":"","sources":["../../src/scope-matching/matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjF,OAAO,KAAK,EAEV,iBAAiB,EAKlB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EACV,oBAAoB,EAEpB,mBAAmB,EAGpB,MAAM,YAAY,CAAC;AAqfpB,0EAA0E;AAC1E,eAAO,MAAM,iCAAiC,GAC5C,OAAO,SAAS,eAAe,EAAE,KAChC,OAAO,CAAC,cAAc,CAQxB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,EAC3B,OAAO,SAAS,eAAe,EAAE,EACjC,QAAQ,mBAAmB,KAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAmC3F,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ICoreOptionsSnapshot } from '../options/index.js';
|
|
2
|
+
import type { IManifestScopeInput, IManifestScopeResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parses a manifest and matches its repository relationships against changed logical paths.
|
|
5
|
+
* @param input The canonical manifest document and untrusted changed-path collection.
|
|
6
|
+
* @param options The immutable Core operation options.
|
|
7
|
+
* @returns A promise resolving to frozen content-free scope metadata and matches.
|
|
8
|
+
* @throws
|
|
9
|
+
* - INVALID_REPOSITORY_PATH: The manifest path or a changed repository path is invalid.
|
|
10
|
+
* - INVALID_ARGUMENT: The scope operation received an invalid argument.
|
|
11
|
+
* - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
|
|
12
|
+
*/
|
|
13
|
+
export declare const matchManifestScope: (input: IManifestScopeInput, options: ICoreOptionsSnapshot) => Promise<IManifestScopeResult>;
|
|
14
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/scope-matching/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG5E;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,mBAAmB,EAC1B,SAAS,oBAAoB,KAC5B,OAAO,CAAC,oBAAoB,CAkC9B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IRepositoryPath } from '@moldea.ai/repository';
|
|
2
|
+
import type { IContentDigest, ITextDocumentInput } from '../contracts/index.js';
|
|
3
|
+
import type { ICoreDiagnostic } from '../diagnostics/index.js';
|
|
4
|
+
export type IManifestScopeOwnerKind = 'agent' | 'context' | 'decision' | 'skill' | 'tool' | 'unresolved';
|
|
5
|
+
export type IManifestScopeRelationshipField = 'affectedBy' | 'bindings' | 'implementation' | 'inputSchema' | 'instructionLoader' | 'mirrors' | 'outputSchema' | 'registration' | 'related' | 'runtimeAgent' | 'variableProvider';
|
|
6
|
+
export interface IManifestScopeOwner {
|
|
7
|
+
readonly kind: IManifestScopeOwnerKind;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly agentId: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface IExactManifestScopeDeclaration {
|
|
12
|
+
readonly kind: 'exact';
|
|
13
|
+
readonly path: IRepositoryPath;
|
|
14
|
+
readonly symbol: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface IGlobManifestScopeDeclaration {
|
|
17
|
+
readonly kind: 'glob';
|
|
18
|
+
readonly pattern: string;
|
|
19
|
+
}
|
|
20
|
+
export type IManifestScopeDeclaration = IExactManifestScopeDeclaration | IGlobManifestScopeDeclaration;
|
|
21
|
+
export interface IManifestScopeMatch {
|
|
22
|
+
readonly inputPath: IRepositoryPath;
|
|
23
|
+
readonly owner: IManifestScopeOwner;
|
|
24
|
+
readonly field: IManifestScopeRelationshipField;
|
|
25
|
+
readonly pointer: string;
|
|
26
|
+
readonly declaration: IManifestScopeDeclaration;
|
|
27
|
+
}
|
|
28
|
+
export interface IManifestScopeCounts {
|
|
29
|
+
readonly declarations: number;
|
|
30
|
+
readonly inputPaths: number;
|
|
31
|
+
readonly matchedOwners: number;
|
|
32
|
+
readonly matchedPaths: number;
|
|
33
|
+
readonly matches: number;
|
|
34
|
+
}
|
|
35
|
+
export interface IManifestScopeInput {
|
|
36
|
+
readonly manifest: ITextDocumentInput;
|
|
37
|
+
readonly paths: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface IManifestScopeResult {
|
|
40
|
+
readonly valid: boolean;
|
|
41
|
+
readonly relevant: boolean;
|
|
42
|
+
readonly manifestDigest: IContentDigest | null;
|
|
43
|
+
readonly inputDigest: IContentDigest;
|
|
44
|
+
readonly counts: IManifestScopeCounts;
|
|
45
|
+
readonly matches: readonly IManifestScopeMatch[];
|
|
46
|
+
readonly diagnostics: readonly ICoreDiagnostic[];
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/scope-matching/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,MAAM,MAAM,uBAAuB,GACjC,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,M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;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,CAAC;CAClD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IRepositoryPath } from '@moldea.ai/repository';
|
|
2
|
+
import type { ICoreResourceLimits, ITextDocumentInput } from '../contracts/index.js';
|
|
3
|
+
import type { IManifestScopeInput } from './types.js';
|
|
4
|
+
/** Measures scalar UTF-8 bytes without allocating an encoded copy. */
|
|
5
|
+
export declare const measureUtf8ByteLength: (value: string) => number;
|
|
6
|
+
export interface INormalizedManifestScopeInput {
|
|
7
|
+
readonly manifest: ITextDocumentInput;
|
|
8
|
+
readonly paths: readonly IRepositoryPath[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validates and snapshots one public manifest-scope input.
|
|
12
|
+
* @param input The untrusted manifest document and changed logical paths.
|
|
13
|
+
* @param limits The immutable Core resource limits.
|
|
14
|
+
* @returns The detached manifest input and sorted unique repository paths.
|
|
15
|
+
* @throws
|
|
16
|
+
* - INVALID_REPOSITORY_PATH: A changed repository path is invalid.
|
|
17
|
+
* - INVALID_ARGUMENT: The scope operation received an invalid argument.
|
|
18
|
+
* - RESOURCE_LIMIT_EXCEEDED: The changed-path count or byte budget was exceeded.
|
|
19
|
+
*/
|
|
20
|
+
export declare const normalizeManifestScopeInput: (input: IManifestScopeInput, limits: ICoreResourceLimits) => INormalizedManifestScopeInput;
|
|
21
|
+
//# sourceMappingURL=validations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/scope-matching/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAuBtD,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,KAAG,MASrD,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,mBAAmB,EAC1B,QAAQ,mBAAmB,KAC1B,6BAsCF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moldea.ai/core",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Source-neutral, deterministic interpretation and indexing of moldea repositories.",
|
|
5
5
|
"homepage": "https://github.com/moldea-ai/packages/tree/main/projects/core#readme",
|
|
6
6
|
"bugs": {
|