@sunshaobei/dsh-balance-panel 3.0.8 → 3.0.9

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/lib/client.js CHANGED
@@ -1327,6 +1327,7 @@ window.__ModuleLoader__.load({
1327
1327
  var cur = snap && snap.current;
1328
1328
  if (cur && cur.provider) {
1329
1329
  setSel({ provider: String(cur.provider), model: String(cur.model || ""), src: "service" });
1330
+ clientLog('service publish session=' + (bound && bound.sessionId) + ' provider=' + JSON.stringify(String(cur.provider)) + ' model=' + JSON.stringify(String(cur.model || "")));
1330
1331
  }
1331
1332
  }
1332
1333
  catch (_) { /* transient store read */ }
@@ -1339,6 +1340,7 @@ window.__ModuleLoader__.load({
1339
1340
  var id = ordered[i].id;
1340
1341
  if (bound && bound.sessionId === id)
1341
1342
  return; // already bound
1343
+ clientLog('bind candidate session=' + id + ' (first in updatedAt order)');
1342
1344
  try {
1343
1345
  var dir = dirs.directoryFor(id);
1344
1346
  var unsub = null;
@@ -1388,7 +1390,10 @@ window.__ModuleLoader__.load({
1388
1390
  // `conversation.composer.dock` slot — the same flex row that hosts
1389
1391
  // the session ContextMeter stats strip; the seat renders right of
1390
1392
  // it. No floating widget, no dragging.
1391
- ctx.slots.inject("conversation.composer.dock", () => ctx.slots.register({ name: "conversation.composer.dock", id: "dsh-quota-panel", order: 20, label: () => t("title"), locale: NS }, () => React.createElement(QuotaPanel, { t: t })));
1393
+ ctx.slots.inject("conversation.composer.dock", () => ctx.slots.register({ name: "conversation.composer.dock", id: "dsh-quota-panel", order: 20, label: () => t("title"), locale: NS }, (props) => { try {
1394
+ clientLog('dock slotProps keys=' + JSON.stringify(Object.keys(props || {})) + ' sessionId=' + JSON.stringify(props && (props.sessionId || (props.entry && props.entry.sessionId))));
1395
+ }
1396
+ catch { } return React.createElement(QuotaPanel, { t: t, slotSessionId: props && (props.sessionId || (props.entry && props.entry.sessionId)) }); }));
1392
1397
  }
1393
1398
  exports.apply = apply;
1394
1399
  exports.inject = inject;
package/lib/index.js CHANGED
@@ -2003,6 +2003,7 @@ export function apply(ctx, config = {}) {
2003
2003
  if (endpoint === 'specs') {
2004
2004
  try {
2005
2005
  const fsp2 = await import('node:fs/promises');
2006
+ fsMod.mkdirSync(chatgptDshStoreDir(), { recursive: true });
2006
2007
  const dbg = path.join(chatgptDshStoreDir(), 'debug.log');
2007
2008
  await fsp2.appendFile(dbg, new Date().toISOString() + ' specs rows=[' + rows.map(r2 => r2.id + ':' + r2.kind).join(',') + ']\n').catch(() => { });
2008
2009
  }
@@ -2013,6 +2014,7 @@ export function apply(ctx, config = {}) {
2013
2014
  try {
2014
2015
  const fsp2 = await import('node:fs/promises');
2015
2016
  const line = payload && typeof payload.line === 'string' ? payload.line : '';
2017
+ fsMod.mkdirSync(chatgptDshStoreDir(), { recursive: true });
2016
2018
  const dbg = path.join(chatgptDshStoreDir(), 'debug.log');
2017
2019
  await fsp2.appendFile(dbg, new Date().toISOString() + ' client: ' + line + '\n').catch(() => { });
2018
2020
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sunshaobei/dsh-balance-panel",
3
3
  "description": "Provider quota/balance widget for the dsh web surface: an inline sidebar card above the Settings row (collapsed glanceable row expanding into a Harness-native card with a settings panel), fed by a loopback Connection RPC channel whose host half proxies each provider with credentials that never reach the browser.",
4
- "version": "3.0.8",
4
+ "version": "3.0.9",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
package/src/client.ts CHANGED
@@ -1325,6 +1325,7 @@
1325
1325
  var cur = snap && snap.current;
1326
1326
  if (cur && cur.provider) {
1327
1327
  setSel({ provider: String(cur.provider), model: String(cur.model || ""), src: "service" });
1328
+ clientLog('service publish session=' + (bound && bound.sessionId) + ' provider=' + JSON.stringify(String(cur.provider)) + ' model=' + JSON.stringify(String(cur.model || "")));
1328
1329
  }
1329
1330
  } catch (_) { /* transient store read */ }
1330
1331
  };
@@ -1335,6 +1336,7 @@
1335
1336
  for (var i = 0; i < ordered.length; i++) {
1336
1337
  var id = ordered[i].id;
1337
1338
  if (bound && bound.sessionId === id) return; // already bound
1339
+ clientLog('bind candidate session=' + id + ' (first in updatedAt order)');
1338
1340
  try {
1339
1341
  var dir = dirs.directoryFor(id);
1340
1342
  var unsub = null;
@@ -1368,7 +1370,7 @@
1368
1370
  // it. No floating widget, no dragging.
1369
1371
  ctx.slots.inject("conversation.composer.dock", () => ctx.slots.register(
1370
1372
  { name: "conversation.composer.dock", id: "dsh-quota-panel", order: 20, label: () => t("title"), locale: NS },
1371
- () => React.createElement(QuotaPanel, { t: t })
1373
+ (props) => { try { clientLog('dock slotProps keys=' + JSON.stringify(Object.keys(props || {})) + ' sessionId=' + JSON.stringify(props && (props.sessionId || (props.entry && props.entry.sessionId)))); } catch {} return React.createElement(QuotaPanel, { t: t, slotSessionId: props && (props.sessionId || (props.entry && props.entry.sessionId)) }); }
1372
1374
  ));
1373
1375
  }
1374
1376
 
package/src/index.ts CHANGED
@@ -1944,6 +1944,7 @@ export function apply(ctx, config: Record<string, any> = {}) {
1944
1944
  if (endpoint === 'specs') {
1945
1945
  try {
1946
1946
  const fsp2 = await import('node:fs/promises');
1947
+ fsMod.mkdirSync(chatgptDshStoreDir(), { recursive: true });
1947
1948
  const dbg = path.join(chatgptDshStoreDir(), 'debug.log');
1948
1949
  await fsp2.appendFile(dbg, new Date().toISOString() + ' specs rows=[' + rows.map(r2 => r2.id + ':' + r2.kind).join(',') + ']\n').catch(() => {});
1949
1950
  } catch {}
@@ -1953,6 +1954,7 @@ export function apply(ctx, config: Record<string, any> = {}) {
1953
1954
  try {
1954
1955
  const fsp2 = await import('node:fs/promises');
1955
1956
  const line = payload && typeof payload.line === 'string' ? payload.line : '';
1957
+ fsMod.mkdirSync(chatgptDshStoreDir(), { recursive: true });
1956
1958
  const dbg = path.join(chatgptDshStoreDir(), 'debug.log');
1957
1959
  await fsp2.appendFile(dbg, new Date().toISOString() + ' client: ' + line + '\n').catch(() => {});
1958
1960
  } catch {}