agentosity 0.1.1 → 0.1.2

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 +1 -1
  2. package/src/mcp.js +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentosity",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Agentosity — AI-native is a number now. Automatic attendance for your AI agents (stdio MCP lifecycle + activity probes) + human clock-out CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/mcp.js CHANGED
@@ -17,6 +17,7 @@ export function serve({ company, deviceId }) {
17
17
  let probe = null;
18
18
  let probeLabel = "none";
19
19
  let activeSeconds = 0;
20
+ let activeNow = true; // 会话刚拉起视为在干活,之后由探针接管
20
21
  let lastTick = Date.now();
21
22
  let ended = false;
22
23
 
@@ -35,6 +36,7 @@ export function serve({ company, deviceId }) {
35
36
  try {
36
37
  const s = probe.sample();
37
38
  probeLabel = s.probe;
39
+ activeNow = s.active;
38
40
  if (s.active) {
39
41
  activeSeconds = Math.min(
40
42
  activeSeconds + Math.round((now - lastTick) / 1000),
@@ -54,6 +56,7 @@ export function serve({ company, deviceId }) {
54
56
  session_id: sessionId,
55
57
  active_seconds: activeSeconds,
56
58
  probe: probeLabel,
59
+ active: activeNow,
57
60
  });
58
61
  }
59
62
  }, HEARTBEAT_MS);