instar 1.3.273 → 1.3.274
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +27 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/core/MachinePoolRegistry.d.ts +3 -0
- package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
- package/dist/core/MachinePoolRegistry.js +1 -0
- package/dist/core/MachinePoolRegistry.js.map +1 -1
- package/dist/core/PlacementExecutor.d.ts.map +1 -1
- package/dist/core/PlacementExecutor.js +28 -6
- package/dist/core/PlacementExecutor.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +14 -2
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/types.d.ts +11 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/src/scaffold/templates.ts +1 -0
- package/upgrades/1.3.274.md +47 -0
- package/upgrades/side-effects/quota-aware-placement.md +99 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA4SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgjRtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -9060,12 +9060,39 @@ export async function startServer(options) {
|
|
|
9060
9060
|
poolIdMgr.recordSelfHardware(poolSelfId, poolMod.captureHardware());
|
|
9061
9061
|
}
|
|
9062
9062
|
catch { /* best-effort hardware self-attest */ }
|
|
9063
|
+
// Quota-aware placement (2026-06-05): self-report whether a NEW
|
|
9064
|
+
// session on THIS machine could work right now. Blocked = a provider
|
|
9065
|
+
// block is in effect (blockedUntil in the future) or the 5-hour
|
|
9066
|
+
// window is exhausted (>= 95%, the same bar QuotaTracker.canRunJob
|
|
9067
|
+
// uses to block all spawns). Sourced from THIS machine's own
|
|
9068
|
+
// QuotaTracker — never another machine's file (the gemini
|
|
9069
|
+
// quota-conflation lesson). Absent/unreadable state = not blocked.
|
|
9070
|
+
const selfQuotaState = () => {
|
|
9071
|
+
try {
|
|
9072
|
+
const q = quotaTracker?.getState();
|
|
9073
|
+
if (!q)
|
|
9074
|
+
return undefined;
|
|
9075
|
+
const blockActive = !!q.blockedUntil && Date.parse(q.blockedUntil) > Date.now();
|
|
9076
|
+
const fiveHourExhausted = (q.fiveHourPercent ?? 0) >= 95;
|
|
9077
|
+
if (!blockActive && !fiveHourExhausted)
|
|
9078
|
+
return { blocked: false };
|
|
9079
|
+
return {
|
|
9080
|
+
blocked: true,
|
|
9081
|
+
blockedUntil: q.blockedUntil,
|
|
9082
|
+
reason: q.blockReason ?? (fiveHourExhausted ? `5-hour window at ${q.fiveHourPercent}%` : 'provider block'),
|
|
9083
|
+
};
|
|
9084
|
+
}
|
|
9085
|
+
catch {
|
|
9086
|
+
return undefined; /* unknown ≠ blocked */
|
|
9087
|
+
}
|
|
9088
|
+
};
|
|
9063
9089
|
const refreshPool = () => {
|
|
9064
9090
|
try {
|
|
9065
9091
|
machinePoolRegistry.recordHeartbeat({
|
|
9066
9092
|
machineId: poolSelfId,
|
|
9067
9093
|
selfReportedLastSeen: new Date().toISOString(),
|
|
9068
9094
|
loadAvg: osMod.loadavg()[0],
|
|
9095
|
+
quotaState: selfQuotaState(),
|
|
9069
9096
|
});
|
|
9070
9097
|
const hbApi = machineHeartbeat?.api;
|
|
9071
9098
|
if (hbApi) {
|