@statezero/core 0.1.10 → 0.1.12
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
|
|
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
|
|
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
|
|
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
|
|
112
|
-
12.2. For LLM training license inquiries, contact **Airhome Sp Zoo** at **robert
|
|
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.**
|
|
@@ -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
|
-
|
|
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 (
|
|
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 (
|
|
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];
|
|
@@ -68,7 +68,7 @@ export class QuerysetStore {
|
|
|
68
68
|
}
|
|
69
69
|
async addOperation(operation) {
|
|
70
70
|
this.operationsMap.set(operation.operationId, operation);
|
|
71
|
-
if (this.operationsMap.size > this.pruneThreshold) {
|
|
71
|
+
if (this.operationsMap.size > this.pruneThreshold && !this.isSyncing) {
|
|
72
72
|
this.prune();
|
|
73
73
|
}
|
|
74
74
|
this._emitRenderEvent();
|
|
@@ -116,6 +116,10 @@ export class QuerysetStore {
|
|
|
116
116
|
operation.status != Status.REJECTED);
|
|
117
117
|
}
|
|
118
118
|
prune() {
|
|
119
|
+
if (this.isSyncing) {
|
|
120
|
+
console.log(`[ModelStore ${this.modelClass.modelName}] Skipping prune - sync in progress`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
119
123
|
const renderedPks = this.render(false);
|
|
120
124
|
this.setGroundTruth(renderedPks);
|
|
121
125
|
this.setOperations(this.getInflightOperations());
|
|
@@ -182,8 +186,16 @@ export class QuerysetStore {
|
|
|
182
186
|
ast: this.queryset.build(),
|
|
183
187
|
modelClass: this.modelClass
|
|
184
188
|
});
|
|
189
|
+
if (!response || typeof response !== "object") {
|
|
190
|
+
throw new Error(`Invalid response structure from fetchFn`);
|
|
191
|
+
}
|
|
185
192
|
const { data, included } = response;
|
|
186
193
|
console.log(`[${id}] Sync fetch completed. Received: ${JSON.stringify(data)}.`);
|
|
194
|
+
if (!Array.isArray(data)) {
|
|
195
|
+
console.warn(`[${id}] fetchFn returned non-array data:`, typeof data);
|
|
196
|
+
// Don't update ground truth with invalid data
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
187
199
|
// Persists all the instances (including nested instances) to the model store
|
|
188
200
|
processIncludedEntities(modelStoreRegistry, included, this.modelClass);
|
|
189
201
|
this.setGroundTruth(data);
|
package/package.json
CHANGED