agent-office-cli 0.0.1 → 0.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-office-cli",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Run and manage AI agent sessions locally, with optional relay to agentoffice.top",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -349,11 +349,22 @@ function createPtyManager({ store }) {
349
349
  }
350
350
  }
351
351
 
352
- const screen = await capturePane(runtime.tmuxSession);
353
- const nextState = runtime.provider.classifyOutput(screen, store.getSession(session.sessionId));
354
- if (nextState && nextState !== session.displayState) {
355
- store.setSessionState(session.sessionId, nextState, { status: "running" });
352
+ const provider = getProvider(session.provider);
353
+ const reconcileResult = provider.reconcileSession(session, { sessions: currentSessions });
354
+ // Only run screen-based classifyOutput when the session has no transcript-driven state.
355
+ // For providers like Codex that use a transcript (codexSessionPath set), classifyOutput
356
+ // on the raw terminal text is unreliable and fights the transcript state machine, causing
357
+ // the session to flicker between "attention" and "idle" every polling tick.
358
+ const hasTranscriptState = Boolean(session.meta && session.meta.codexSessionPath);
359
+ if (!hasTranscriptState && (!reconcileResult || !reconcileResult.state)) {
360
+ const screen = await capturePane(runtime.tmuxSession);
361
+ const nextState = runtime.provider.classifyOutput(screen, store.getSession(session.sessionId));
362
+ if (nextState && nextState !== session.displayState) {
363
+ store.setSessionState(session.sessionId, nextState, { status: "running" });
364
+ }
356
365
  }
366
+ applyProviderReconcile(session, reconcileResult);
367
+ continue;
357
368
  }
358
369
 
359
370
  const provider = getProvider(session.provider);
package/src/server.js CHANGED
@@ -1,8 +1,6 @@
1
1
  const http = require("node:http");
2
- const path = require("node:path");
3
2
  const express = require("express");
4
3
  const { WebSocketServer } = require("ws");
5
- const { STATIC_DIR } = require("./web");
6
4
  const auth = require("./auth");
7
5
 
8
6
  function createAppServer({ host, port, store, ptyManager }) {
@@ -37,7 +35,7 @@ function createAppServer({ host, port, store, ptyManager }) {
37
35
  }
38
36
 
39
37
  function sendOfficeShell(res) {
40
- res.sendFile(path.join(STATIC_DIR, "office.html"));
38
+ res.status(404).json({ error: "no_web_ui" });
41
39
  }
42
40
 
43
41
  app.use((req, res, next) => {
@@ -110,8 +108,6 @@ function createAppServer({ host, port, store, ptyManager }) {
110
108
  sendOfficeShell(res);
111
109
  });
112
110
 
113
- app.use(express.static(STATIC_DIR, { index: false }));
114
-
115
111
  app.get("/api/health", (_req, res) => {
116
112
  res.json({ ok: true });
117
113
  });
package/src/web/index.js DELETED
@@ -1,7 +0,0 @@
1
- const path = require("node:path");
2
-
3
- const STATIC_DIR = path.join(__dirname, "public");
4
-
5
- module.exports = {
6
- STATIC_DIR
7
- };