@agimon-ai/po-core 0.0.0-alpha.186 → 0.0.0-alpha.187
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/dist/headlessServer.cjs
CHANGED
|
@@ -600,7 +600,11 @@ async function serveHeadlessServer(options) {
|
|
|
600
600
|
* routes. The marker is written here, never forwarded to a session service, so tool, spawn and fork paths cannot set it.
|
|
601
601
|
*/
|
|
602
602
|
const markBot = async (sessionId) => {
|
|
603
|
-
|
|
603
|
+
const runtime = options.headlessHub.runtime(sessionId);
|
|
604
|
+
const session = options.headlessHub.session(sessionId);
|
|
605
|
+
const name = session?.profile?.displayName ?? session?.profile?.name;
|
|
606
|
+
if (name && name !== session?.name) await runtime?.setName(name);
|
|
607
|
+
if ((await runtime?.setBot({
|
|
604
608
|
bot: {},
|
|
605
609
|
expectedRevision: 0
|
|
606
610
|
}))?.ok !== true) throw new Error("The new session could not be marked as a bot.");
|