@agimon-ai/po-session 0.0.0-alpha.204 → 0.0.0-alpha.205

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.
@@ -990,13 +990,15 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)((plug
990
990
  },
991
991
  onError: (error) => pluginContext.host.context.onNotice(`Stop report failed: ${String(error)}`)
992
992
  });
993
- const settled = agent.registerHook({
993
+ const settled = agent.registerHook((0, _agimon_ai_po_core_extensionFile.defineHook)({
994
+ name: "session-report-sustained-stop",
995
+ description: "Update the session snapshot and schedule a coordinator report when the session stays stopped.",
994
996
  event: "agent_settled",
995
997
  handle: (_event, execution) => {
996
998
  session = execution.session;
997
999
  stop.settled();
998
1000
  }
999
- });
1001
+ }));
1000
1002
  const eligibility = options.provenance() === _agimon_ai_po_core_hubChannel.COORDINATOR_SESSION_PROVENANCE ? void 0 : agent.registerToolRestriction({ excludedTools: [require_type.START_SESSION_TOOL_NAME] });
1001
1003
  const notice = (label) => (error) => pluginContext.host.context.onNotice(`${label}: ${String(error)}`);
1002
1004
  const sessionContext = pluginContext.host.context.sessionContext;
@@ -1039,13 +1041,15 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)((plug
1039
1041
  return await current.admitMessage(message, "followUp", requestId);
1040
1042
  } });
1041
1043
  let detachSink = attach();
1042
- const ready = agent.registerHook({
1044
+ const ready = agent.registerHook((0, _agimon_ai_po_core_extensionFile.defineHook)({
1045
+ name: "session-reattach-child-report-sink",
1046
+ description: "Reattach the child report sink when the session is ready to admit waiting reports.",
1043
1047
  event: "session_ready",
1044
1048
  handle: () => {
1045
1049
  detachSink();
1046
1050
  detachSink = attach();
1047
1051
  }
1048
- });
1052
+ }));
1049
1053
  releases.push(() => {
1050
1054
  ready.dispose();
1051
1055
  detachSink();
@@ -1073,13 +1077,15 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)((plug
1073
1077
  label: "Reporting to parent"
1074
1078
  }] : []
1075
1079
  });
1076
- const settledGate = agent.registerHook({
1080
+ const settledGate = agent.registerHook((0, _agimon_ai_po_core_extensionFile.defineHook)({
1081
+ name: "session-check-child-terminal-report",
1082
+ description: "Update the session snapshot and check whether the child can report completion to its parent.",
1077
1083
  event: "agent_settled",
1078
1084
  handle: (event, execution) => {
1079
1085
  session = execution.session;
1080
1086
  childGate.settled(event).catch(notice("Child report check failed"));
1081
1087
  }
1082
- });
1088
+ }));
1083
1089
  childGate.start().catch(notice("Child report check failed"));
1084
1090
  releases.push(() => {
1085
1091
  settledGate.dispose();
@@ -1239,20 +1245,24 @@ var root_server_default = (0, _agimon_ai_po_core_extensionFile.defineRoot)((plug
1239
1245
  onError: (error) => pluginContext.host.context.onNotice(`Inbox digest failed: ${String(error)}`)
1240
1246
  });
1241
1247
  digest = inbox;
1242
- const settledInbox = agent.registerHook({
1248
+ const settledInbox = agent.registerHook((0, _agimon_ai_po_core_extensionFile.defineHook)({
1249
+ name: "session-schedule-inbox-digest",
1250
+ description: "Schedule an inbox digest after a settled run unless the person aborted it.",
1243
1251
  event: "agent_settled",
1244
1252
  handle: async (event) => {
1245
1253
  if (event.aborted !== true) await inbox.settled();
1246
1254
  }
1247
- });
1248
- const compacted = agent.registerHook({
1255
+ }));
1256
+ const compacted = agent.registerHook((0, _agimon_ai_po_core_extensionFile.defineHook)({
1257
+ name: "session-expire-mention-grants",
1258
+ description: "Expire session mention grants and reauthorize delivery after compaction completes.",
1249
1259
  event: "session_compact",
1250
1260
  handle: (event) => {
1251
1261
  if (event.status !== "completed") return;
1252
1262
  sessionService.mentions?.expire(agent.context.sessionId);
1253
1263
  service.reauthorize?.().catch((error) => pluginContext.host.context.onNotice(`Delivery reauthorization failed: ${String(error)}`));
1254
1264
  }
1255
- });
1265
+ }));
1256
1266
  inbox.note();
1257
1267
  await require_type.rearmAskReminders(service, (text, requestId, details) => remindSession(agent, text, requestId, details), (error) => pluginContext.host.context.onNotice(`Ask reminder failed: ${String(error)}`));
1258
1268
  logbookWake = require_type.createLogbookWake({