geospec 0.1.0-beta.9 → 0.4.1-next.331
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 +34 -9
- package/agent/doctrine.md +2 -1
- package/agent/geospec-authoring/SKILL.md +3 -3
- package/agent/geospec-authoring/api-index.md +20 -92
- package/agent/geospec-authoring/api-types.md +85 -480
- package/agent/geospec-authoring/public-api-functions.md +21 -1
- package/agent/geospec-authoring/public-api-index.md +215 -319
- package/agent/geospec-authoring/public-api-types-2.md +480 -352
- package/agent/geospec-authoring/public-api-types-3.md +79 -215
- package/agent/geospec-authoring/public-api-types.md +334 -849
- package/agent/resources.js +12 -13
- package/agent/skills.json +2 -3
- package/dist/assertion-client/client.d.mts +14 -15
- package/dist/assertion-client/client.mjs +1 -1
- package/dist/cli/check.mjs +2 -0
- package/dist/cli/cli.d.mts +5 -5
- package/dist/cli/cli.mjs +20 -3
- package/dist/cli/node-host.d.mts +5 -4
- package/dist/cli/node-host.mjs +1 -1
- package/dist/cli/wire-value.mjs +1 -1
- package/dist/config/define-config.d.mts +2 -3
- package/dist/config/node/index.mjs +1 -1
- package/dist/config/node/load.d.mts +2 -3
- package/dist/config/node/load.mjs +1 -1
- package/dist/config/read-geospec-config.d.mts +10 -6
- package/dist/config/read-geospec-config.mjs +1 -1
- package/dist/config/types.d.mts +6 -7
- package/dist/create-geospec.d.mts +7 -6
- package/dist/engine/client.d.mts +15 -15
- package/dist/engine/client.mjs +1 -1
- package/dist/engine/matchers.d.mts +10 -11
- package/dist/engine/pmi.types.d.mts +11 -12
- package/dist/engine/protocol.d.mts +7 -8
- package/dist/engine/protocol.mjs +1 -1
- package/dist/geometry-unit.d.mts +2 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mesh/index.d.mts +2 -2
- package/dist/mesh/types.d.mts +8 -505
- package/dist/model/errors.d.mts +2 -3
- package/dist/model/load-model.d.mts +3 -4
- package/dist/model/mesh-evidence-matchers.d.mts +2 -3
- package/dist/model/native-model-loader.d.mts +14 -17
- package/dist/model/native-model-loader.mjs +1 -1
- package/dist/model/node/command-exporter.d.mts +3 -4
- package/dist/model/node/command-exporter.mjs +1 -1
- package/dist/model/node/index.mjs +1 -1
- package/dist/model/region-scope.d.mts +3 -6
- package/dist/model/region-scope.mjs +1 -1
- package/dist/model/subject.d.mts +2 -5
- package/dist/model/subject.mjs +1 -1
- package/dist/model/types.d.mts +19 -20
- package/dist/runner/collector.d.mts +7 -8
- package/dist/runner/collector.mjs +3 -1
- package/dist/runner/discovery.d.mts +10 -11
- package/dist/runner/discovery.mjs +5 -1
- package/dist/runner/filter.d.mts +6 -7
- package/dist/runner/filter.mjs +3 -1
- package/dist/runner/index.d.mts +3 -1
- package/dist/runner/index.mjs +1 -1
- package/dist/runner/native/native-pool-grants.d.mts +2 -3
- package/dist/runner/native/native-serial-runner.d.mts +4 -7
- package/dist/runner/native/native-serial-runner.mjs +1 -1
- package/dist/runner/node/engine.d.mts +5 -6
- package/dist/runner/node/index.mjs +1 -1
- package/dist/runner/node/node-vm-filesystem.d.mts +4 -5
- package/dist/runner/node/node-vm-filesystem.mjs +1 -1
- package/dist/runner/node/pool-runner.d.mts +15 -6
- package/dist/runner/node/pool-runner.mjs +1 -1
- package/dist/runner/node/pool-worker-entry.d.mts +9 -6
- package/dist/runner/node/pool-worker-entry.mjs +1 -1
- package/dist/runner/pool/events.mjs +1 -1
- package/dist/runner/pool/pool-messages.d.mts +8 -9
- package/dist/runner/pool/pool.d.mts +4 -6
- package/dist/runner/pool/pool.mjs +1 -1
- package/dist/runner/pool/shard-timings.d.mts +3 -4
- package/dist/runner/pool/worker-host.d.mts +6 -5
- package/dist/runner/pool/worker-host.mjs +1 -1
- package/dist/runner/run-geospec-module.d.mts +2 -3
- package/dist/runner/run-geospec-module.mjs +2 -2
- package/dist/runner/timeout-codes.d.mts +6 -8
- package/dist/runner/types.d.mts +56 -53
- package/dist/runner/worker/no-matching-tests-issue.d.mts +3 -4
- package/dist/runner/worker/runner-types.d.mts +17 -16
- package/dist/runner/worker/serial-runner.mjs +1 -1
- package/dist/selector/types.d.mts +22 -23
- package/dist/step/types.d.mts +4 -119
- package/dist/support/filesystem-errors.mjs +1 -0
- package/dist/support/hash.mjs +1 -0
- package/dist/support/path.mjs +1 -0
- package/dist/support/sha256.mjs +1 -0
- package/dist/support/types.d.mts +38 -0
- package/dist/vitest/adapter.d.mts +5 -6
- package/dist/vitest/adapter.mjs +1 -1
- package/dist/vitest/index.d.mts +0 -1
- package/dist/vitest/index.mjs +1 -1
- package/dist/vitest/node/index.d.mts +2 -0
- package/dist/vitest/node/index.mjs +1 -0
- package/dist/vitest/node/setup-project.d.mts +60 -0
- package/dist/vitest/node/setup-project.mjs +1 -0
- package/dist/vm/plain-module-vm.d.mts +13 -0
- package/dist/vm/plain-module-vm.mjs +8 -0
- package/dist/vm/types.d.mts +142 -0
- package/package.json +17 -9
- package/agent/geospec-authoring/api-types-2.md +0 -85
|
@@ -15,6 +15,5 @@ import { LoadGeoSpecConfigOptions, LoadedGeoSpecConfig } from "../types.mjs";
|
|
|
15
15
|
* @param options - Project, optional explicit config and defined option overrides.
|
|
16
16
|
* @returns Real config path when present and validated data without runner defaults.
|
|
17
17
|
*/
|
|
18
|
-
declare const loadGeoSpecConfig: (options: LoadGeoSpecConfigOptions) => Promise<LoadedGeoSpecConfig>;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { loadGeoSpecConfig };
|
|
18
|
+
export declare const loadGeoSpecConfig: (options: LoadGeoSpecConfigOptions) => Promise<LoadedGeoSpecConfig>;
|
|
19
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveGeoSpecConfig as e}from"../validate.mjs";import{registerHooks as t}from"node:module";import{
|
|
1
|
+
import{resolveGeoSpecConfig as e}from"../validate.mjs";import{registerHooks as t}from"node:module";import{extname as n,isAbsolute as r,relative as i,resolve as a,sep as o}from"node:path";import{realpath as s,stat as c}from"node:fs/promises";import{pathToFileURL as l}from"node:url";const u=[`.js`,`.mjs`,`.ts`,`.mts`],d=async e=>{try{return(await c(e)).isFile()}catch(e){if(typeof e==`object`&&e&&`code`in e&&e.code===`ENOENT`)return!1;throw e}},f=`geospec/config`,p=async e=>{let n=import.meta.resolve(f),r=t({resolve(e,t,r){try{return r(e,t)}catch(t){if(e===f&&typeof t==`object`&&t&&`code`in t&&t.code===`ERR_MODULE_NOT_FOUND`)return{url:n,shortCircuit:!0};throw t}}});try{return(await import(l(e).href)).default}finally{r.deregister()}},m=async t=>{let l=await s(t.projectPath),f=t.configPath;if(f===void 0){let e=u.map(e=>`geospec.config${e}`),t=(await Promise.all(e.map(async e=>await d(a(l,e))?e:void 0))).filter(e=>e!==void 0);if(t.length>1)throw TypeError(`Multiple GeoSpec configs found: ${t.join(`, `)}. Select configPath explicitly.`);[f]=t}if(f===void 0)return{options:e({},t.overrides)};let m=n(f);if(!u.some(e=>e===m))throw TypeError(`GeoSpec configPath must select a .js, .mjs, .ts or .mts file.`);let h=await s(a(l,f)),g=i(l,h);if(r(g)||g===`..`||g.startsWith(`..${o}`))throw TypeError(`GeoSpec configPath must resolve within projectPath.`);if(!(await c(h)).isFile())throw TypeError(`GeoSpec configPath must select a file.`);return{configPath:h,options:e(await p(h),t.overrides)}};export{m as loadGeoSpecConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CreateModuleVm, VmFileSystem } from "../vm/types.mjs";
|
|
1
2
|
import { GeoSpecConfigData } from "./types.mjs";
|
|
2
|
-
import { VmFileSystem } from "@taucad/esbuild/vm";
|
|
3
3
|
//#region src/config/read-geospec-config.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Outcome of {@link readGeoSpecConfig}. A config the host cannot apply is an expected case with
|
|
@@ -7,7 +7,7 @@ import { VmFileSystem } from "@taucad/esbuild/vm";
|
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
type ReadGeoSpecConfigResult = {
|
|
10
|
+
export type ReadGeoSpecConfigResult = {
|
|
11
11
|
readonly status: 'absent';
|
|
12
12
|
} | {
|
|
13
13
|
readonly status: 'applied';
|
|
@@ -24,11 +24,16 @@ type ReadGeoSpecConfigResult = {
|
|
|
24
24
|
readonly message: string;
|
|
25
25
|
};
|
|
26
26
|
/** Options for {@link readGeoSpecConfig}. @public */
|
|
27
|
-
type ReadGeoSpecConfigOptions = {
|
|
27
|
+
export type ReadGeoSpecConfigOptions = {
|
|
28
28
|
/** The project filesystem; paths are rooted, as the spec VM reads them. */
|
|
29
29
|
readonly filesystem: VmFileSystem;
|
|
30
30
|
/** Rooted directory holding the config, in the filesystem's spelling: `''` for its root, else `'sub/dir'`. */
|
|
31
31
|
readonly projectPath: string;
|
|
32
|
+
/**
|
|
33
|
+
* Module VM factory; defaults to GeoSpec's plain VM (native esbuild on Node, refused elsewhere). A host that bundles
|
|
34
|
+
* in a browser injects its own; Tau injects `createEsbuildModuleVm`.
|
|
35
|
+
*/
|
|
36
|
+
readonly createModuleVm?: CreateModuleVm;
|
|
32
37
|
};
|
|
33
38
|
/**
|
|
34
39
|
* Read a project's `geospec.config.*` data fields through the spec VM, the same way on every host.
|
|
@@ -42,6 +47,5 @@ type ReadGeoSpecConfigOptions = {
|
|
|
42
47
|
* @param options - The project filesystem and the rooted project directory.
|
|
43
48
|
* @returns `absent`, `applied` with the data fields, or `not-applied` with the reason.
|
|
44
49
|
*/
|
|
45
|
-
declare const readGeoSpecConfig: (options: ReadGeoSpecConfigOptions) => Promise<ReadGeoSpecConfigResult>;
|
|
46
|
-
//#endregion
|
|
47
|
-
export { ReadGeoSpecConfigOptions, ReadGeoSpecConfigResult, readGeoSpecConfig };
|
|
50
|
+
export declare const readGeoSpecConfig: (options: ReadGeoSpecConfigOptions) => Promise<ReadGeoSpecConfigResult>;
|
|
51
|
+
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{resolveGeoSpecConfig as e}from"./validate.mjs";import{defineConfigBuiltinCode as t}from"./define-config.mjs";import{
|
|
1
|
+
import{resolveGeoSpecConfig as e}from"./validate.mjs";import{defineConfigBuiltinCode as t}from"./define-config.mjs";import{createPlainModuleVm as n}from"../vm/plain-module-vm.mjs";const r=[`geospec.config.ts`,`geospec.config.mts`,`geospec.config.js`,`geospec.config.mjs`],i=async i=>{let{filesystem:a}=i,o=i.projectPath===``?``:`${i.projectPath.replace(/\/+$/u,``)}/`,s=(await Promise.all(r.map(async e=>await a.exists(`${o}${e}`)?`${o}${e}`:void 0))).filter(e=>e!==void 0),[c]=s;if(c===void 0)return{status:`absent`};let l=(e,t)=>({status:`not-applied`,configPath:c,reason:e,message:t});if(s.length>1)return l(`invalid`,`Multiple GeoSpec configs found: ${s.join(`, `)}. Keep one.`);let u=await(i.createModuleVm??n)({filesystem:a});try{u.registerModule(`geospec/config`,{version:`0.0.0`,code:t});let n;try{({detectedModules:n}=await u.detectImports(c))}catch(e){return l(`invalid`,e instanceof Error?e.message:String(e))}let r=n.filter(e=>e!==`geospec/config`);if(r.length>0)return l(`unresolved-import`,`The GeoSpec config imports ${r.map(e=>`'${e}'`).join(`, `)}, which this host does not provide; only a native run applies it.`);let i=await u.bundle(c);if(!i.success)return l(`invalid`,i.issues.map(({message:e})=>e).join(`
|
|
2
2
|
`));let a=await u.execute(i.code);if(!a.success)return l(`invalid`,a.issues.map(({message:e})=>e).join(`
|
|
3
3
|
`));let{exporters:o,...s}=e(a.value.default);return{status:`applied`,configPath:c,options:s}}catch(e){if(e instanceof TypeError)return l(`invalid`,e.message);throw e}finally{u.dispose()}};export{i as readGeoSpecConfig};
|
package/dist/config/types.d.mts
CHANGED
|
@@ -5,12 +5,12 @@ import { GeoSpecModelExporter } from "../model/types.mjs";
|
|
|
5
5
|
*
|
|
6
6
|
* Omitted values keep their existing owner's defaults. Defined overrides
|
|
7
7
|
* replace whole fields, including empty arrays and false.
|
|
8
|
-
* Existing discovery
|
|
8
|
+
* Existing discovery treats an absent or empty include array as its
|
|
9
9
|
* default pattern. Preserving [] here does not change that consumer behavior.
|
|
10
10
|
* This is configuration data, not a canonical engine plan or a geometry result.
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
type GeoSpecConfig = {
|
|
13
|
+
export type GeoSpecConfig = {
|
|
14
14
|
include?: readonly string[];
|
|
15
15
|
exclude?: readonly string[];
|
|
16
16
|
testNamePattern?: string;
|
|
@@ -25,9 +25,9 @@ type GeoSpecConfig = {
|
|
|
25
25
|
exporters?: readonly GeoSpecModelExporter[];
|
|
26
26
|
};
|
|
27
27
|
/** The config's data fields: everything a host that holds its own exporters reads. @public */
|
|
28
|
-
type GeoSpecConfigData = Omit<GeoSpecConfig, 'exporters'>;
|
|
28
|
+
export type GeoSpecConfigData = Omit<GeoSpecConfig, 'exporters'>;
|
|
29
29
|
/** Options for one trusted Node configuration load. @public */
|
|
30
|
-
type LoadGeoSpecConfigOptions = {
|
|
30
|
+
export type LoadGeoSpecConfigOptions = {
|
|
31
31
|
readonly projectPath: string;
|
|
32
32
|
/** Explicit file, resolved relative to the project unless absolute. */
|
|
33
33
|
readonly configPath?: string;
|
|
@@ -35,9 +35,8 @@ type LoadGeoSpecConfigOptions = {
|
|
|
35
35
|
readonly overrides?: GeoSpecConfig;
|
|
36
36
|
};
|
|
37
37
|
/** Resolved file identity and validated configuration data. @public */
|
|
38
|
-
type LoadedGeoSpecConfig = {
|
|
38
|
+
export type LoadedGeoSpecConfig = {
|
|
39
39
|
readonly configPath?: string;
|
|
40
40
|
readonly options: GeoSpecConfig;
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
|
-
export { GeoSpecConfig, GeoSpecConfigData, LoadGeoSpecConfigOptions, LoadedGeoSpecConfig };
|
|
42
|
+
//#endregion
|
|
@@ -15,19 +15,20 @@ type TestFunction = {
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
declare const describe: SuiteFunction;
|
|
18
|
+
export declare const describe: SuiteFunction;
|
|
19
19
|
/**
|
|
20
20
|
* GeoSpec test helper used inside VM-executed test modules.
|
|
21
21
|
*
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
declare const it: TestFunction;
|
|
24
|
+
export declare const it: TestFunction;
|
|
25
25
|
/**
|
|
26
26
|
* Alias for {@link it}.
|
|
27
27
|
*
|
|
28
|
+
* @alias
|
|
28
29
|
* @public
|
|
29
30
|
*/
|
|
30
|
-
declare const test: TestFunction;
|
|
31
|
+
export declare const test: TestFunction;
|
|
31
32
|
/**
|
|
32
33
|
* Start a geometry assertion chain.
|
|
33
34
|
*
|
|
@@ -36,7 +37,7 @@ declare const test: TestFunction;
|
|
|
36
37
|
* @returns GeoSpec geometry matchers.
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
39
|
-
declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
|
|
40
|
+
export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
|
|
40
41
|
/**
|
|
41
42
|
* Every matcher name exposed by {@link expectGeo}, derived from the live
|
|
42
43
|
* matcher surface so it can never drift from the real implementation. Use it to
|
|
@@ -45,6 +46,6 @@ declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptio
|
|
|
45
46
|
*
|
|
46
47
|
* @public
|
|
47
48
|
*/
|
|
48
|
-
declare const geoSpecMatcherNames: readonly string[];
|
|
49
|
+
export declare const geoSpecMatcherNames: readonly string[];
|
|
49
50
|
//#endregion
|
|
50
|
-
export {
|
|
51
|
+
export {};
|
package/dist/engine/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { JSONValue } from "../support/types.mjs";
|
|
1
2
|
import { GeoSpecFixedMatcherName } from "./matchers.mjs";
|
|
2
|
-
import { JSONValue } from "@taucad/runtime/types";
|
|
3
3
|
//#region src/engine/client.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Default largest work-unit budget a spec may author through `loadModel` or `expectGeo` options:
|
|
@@ -8,7 +8,7 @@ import { JSONValue } from "@taucad/runtime/types";
|
|
|
8
8
|
* host's own `workUnitLimit` keeps the full safe-integer range.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
declare const geoSpecMaximumWorkUnitLimit = 512000000;
|
|
11
|
+
export declare const geoSpecMaximumWorkUnitLimit = 512000000;
|
|
12
12
|
/**
|
|
13
13
|
* Resolve a host's largest authored work-unit budget.
|
|
14
14
|
*
|
|
@@ -17,33 +17,33 @@ declare const geoSpecMaximumWorkUnitLimit = 512000000;
|
|
|
17
17
|
* @throws TypeError when the configured maximum is not a positive safe integer.
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
declare const resolveGeoSpecMaximumWorkUnitLimit: (maximum?: number) => number;
|
|
20
|
+
export declare const resolveGeoSpecMaximumWorkUnitLimit: (maximum?: number) => number;
|
|
21
21
|
/**
|
|
22
22
|
* Exact core bytes of one claim evaluated in one engine call: the canonical plan, its one
|
|
23
23
|
* canonical claim and the canonical result, as fresh bytes the client retains without copying.
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
type GeoSpecNativeClaimEvaluation = {
|
|
26
|
+
export type GeoSpecNativeClaimEvaluation = {
|
|
27
27
|
readonly canonicalClaim: Uint8Array<ArrayBuffer>;
|
|
28
28
|
readonly canonicalPlan: Uint8Array<ArrayBuffer>;
|
|
29
29
|
readonly canonicalResult: Uint8Array<ArrayBuffer>;
|
|
30
30
|
};
|
|
31
31
|
/** Byte-only engine surface consumed by the runner-independent assertion client. @public */
|
|
32
|
-
type GeoSpecNativeEngine = {
|
|
32
|
+
export type GeoSpecNativeEngine = {
|
|
33
33
|
evaluateClaim(request: Uint8Array<ArrayBuffer>): GeoSpecNativeClaimEvaluation;
|
|
34
34
|
processRequest(request: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
35
35
|
};
|
|
36
36
|
/** Content-addressed subject accepted by a protocol-3 assertion plan. @public */
|
|
37
|
-
type GeoSpecNativeSubject = {
|
|
37
|
+
export type GeoSpecNativeSubject = {
|
|
38
38
|
readonly contentHash?: string;
|
|
39
39
|
readonly subjectHash?: string;
|
|
40
40
|
};
|
|
41
41
|
/** Polarity evaluated exactly once by the native core. @public */
|
|
42
|
-
type GeoSpecClaimPolarity = 'negative' | 'positive';
|
|
42
|
+
export type GeoSpecClaimPolarity = 'negative' | 'positive';
|
|
43
43
|
/** Canonical claim status returned by the native core. @public */
|
|
44
|
-
type GeoSpecCanonicalClaimStatus = 'cancelled' | 'engine-error' | 'failed' | 'invalid' | 'passed' | 'refused' | 'unsupported' | (string & {});
|
|
44
|
+
export type GeoSpecCanonicalClaimStatus = 'cancelled' | 'engine-error' | 'failed' | 'invalid' | 'passed' | 'refused' | 'unsupported' | (string & {});
|
|
45
45
|
/** Full native assertion result with the exact core-owned bytes retained. @public */
|
|
46
|
-
type GeoSpecCanonicalClaimReport = {
|
|
46
|
+
export type GeoSpecCanonicalClaimReport = {
|
|
47
47
|
readonly canonicalClaim: Uint8Array<ArrayBuffer>;
|
|
48
48
|
readonly canonicalPlan: Uint8Array<ArrayBuffer>;
|
|
49
49
|
readonly canonicalResult: Uint8Array<ArrayBuffer>;
|
|
@@ -64,7 +64,7 @@ type GeoSpecCanonicalClaimReport = {
|
|
|
64
64
|
* undeclared duplicate faces, and all but the first matching circular hole.
|
|
65
65
|
* @public
|
|
66
66
|
*/
|
|
67
|
-
type GeoSpecNativeEvidenceProfile = 'bounded' | 'complete';
|
|
67
|
+
export type GeoSpecNativeEvidenceProfile = 'bounded' | 'complete';
|
|
68
68
|
type GeoSpecNativeClaimContext = {
|
|
69
69
|
readonly claimId: string;
|
|
70
70
|
readonly engine: GeoSpecNativeEngine;
|
|
@@ -77,7 +77,7 @@ type GeoSpecNativeClaimContext = {
|
|
|
77
77
|
readonly maximumWorkUnitLimit?: number;
|
|
78
78
|
};
|
|
79
79
|
/** One authored matcher call lowered and evaluated by Rust in one engine call. @public */
|
|
80
|
-
type GeoSpecNativeClaimOptions = GeoSpecNativeClaimContext & ({
|
|
80
|
+
export type GeoSpecNativeClaimOptions = GeoSpecNativeClaimContext & ({
|
|
81
81
|
readonly arguments: readonly unknown[];
|
|
82
82
|
readonly capability: GeoSpecFixedMatcherName;
|
|
83
83
|
} | {
|
|
@@ -87,14 +87,14 @@ type GeoSpecNativeClaimOptions = GeoSpecNativeClaimContext & ({
|
|
|
87
87
|
});
|
|
88
88
|
declare const geoSpecQueryCapabilities: readonly ["analyzeMesh", "analyzeBrep", "inspectGeometry", "analyzeMeshOverlap", "queryPmi", "minimumDistance"];
|
|
89
89
|
/** Existing positive-only ancillary operations owned by the native core. @public */
|
|
90
|
-
type GeoSpecQueryCapability = Exclude<(typeof geoSpecQueryCapabilities)[number], 'minimumDistance'>;
|
|
90
|
+
export type GeoSpecQueryCapability = Exclude<(typeof geoSpecQueryCapabilities)[number], 'minimumDistance'>;
|
|
91
91
|
/**
|
|
92
92
|
* Flat native query transport options. Payloads use the existing authoring
|
|
93
93
|
* serializer, including ordinary RegExp values; omitted payloads encode null.
|
|
94
94
|
* The core validates selectors, pairs and all operation-specific constraints.
|
|
95
95
|
* @public
|
|
96
96
|
*/
|
|
97
|
-
type GeoSpecNativeQueryOptions = Omit<GeoSpecNativeClaimOptions, 'arguments' | 'capability' | 'kind' | 'polarity'> & {
|
|
97
|
+
export type GeoSpecNativeQueryOptions = Omit<GeoSpecNativeClaimOptions, 'arguments' | 'capability' | 'kind' | 'polarity'> & {
|
|
98
98
|
readonly capability: GeoSpecQueryCapability | 'minimumDistance';
|
|
99
99
|
readonly payload?: unknown;
|
|
100
100
|
};
|
|
@@ -110,6 +110,6 @@ type GeoSpecNativeQueryOptions = Omit<GeoSpecNativeClaimOptions, 'arguments' | '
|
|
|
110
110
|
* @returns The complete report with exact canonical claim, plan and result bytes.
|
|
111
111
|
* @public
|
|
112
112
|
*/
|
|
113
|
-
declare const evaluateGeoSpecNativeQuery: (options: GeoSpecNativeQueryOptions) => GeoSpecCanonicalClaimReport;
|
|
113
|
+
export declare const evaluateGeoSpecNativeQuery: (options: GeoSpecNativeQueryOptions) => GeoSpecCanonicalClaimReport;
|
|
114
114
|
//#endregion
|
|
115
|
-
export {
|
|
115
|
+
export {};
|
package/dist/engine/client.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{assertGeoSpecJsonValue as e,toGeoSpecProtocolJson as t}from"./protocol.mjs";import{geoSpecMatcherDescriptors as n}from"./matchers.mjs";const r=`geospec-jcs-v1`,i=512e6,a=e=>{if(e===void 0)return i;if(!Number.isSafeInteger(e)||e<=0)throw TypeError(`GeoSpec maximumWorkUnitLimit must be a positive safe integer; received ${String(e)}.`);return e},o=[`analyzeMesh`,`analyzeBrep`,`inspectGeometry`,`analyzeMeshOverlap`,`queryPmi`,`minimumDistance`],s=t=>{let n=JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(t));return e(n),n},c=new TextEncoder().encode(`{"canonicalProfile":"geospec-jcs-v1","method":"initialize","protocolVersion":3,"registryVersion":5,"requestId":"configuration"}`),l
|
|
1
|
+
import{assertGeoSpecJsonValue as e,toGeoSpecProtocolJson as t}from"./protocol.mjs";import{geoSpecMatcherDescriptors as n}from"./matchers.mjs";const r=`geospec-jcs-v1`,i=512e6,a=e=>{if(e===void 0)return i;if(!Number.isSafeInteger(e)||e<=0)throw TypeError(`GeoSpec maximumWorkUnitLimit must be a positive safe integer; received ${String(e)}.`);return e},o=[`analyzeMesh`,`analyzeBrep`,`inspectGeometry`,`analyzeMeshOverlap`,`queryPmi`,`minimumDistance`],s=t=>{let n=JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(t));return e(n),n},c=new TextEncoder().encode(`{"canonicalProfile":"geospec-jcs-v1","method":"initialize","protocolVersion":3,"registryVersion":5,"requestId":"configuration"}`),l=/* @__PURE__ */ new WeakMap,u=/* @__PURE__ */ new WeakMap,d=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`GeoSpec engine returned a malformed ${t}.`);return e},f=(e,t)=>{let{contentHash:n,subjectHash:r}=e;if(n===void 0==(r===void 0))throw TypeError(`A native GeoSpec subject requires exactly one of contentHash or subjectHash.`);let i=n??r;if(!/^[0-9a-f]{64}$/u.test(i))throw TypeError(`A native GeoSpec subject hash must contain 64 lowercase hexadecimal characters.`);return n===void 0?{slot:t,subjectHash:i}:{slot:t,contentHash:i}},p=e=>{if(!Number.isSafeInteger(e)||e<=0||e>9007199254740991)throw TypeError(`GeoSpec workUnitLimit must be a positive exact safe integer.`)},m=e=>{if(e.claimId.length===0||e.subjectSlot.length===0)throw TypeError(`GeoSpec claim IDs and subject slots must be non-empty strings.`);p(e.workUnitLimit)},h=(e,t,n=i)=>e===void 0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0&&e<=n?void 0:`GeoSpec ${t} must be a positive integer no greater than this host's maximum of ${n} (the host can raise it with maximumWorkUnitLimit); received ${typeof e==`number`?String(e):typeof e}.`,g=(e,t,n)=>{let r=h(e,t,n);if(r!==void 0)throw TypeError(r)},_=(e,t)=>{if(t!==void 0)return p(t),t;let n=l.get(e);if(n!==void 0)return n;let i=d(s(Uint8Array.from(e.processRequest(Uint8Array.from(c)))),`initialize response envelope`);if(i.requestId!==`configuration`)throw TypeError(`GeoSpec engine returned an initialize response with the wrong requestId.`);let a=d(i.result,`initialize result`);if(a.canonicalProfile!==r||a.protocolVersion!==3||a.registryVersion!==5)throw TypeError(`GeoSpec engine returned an initialize response for an incompatible protocol profile.`);let o=d(a.configuration,`initialize configuration`),{capabilities:f}=a,m=Array.isArray(f)?f.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.name===`minimumDistance`):[];u.set(e,m.length===1&&m.every(e=>e.profile===`geospec-minimum-distance-v1`&&e.implementation===`implemented`&&e.registryVersion===5));let{configurationProfile:h}=o;if(h!==`geospec-entry-config-v1`&&!(typeof h==`string`&&h.startsWith(`geospec-host-config-v1-`)))throw TypeError(`GeoSpec engine returned an unsupported configuration profile.`);let g=o.defaultWorkUnitBudget;if(typeof g!=`number`)throw TypeError(`GeoSpec engine initialize configuration omitted defaultWorkUnitBudget.`);return p(g),l.set(e,g),g},v=e=>(_(e),u.get(e)===!0),y=e=>{if(e.capability===`toSatisfyRationalPlate`||e.capability===`toSatisfyParallelPlaneDistance`){if(e.arguments.length>0)throw TypeError(`GeoSpec matcher ${e.capability} does not accept arguments.`);return w({...e,payload:{contract:n[e.capability].contract}})}if(!(`kind`in e))throw TypeError(`This GeoSpec matcher requires its canonical kind.`);return w({...e,payload:{kind:e.kind,arguments:e.arguments.map(e=>t(e))}})},b=e=>{if(!o.includes(e.capability))throw TypeError(`GeoSpec query capability must name an ancillary operation.`);return w({...e,payload:t(e.payload),polarity:`positive`})},x=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,S=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.code===`MATCHER_TIMEOUT`,C=(e,t,n)=>{if(!S(e))return e;let{details:r}=e,i=typeof r==`object`&&r&&!Array.isArray(r)?r:{},a=x(i.budget)??x(i.workUnitBudget)??t,o=x(i.unitsUsed)??x(i.requiredWorkUnits);return{...e,details:{...i,limit:a,...o===void 0?{}:{used:o},maximumLimit:n}}},w=e=>{m(e);let t={method:`submitClaims`,requestId:e.claimId,protocolVersion:3,registryVersion:5,canonicalProfile:r,plan:{subjects:[f(e.subject,e.subjectSlot)],claims:[{claimId:e.claimId,capability:e.capability,subjectSlots:[e.subjectSlot],payload:e.payload,polarity:e.polarity,workUnitBudget:e.workUnitLimit}],...e.evidenceProfile===void 0?{}:{evidenceProfile:e.evidenceProfile}}},{canonicalClaim:n,canonicalPlan:i,canonicalResult:a}=e.engine.evaluateClaim(new TextEncoder().encode(JSON.stringify(t))),o=d(s(n),`canonical claim`);if(o.claimId!==e.claimId)throw TypeError(`GeoSpec engine returned a malformed canonical claim for '${e.claimId}'.`);let{results:c}=d(s(a),`canonical result envelope`);if(!Array.isArray(c)||c.length!==1)throw TypeError(`GeoSpec engine returned a canonical result envelope without exactly one result.`);let[l]=c,u=d(l,`canonical claim result`),{claimId:p,diagnostics:h,status:g}=u;if(p!==e.claimId||typeof g!=`string`||!Array.isArray(h))throw TypeError(`GeoSpec engine returned a malformed result for claim '${e.claimId}'.`);return{canonicalClaim:n,canonicalPlan:i,canonicalResult:a,claim:o,claimId:p,diagnostics:h.some(e=>S(e))?h.map(t=>C(t,e.workUnitLimit,e.maximumWorkUnitLimit??512e6)):h,...u.evidence===void 0?{}:{evidence:u.evidence},polarity:e.polarity,result:u,status:g}};export{g as assertGeoSpecAuthoredWorkUnitLimit,y as evaluateGeoSpecNativeClaim,b as evaluateGeoSpecNativeQuery,h as geoSpecAuthoredWorkUnitLimitProblem,i as geoSpecMaximumWorkUnitLimit,a as resolveGeoSpecMaximumWorkUnitLimit,_ as resolveGeoSpecNativeWorkUnitLimit,v as supportsGeoSpecNativeMinimumDistance};
|
|
@@ -5,7 +5,7 @@ import { GeoSpecAssertion, GeoSpecMatcher } from "../runner/types.mjs";
|
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
type GeoSpecMatcherName = Exclude<keyof GeoSpecMatcher, 'not'>;
|
|
8
|
+
export type GeoSpecMatcherName = Exclude<keyof GeoSpecMatcher, 'not'>;
|
|
9
9
|
/**
|
|
10
10
|
* How the substrate derives an assertion's recorded `expected` value from the
|
|
11
11
|
* arguments the spec author passed. Data, not code, so the registry stays
|
|
@@ -19,22 +19,22 @@ type GeoSpecMatcherName = Exclude<keyof GeoSpecMatcher, 'not'>;
|
|
|
19
19
|
*
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
|
-
type GeoSpecMatcherExpectedShape = 'first' | 'first-or-empty' | 'bounds' | 'true';
|
|
22
|
+
export type GeoSpecMatcherExpectedShape = 'first' | 'first-or-empty' | 'bounds' | 'true';
|
|
23
23
|
/**
|
|
24
24
|
* Whether a matcher settles synchronously (throwing its
|
|
25
25
|
* `GeoSpecAssertionError` inside the `it()` body) or asynchronously (settled
|
|
26
26
|
* before the test completes). Part of the contract: it decides whether the
|
|
27
|
-
* deterministic work-unit budget
|
|
27
|
+
* deterministic work-unit budget brackets the evaluation.
|
|
28
28
|
*
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
|
-
type GeoSpecMatcherMode = 'sync' | 'async';
|
|
31
|
+
export type GeoSpecMatcherMode = 'sync' | 'async';
|
|
32
32
|
/**
|
|
33
33
|
* One matcher's contract entry.
|
|
34
34
|
*
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
|
-
type GeoSpecMatcherDescriptor = {
|
|
37
|
+
export type GeoSpecMatcherDescriptor = {
|
|
38
38
|
readonly kind: GeoSpecAssertion['kind'];
|
|
39
39
|
readonly expected: GeoSpecMatcherExpectedShape;
|
|
40
40
|
readonly mode: GeoSpecMatcherMode;
|
|
@@ -46,17 +46,17 @@ type GeoSpecMatcherDescriptor = {
|
|
|
46
46
|
*
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
declare const geoSpecMatcherDescriptors: Readonly<{ [Name in GeoSpecMatcherName]: Name extends GeoSpecFixedMatcherName ? GeoSpecFixedMatcherDescriptor & {
|
|
49
|
+
export declare const geoSpecMatcherDescriptors: Readonly<{ [Name in GeoSpecMatcherName]: Name extends GeoSpecFixedMatcherName ? GeoSpecFixedMatcherDescriptor & {
|
|
50
50
|
readonly kind: Name;
|
|
51
51
|
} : GeoSpecMatcherDescriptor; }>;
|
|
52
52
|
/** A canonical fixed-contract matcher. @public */
|
|
53
|
-
type GeoSpecFixedMatcherDescriptor = {
|
|
53
|
+
export type GeoSpecFixedMatcherDescriptor = {
|
|
54
54
|
readonly contract: 'geospec.plate-two-windows/v1' | 'geospec.pmi.parallel-plane-distance/v1';
|
|
55
55
|
readonly expected: 'true';
|
|
56
56
|
readonly mode: 'sync';
|
|
57
57
|
};
|
|
58
58
|
/** Every canonical fixed-contract matcher name. @public */
|
|
59
|
-
type GeoSpecFixedMatcherName = 'toSatisfyRationalPlate' | 'toSatisfyParallelPlaneDistance';
|
|
59
|
+
export type GeoSpecFixedMatcherName = 'toSatisfyRationalPlate' | 'toSatisfyParallelPlaneDistance';
|
|
60
60
|
/**
|
|
61
61
|
* Derive the `expected` value an assertion records from the call arguments.
|
|
62
62
|
*
|
|
@@ -65,6 +65,5 @@ type GeoSpecFixedMatcherName = 'toSatisfyRationalPlate' | 'toSatisfyParallelPlan
|
|
|
65
65
|
* @returns The value recorded as the assertion's `expected`.
|
|
66
66
|
* @public
|
|
67
67
|
*/
|
|
68
|
-
declare const normalizeGeoSpecExpected: (shape: GeoSpecMatcherExpectedShape, callArguments: readonly unknown[]) => unknown;
|
|
69
|
-
//#endregion
|
|
70
|
-
export { GeoSpecFixedMatcherDescriptor, GeoSpecFixedMatcherName, GeoSpecMatcherDescriptor, GeoSpecMatcherExpectedShape, GeoSpecMatcherMode, GeoSpecMatcherName, geoSpecMatcherDescriptors, normalizeGeoSpecExpected };
|
|
68
|
+
export declare const normalizeGeoSpecExpected: (shape: GeoSpecMatcherExpectedShape, callArguments: readonly unknown[]) => unknown;
|
|
69
|
+
//#endregion
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
//#region src/engine/pmi.types.d.ts
|
|
2
2
|
/** Explicit support state for one source-attributed inventory field. @public */
|
|
3
|
-
type GeoSpecPmiField<Value> = {
|
|
3
|
+
export type GeoSpecPmiField<Value> = {
|
|
4
4
|
readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
|
|
5
5
|
readonly value: Value | null;
|
|
6
6
|
readonly reason: string | null;
|
|
7
7
|
};
|
|
8
8
|
/** Original Part21 entity ID and exact source argument tokens. @public */
|
|
9
|
-
type GeoSpecPmiRawEntity = {
|
|
9
|
+
export type GeoSpecPmiRawEntity = {
|
|
10
10
|
readonly sourceId: number;
|
|
11
11
|
readonly kind: string;
|
|
12
12
|
readonly arguments: readonly string[];
|
|
13
13
|
};
|
|
14
14
|
/** Source-authored scalar and Rust-normalized reduced rational millimetres. @public */
|
|
15
|
-
type GeoSpecPmiNumber = {
|
|
15
|
+
export type GeoSpecPmiNumber = {
|
|
16
16
|
readonly sourceId: number;
|
|
17
17
|
readonly authoredText: string;
|
|
18
18
|
readonly unitId: number;
|
|
@@ -21,14 +21,14 @@ type GeoSpecPmiNumber = {
|
|
|
21
21
|
readonly name: string;
|
|
22
22
|
};
|
|
23
23
|
/** A uniquely forward-transferred face; null occurrence denotes the whole part. @public */
|
|
24
|
-
type GeoSpecPmiFaceAssociation = {
|
|
24
|
+
export type GeoSpecPmiFaceAssociation = {
|
|
25
25
|
readonly sourceFaceId: number;
|
|
26
26
|
readonly occurrenceRoute: readonly number[];
|
|
27
27
|
readonly occurrence: number | null;
|
|
28
28
|
readonly publicFaceOrdinal: number;
|
|
29
29
|
};
|
|
30
30
|
/** One ordered role reference, including incomplete source/transfer evidence. @public */
|
|
31
|
-
type GeoSpecPmiShapeReference = {
|
|
31
|
+
export type GeoSpecPmiShapeReference = {
|
|
32
32
|
readonly sourceAspectId: number | null;
|
|
33
33
|
readonly sourceUsageIds: readonly number[];
|
|
34
34
|
readonly sourceItemIds: readonly number[];
|
|
@@ -36,13 +36,13 @@ type GeoSpecPmiShapeReference = {
|
|
|
36
36
|
readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>;
|
|
37
37
|
};
|
|
38
38
|
/** Normalized authored limits; never an inferred geometric conformance verdict. @public */
|
|
39
|
-
type GeoSpecPmiLimits = {
|
|
39
|
+
export type GeoSpecPmiLimits = {
|
|
40
40
|
readonly lowerMillimetres: string;
|
|
41
41
|
readonly upperMillimetres: string;
|
|
42
42
|
readonly basis: 'authored-limits' | 'nominal-plus-minus';
|
|
43
43
|
};
|
|
44
44
|
/** Source record preserving semantic/presentation separation and ordered roles. @public */
|
|
45
|
-
type GeoSpecPmiRecord = {
|
|
45
|
+
export type GeoSpecPmiRecord = {
|
|
46
46
|
readonly sourceId: number;
|
|
47
47
|
readonly family: 'dimension' | 'datum' | 'tolerance' | 'presentation';
|
|
48
48
|
readonly channel: 'semantic' | 'presentation';
|
|
@@ -56,7 +56,7 @@ type GeoSpecPmiRecord = {
|
|
|
56
56
|
readonly raw: readonly GeoSpecPmiRawEntity[];
|
|
57
57
|
};
|
|
58
58
|
/** Positive-only inventory value inside the ordinary canonical query report. @public */
|
|
59
|
-
type GeoSpecPmiInventory = {
|
|
59
|
+
export type GeoSpecPmiInventory = {
|
|
60
60
|
readonly contract: 'geospec.pmi.inventory/v1';
|
|
61
61
|
readonly status: 'semantic' | 'graphical-only' | 'empty';
|
|
62
62
|
readonly fileSchema: string;
|
|
@@ -64,15 +64,14 @@ type GeoSpecPmiInventory = {
|
|
|
64
64
|
readonly records: readonly GeoSpecPmiRecord[];
|
|
65
65
|
};
|
|
66
66
|
/** Strict inventory output limits. Exceeding either refuses without truncation. @public */
|
|
67
|
-
type GeoSpecPmiQueryPayload = {
|
|
67
|
+
export type GeoSpecPmiQueryPayload = {
|
|
68
68
|
readonly maxRecords?: number;
|
|
69
69
|
readonly maxOutputBytes?: number;
|
|
70
70
|
};
|
|
71
71
|
/** Complete inventory value; provenance is the unchanged core identity descriptor. @public */
|
|
72
|
-
type GeoSpecPmiQueryValue = {
|
|
72
|
+
export type GeoSpecPmiQueryValue = {
|
|
73
73
|
readonly inventory: GeoSpecPmiInventory;
|
|
74
74
|
readonly subjectHash: string;
|
|
75
75
|
readonly provenance: Readonly<Record<string, unknown>>;
|
|
76
76
|
};
|
|
77
|
-
//#endregion
|
|
78
|
-
export { GeoSpecPmiFaceAssociation, GeoSpecPmiField, GeoSpecPmiInventory, GeoSpecPmiLimits, GeoSpecPmiNumber, GeoSpecPmiQueryPayload, GeoSpecPmiQueryValue, GeoSpecPmiRawEntity, GeoSpecPmiRecord, GeoSpecPmiShapeReference };
|
|
77
|
+
//#endregion
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { JSONValue } from "
|
|
1
|
+
import { JSONValue } from "../support/types.mjs";
|
|
2
2
|
//#region src/engine/protocol.d.ts
|
|
3
3
|
/** Runtime JSON-value guard used at every protocol trust boundary. @public */
|
|
4
|
-
declare const isGeoSpecJsonValue: (value: unknown, ancestors?: Set<WeakKey>) => value is JSONValue;
|
|
4
|
+
export declare const isGeoSpecJsonValue: (value: unknown, ancestors?: Set<WeakKey>) => value is JSONValue;
|
|
5
5
|
/** Reject a non-wire value rather than letting JSON.stringify erase it. @public */
|
|
6
|
-
declare const assertGeoSpecJsonValue: (value: unknown) => asserts value is JSONValue;
|
|
6
|
+
export declare const assertGeoSpecJsonValue: (value: unknown) => asserts value is JSONValue;
|
|
7
7
|
/** Encode client-owned canonical claim bytes. @public */
|
|
8
|
-
declare const encodeGeoSpecCanonicalJson: (value: JSONValue) => Uint8Array<ArrayBuffer>;
|
|
8
|
+
export declare const encodeGeoSpecCanonicalJson: (value: JSONValue) => Uint8Array<ArrayBuffer>;
|
|
9
9
|
/** Parse and validate canonical bytes without re-canonicalizing them. @public */
|
|
10
|
-
declare const decodeGeoSpecCanonicalJson: (bytes: Uint8Array<ArrayBuffer>) => JSONValue;
|
|
10
|
+
export declare const decodeGeoSpecCanonicalJson: (bytes: Uint8Array<ArrayBuffer>) => JSONValue;
|
|
11
11
|
/**
|
|
12
12
|
* Convert an authoring value to protocol JSON, including the two explicit
|
|
13
13
|
* bindings the TypeScript client needs: regex data and opaque subject refs.
|
|
@@ -15,6 +15,5 @@ declare const decodeGeoSpecCanonicalJson: (bytes: Uint8Array<ArrayBuffer>) => JS
|
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
declare const toGeoSpecProtocolJson: (value: unknown, ancestors?: Set<WeakKey>) => JSONValue;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { assertGeoSpecJsonValue, decodeGeoSpecCanonicalJson, encodeGeoSpecCanonicalJson, isGeoSpecJsonValue, toGeoSpecProtocolJson };
|
|
18
|
+
export declare const toGeoSpecProtocolJson: (value: unknown, ancestors?: Set<WeakKey>) => JSONValue;
|
|
19
|
+
//#endregion
|
package/dist/engine/protocol.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},t=(n,r
|
|
1
|
+
const e=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},t=(n,r=/* @__PURE__ */ new Set)=>{if(n===null||typeof n==`string`||typeof n==`boolean`)return!0;if(typeof n==`number`)return Number.isFinite(n);if(!Array.isArray(n)&&!e(n)||r.has(n))return!1;r.add(n);let i=Array.isArray(n)?n.every(e=>t(e,r)):e(n)&&Object.values(n).every(e=>t(e,r));return r.delete(n),i},n=e=>{if(!t(e))throw TypeError(`GeoSpec protocol values must contain only finite JSON data.`)},r=e=>Array.isArray(e)?e.map(e=>r(e)):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,r(t)])):e,i=e=>(n(e),new TextEncoder().encode(JSON.stringify(r(e)))),a=e=>{let t=JSON.parse(new TextDecoder().decode(e));return n(t),t},o=(t,n=/* @__PURE__ */ new Set)=>{if(t==null)return null;if(typeof t==`string`||typeof t==`boolean`)return t;if(typeof t==`number`){if(!Number.isFinite(t))throw TypeError(`GeoSpec claims cannot contain non-finite numbers.`);return t}if(t instanceof RegExp)return{type:`regexp`,pattern:t.source,flags:t.flags};if(typeof t!=`object`||n.has(t))throw TypeError(`GeoSpec claims cannot contain functions, symbols, bigint values, or cycles.`);let r=Reflect.get(t,`subjectId`);if(typeof r==`string`)return{type:`subject-reference`,subjectId:r};if(n.add(t),Array.isArray(t)){let e=t.map(e=>o(e,n));return n.delete(t),e}if(!e(t))throw TypeError(`GeoSpec claims cannot contain class instances.`);let i={};for(let[e,r]of Object.entries(t))r!==void 0&&(i[e]=o(r,n));return n.delete(t),i};export{n as assertGeoSpecJsonValue,a as decodeGeoSpecCanonicalJson,i as encodeGeoSpecCanonicalJson,t as isGeoSpecJsonValue,o as toGeoSpecProtocolJson};
|
package/dist/geometry-unit.d.mts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeoSpecUnit } from "./geometry-unit.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { GeometryDiagnostic, Vec3 } from "./mesh/types.mjs";
|
|
3
3
|
import { GeoSpecSubject } from "./model/subject.mjs";
|
|
4
4
|
import { GeoSpecAssemblyOccurrenceExpectation, GeoSpecAssemblyOccurrencesExpectation, GeoSpecAssertion, GeoSpecAxisExpectation, GeoSpecBoundingBoxExpectation, GeoSpecCenterOfMassExpectation, GeoSpecChamferFeatureExpectation, GeoSpecCircularHoleExpectation, GeoSpecCircularHolePatternExpectation, GeoSpecComponentInterferenceAllowance, GeoSpecComponentInterferenceExpectation, GeoSpecComponentInterferencePairExpectation, GeoSpecConnectedComponentsExpectation, GeoSpecCylindricalFaceExpectation, GeoSpecExpectOptions, GeoSpecFilletFeatureExpectation, GeoSpecGeometrySelector, GeoSpecMassExpectation, GeoSpecMatcher, GeoSpecMeshIntegrityExpectation, GeoSpecMinimumWallThicknessExpectation, GeoSpecNoDiagnosticsExpectation, GeoSpecNumericExpectation, GeoSpecPlanarFaceExpectation, GeoSpecPointExpectation, GeoSpecProductStructureExpectation, GeoSpecSpatialRelationshipExpectation, GeoSpecSpatialRelationshipsExpectation, GeoSpecStepUnitsExpectation, GeoSpecSurfaceAreaExpectation, GeoSpecTopologyCountsExpectation, GeoSpecValidBrepExpectation, GeoSpecVoidContinuityExpectation, GeoSpecVoidWaypoint, GeoSpecVolumeExpectation } from "./runner/types.mjs";
|
|
5
5
|
import { describe, expectGeo, geoSpecMatcherNames, it, test } from "./create-geospec.mjs";
|
|
6
|
-
export { type
|
|
6
|
+
export { type GeoSpecAssemblyOccurrenceExpectation, type GeoSpecAssemblyOccurrencesExpectation, type GeoSpecAssertion, type GeoSpecAxisExpectation, type GeoSpecBoundingBoxExpectation, type GeoSpecCenterOfMassExpectation, type GeoSpecChamferFeatureExpectation, type GeoSpecCircularHoleExpectation, type GeoSpecCircularHolePatternExpectation, type GeoSpecComponentInterferenceAllowance, type GeoSpecComponentInterferenceExpectation, type GeoSpecComponentInterferencePairExpectation, type GeoSpecConnectedComponentsExpectation, type GeoSpecCylindricalFaceExpectation, type GeoSpecExpectOptions, type GeoSpecFilletFeatureExpectation, type GeoSpecGeometrySelector, type GeoSpecMassExpectation, type GeoSpecMatcher, type GeoSpecMeshIntegrityExpectation, type GeoSpecMinimumWallThicknessExpectation, type GeoSpecNoDiagnosticsExpectation, type GeoSpecNumericExpectation, type GeoSpecPlanarFaceExpectation, type GeoSpecPointExpectation, type GeoSpecProductStructureExpectation, type GeoSpecSpatialRelationshipExpectation, type GeoSpecSpatialRelationshipsExpectation, type GeoSpecStepUnitsExpectation, type GeoSpecSubject, type GeoSpecSurfaceAreaExpectation, type GeoSpecTopologyCountsExpectation, type GeoSpecUnit, type GeoSpecValidBrepExpectation, type Vec3 as GeoSpecVec3, type GeoSpecVoidContinuityExpectation, type GeoSpecVoidWaypoint, type GeoSpecVolumeExpectation, type GeometryDiagnostic, type Vec3, describe, expectGeo, geoSpecMatcherNames, it, test };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{describe,expectGeo,geoSpecMatcherNames,it,test}from"./create-geospec.mjs";
|
package/dist/mesh/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GeoSpecUnit } from "../geometry-unit.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { GeometryDiagnostic, GeometryExportIntent, GeometryFileFormat, MeshFileFormat, Vec3 } from "./types.mjs";
|
|
3
3
|
import { MeshBufferSource, MeshSource } from "../model/types.mjs";
|
|
4
|
-
export type {
|
|
4
|
+
export type { GeoSpecUnit, GeometryDiagnostic, GeometryExportIntent, GeometryFileFormat, MeshBufferSource, MeshFileFormat, MeshSource, Vec3 };
|