@pascal-app/core 1.1.1 → 1.1.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.
Files changed (40) hide show
  1. package/dist/agent-operations/__fixtures__/roof-bearing-cases.d.ts +13453 -13453
  2. package/dist/agent-operations/batch.d.ts +4 -8
  3. package/dist/agent-operations/batch.d.ts.map +1 -1
  4. package/dist/agent-operations/batch.js +7 -19
  5. package/dist/agent-operations/circulation-spaces.d.ts +3431 -3431
  6. package/dist/agent-operations/index.d.ts +5715 -9
  7. package/dist/agent-operations/index.d.ts.map +1 -1
  8. package/dist/agent-operations/index.js +16 -5
  9. package/dist/agent-operations/scene-queries.d.ts +2610 -2610
  10. package/dist/agent-operations/types.d.ts +7 -0
  11. package/dist/agent-operations/types.d.ts.map +1 -1
  12. package/dist/agent-operations/usage-checks.js +2 -2
  13. package/dist/agent-operations/verify-scene.d.ts +7 -3
  14. package/dist/agent-operations/verify-scene.d.ts.map +1 -1
  15. package/dist/agent-operations/verify-scene.js +15 -7
  16. package/dist/building/__fixtures__/wall-opening-cases.d.ts +238 -238
  17. package/dist/building/level-duplication.d.ts +1274 -1274
  18. package/dist/commands/structure/zone-wall-merge.d.ts +568 -568
  19. package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +2610 -2610
  20. package/dist/lib/__fixtures__/mezzanine.d.ts +10874 -10874
  21. package/dist/lib/absorb-wall-separators.d.ts +635 -635
  22. package/dist/lib/steps.d.ts +8 -0
  23. package/dist/lib/steps.d.ts.map +1 -0
  24. package/dist/lib/steps.js +7 -0
  25. package/dist/spatial/usage-field/findings.d.ts +3 -0
  26. package/dist/spatial/usage-field/findings.d.ts.map +1 -1
  27. package/dist/spatial/usage-field/findings.js +17 -5
  28. package/dist/spatial/usage-field/measure.d.ts +3 -1
  29. package/dist/spatial/usage-field/measure.d.ts.map +1 -1
  30. package/dist/spatial/usage-field/measure.js +7 -2
  31. package/dist/store/actions/node-actions.d.ts +3431 -3431
  32. package/dist/store/scene-annotations.d.ts +1193 -1193
  33. package/dist/systems/slab/__fixtures__/floor-step.d.ts +3431 -3431
  34. package/dist/systems/slab/__fixtures__/raised-room.d.ts +2610 -2610
  35. package/dist/systems/stair/stair-opening-preview.d.ts +2610 -2610
  36. package/dist/utils/ensure-scene-openings.d.ts +6215 -6215
  37. package/dist/utils/floor-plate-migration.d.ts +635 -635
  38. package/dist/utils/owned-floor-opening-migration.d.ts +635 -635
  39. package/dist/utils/reconcile-structure-on-load.d.ts +3431 -3431
  40. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { AgentOperation, AgentOperationOutcome } from './types.js';
2
+ import type { AgentOperation, AgentOperationSteps } from './types.js';
3
3
  type BatchInput = {
4
4
  calls: {
5
5
  tool: string;
@@ -11,18 +11,14 @@ type Contract = {
11
11
  name: string;
12
12
  input: Record<string, z.ZodType>;
13
13
  };
14
- /** A batch one call at a time: each resume runs the next call, and the last returns the outcome. */
15
- export type BatchSteps = (...args: Parameters<AgentOperation<BatchInput>>) => Generator<void, AgentOperationOutcome, void>;
16
14
  /**
17
15
  * `run_batch`: shared tools in order, each on the scene the calls before it left, their changes
18
16
  * merged into one set — one undo step, one write on either surface. The user: the model spent a
19
17
  * round trip per step on what could be serialised (deleting balcony walls one by one, the same
20
18
  * build on every floor). Pre-check and operation refusals follow the same per-call policy.
21
- * It stops after each call, so a host that can let other work run between a batch's calls does
22
- * (`createBatchOperation` runs it through in one go).
19
+ * It stops after each call, and where a call that runs in steps (`stepped`) does, so a host that
20
+ * can let other work run meanwhile does (`AGENT_OPERATIONS.run_batch` runs it through in one go).
23
21
  */
24
- export declare function createBatchSteps(operations: Readonly<Record<string, AgentOperation<never>>>, contracts: readonly Contract[]): BatchSteps;
25
- /** `run_batch` as one synchronous operation: every call, back to back. */
26
- export declare function createBatchOperation(operations: Readonly<Record<string, AgentOperation<never>>>, contracts: readonly Contract[]): AgentOperation<BatchInput>;
22
+ export declare function createBatchSteps(operations: Readonly<Record<string, AgentOperation<never>>>, contracts: readonly Contract[], stepped?: Readonly<Record<string, AgentOperationSteps<never>>>): AgentOperationSteps<BatchInput>;
27
23
  export {};
28
24
  //# sourceMappingURL=batch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/agent-operations/batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAgB,MAAM,SAAS,CAAA;AAElF,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;IAC1D,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B,CAAA;AACD,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AA8BlE,oGAAoG;AACpG,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,KAC5C,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAA;AAEjD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAC3D,SAAS,EAAE,SAAS,QAAQ,EAAE,GAC7B,UAAU,CAqFZ;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAC3D,SAAS,EAAE,SAAS,QAAQ,EAAE,GAC7B,cAAc,CAAC,UAAU,CAAC,CAS5B"}
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/agent-operations/batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAgB,MAAM,SAAS,CAAA;AAEhF,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;IAC1D,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B,CAAA;AACD,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AA8BlE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAC3D,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAM,GACjE,mBAAmB,CAAC,UAAU,CAAC,CAqFjC"}
@@ -21,10 +21,10 @@ function prepareCall(call, index, operations, contracts) {
21
21
  * merged into one set — one undo step, one write on either surface. The user: the model spent a
22
22
  * round trip per step on what could be serialised (deleting balcony walls one by one, the same
23
23
  * build on every floor). Pre-check and operation refusals follow the same per-call policy.
24
- * It stops after each call, so a host that can let other work run between a batch's calls does
25
- * (`createBatchOperation` runs it through in one go).
24
+ * It stops after each call, and where a call that runs in steps (`stepped`) does, so a host that
25
+ * can let other work run meanwhile does (`AGENT_OPERATIONS.run_batch` runs it through in one go).
26
26
  */
27
- export function createBatchSteps(operations, contracts) {
27
+ export function createBatchSteps(operations, contracts, stepped = {}) {
28
28
  return function* (nodes, { calls, onRefusal = 'stop' }, context) {
29
29
  let working = nodes;
30
30
  let workingContext = context;
@@ -38,10 +38,10 @@ export function createBatchSteps(operations, contracts) {
38
38
  catalog: workingContext.catalog,
39
39
  });
40
40
  const { operation, input } = prepareCall(call, index, operations, contracts);
41
- const { result, changes } = operation(working, input, {
42
- ...workingContext,
43
- batchCall: index,
44
- });
41
+ const callContext = { ...workingContext, batchCall: index };
42
+ const { result, changes } = Object.hasOwn(stepped, call.tool)
43
+ ? yield* stepped[call.tool](working, input, callContext)
44
+ : operation(working, input, callContext);
45
45
  if (changes) {
46
46
  sets.push(changes);
47
47
  working = applySceneChanges(working, changes);
@@ -104,15 +104,3 @@ export function createBatchSteps(operations, contracts) {
104
104
  };
105
105
  };
106
106
  }
107
- /** `run_batch` as one synchronous operation: every call, back to back. */
108
- export function createBatchOperation(operations, contracts) {
109
- const steps = createBatchSteps(operations, contracts);
110
- return (nodes, input, context) => {
111
- const batch = steps(nodes, input, context);
112
- for (;;) {
113
- const step = batch.next();
114
- if (step.done)
115
- return step.value;
116
- }
117
- };
118
- }