@ouro.bot/cli 0.1.0-alpha.191 → 0.1.0-alpha.192

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/changelog.json CHANGED
@@ -2,8 +2,9 @@
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
4
  {
5
- "version": "0.1.0-alpha.191",
5
+ "version": "0.1.0-alpha.192",
6
6
  "changes": [
7
+ "refactor: canonical obligations — ActiveWorkFrame as single source of truth for prompt sections",
7
8
  "feat(mcp): dynamic server add/remove \u2014 agents can manage MCP servers without daemon restart"
8
9
  ]
9
10
  },
@@ -666,8 +666,8 @@ function formatActiveWorkFrame(frame, options) {
666
666
  }
667
667
  if ((frame.pendingObligations ?? []).length > 0) {
668
668
  const openCount = frame.pendingObligations.filter((ob) => (0, obligations_1.isOpenObligationStatus)(ob.status)).length;
669
- if (options?.hasWakePacket && openCount > 0) {
670
- // Wake packet carries enriched obligations (with resumeHint, stalenessClass, waitingOn).
669
+ if (options?.obligationDetailsRenderedElsewhere && openCount > 0) {
670
+ // Enriched obligation data (with resumeHint, stalenessClass, waitingOn) is rendered elsewhere.
671
671
  // Avoid duplicating the full list — just anchor the count here.
672
672
  lines.push("");
673
673
  lines.push(`return obligations: ${openCount} active (canonical details in **Owed** section of wake packet)`);
@@ -65,10 +65,11 @@ function buildPresenceSection(peers) {
65
65
  .map((p) => `- ${p.agentName}: ${p.availability}/${p.lane}`)
66
66
  .join("\n");
67
67
  }
68
- function buildResumeHint(view) {
68
+ function buildResumeHint(view, obligations) {
69
69
  // Compose from authored obligation resumeHints and top intentions
70
70
  const hints = [];
71
- for (const ob of view.activeObligations) {
71
+ const effectiveObligations = obligations ?? view.activeObligations;
72
+ for (const ob of effectiveObligations) {
72
73
  if (ob.meaning?.resumeHint) {
73
74
  hints.push(ob.meaning.resumeHint);
74
75
  }
@@ -78,23 +79,24 @@ function buildResumeHint(view) {
78
79
  }
79
80
  if (hints.length === 0) {
80
81
  // Fall back to top obligation content
81
- if (view.activeObligations.length > 0) {
82
- hints.push(view.activeObligations[0].content);
82
+ if (effectiveObligations.length > 0) {
83
+ hints.push(effectiveObligations[0].content);
83
84
  }
84
85
  }
85
86
  if (hints.length === 0)
86
87
  return "";
87
88
  return hints.join("; ");
88
89
  }
89
- function buildWakePacket(view) {
90
+ function buildWakePacket(view, opts) {
90
91
  const tempo = view.tempo;
91
92
  const tokenBudget = tempo_1.TEMPO_BUDGETS[tempo];
93
+ const effectiveObligations = opts?.canonicalObligations ? opts.canonicalObligations.all : view.activeObligations;
92
94
  const packet = {
93
95
  plotLine: buildPlotLine(view.recentEpisodes, tempo),
94
- obligations: buildObligationsSection(view.activeObligations),
96
+ obligations: buildObligationsSection(effectiveObligations),
95
97
  cares: buildCaresSection(view.activeCares),
96
98
  presence: buildPresenceSection(view.peerPresence),
97
- resumeHint: buildResumeHint(view),
99
+ resumeHint: buildResumeHint(view, opts?.canonicalObligations ? effectiveObligations : undefined),
98
100
  tempo,
99
101
  tokenBudget,
100
102
  assembledAt: new Date().toISOString(),
@@ -106,7 +106,10 @@ function resetPsycheCache() {
106
106
  }
107
107
  const DEFAULT_ACTIVE_THRESHOLD_MS = 24 * 60 * 60 * 1000; // 24 hours
108
108
  function buildSessionSummary(options) {
109
- const { sessionsDir, friendsDir, agentName, currentFriendId, currentChannel, currentKey, activeThresholdMs = DEFAULT_ACTIVE_THRESHOLD_MS, } = options;
109
+ const { sessionsDir, friendsDir, agentName, currentSession, activeThresholdMs = DEFAULT_ACTIVE_THRESHOLD_MS, } = options;
110
+ const currentFriendId = currentSession?.friendId ?? options.currentFriendId;
111
+ const currentChannel = currentSession?.channel ?? options.currentChannel;
112
+ const currentKey = currentSession?.key ?? options.currentKey;
110
113
  const now = Date.now();
111
114
  const query = {
112
115
  sessionsDir,
@@ -519,7 +522,7 @@ function wakePacketSection(options) {
519
522
  function activeWorkSection(options) {
520
523
  if (!options?.activeWorkFrame)
521
524
  return "";
522
- return (0, active_work_1.formatActiveWorkFrame)(options.activeWorkFrame, { hasWakePacket: !!options?.wakePacket });
525
+ return (0, active_work_1.formatActiveWorkFrame)(options.activeWorkFrame, { obligationDetailsRenderedElsewhere: !!options?.wakePacket });
523
526
  }
524
527
  function liveWorldStateSection(options) {
525
528
  if (!options?.activeWorkFrame)
@@ -1079,6 +1082,9 @@ async function buildSystem(channel = "cli", options, context) {
1079
1082
  sessionsDir: path.join((0, identity_1.getAgentRoot)(), "state", "sessions"),
1080
1083
  friendsDir: path.join((0, identity_1.getAgentRoot)(), "friends"),
1081
1084
  agentName: (0, identity_1.getAgentName)(),
1085
+ currentSession: options?.activeWorkFrame?.currentSession
1086
+ ? { friendId: options.activeWorkFrame.currentSession.friendId, channel: options.activeWorkFrame.currentSession.channel, key: options.activeWorkFrame.currentSession.key }
1087
+ : undefined,
1082
1088
  currentFriendId: context?.friend?.id,
1083
1089
  currentChannel: channel,
1084
1090
  currentKey: options?.currentSessionKey ?? "session",
@@ -485,7 +485,12 @@ async function handleInboundTurn(input) {
485
485
  activeCares,
486
486
  },
487
487
  });
488
- const wakePacket = (0, wake_packet_1.buildWakePacket)(temporalView);
488
+ const wakePacket = (0, wake_packet_1.buildWakePacket)(temporalView, {
489
+ canonicalObligations: {
490
+ primary: activeWorkFrame.primaryObligation,
491
+ all: activeWorkFrame.pendingObligations,
492
+ },
493
+ });
489
494
  renderedWakePacket = (0, wake_packet_1.renderWakePacket)(wakePacket);
490
495
  if (!renderedWakePacket)
491
496
  renderedWakePacket = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.191",
3
+ "version": "0.1.0-alpha.192",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",