@volter/supercode-teams 0.2.145 → 0.2.146

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 (2) hide show
  1. package/package.json +3 -3
  2. package/worker/index.mjs +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.145",
3
+ "version": "0.2.146",
4
4
  "type": "module",
5
5
  "description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
6
6
  "license": "MIT",
@@ -60,9 +60,9 @@
60
60
  "@homebridge/node-pty-prebuilt-multiarch": "^0.14.1",
61
61
  "@volter/supercode-frontend": "^0.2.2",
62
62
  "@volter/supercode-harness-sdk": "^0.3.43",
63
- "@volter/supercode-terminal": "^0.2.53",
63
+ "@volter/supercode-terminal": "^0.2.54",
64
64
  "@volter/identity": "^0.4.1",
65
- "@volter/teams": "^0.1.54",
65
+ "@volter/teams": "^0.1.58",
66
66
  "@xterm/addon-serialize": "^0.14.0",
67
67
  "@xterm/headless": "^6.0.0",
68
68
  "protobufjs": "8.8.0",
package/worker/index.mjs CHANGED
@@ -84,9 +84,9 @@ export class TeamsServer extends DurableObject {
84
84
  this.api = createTeamsApi({ publicOrigin: normalizePublicOrigin(env.PUBLIC_ORIGIN), identityIssuer: env.VOLTER_ISSUER || null, identityOrganizations: identityOrganizationsFromEnv(env), delegatedIssuer: env.DELEGATED_ISSUER || null });
85
85
  this.api.storageUsage = () => {
86
86
  const sql = ctx.storage.sql;
87
- let free = 0, page = 0;
88
- try { free = sql.exec('PRAGMA freelist_count').one().freelist_count; page = sql.exec('PRAGMA page_size').one().page_size; } catch { /* conservative allocation measure if host omits the pragmas */ }
89
- return { allocated: sql.databaseSize, used: Math.max(0, sql.databaseSize - free * page), limit: 10 * 1024 ** 3 };
87
+ let freeBytes = null;
88
+ try { freeBytes = sql.exec('PRAGMA freelist_count').one().freelist_count * sql.exec('PRAGMA page_size').one().page_size; } catch { /* preserve an explicit unknown if the host omits these pragmas */ }
89
+ return { allocated: sql.databaseSize, free_bytes: freeBytes, used: Math.max(0, sql.databaseSize - (freeBytes ?? 0)), used_is_upper_bound: freeBytes === null, limit: 10 * 1024 ** 3 };
90
90
  };
91
91
  this.api.attach({ store: new DirectStore(createStoreHandlers(db)), harnessRoutes });
92
92
  const existing = await this.api.store.one("SELECT value FROM server_meta WHERE key='server_id'");