@ifc-lite/sandbox 1.14.2 → 1.14.4
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/dist/bridge-schema.d.ts +39 -2
- package/dist/bridge-schema.d.ts.map +1 -1
- package/dist/bridge-schema.js +935 -181
- package/dist/bridge-schema.js.map +1 -1
- package/dist/bridge.d.ts +3 -1
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +9 -4
- package/dist/bridge.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +16 -1
- package/dist/sandbox.js.map +1 -1
- package/dist/transpile.d.ts +2 -0
- package/dist/transpile.d.ts.map +1 -1
- package/dist/transpile.js +38 -3
- package/dist/transpile.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/bridge-schema.d.ts
CHANGED
|
@@ -17,6 +17,37 @@ import type { SandboxPermissions } from './types.js';
|
|
|
17
17
|
type ArgType = 'string' | 'number' | 'dump' | 'entityRefs' | '...strings';
|
|
18
18
|
/** How to marshal the return value back to QuickJS */
|
|
19
19
|
type ReturnType = 'void' | 'string' | 'value';
|
|
20
|
+
export type LlmTaskIntent = 'create' | 'inspect' | 'modify' | 'visualize' | 'repair' | 'export';
|
|
21
|
+
export type MethodPlacementKind = 'storey-relative' | 'world' | 'wall-local' | 'explicit-placement' | 'element-target';
|
|
22
|
+
export interface MethodSemanticContract {
|
|
23
|
+
/** High-level tasks where this method is especially relevant */
|
|
24
|
+
taskTags?: LlmTaskIntent[];
|
|
25
|
+
/** Expected placement frame for geometry methods */
|
|
26
|
+
placement?: MethodPlacementKind;
|
|
27
|
+
/** Required keys inside the params object */
|
|
28
|
+
requiredKeys?: string[];
|
|
29
|
+
/** Alternative required key groups, where any one group is valid */
|
|
30
|
+
anyOfKeys?: string[][];
|
|
31
|
+
/** Numeric keys that should be positive when provided as literals */
|
|
32
|
+
positiveKeys?: string[];
|
|
33
|
+
/** Point-array arity checks for literal vectors */
|
|
34
|
+
pointArity?: Record<string, number>;
|
|
35
|
+
/** Axis keys that must not collapse to the same point */
|
|
36
|
+
axisPair?: [string, string];
|
|
37
|
+
/** Keys that should never be used with this helper */
|
|
38
|
+
forbiddenKeys?: Array<{
|
|
39
|
+
key: string;
|
|
40
|
+
message: string;
|
|
41
|
+
}>;
|
|
42
|
+
/** Shared custom validator hook name for prompt/preflight/hints */
|
|
43
|
+
customValidationId?: 'slab-shape' | 'roof-shape' | 'generic-element' | 'axis-element';
|
|
44
|
+
/** Guidance for when to choose this helper */
|
|
45
|
+
useWhen?: string;
|
|
46
|
+
/** Warnings or repair hints attached to the contract */
|
|
47
|
+
cautions?: string[];
|
|
48
|
+
/** Whether repairs should inspect the loaded model first */
|
|
49
|
+
inspectFirst?: boolean;
|
|
50
|
+
}
|
|
20
51
|
export interface MethodSchema {
|
|
21
52
|
/** Method name exposed in QuickJS (e.g., 'colorize') */
|
|
22
53
|
name: string;
|
|
@@ -31,9 +62,11 @@ export interface MethodSchema {
|
|
|
31
62
|
/** TypeScript return type for generated declarations (default: inferred from returns) */
|
|
32
63
|
tsReturn?: string;
|
|
33
64
|
/** Execute the SDK call and return a native JS value */
|
|
34
|
-
call: (sdk: BimContext, args: unknown[]) => unknown;
|
|
65
|
+
call: (sdk: BimContext, args: unknown[], context: BridgeCallContext) => unknown;
|
|
35
66
|
/** How to marshal the return value */
|
|
36
67
|
returns: ReturnType;
|
|
68
|
+
/** Shared semantic contract for prompts, validation, and repair hints */
|
|
69
|
+
llmSemantics?: MethodSemanticContract;
|
|
37
70
|
}
|
|
38
71
|
export interface NamespaceSchema {
|
|
39
72
|
/** Namespace name on the `bim` object (e.g., 'viewer') */
|
|
@@ -45,12 +78,16 @@ export interface NamespaceSchema {
|
|
|
45
78
|
/** Methods in this namespace */
|
|
46
79
|
methods: MethodSchema[];
|
|
47
80
|
}
|
|
81
|
+
export interface BridgeCallContext {
|
|
82
|
+
sandboxSessionId: string;
|
|
83
|
+
}
|
|
48
84
|
export declare const NAMESPACE_SCHEMAS: NamespaceSchema[];
|
|
49
85
|
/**
|
|
50
86
|
* Build all schema-defined namespaces on the `bim` handle.
|
|
51
87
|
* Skips namespaces whose permission is disabled.
|
|
52
88
|
*/
|
|
53
|
-
export declare function buildSchemaNamespaces(vm: QuickJSContext, bimHandle: QuickJSHandle, sdk: BimContext, permissions: Required<SandboxPermissions
|
|
89
|
+
export declare function buildSchemaNamespaces(vm: QuickJSContext, bimHandle: QuickJSHandle, sdk: BimContext, permissions: Required<SandboxPermissions>, context: BridgeCallContext): void;
|
|
90
|
+
export declare function disposeSchemaNamespaceSession(context: BridgeCallContext): void;
|
|
54
91
|
/** Recursively convert a native JS value to a QuickJS handle */
|
|
55
92
|
export declare function marshalValue(vm: QuickJSContext, value: unknown): QuickJSHandle;
|
|
56
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-schema.d.ts","sourceRoot":"","sources":["../src/bridge-schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge-schema.d.ts","sourceRoot":"","sources":["../src/bridge-schema.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAEvE,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