@statezero/core 0.1.10 → 0.1.11

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 CHANGED
@@ -20,7 +20,7 @@ _Last Updated: 2025-06-29_
20
20
 
21
21
  2.2. **License Philosophy**: If SaaS is like renting and open-source is like owning, our license is like a **999-year leasehold on fixed rent**. It provides the security you need to build and grow your company around StateZero, while allowing us to maintain and develop StateZero to a high standard.
22
22
 
23
- 2.3. **Rate Lock Guarantee**: You lock in the **full rate card for all tiers** at the time you sign up, meaning your fees remain predictable no matter how much your revenue or our pricing changes. To lock in your rates, simply contact us at **robert.herring@resipilot.com**.
23
+ 2.3. **Rate Lock Guarantee**: You lock in the **full rate card for all tiers** at the time you sign up, meaning your fees remain predictable no matter how much your revenue or our pricing changes. To lock in your rates, simply contact us at **robert@statezero.dev**.
24
24
 
25
25
  ## **3. Pricing Structure**
26
26
 
@@ -51,11 +51,11 @@ _Last Updated: 2025-06-29_
51
51
 
52
52
  ## **5. LLM Training License**
53
53
 
54
- 5.1. **Separate License Required**: Use of StateZero for **Large Language Model (LLM) training purposes** requires a separate license agreement.
54
+ 5.1. **Separate License Required**: Use of StateZero codebase for **Large Language Model (LLM) training purposes** requires a separate license agreement.
55
55
 
56
56
  5.2. **LLM Training License Fee**: The annual license fee for LLM training usage is **$250,000 per year**.
57
57
 
58
- 5.3. **Contact for LLM License**: Organizations requiring LLM training rights must contact **Airhome Sp Zoo** at **robert.herring@resipilot.com** to arrange a separate licensing agreement.
58
+ 5.3. **Contact for LLM License**: Organizations requiring LLM training rights must contact **Airhome Sp Zoo** at **robert@statezero.dev** to arrange a separate licensing agreement.
59
59
 
60
60
  ## **6. Restrictions**
61
61
 
@@ -64,6 +64,7 @@ _Last Updated: 2025-06-29_
64
64
  - You **may not** modify, reverse engineer, decompile, or disassemble StateZero
65
65
  - You **may not** remove, alter, or obscure any **proprietary notices, branding, or license enforcement mechanisms**
66
66
  - You **may not** sublicense, resell, or distribute StateZero to any third party **without explicit written permission**
67
+ - You **may not** use StateZero for any illegal, unlawful, or criminal activities under the laws of Singapore or under the laws of the jurisdiction where you are located or operating
67
68
  - You **may not** use StateZero to develop or offer **a competing product or service**
68
69
  - You **may not** use StateZero to create a cloud-hosted version of our service (similar to services like Heroku, Netlify, AWS, etc.)
69
70
  - You **may not** use StateZero for LLM training without the separate license outlined in Section 5
@@ -74,7 +75,7 @@ _Last Updated: 2025-06-29_
74
75
 
75
76
  7.2. **Revenue Tier Reporting**: You are responsible for accurately reporting your revenue tier and upgrading to the appropriate pricing tier when revenue thresholds are exceeded.
76
77
 
77
- 7.3. **Rate Lock Process**: To lock in current pricing for all tiers, contact us at **robert.herring@resipilot.com**.
78
+ 7.3. **Rate Lock Process**: To lock in current pricing for all tiers, contact us at **robert@statezero.dev**.
78
79
 
79
80
  ## **8. Disclaimer of Warranty**
80
81
 
@@ -108,9 +109,9 @@ _Last Updated: 2025-06-29_
108
109
 
109
110
  ## **12. Contact Information**
110
111
 
111
- 12.1. For general inquiries and rate lock requests, contact **Airhome Sp Zoo** at **robert.herring@resipilot.com**.
112
- 12.2. For LLM training license inquiries, contact **Airhome Sp Zoo** at **robert.herring@resipilot.com**.
112
+ 12.1. For general inquiries and rate lock requests, contact **Airhome Sp Zoo** at **robert@statezero.dev**.
113
+ 12.2. For LLM training license inquiries, contact **Airhome Sp Zoo** at **robert@statezero.dev**.
113
114
 
114
115
  ---
115
116
 
116
- **By downloading, installing, or using StateZero, you acknowledge that you have read, understood, and agree to be bound by the terms of this License Agreement.**
117
+ **By downloading, installing, or using StateZero, you acknowledge that you have read, understood, and agree to be bound by the terms of this License Agreement.**
@@ -39,6 +39,7 @@ export class Model {
39
39
  _data: {};
40
40
  _pk: any;
41
41
  __version: number;
42
+ _isDirty: boolean;
42
43
  touch(): void;
43
44
  /**
44
45
  * Sets the primary key of the model instance.
@@ -33,6 +33,7 @@ export class Model {
33
33
  this._data = data;
34
34
  this._pk = data[this.constructor.primaryKeyField] || undefined;
35
35
  this.__version = 0;
36
+ this._isDirty = false;
36
37
  return wrapReactiveModel(this);
37
38
  }
38
39
  touch() {
@@ -66,7 +67,14 @@ export class Model {
66
67
  instance.pk = pk;
67
68
  this.instanceCache.set(key, instance);
68
69
  }
69
- return this.instanceCache.get(key);
70
+ const cachedInstance = this.instanceCache.get(key);
71
+ // If cached instance is dirty, return a fresh instance instead
72
+ if (cachedInstance._isDirty) {
73
+ const freshInstance = new this();
74
+ freshInstance.pk = pk;
75
+ return freshInstance;
76
+ }
77
+ return cachedInstance;
70
78
  }
71
79
  /**
72
80
  * Gets a field value from the internal data store
@@ -84,7 +92,7 @@ export class Model {
84
92
  // check local overrides
85
93
  let value = this._data[field];
86
94
  // if its not been overridden, get it from the store
87
- if (isNil(value) && !isNil(this._pk)) {
95
+ if (value === undefined && !isNil(this._pk)) {
88
96
  let storedValue = modelStoreRegistry.getEntity(ModelClass, this._pk);
89
97
  if (storedValue)
90
98
  value = storedValue[field]; // if stops null -> undefined
@@ -145,6 +153,7 @@ export class Model {
145
153
  this._pk = value;
146
154
  }
147
155
  else {
156
+ this._isDirty = true;
148
157
  this._data[field] = value;
149
158
  }
150
159
  }
@@ -186,7 +195,7 @@ export class Model {
186
195
  // check local overrides
187
196
  let value = this._data[field];
188
197
  // if it's not been overridden, get it from the store
189
- if (isNil(value) && !isNil(this._pk)) {
198
+ if (value === undefined && !isNil(this._pk)) {
190
199
  let storedValue = modelStoreRegistry.getEntity(ModelClass, this._pk);
191
200
  if (storedValue)
192
201
  value = storedValue[field];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",