@ouro.bot/cli 0.1.0-alpha.197 → 0.1.0-alpha.199
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
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
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
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.199",
|
|
6
|
+
"changes": [
|
|
7
|
+
"refactor: rename wake packet to start-of-turn packet across codebase (types, modules, events, tests)"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.197",
|
|
6
12
|
"changes": [
|
|
@@ -670,7 +670,7 @@ function formatActiveWorkFrame(frame, options) {
|
|
|
670
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
|
-
lines.push(`return obligations: ${openCount} active (canonical details in **Owed** section of
|
|
673
|
+
lines.push(`return obligations: ${openCount} active (canonical details in **Owed** section of start-of-turn packet)`);
|
|
674
674
|
}
|
|
675
675
|
else if (openCount > 0) {
|
|
676
676
|
lines.push("");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.buildStartOfTurnPacket = buildStartOfTurnPacket;
|
|
4
|
+
exports.renderStartOfTurnPacket = renderStartOfTurnPacket;
|
|
5
|
+
exports.renderCompactStartOfTurnPacket = renderCompactStartOfTurnPacket;
|
|
6
6
|
const runtime_1 = require("../nerves/runtime");
|
|
7
7
|
const tempo_1 = require("./tempo");
|
|
8
8
|
function estimateTokens(text) {
|
|
@@ -87,7 +87,7 @@ function buildResumeHint(view, obligations) {
|
|
|
87
87
|
return "";
|
|
88
88
|
return hints.join("; ");
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function buildStartOfTurnPacket(view, opts) {
|
|
91
91
|
const tempo = view.tempo;
|
|
92
92
|
const tokenBudget = tempo_1.TEMPO_BUDGETS[tempo];
|
|
93
93
|
const effectiveObligations = opts?.canonicalObligations ? opts.canonicalObligations.all : view.activeObligations;
|
|
@@ -103,8 +103,8 @@ function buildWakePacket(view, opts) {
|
|
|
103
103
|
};
|
|
104
104
|
(0, runtime_1.emitNervesEvent)({
|
|
105
105
|
component: "heart",
|
|
106
|
-
event: "heart.
|
|
107
|
-
message: `
|
|
106
|
+
event: "heart.start_of_turn_packet_built",
|
|
107
|
+
message: `start-of-turn packet built: tempo=${tempo}`,
|
|
108
108
|
meta: {
|
|
109
109
|
tempo,
|
|
110
110
|
plotLineTokens: estimateTokens(packet.plotLine),
|
|
@@ -117,13 +117,13 @@ function buildWakePacket(view, opts) {
|
|
|
117
117
|
return packet;
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
|
-
* Renders a
|
|
120
|
+
* Renders a start-of-turn packet to prompt text, respecting token budget.
|
|
121
121
|
* Truncation priority (last truncated first):
|
|
122
122
|
* resumeHint (PROTECTED) > obligations > cares > plotLine > presence
|
|
123
123
|
* So presence is truncated first, then plotLine, then cares, then obligations.
|
|
124
124
|
* resumeHint is never truncated.
|
|
125
125
|
*/
|
|
126
|
-
function
|
|
126
|
+
function renderStartOfTurnPacket(packet) {
|
|
127
127
|
const budget = packet.tokenBudget;
|
|
128
128
|
// Assemble sections in priority order (highest priority first for budget allocation)
|
|
129
129
|
// Each section is { label, content, priority } where lower priority number = truncated first
|
|
@@ -137,8 +137,8 @@ function renderWakePacket(packet) {
|
|
|
137
137
|
if (sections.length === 0) {
|
|
138
138
|
(0, runtime_1.emitNervesEvent)({
|
|
139
139
|
component: "heart",
|
|
140
|
-
event: "heart.
|
|
141
|
-
message: "
|
|
140
|
+
event: "heart.start_of_turn_packet_rendered",
|
|
141
|
+
message: "start-of-turn packet rendered: empty",
|
|
142
142
|
meta: { tokens: 0, tempo: packet.tempo },
|
|
143
143
|
});
|
|
144
144
|
return "";
|
|
@@ -167,8 +167,8 @@ function renderWakePacket(packet) {
|
|
|
167
167
|
}
|
|
168
168
|
(0, runtime_1.emitNervesEvent)({
|
|
169
169
|
component: "heart",
|
|
170
|
-
event: "heart.
|
|
171
|
-
message: `
|
|
170
|
+
event: "heart.start_of_turn_packet_rendered",
|
|
171
|
+
message: `start-of-turn packet rendered: ${tokens} tokens`,
|
|
172
172
|
meta: { tokens, tempo: packet.tempo, sectionCount: sections.length },
|
|
173
173
|
});
|
|
174
174
|
return rendered;
|
|
@@ -200,7 +200,7 @@ function formatSections(sections) {
|
|
|
200
200
|
* Ultra-compact version for coding context (max 200 tokens).
|
|
201
201
|
* Just resumeHint + top obligation + top care, single-line bullets.
|
|
202
202
|
*/
|
|
203
|
-
function
|
|
203
|
+
function renderCompactStartOfTurnPacket(packet) {
|
|
204
204
|
const parts = [];
|
|
205
205
|
if (packet.resumeHint) {
|
|
206
206
|
parts.push(`next: ${packet.resumeHint}`);
|
|
@@ -220,8 +220,8 @@ function renderCompactWakePacket(packet) {
|
|
|
220
220
|
const result = compact.length > maxChars ? compact.slice(0, maxChars) : compact;
|
|
221
221
|
(0, runtime_1.emitNervesEvent)({
|
|
222
222
|
component: "heart",
|
|
223
|
-
event: "heart.
|
|
224
|
-
message: `compact
|
|
223
|
+
event: "heart.start_of_turn_packet_compact_rendered",
|
|
224
|
+
message: `compact start-of-turn packet: ${estimateTokens(result)} tokens`,
|
|
225
225
|
meta: { tokens: estimateTokens(result) },
|
|
226
226
|
});
|
|
227
227
|
return result;
|
package/dist/mind/prompt.js
CHANGED
|
@@ -39,7 +39,7 @@ exports.bodyMapSection = bodyMapSection;
|
|
|
39
39
|
exports.mcpToolsSection = mcpToolsSection;
|
|
40
40
|
exports.runtimeInfoSection = runtimeInfoSection;
|
|
41
41
|
exports.toolRestrictionSection = toolRestrictionSection;
|
|
42
|
-
exports.
|
|
42
|
+
exports.startOfTurnPacketSection = startOfTurnPacketSection;
|
|
43
43
|
exports.centerOfGravitySteeringSection = centerOfGravitySteeringSection;
|
|
44
44
|
exports.commitmentsSection = commitmentsSection;
|
|
45
45
|
exports.delegationHintSection = delegationHintSection;
|
|
@@ -516,13 +516,13 @@ function bridgeContextSection(options) {
|
|
|
516
516
|
return "";
|
|
517
517
|
return bridgeContext.startsWith("## ") ? bridgeContext : `## active bridge work\n${bridgeContext}`;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return options?.
|
|
519
|
+
function startOfTurnPacketSection(options) {
|
|
520
|
+
return options?.startOfTurnPacket ?? "";
|
|
521
521
|
}
|
|
522
522
|
function activeWorkSection(options) {
|
|
523
523
|
if (!options?.activeWorkFrame)
|
|
524
524
|
return "";
|
|
525
|
-
return (0, active_work_1.formatActiveWorkFrame)(options.activeWorkFrame, { obligationDetailsRenderedElsewhere: !!options?.
|
|
525
|
+
return (0, active_work_1.formatActiveWorkFrame)(options.activeWorkFrame, { obligationDetailsRenderedElsewhere: !!options?.startOfTurnPacket });
|
|
526
526
|
}
|
|
527
527
|
function liveWorldStateSection(options) {
|
|
528
528
|
if (!options?.activeWorkFrame)
|
|
@@ -544,8 +544,8 @@ function familyCrossSessionTruthSection(context, options) {
|
|
|
544
544
|
return "";
|
|
545
545
|
if (context?.friend?.trustLevel !== "family")
|
|
546
546
|
return "";
|
|
547
|
-
// When
|
|
548
|
-
if (options?.
|
|
547
|
+
// When start-of-turn packet is present, compress to one line
|
|
548
|
+
if (options?.startOfTurnPacket) {
|
|
549
549
|
return "When family asks whole-self status, answer from the cross-session picture above.";
|
|
550
550
|
}
|
|
551
551
|
return `## cross-session truth
|
|
@@ -1070,7 +1070,7 @@ async function buildSystem(channel = "cli", options, context) {
|
|
|
1070
1070
|
] : []),
|
|
1071
1071
|
// Group 7: dynamic state for this turn
|
|
1072
1072
|
"# dynamic state for this turn",
|
|
1073
|
-
|
|
1073
|
+
startOfTurnPacketSection(options),
|
|
1074
1074
|
liveWorldStateSection(options),
|
|
1075
1075
|
pendingMessagesSection(options),
|
|
1076
1076
|
activeWorkSection(options),
|
|
@@ -224,7 +224,7 @@ function buildScopeContent(request, contextFiles, skills, agentName) {
|
|
|
224
224
|
formatSkills(skills),
|
|
225
225
|
].join("\n");
|
|
226
226
|
}
|
|
227
|
-
function buildStateContent(request, contextKey, generatedAt, snapshot, existingSessions, agentName, identityPacket, activeWorkFrame,
|
|
227
|
+
function buildStateContent(request, contextKey, generatedAt, snapshot, existingSessions, agentName, identityPacket, activeWorkFrame, startOfTurnPacket) {
|
|
228
228
|
const gitSection = snapshot.available
|
|
229
229
|
? [
|
|
230
230
|
`repoRoot: ${snapshot.repoRoot ?? "unknown"}`,
|
|
@@ -241,7 +241,7 @@ function buildStateContent(request, contextKey, generatedAt, snapshot, existingS
|
|
|
241
241
|
`agent: ${request.parentAgent ?? agentName}`,
|
|
242
242
|
formatOrigin(request),
|
|
243
243
|
`obligationId: ${request.obligationId ?? "none"}`,
|
|
244
|
-
...(
|
|
244
|
+
...(startOfTurnPacket ? ["", "## Continuity", startOfTurnPacket] : []),
|
|
245
245
|
"",
|
|
246
246
|
formatIdentitySection(identityPacket),
|
|
247
247
|
"",
|
|
@@ -281,7 +281,7 @@ function prepareCodingContextPack(input, deps = {}) {
|
|
|
281
281
|
const generatedAt = nowIso();
|
|
282
282
|
const identityPacket = buildIdentityPacket(snapshot, input.request);
|
|
283
283
|
const scopeContent = buildScopeContent(input.request, contextFiles, skills, agentName);
|
|
284
|
-
const stateContent = buildStateContent(input.request, contextKey, generatedAt, snapshot, existingSessions, agentName, identityPacket, input.activeWorkFrame, input.
|
|
284
|
+
const stateContent = buildStateContent(input.request, contextKey, generatedAt, snapshot, existingSessions, agentName, identityPacket, input.activeWorkFrame, input.startOfTurnPacket || undefined);
|
|
285
285
|
mkdirSync(contextDir, { recursive: true });
|
|
286
286
|
writeFileSync(scopeFile, `${scopeContent}\n`, "utf-8");
|
|
287
287
|
writeFileSync(stateFile, `${stateContent}\n`, "utf-8");
|
|
@@ -310,7 +310,7 @@ function prepareCodingContextPack(input, deps = {}) {
|
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
312
|
* Emit a coding milestone episode when a session completes or blocks.
|
|
313
|
-
* This is the outbound leg of the coding round-trip: compact
|
|
313
|
+
* This is the outbound leg of the coding round-trip: compact start-of-turn packet goes IN,
|
|
314
314
|
* episodes come BACK OUT.
|
|
315
315
|
*/
|
|
316
316
|
function emitCodingEpisode(agentRoot, session, outcome) {
|
package/dist/senses/pipeline.js
CHANGED
|
@@ -61,7 +61,7 @@ const provider_ping_1 = require("../heart/provider-ping");
|
|
|
61
61
|
const auth_flow_1 = require("../heart/daemon/auth-flow");
|
|
62
62
|
const tempo_1 = require("../heart/tempo");
|
|
63
63
|
const temporal_view_1 = require("../heart/temporal-view");
|
|
64
|
-
const
|
|
64
|
+
const start_of_turn_packet_1 = require("../heart/start-of-turn-packet");
|
|
65
65
|
const presence_1 = require("../heart/presence");
|
|
66
66
|
const episodes_1 = require("../mind/episodes");
|
|
67
67
|
const cares_1 = require("../heart/cares");
|
|
@@ -457,8 +457,8 @@ async function handleInboundTurn(input) {
|
|
|
457
457
|
for (const msg of input.messages) {
|
|
458
458
|
sessionMessages.push(msg);
|
|
459
459
|
}
|
|
460
|
-
// Step 4b: Continuity pipeline — derive tempo, build
|
|
461
|
-
let
|
|
460
|
+
// Step 4b: Continuity pipeline — derive tempo, build start-of-turn packet, snapshot obligations
|
|
461
|
+
let renderedStartOfTurnPacket;
|
|
462
462
|
const preTurnObligationIds = new Set(pendingObligations.map((ob) => `${ob.id}:${ob.status}`));
|
|
463
463
|
try {
|
|
464
464
|
const agentRoot = (0, identity_1.getAgentRoot)();
|
|
@@ -485,15 +485,15 @@ async function handleInboundTurn(input) {
|
|
|
485
485
|
activeCares,
|
|
486
486
|
},
|
|
487
487
|
});
|
|
488
|
-
const
|
|
488
|
+
const startOfTurnPacket = (0, start_of_turn_packet_1.buildStartOfTurnPacket)(temporalView, {
|
|
489
489
|
canonicalObligations: {
|
|
490
490
|
primary: activeWorkFrame.primaryObligation,
|
|
491
491
|
all: activeWorkFrame.pendingObligations,
|
|
492
492
|
},
|
|
493
493
|
});
|
|
494
|
-
|
|
495
|
-
if (!
|
|
496
|
-
|
|
494
|
+
renderedStartOfTurnPacket = (0, start_of_turn_packet_1.renderStartOfTurnPacket)(startOfTurnPacket);
|
|
495
|
+
if (!renderedStartOfTurnPacket)
|
|
496
|
+
renderedStartOfTurnPacket = undefined;
|
|
497
497
|
// Update self-presence
|
|
498
498
|
const presence = (0, presence_1.derivePresence)(agentRoot, agentName, {
|
|
499
499
|
activeSessions: sessionActivity.length + 1,
|
|
@@ -509,7 +509,7 @@ async function handleInboundTurn(input) {
|
|
|
509
509
|
level: "warn",
|
|
510
510
|
component: "senses",
|
|
511
511
|
event: "senses.continuity_error",
|
|
512
|
-
message: "continuity pipeline failed, continuing without
|
|
512
|
+
message: "continuity pipeline failed, continuing without start-of-turn packet",
|
|
513
513
|
meta: { error: continuityError instanceof Error ? continuityError.message : String(continuityError) },
|
|
514
514
|
});
|
|
515
515
|
}
|
|
@@ -520,7 +520,7 @@ async function handleInboundTurn(input) {
|
|
|
520
520
|
bridgeContext,
|
|
521
521
|
activeWorkFrame,
|
|
522
522
|
delegationDecision,
|
|
523
|
-
|
|
523
|
+
startOfTurnPacket: renderedStartOfTurnPacket,
|
|
524
524
|
pendingMessages: pending.length > 0 ? pending.map((msg) => ({ from: msg.from, content: msg.content })) : undefined,
|
|
525
525
|
currentSessionKey: currentSession.key,
|
|
526
526
|
currentObligation,
|