@ouro.bot/cli 0.1.0-alpha.666 → 0.1.0-alpha.668
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 +13 -0
- package/dist/arc/flight-recorder.js +179 -6
- package/dist/arc/obligations.js +35 -1
- package/dist/heart/daemon/cli-exec.js +90 -1
- package/dist/heart/daemon/cli-help.js +12 -1
- package/dist/heart/daemon/cli-parse.js +102 -0
- package/dist/heart/habits/habit-parser.js +8 -0
- package/dist/heart/habits/habit-runtime-state.js +17 -3
- package/dist/heart/habits/habit-session-summary.js +318 -0
- package/dist/heart/habits/habit-session.js +62 -7
- package/dist/heart/mailbox/mailbox-http-hooks.js +27 -1
- package/dist/heart/mailbox/mailbox-http-routes.js +82 -1
- package/dist/heart/mailbox/mailbox-read.js +3 -1
- package/dist/heart/mailbox/readers/agent-machine.js +12 -2
- package/dist/heart/mailbox/readers/runtime-readers.js +31 -0
- package/dist/heart/work-card.js +6 -2
- package/dist/repertoire/tools-session.js +126 -0
- package/dist/senses/habit-turn-message.js +41 -3
- package/dist/senses/inner-dialog-worker.js +113 -1
- package/dist/senses/inner-dialog.js +24 -12
- package/dist/senses/pipeline.js +2 -2
- package/package.json +1 -1
|
@@ -692,24 +692,35 @@ async function runInnerDialogTurn(options) {
|
|
|
692
692
|
const agentRoot = (0, identity_1.getAgentRoot)();
|
|
693
693
|
const habitName = options.habitName;
|
|
694
694
|
const habitFilePath = path.join(agentRoot, "habits", `${habitName}.md`);
|
|
695
|
+
const preparedHabit = options.preparedHabit?.habit.name === habitName ? options.preparedHabit.habit : null;
|
|
695
696
|
// Read and parse the habit file
|
|
696
697
|
let habitBody;
|
|
697
698
|
let habitTitle = habitName;
|
|
698
699
|
let habitLastRun = null;
|
|
699
700
|
let habitOrigin = null;
|
|
700
701
|
let habitSurface = { family: true, originator: true, extra: [] };
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
habitOrigin = parsed.origin;
|
|
709
|
-
habitSurface = parsed.surface;
|
|
702
|
+
if (preparedHabit) {
|
|
703
|
+
habitBody = preparedHabit.body || undefined;
|
|
704
|
+
habitTitle = preparedHabit.title || habitName;
|
|
705
|
+
habitLastRun = preparedHabit.lastRun;
|
|
706
|
+
habitTools = preparedHabit.tools;
|
|
707
|
+
habitOrigin = preparedHabit.origin;
|
|
708
|
+
habitSurface = preparedHabit.surface;
|
|
710
709
|
}
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
else {
|
|
711
|
+
try {
|
|
712
|
+
const habitContent = fs.readFileSync(habitFilePath, "utf-8");
|
|
713
|
+
const parsed = (0, habit_runtime_state_1.applyHabitRuntimeState)(agentRoot, (0, habit_parser_1.parseHabitFile)(habitContent, habitFilePath));
|
|
714
|
+
habitBody = parsed.body || undefined;
|
|
715
|
+
habitTitle = parsed.title || habitName;
|
|
716
|
+
habitLastRun = parsed.lastRun;
|
|
717
|
+
habitTools = parsed.tools;
|
|
718
|
+
habitOrigin = parsed.origin;
|
|
719
|
+
habitSurface = parsed.surface;
|
|
720
|
+
}
|
|
721
|
+
catch {
|
|
722
|
+
// Habit file missing or unreadable
|
|
723
|
+
}
|
|
713
724
|
}
|
|
714
725
|
// If the habit file couldn't be read at all (no body, no title parsed), error message
|
|
715
726
|
if (habitBody === undefined && habitTitle === habitName) {
|
|
@@ -753,6 +764,7 @@ async function runInnerDialogTurn(options) {
|
|
|
753
764
|
arcResume,
|
|
754
765
|
deskOrientation,
|
|
755
766
|
surfacePolicy,
|
|
767
|
+
priorSessionSummary: options.preparedHabit?.habit.name === habitName ? options.preparedHabit.priorSessionSummary : undefined,
|
|
756
768
|
now,
|
|
757
769
|
});
|
|
758
770
|
}
|
|
@@ -875,7 +887,7 @@ async function runInnerDialogTurn(options) {
|
|
|
875
887
|
runAgent: core_1.runAgent,
|
|
876
888
|
postTurn: (turnMessages, sessionPathArg, usage, hooks, state) => {
|
|
877
889
|
const prepared = (0, context_1.postTurnTrim)(turnMessages, usage, hooks);
|
|
878
|
-
(0, context_1.deferPostTurnPersist)(sessionPathArg, prepared, usage, state);
|
|
890
|
+
return (0, context_1.deferPostTurnPersist)(sessionPathArg, prepared, usage, state);
|
|
879
891
|
},
|
|
880
892
|
accumulateFriendTokens: tokens_1.accumulateFriendTokens,
|
|
881
893
|
signal: options?.signal,
|
package/dist/senses/pipeline.js
CHANGED
|
@@ -827,7 +827,7 @@ async function handleInboundTurn(input) {
|
|
|
827
827
|
/* v8 ignore next -- defensive: error always set when errored @preserve */
|
|
828
828
|
result.error?.message ?? "unknown error", classification, currentProvider, currentBinding.model, agentName, inventory, {}, { currentLane });
|
|
829
829
|
input.failoverState.pending = failoverContext;
|
|
830
|
-
input.postTurn(sessionMessages, session.sessionPath, result.usage);
|
|
830
|
+
await input.postTurn(sessionMessages, session.sessionPath, result.usage);
|
|
831
831
|
try {
|
|
832
832
|
const agentRoot = (0, identity_1.getAgentRoot)();
|
|
833
833
|
const postTurnArc = readPostTurnFlightRecorderArcSnapshot(agentRoot);
|
|
@@ -902,7 +902,7 @@ async function handleInboundTurn(input) {
|
|
|
902
902
|
? { lastFriendActivityAt }
|
|
903
903
|
: undefined)
|
|
904
904
|
: (Object.keys(continuingState).length > 0 ? continuingState : undefined);
|
|
905
|
-
input.postTurn(sessionMessages, session.sessionPath, result.usage, undefined, nextState);
|
|
905
|
+
await input.postTurn(sessionMessages, session.sessionPath, result.usage, undefined, nextState);
|
|
906
906
|
try {
|
|
907
907
|
const agentRoot = (0, identity_1.getAgentRoot)();
|
|
908
908
|
const postTurnArc = readPostTurnFlightRecorderArcSnapshot(agentRoot);
|