diff --git a/libs/a2ui/package.json b/libs/a2ui/package.json index 646dcd057..31e230662 100644 --- a/libs/a2ui/package.json +++ b/libs/a2ui/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/a2ui", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/ag-ui/package.json b/libs/ag-ui/package.json index 95f703370..64b5f7949 100644 --- a/libs/ag-ui/package.json +++ b/libs/ag-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/ag-ui", - "version": "0.0.27", + "version": "0.0.28", "peerDependencies": { "@ngaf/chat": "*", "@ngaf/licensing": "*", diff --git a/libs/chat/package.json b/libs/chat/package.json index 351922d62..bb9b96d5a 100644 --- a/libs/chat/package.json +++ b/libs/chat/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/chat", - "version": "0.0.27", + "version": "0.0.28", "exports": { ".": { "types": "./index.d.ts", diff --git a/libs/cockpit-docs/package.json b/libs/cockpit-docs/package.json index 02b6181dd..cd39d37a5 100644 --- a/libs/cockpit-docs/package.json +++ b/libs/cockpit-docs/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/cockpit-docs", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/cockpit-registry/package.json b/libs/cockpit-registry/package.json index 330f73157..fad777c8d 100644 --- a/libs/cockpit-registry/package.json +++ b/libs/cockpit-registry/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/cockpit-registry", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/cockpit-shell/package.json b/libs/cockpit-shell/package.json index 09f9a4955..97d7642d9 100644 --- a/libs/cockpit-shell/package.json +++ b/libs/cockpit-shell/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/cockpit-shell", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/cockpit-testing/package.json b/libs/cockpit-testing/package.json index 25cbbed1e..0e63ff33f 100644 --- a/libs/cockpit-testing/package.json +++ b/libs/cockpit-testing/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/cockpit-testing", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/cockpit-ui/package.json b/libs/cockpit-ui/package.json index b312be9f1..0126022f7 100644 --- a/libs/cockpit-ui/package.json +++ b/libs/cockpit-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/cockpit-ui", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/db/package.json b/libs/db/package.json index ca2d6f376..bedfe3045 100644 --- a/libs/db/package.json +++ b/libs/db/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/db", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/design-tokens/package.json b/libs/design-tokens/package.json index 452e8b4a0..4d5a6a17d 100644 --- a/libs/design-tokens/package.json +++ b/libs/design-tokens/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/design-tokens", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/example-layouts/package.json b/libs/example-layouts/package.json index f7f4587f3..6e6c4bd9c 100644 --- a/libs/example-layouts/package.json +++ b/libs/example-layouts/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/example-layouts", - "version": "0.0.27", + "version": "0.0.28", "peerDependencies": { "@angular/core": "^20.0.0 || ^21.0.0", "@angular/common": "^20.0.0 || ^21.0.0" diff --git a/libs/langgraph/package.json b/libs/langgraph/package.json index cf918e7d0..a7a6ef5d4 100644 --- a/libs/langgraph/package.json +++ b/libs/langgraph/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/langgraph", - "version": "0.0.27", + "version": "0.0.28", "peerDependencies": { "@ngaf/chat": "*", "@ngaf/licensing": "*", diff --git a/libs/langgraph/src/lib/agent.fn.ts b/libs/langgraph/src/lib/agent.fn.ts index 460c8a180..ced82682d 100644 --- a/libs/langgraph/src/lib/agent.fn.ts +++ b/libs/langgraph/src/lib/agent.fn.ts @@ -14,14 +14,21 @@ import type { Observable } from 'rxjs'; import type { BaseMessage, AIMessage as CoreAIMessage } from '@langchain/core/messages'; /** - * Wire-shape of a `RemoveMessage` instruction — LangGraph's `add_messages` - * reducer recognises this plain-object shape and removes the matching - * message id from server state. Used by `regenerate()`. We construct the - * shape directly instead of importing the `RemoveMessage` class from - * `@langchain/core/messages` because that pulls in the full BaseMessage - * class hierarchy (~30-50 kB) which Cockpit's bundle-size budget rejects. + * Wire-shape of a `RemoveMessage` instruction. LangGraph's `add_messages` + * reducer (Python side) coerces incoming dicts via a strict check that + * expects `role` + `content` keys; without them, the dict-to-Message + * conversion throws and the whole `updateState` request 400s. Construct + * the shape directly with the required keys so we get correct semantics + * without importing the `RemoveMessage` class from `@langchain/core/messages` + * (the class import pulls in the full BaseMessage hierarchy, ~30-50 kB, + * which Cockpit's example-app bundle budget rejects). */ -type RemoveMessageInstruction = { type: 'remove'; id: string }; +type RemoveMessageInstruction = { + type: 'remove'; + role: 'remove'; + id: string; + content: ''; +}; import type { Command, Interrupt, ToolCallWithResult } from '@langchain/langgraph-sdk'; import type { BagTemplate, InferBag } from '@langchain/langgraph-sdk'; import type { @@ -296,7 +303,9 @@ export function agent< .map(m => { const raw = m as unknown as Record; const id = typeof raw['id'] === 'string' ? raw['id'] : undefined; - return id ? { type: 'remove' as const, id } : null; + return id + ? { type: 'remove' as const, role: 'remove' as const, id, content: '' as const } + : null; }) .filter((rm): rm is RemoveMessageInstruction => rm !== null); diff --git a/libs/licensing/package.json b/libs/licensing/package.json index b10209e4f..0ff1f7436 100644 --- a/libs/licensing/package.json +++ b/libs/licensing/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/licensing", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git", diff --git a/libs/partial-json/package.json b/libs/partial-json/package.json index 93626ee44..c92d32fbb 100644 --- a/libs/partial-json/package.json +++ b/libs/partial-json/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/partial-json", - "version": "0.0.27", + "version": "0.0.28", "deprecated": "Replaced by @cacheplane/partial-json. No further versions will be published from this package.", "license": "MIT", "repository": { diff --git a/libs/render/package.json b/libs/render/package.json index 9fe04757b..f0f6a1b9d 100644 --- a/libs/render/package.json +++ b/libs/render/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/render", - "version": "0.0.27", + "version": "0.0.28", "peerDependencies": { "@angular/core": "^20.0.0 || ^21.0.0", "@angular/common": "^20.0.0 || ^21.0.0", diff --git a/libs/ui-react/package.json b/libs/ui-react/package.json index 7f510c3de..047438adb 100644 --- a/libs/ui-react/package.json +++ b/libs/ui-react/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/ui-react", - "version": "0.0.27", + "version": "0.0.28", "license": "MIT", "repository": { "type": "git",