geospec 0.0.0 → 0.1.0-beta.2
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 +201 -0
- package/README.md +244 -0
- package/agent/doctrine.md +47 -0
- package/agent/geospec-authoring/SKILL.md +496 -0
- package/agent/geospec-authoring/api-classes.md +13 -0
- package/agent/geospec-authoring/api-constants.md +6 -0
- package/agent/geospec-authoring/api-functions.md +49 -0
- package/agent/geospec-authoring/api-index.md +362 -0
- package/agent/geospec-authoring/api-types.md +1700 -0
- package/agent/geospec-authoring/public-api-classes.md +22 -0
- package/agent/geospec-authoring/public-api-constants.md +19 -0
- package/agent/geospec-authoring/public-api-functions.md +196 -0
- package/agent/geospec-authoring/public-api-index.md +856 -0
- package/agent/geospec-authoring/public-api-types-2.md +1513 -0
- package/agent/geospec-authoring/public-api-types.md +2048 -0
- package/agent/resources.d.ts +19 -0
- package/agent/resources.js +26 -0
- package/agent/skills.d.cts +13 -0
- package/agent/skills.json +27 -0
- package/dist/assertion-client/client.d.mts +124 -0
- package/dist/assertion-client/client.mjs +2 -0
- package/dist/assertion-client/index.d.mts +5 -0
- package/dist/assertion-client/index.mjs +1 -0
- package/dist/config/index.d.mts +3 -0
- package/dist/config/index.mjs +1 -0
- package/dist/config/node/index.d.mts +3 -0
- package/dist/config/node/index.mjs +1 -0
- package/dist/config/node/load.d.mts +19 -0
- package/dist/config/node/load.mjs +1 -0
- package/dist/config/tau-project-artifact.d.mts +54 -0
- package/dist/config/tau-project-artifact.mjs +3 -0
- package/dist/config/types.d.mts +57 -0
- package/dist/config/validate.mjs +1 -0
- package/dist/create-geospec.d.mts +49 -0
- package/dist/create-geospec.mjs +1 -0
- package/dist/engine/client.d.mts +93 -0
- package/dist/engine/client.mjs +1 -0
- package/dist/engine/index.d.mts +3 -0
- package/dist/engine/index.mjs +1 -0
- package/dist/engine/matchers.d.mts +70 -0
- package/dist/engine/matchers.mjs +1 -0
- package/dist/engine/pmi.types.d.mts +78 -0
- package/dist/engine/protocol.d.mts +20 -0
- package/dist/engine/protocol.mjs +1 -0
- package/dist/geometry-unit.d.mts +12 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +1 -0
- package/dist/mesh/index.d.mts +4 -0
- package/dist/mesh/index.mjs +1 -0
- package/dist/mesh/types.d.mts +575 -0
- package/dist/model/errors.d.mts +20 -0
- package/dist/model/errors.mjs +2 -0
- package/dist/model/export-intent.d.mts +63 -0
- package/dist/model/export-intent.mjs +1 -0
- package/dist/model/index.d.mts +6 -0
- package/dist/model/index.mjs +1 -0
- package/dist/model/load-model.d.mts +25 -0
- package/dist/model/load-model.mjs +1 -0
- package/dist/model/native-model-loader.d.mts +119 -0
- package/dist/model/native-model-loader.mjs +1 -0
- package/dist/model/subject-assertions.mjs +1 -0
- package/dist/model/subject.d.mts +11 -0
- package/dist/model/subject.mjs +1 -0
- package/dist/model/types.d.mts +207 -0
- package/dist/runner/collector.d.mts +62 -0
- package/dist/runner/collector.mjs +2 -0
- package/dist/runner/discovery.d.mts +93 -0
- package/dist/runner/discovery.mjs +1 -0
- package/dist/runner/filter.d.mts +50 -0
- package/dist/runner/filter.mjs +1 -0
- package/dist/runner/index.d.mts +6 -0
- package/dist/runner/index.mjs +1 -0
- package/dist/runner/native/index.d.mts +4 -0
- package/dist/runner/native/index.mjs +1 -0
- package/dist/runner/native/native-pool-grants.d.mts +21 -0
- package/dist/runner/native/native-pool-grants.mjs +1 -0
- package/dist/runner/native/native-serial-runner.d.mts +29 -0
- package/dist/runner/native/native-serial-runner.mjs +1 -0
- package/dist/runner/pool/pool-messages.d.mts +94 -0
- package/dist/runner/run-geospec-module.d.mts +13 -0
- package/dist/runner/run-geospec-module.mjs +47 -0
- package/dist/runner/types.d.mts +743 -0
- package/dist/runner/worker/index.d.mts +4 -0
- package/dist/runner/worker/index.mjs +1 -0
- package/dist/runner/worker/no-matching-tests-issue.d.mts +12 -0
- package/dist/runner/worker/no-matching-tests-issue.mjs +1 -0
- package/dist/runner/worker/runner-types.d.mts +146 -0
- package/dist/runner/worker/serial-runner.mjs +1 -0
- package/dist/selector/types.d.mts +271 -0
- package/dist/step/types.d.mts +134 -0
- package/dist/vitest/adapter.d.mts +56 -0
- package/dist/vitest/adapter.mjs +3 -0
- package/dist/vitest/index.d.mts +4 -0
- package/dist/vitest/index.mjs +1 -0
- package/package.json +114 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# geospec — Classes
|
|
2
|
+
|
|
3
|
+
2 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// Error thrown by {@link import ('./load-model.js').loadModel} when geometry cannot be loaded
|
|
6
|
+
GeoSpecModelLoadError: export declare class GeoSpecModelLoadError extends Error
|
|
7
|
+
|
|
8
|
+
// Structured diagnostics explaining why model loading failed
|
|
9
|
+
readonly diagnostics: readonly GeometryDiagnostic[]
|
|
10
|
+
|
|
11
|
+
// GeoSpecModelLoadError.constructor (constructor)
|
|
12
|
+
constructor(diagnostics: readonly GeometryDiagnostic[]);
|
|
13
|
+
// diagnostics: Geometry diagnostics to expose to callers
|
|
14
|
+
|
|
15
|
+
// Assertion error thrown by GeoSpec matchers when an expectation does not hold
|
|
16
|
+
// Remarks: Runner, CLI, and tool adapters unwrap this error to preserve structured diagnostics instead of collapsing them into a single string.
|
|
17
|
+
GeoSpecAssertionError: export declare class GeoSpecAssertionError extends Error
|
|
18
|
+
|
|
19
|
+
readonly diagnostics: readonly GeometryDiagnostic[]
|
|
20
|
+
|
|
21
|
+
// GeoSpecAssertionError.constructor (constructor)
|
|
22
|
+
constructor(diagnostics: readonly GeometryDiagnostic[]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# geospec — Constants
|
|
2
|
+
|
|
3
|
+
4 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// Every matcher name exposed by {@link expectGeo}, derived from the live matcher surface so it can never drift from the real implementation
|
|
6
|
+
geoSpecMatcherNames: readonly string[]
|
|
7
|
+
|
|
8
|
+
// The 26-entry matcher registry
|
|
9
|
+
geoSpecMatcherDescriptors: Readonly<{
|
|
10
|
+
[Name in GeoSpecMatcherName]: Name extends GeoSpecFixedMatcherName ? GeoSpecFixedMatcherDescriptor & {
|
|
11
|
+
readonly kind: Name;
|
|
12
|
+
} : GeoSpecMatcherDescriptor;
|
|
13
|
+
}>
|
|
14
|
+
|
|
15
|
+
// Directories skipped by recursive GeoSpec discovery unless callers provide their own ignored-directory list
|
|
16
|
+
defaultGeoSpecIgnoredDirectories: readonly [".git", "node_modules", "dist", "coverage", ".tau/cache", ".tau/artifacts", ".tau/transcripts"]
|
|
17
|
+
|
|
18
|
+
// Default file globs used by GeoSpec test discovery
|
|
19
|
+
defaultGeoSpecInclude: readonly ["**/*.geospec.{ts,js}"]
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# geospec — Functions
|
|
2
|
+
|
|
3
|
+
34 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// GeoSpec suite helper used inside VM-executed test modules
|
|
6
|
+
// describe (function)
|
|
7
|
+
export declare function describe(name: string, function_: GeoSpecTestCallback): void;
|
|
8
|
+
|
|
9
|
+
// describe.skip (method)
|
|
10
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
11
|
+
|
|
12
|
+
// Start a geometry assertion chain
|
|
13
|
+
// expectGeo (function)
|
|
14
|
+
export declare function expectGeo(subject: GeoSpecSubject): GeoSpecMatcher;
|
|
15
|
+
// subject: geometry subject under test
|
|
16
|
+
|
|
17
|
+
// GeoSpec test helper used inside VM-executed test modules
|
|
18
|
+
// it (function)
|
|
19
|
+
export declare function it(name: string, function_: GeoSpecTestCallback): void;
|
|
20
|
+
|
|
21
|
+
// it.skip (method)
|
|
22
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
23
|
+
|
|
24
|
+
// Alias for {@link it}
|
|
25
|
+
// test (function)
|
|
26
|
+
export declare function test(name: string, function_: GeoSpecTestCallback): void;
|
|
27
|
+
|
|
28
|
+
// test.skip (method)
|
|
29
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
30
|
+
|
|
31
|
+
// Derive the `expected` value an assertion records from the call arguments
|
|
32
|
+
// normalizeGeoSpecExpected (function)
|
|
33
|
+
export declare function normalizeGeoSpecExpected(shape: GeoSpecMatcherExpectedShape, callArguments: readonly unknown[]): unknown;
|
|
34
|
+
// shape: Normalization shape from the matcher's registry entry
|
|
35
|
+
// callArguments: Arguments the spec author passed, in order
|
|
36
|
+
|
|
37
|
+
// Reject a non-wire value rather than letting JSON.stringify erase it
|
|
38
|
+
// assertGeoSpecJsonValue (function)
|
|
39
|
+
export declare function assertGeoSpecJsonValue(value: unknown): asserts value is JSONValue;
|
|
40
|
+
|
|
41
|
+
// Parse and validate canonical bytes without re-canonicalizing them
|
|
42
|
+
// decodeGeoSpecCanonicalJson (function)
|
|
43
|
+
export declare function decodeGeoSpecCanonicalJson(bytes: Uint8Array<ArrayBuffer>): JSONValue;
|
|
44
|
+
|
|
45
|
+
// Encode client-owned canonical claim bytes
|
|
46
|
+
// encodeGeoSpecCanonicalJson (function)
|
|
47
|
+
export declare function encodeGeoSpecCanonicalJson(value: JSONValue): Uint8Array<ArrayBuffer>;
|
|
48
|
+
|
|
49
|
+
// Runtime JSON-value guard used at every protocol trust boundary
|
|
50
|
+
// isGeoSpecJsonValue (function)
|
|
51
|
+
export declare function isGeoSpecJsonValue(value: unknown, ancestors?: Set<object>): value is JSONValue;
|
|
52
|
+
|
|
53
|
+
// Convert an authoring value to protocol JSON, including the two explicit bindings the TypeScript client needs
|
|
54
|
+
// toGeoSpecProtocolJson (function)
|
|
55
|
+
export declare function toGeoSpecProtocolJson(value: unknown, ancestors?: Set<object>): JSONValue;
|
|
56
|
+
|
|
57
|
+
// Create a {@link loadModel} function over a host-supplied compiled engine
|
|
58
|
+
// createModelLoader (function)
|
|
59
|
+
export declare function createModelLoader(defaults: CreateModelLoaderOptions): ManagedGeoSpecModelLoader;
|
|
60
|
+
// defaults: The compiled engine plus model loading defaults
|
|
61
|
+
|
|
62
|
+
// Load a CAD model into GeoSpec evidence
|
|
63
|
+
// Remarks: This is the authoring declaration: a GeoSpec runner replaces it with the host's native model loader. Called outside a runner it always throws.
|
|
64
|
+
// Throws: {@link GeoSpecModelLoadError} with `GEOSPEC_MODEL_LOADER_UNAVAILABLE` when no runner is active.
|
|
65
|
+
// loadModel (function)
|
|
66
|
+
export declare function loadModel<Code extends Record<string, string> = Record<string, string>>(_options: LoadModelOptions<Code>): Promise<GeoSpecSubject>;
|
|
67
|
+
// _options: Source, code, or file model load options
|
|
68
|
+
|
|
69
|
+
// resolveRuntimeExportIntent (function)
|
|
70
|
+
export declare function resolveRuntimeExportIntent(options: {
|
|
71
|
+
runtime: GeoSpecRuntimeClient;
|
|
72
|
+
format: RuntimeBackedModelFormat;
|
|
73
|
+
meshLinearTolerance?: number;
|
|
74
|
+
meshAngularToleranceDegrees?: number;
|
|
75
|
+
}): RuntimeExportIntent | RuntimeExportIntentFailure;
|
|
76
|
+
|
|
77
|
+
// clearCollectorGlobals (function)
|
|
78
|
+
export declare function clearCollectorGlobals(): void;
|
|
79
|
+
|
|
80
|
+
// Create the collector used by the embedded GeoSpec runner
|
|
81
|
+
// createCollector (function)
|
|
82
|
+
export declare function createCollector(options: GeoSpecCollectorOptions): GeoSpecCollector;
|
|
83
|
+
// options: The native assertion client configuration for this module
|
|
84
|
+
|
|
85
|
+
// installCollector (function)
|
|
86
|
+
export declare function installCollector(collector: GeoSpecCollector): void;
|
|
87
|
+
|
|
88
|
+
// Compile a Vitest-style test-name pattern once for a GeoSpec run
|
|
89
|
+
// Remarks: String inputs are JavaScript regular expression sources matched against the full `suite > test` name. `RegExp` inputs are used as-is.
|
|
90
|
+
// compileGeoSpecTestNamePattern (function)
|
|
91
|
+
export declare function compileGeoSpecTestNamePattern(testNamePattern: string | RegExp | undefined): {
|
|
92
|
+
success: true;
|
|
93
|
+
pattern?: GeoSpecTestNamePattern;
|
|
94
|
+
} | {
|
|
95
|
+
success: false;
|
|
96
|
+
issue: VmIssue;
|
|
97
|
+
};
|
|
98
|
+
// testNamePattern: Optional regex source or precompiled expression
|
|
99
|
+
|
|
100
|
+
// Filter collected GeoSpec tests by compiled test-name pattern
|
|
101
|
+
// filterGeoSpecTests (function)
|
|
102
|
+
export declare function filterGeoSpecTests(tests: readonly GeoSpecTestCase[], testNamePattern: GeoSpecTestNamePattern | undefined): GeoSpecTestCase[];
|
|
103
|
+
// tests: collected tests
|
|
104
|
+
// testNamePattern: optional compiled regex
|
|
105
|
+
|
|
106
|
+
// Return true when a collected GeoSpec test matches the supplied compiled Vitest-style test-name pattern
|
|
107
|
+
// matchesGeoSpecTestName (function)
|
|
108
|
+
export declare function matchesGeoSpecTestName(test: Pick<GeoSpecTestCase, "suite" | "name">, testNamePattern: GeoSpecTestNamePattern | undefined): boolean;
|
|
109
|
+
// test: collected test metadata
|
|
110
|
+
// testNamePattern: optional compiled regex
|
|
111
|
+
|
|
112
|
+
// Discover GeoSpec test files from exact files or directory roots
|
|
113
|
+
// Remarks: The returned `files` are project-relative paths suitable for `runGeoSpecModule` and runner factory APIs.
|
|
114
|
+
// discoverGeoSpecFiles (function)
|
|
115
|
+
export declare function discoverGeoSpecFiles(options: DiscoverGeoSpecFilesOptions): Promise<GeoSpecDiscoveryResult>;
|
|
116
|
+
// options: Discovery options containing a filesystem adapter and project roots
|
|
117
|
+
|
|
118
|
+
// Return true when a project-relative path names a GeoSpec test file
|
|
119
|
+
// isGeoSpecTestFile (function)
|
|
120
|
+
export declare function isGeoSpecTestFile(path: string): boolean;
|
|
121
|
+
// path: Project-relative path to inspect
|
|
122
|
+
|
|
123
|
+
// Execute an ESM GeoSpec module using the shared Tau VM substrate
|
|
124
|
+
// runGeoSpecModule (function)
|
|
125
|
+
export declare function runGeoSpecModule(options: RunGeoSpecModuleOptions): Promise<GeoSpecRunResult>;
|
|
126
|
+
// options: filesystem and test entry path
|
|
127
|
+
|
|
128
|
+
// Compose compiled assertion and model bindings with the SDK's serial lifecycle
|
|
129
|
+
// createNativeGeoSpecRunner (function)
|
|
130
|
+
export declare function createNativeGeoSpecRunner(options: GeoSpecNativeRunnerOptions): GeoSpecRunner;
|
|
131
|
+
// options: VM filesystem, native engine/client options and model defaults
|
|
132
|
+
|
|
133
|
+
// Assign a bounded CPU budget across already-selected worker isolates
|
|
134
|
+
// allocateNativePoolGrants (function)
|
|
135
|
+
export declare function allocateNativePoolGrants(options: {
|
|
136
|
+
workers: number;
|
|
137
|
+
budget?: number;
|
|
138
|
+
hostCap: number;
|
|
139
|
+
}): readonly number[];
|
|
140
|
+
// options: Worker count, optional total budget, and host CPU cap
|
|
141
|
+
|
|
142
|
+
// Create a native model loader that admits actual STEP/GLB bytes and retains generation-checked handles until the owning runner finishes
|
|
143
|
+
// createGeoSpecNativeModelLoader (function)
|
|
144
|
+
export declare function createGeoSpecNativeModelLoader(defaults: CreateGeoSpecNativeModelLoaderOptions): ManagedGeoSpecNativeModelLoader;
|
|
145
|
+
// defaults: Native engine, Runtime defaults, and optional source reader
|
|
146
|
+
|
|
147
|
+
// Create a run-level issue when filters select no tests
|
|
148
|
+
// createNoMatchingGeoSpecTestsIssue (function)
|
|
149
|
+
export declare function createNoMatchingGeoSpecTestsIssue(): VmIssue;
|
|
150
|
+
|
|
151
|
+
// Create a standalone native GeoSpec assertion client
|
|
152
|
+
// createGeoSpecAssertionClient (function)
|
|
153
|
+
export declare function createGeoSpecAssertionClient(options: GeoSpecAssertionClientOptions): GeoSpecAssertionClient;
|
|
154
|
+
// options: Engine, deterministic work limit and optional logical-ID controls
|
|
155
|
+
|
|
156
|
+
// Create the one registry-derived matcher surface used by every JavaScript host
|
|
157
|
+
// createGeoSpecMatcherMethods (function)
|
|
158
|
+
export declare function createGeoSpecMatcherMethods<Result>(options: {
|
|
159
|
+
readonly invoke: (invocation: GeoSpecAuthoringInvocation) => Result;
|
|
160
|
+
readonly polarity: GeoSpecClaimPolarity;
|
|
161
|
+
readonly subject: unknown;
|
|
162
|
+
}): GeoSpecMatcherMethods<Result>;
|
|
163
|
+
// options: Subject, polarity and host invocation function
|
|
164
|
+
|
|
165
|
+
// Submit an ancillary query with positive polarity through the native core
|
|
166
|
+
// Remarks: Queries return full reports even when failed or refused. Protocol errors propagate unchanged. Rust owns defaults, validation and canonical encoding.
|
|
167
|
+
// evaluateGeoSpecNativeQuery (function)
|
|
168
|
+
export declare function evaluateGeoSpecNativeQuery(options: GeoSpecNativeQueryOptions): GeoSpecCanonicalClaimReport;
|
|
169
|
+
// options: Query identity, subject and authored payload
|
|
170
|
+
|
|
171
|
+
// Create Vitest matchers over an existing runner-independent client
|
|
172
|
+
// createGeoSpecVitestAdapter (function)
|
|
173
|
+
export declare function createGeoSpecVitestAdapter(client: GeoSpecAssertionClient): GeoSpecVitestAdapter;
|
|
174
|
+
// client: Native GeoSpec assertion client shared with standalone use
|
|
175
|
+
|
|
176
|
+
// Register GeoSpec matchers and their settlement hook in the active Vitest file
|
|
177
|
+
// installGeoSpecVitest (function)
|
|
178
|
+
export declare function installGeoSpecVitest(client: GeoSpecAssertionClient): GeoSpecVitestAdapter;
|
|
179
|
+
// client: Native client shared with standalone assertion calls
|
|
180
|
+
|
|
181
|
+
// Create a native client and register it with the active Vitest file
|
|
182
|
+
// setupGeoSpecVitest (function)
|
|
183
|
+
export declare function setupGeoSpecVitest(options: GeoSpecAssertionClientOptions): GeoSpecVitestAdapter;
|
|
184
|
+
// options: Flat native assertion-client options
|
|
185
|
+
|
|
186
|
+
// Export one Tau project from Runtime's coherent source snapshot
|
|
187
|
+
// Remarks: This helper preserves finalized bytes and provenance metadata. It does not certify mathematical geometry or grant the runtime trusted-evaluator authority.
|
|
188
|
+
// exportTauProjectArtifact (function)
|
|
189
|
+
export declare function exportTauProjectArtifact(options: ExportTauProjectArtifactOptions): Promise<KernelResult<GeoSpecTauProjectArtifact>>;
|
|
190
|
+
// options: Descriptor, fresh-runtime factory, and optional cancellation signal
|
|
191
|
+
|
|
192
|
+
// Load one trusted project config using Node's native module loader
|
|
193
|
+
// Remarks: Explicit selection or exactly one geospec.config.js/.mjs/.ts/.mts is allowed. TypeScript must use erasable syntax; JSON imports use standard attributes. Executable config/imports are trusted developer code, not sandboxed code. Node's same-process module cache is unchanged: load once per run and use a fresh process when fresh executable imports are required. No reload guarantee or transitive-source identity is supplied here.
|
|
194
|
+
// loadGeoSpecConfig (function)
|
|
195
|
+
export declare function loadGeoSpecConfig(options: LoadGeoSpecConfigOptions): Promise<LoadedGeoSpecConfig>;
|
|
196
|
+
// options: Project, optional explicit config and defined option overrides
|