@agimon-ai/po-session 0.0.0-alpha.208 → 0.0.0-alpha.209
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.
|
@@ -1637,6 +1637,18 @@ async function sendToSession(service, input) {
|
|
|
1637
1637
|
//#region src/extensions/(backend)/method/send-to-session.server.ts
|
|
1638
1638
|
var send_to_session_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoutedContribution)(({ host }) => host.scope === "host" ? (0, _agimon_ai_po_core_serverPlugin.defineServerMethod)(sendToSessionMethod, (input) => sendToSession(host.context.sessionService, input)) : void 0, { cardinality: "optional" });
|
|
1639
1639
|
//#endregion
|
|
1640
|
+
//#region src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.server.ts
|
|
1641
|
+
const BOT_AUTONOMY = `You are running as a bot session. Be proactive and work autonomously toward the person's goals. Make decisions yourself from the evidence and reasonable defaults; do not stop to ask whether to continue while useful, authorized work remains. When something fails, diagnose it and try bounded, reversible fixes before escalating. Ask the person only when you are blocked, when uncertainty is high enough that proceeding could cause harm or wasted work, or when explicit approval is required. When you ask, give the evidence, what you tried, and the exact decision needed, then keep doing unrelated authorized work while you wait. Never bypass approval or safety gates, and stop when the person says stop.`;
|
|
1642
|
+
var before_agent_start_server_default = (0, _agimon_ai_po_core_extensionFile.defineHook)({
|
|
1643
|
+
name: "bot-autonomy-guidance",
|
|
1644
|
+
description: "In bot sessions, append guidance to work autonomously and ask the person only on blockers or high uncertainty.",
|
|
1645
|
+
event: "before_agent_start",
|
|
1646
|
+
async handle({ systemPrompt }, execution) {
|
|
1647
|
+
if (await execution.isBotSession?.() !== true) return;
|
|
1648
|
+
return { systemPrompt: `${typeof systemPrompt === "string" ? systemPrompt : ""}\n\n${BOT_AUTONOMY}` };
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
//#endregion
|
|
1640
1652
|
//#region src/extensions/workspaces/sessions/(backend)/resource/codemode-how-to-network.server.ts
|
|
1641
1653
|
var codemode_how_to_network_server_default = (0, _agimon_ai_po_core_extensionFile.defineResource)({
|
|
1642
1654
|
name: "codemode-how-to-network",
|
|
@@ -1661,6 +1673,18 @@ var codemode_how_to_session_server_default = (0, _agimon_ai_po_core_extensionFil
|
|
|
1661
1673
|
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
1662
1674
|
/* v8 ignore next -- generated normalization branch */
|
|
1663
1675
|
const defined = (values) => values.filter((value) => value !== void 0);
|
|
1676
|
+
const via = (identity, value) => {
|
|
1677
|
+
if (value === void 0) return void 0;
|
|
1678
|
+
const declaration = value;
|
|
1679
|
+
return {
|
|
1680
|
+
...identity,
|
|
1681
|
+
...declaration,
|
|
1682
|
+
...declaration.relations === void 0 ? {} : { relations: declaration.relations.map((relation) => ({
|
|
1683
|
+
evidence: "declared",
|
|
1684
|
+
...relation
|
|
1685
|
+
})) }
|
|
1686
|
+
};
|
|
1687
|
+
};
|
|
1664
1688
|
const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
|
|
1665
1689
|
name: "@agimon-ai/po-session",
|
|
1666
1690
|
providerOverrides: (0, _agimon_ai_po_core_serverPlugin.composeServerProviderOverrides)(root_server_default$1, root_server_default),
|
|
@@ -1720,6 +1744,9 @@ const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
|
|
|
1720
1744
|
get api() {
|
|
1721
1745
|
return defined([context.hosted("host") ? void 0 : at(route_server_default, contextHost)]);
|
|
1722
1746
|
},
|
|
1747
|
+
get hooks() {
|
|
1748
|
+
return [via({ event: "before_agent_start" }, at(before_agent_start_server_default, contextSession))];
|
|
1749
|
+
},
|
|
1723
1750
|
get methods() {
|
|
1724
1751
|
return defined([context.hosted("host") ? void 0 : at(send_to_session_server_default, contextHost)]);
|
|
1725
1752
|
},
|