@geravant/sinain 1.0.16 → 1.0.17

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/index.ts +9 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -528,6 +528,15 @@ export default function sinainHudPlugin(api: OpenClawPluginApi): void {
528
528
  const sessionStates = new Map<string, SessionState>();
529
529
  let curationInterval: ReturnType<typeof setInterval> | null = null;
530
530
  let lastWorkspaceDir: string | null = null;
531
+
532
+ // Pre-initialize from config so situation.update works immediately after gateway restart,
533
+ // without waiting for the first before_agent_start event.
534
+ const _cfgWorkspace = (api.config as any).agents?.defaults?.workspace as string | undefined;
535
+ if (_cfgWorkspace && existsSync(_cfgWorkspace)) {
536
+ lastWorkspaceDir = _cfgWorkspace;
537
+ api.logger.info(`sinain-hud: workspace pre-initialized from config: ${lastWorkspaceDir}`);
538
+ }
539
+
531
540
  let consecutiveHeartbeatSkips = 0;
532
541
  let lastEvalReportDate: string | null = null;
533
542
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geravant/sinain",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "sinain OpenClaw plugin — AI overlay for macOS",
5
5
  "type": "module",
6
6
  "bin": {