@nextclaw/ncp-toolkit 0.5.5 → 0.5.6

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/dist/index.js +4 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -947,12 +947,14 @@ function toSessionSummary(session, liveSession) {
947
947
  ...readOptionalAgentId$1(session.agentId) ? { agentId: readOptionalAgentId$1(session.agentId) } : {},
948
948
  messageCount: session.messages.length,
949
949
  updatedAt: session.updatedAt,
950
+ ...session.messages.length > 0 ? { lastMessageAt: session.messages[session.messages.length - 1]?.timestamp ?? session.updatedAt } : {},
950
951
  status: liveSession?.activeExecution ? "running" : "idle",
951
952
  ...Object.keys(metadata).length > 0 ? { metadata } : {}
952
953
  };
953
954
  }
954
955
  function toLiveSessionSummary(session) {
955
956
  const messages = readMessages(session.stateManager.getSnapshot());
957
+ const updatedAt = now();
956
958
  const metadata = withAutoSessionLabel({
957
959
  metadata: Object.keys(session.metadata).length > 0 ? structuredClone(session.metadata) : session.activeExecution?.requestEnvelope.metadata ? structuredClone(session.activeExecution.requestEnvelope.metadata) : {},
958
960
  messages
@@ -961,7 +963,8 @@ function toLiveSessionSummary(session) {
961
963
  sessionId: session.sessionId,
962
964
  ...readOptionalAgentId$1(session.agentId) ? { agentId: readOptionalAgentId$1(session.agentId) } : {},
963
965
  messageCount: messages.length,
964
- updatedAt: now(),
966
+ updatedAt,
967
+ ...messages.length > 0 ? { lastMessageAt: messages[messages.length - 1]?.timestamp ?? updatedAt } : {},
965
968
  status: session.activeExecution ? "running" : "idle",
966
969
  ...Object.keys(metadata).length > 0 ? { metadata } : {}
967
970
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/ncp-toolkit",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "private": false,
5
5
  "description": "Toolkit implementations built on top of the NextClaw Communication Protocol.",
6
6
  "type": "module",
@@ -15,14 +15,14 @@
15
15
  "dist"
16
16
  ],
17
17
  "dependencies": {
18
- "@nextclaw/ncp": "0.5.0"
18
+ "@nextclaw/ncp": "0.5.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.17.6",
22
22
  "prettier": "^3.3.3",
23
23
  "typescript": "^5.6.3",
24
24
  "vitest": "^4.1.2",
25
- "@nextclaw/ncp-agent-runtime": "0.3.10"
25
+ "@nextclaw/ncp-agent-runtime": "0.3.11"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsdown src/index.ts --dts --clean --target es2022 --no-fixedExtension",