@fugood/bricks-project 2.25.0-beta.17 → 2.25.0-beta.19

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.25.0-beta.17",
3
+ "version": "2.25.0-beta.19",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "typecheck": "tsc --noEmit",
7
7
  "build": "bun scripts/build.js"
8
8
  },
9
9
  "dependencies": {
10
- "@fugood/bricks-cli": "^2.25.0-beta.17",
10
+ "@fugood/bricks-cli": "^2.25.0-beta.19",
11
11
  "@huggingface/gguf": "^0.3.2",
12
12
  "@iarna/toml": "^3.0.0",
13
13
  "@modelcontextprotocol/sdk": "^1.15.0",
package/package.json.bak CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fugood/bricks-ctor",
3
- "version": "2.25.0-beta.17",
3
+ "version": "2.25.0-beta.19",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "typecheck": "tsc --noEmit",
7
7
  "build": "bun scripts/build.js"
8
8
  },
9
9
  "dependencies": {
10
- "@fugood/bricks-cli": "^2.25.0-beta.17",
10
+ "@fugood/bricks-cli": "^2.25.0-beta.19",
11
11
  "@huggingface/gguf": "^0.3.2",
12
12
  "@iarna/toml": "^3.0.0",
13
13
  "@modelcontextprotocol/sdk": "^1.15.0",
@@ -84,7 +84,7 @@ The load-bearing laws. Each is unpacked in [`references/architecture-truths.md`]
84
84
  6. **Frames are grid units.** Off-grid placement is legal but only ever intentional (overflow effects, anchor-at-origin tricks). It is never a nudge to escape the grid. Bricks fully outside the grid are auto-culled.
85
85
  7. **Standby Transition is part of the design language.** Every visible Brick gets an entrance offset (`standbyMode` + `standbyOpacity` + `standbyDelay`); the runtime's auto-tween handles in-flight motion. Snap-cuts are reserved for emphasis (alarm states), never for routine navigation.
86
86
  8. **Subspace is a typed module.** Inputs are call-by-value-on-host-change; outlets emit update + value-change events on the host. Extract a Subspace only when the same flow appears 2+ times or when the boundary scopes Data meaningfully — never as a "tidy up" tactic.
87
- 9. **DataCalculation is for derivation only.** Pure inputs → outputs (DataCalculationScript or DataCalculationMap). If your transformation has side effects, navigation, or async I/O, it belongs in an Event Action chain or a Generator. DataCalc orchestrating DataCalc is the wrong primitive.
87
+ 9. **DataCalculation is for derivation, not orchestration.** Inputs → outputs via DataCalculationScript or DataCalculationMap. Keep scripts pure by default; `enableAsync: true` (Promise / timers / async libs) and Map `FILE_*` commands are available when derivation genuinely needs them. Network calls, navigation, and DataCalc-triggers-DataCalc fanout belong in Event Action chains or Generators.
88
88
  10. **No scroll, no overflow, no responsive reflow.** Frames are fixed; what doesn't fit doesn't show. Design within the Canvas; don't import web habits.
89
89
 
90
90
  ## Commit to a design language
@@ -96,19 +96,26 @@ A Subspace is a self-contained mini-Application: own Canvases, own Bricks, own G
96
96
 
97
97
  **Failure mode:** Subspaces with leaky contracts (every host Data exposed as a Prop). Tighten the contract; if you can't, the boundary is wrong.
98
98
 
99
- ## 9. DataCalculation is for derivation only
99
+ ## 9. DataCalculation is for derivation, not orchestration
100
100
 
101
- Two flavours: `DataCalculationScript` (a JS function with named inputs / outputs) and `DataCalculationMap` (a node-graph of `DataCommand`s with sandbox primitives — string, math, collection, datetime, color, etc.). Both are pure transformations: inputs → outputs.
101
+ Two flavours:
102
+
103
+ - **`DataCalculationScript`** — a sandboxed JS function with named inputs / outputs. Default is sync + pure; opt into async with `enableAsync: true`, which unlocks `Promise`, `setTimeout` / `setInterval` / `setImmediate`, `requestAnimationFrame`, and the full lodash surface (`debounce`, `delay`, `defer`). Bundled libraries include lodash, voca, mathjs, chroma, moment, json5, qs, url, bytes, ms, base45, iconv, nanoid, md5, crypto-browserify, jsrsasign (JWS), cose-js, fflate (gzip/zlib), cbor, fs (limited; no download/upload), officeparser, turndown, opencc-js, toon-format. Runs on Hermes (Android) and JavaScriptCore (iOS) — keep that in mind for engine pitfalls.
104
+ - **`DataCalculationMap`** — a node-graph of `DataCommand`s spanning these categories: `COLLECTION`, `COLOR`, `CONSTANT`, `DATETIME`, `FILE` (file-system ops: `READ` / `WRITE` / `APPEND` / `MKDIR` / `COPY_FILE` / `MOVE_FILE` / `UNLINK` / `EXISTS` / `STAT` / etc.), `ITERATEE`, `LOGICTYPE`, `MATH`, `OBJECT`, `SANDBOX` (`SANDBOX_RUN_JAVASCRIPT` runs a script node inside the graph), `STRING`.
105
+
106
+ Derivation is the intent. Purity is a strong default and the right framing for the common case, but it is a best practice — not a hard runtime restriction. `enableAsync` and `FILE_*` exist because some derivation work (document parsing, decompression, signing, reading a cached file) genuinely needs them.
102
107
 
103
108
  **Use it for**:
104
109
  - Format conversion (date → human-readable, currency → localized string).
105
110
  - Combining Data values into a derived display value.
106
111
  - Reductions / iterations over a collection.
107
112
  - Boolean conditions feeding a Switch.
113
+ - Async derivation pipelines: decode → decompress → parse → verify (cbor, fflate, cose-js, officeparser, turndown).
114
+ - Reading cached files written earlier in the flow (Map `FILE_*` commands or Script `fs`).
108
115
 
109
116
  **Triggering**: `triggerMode: 'auto'` re-runs on input change (watch for circular dependencies); `'manual'` only runs on `PROPERTY_BANK_COMMAND` action.
110
117
 
111
- **Do not use** for orchestration, side effects, navigation, async I/O, network calls, or anything that should be in an Event Action chain or a Generator. A DataCalc that triggers DataCalc that triggers DataCalc is an orchestration system in the wrong primitive — promote to event chains.
118
+ **Do not use** for orchestration, navigation, network calls (no `fetch` / XHR in the sandbox — that's a Generator's job), or anything that should be in an Event Action chain or a Generator. A DataCalc that triggers DataCalc that triggers DataCalc is an orchestration system in the wrong primitive — promote to event chains. `enableAsync` and `FILE_*` are tools for derivation, not a licence to smuggle flow control into the calc layer.
112
119
 
113
120
  **Failure mode:** spinning up a Generator just to do a string concat or unit conversion. That's a DataCalc job; the inverse misuse is just as common.
114
121