@ouro.bot/cli 0.1.0-alpha.6 → 0.1.0-alpha.60
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/AdoptionSpecialist.ouro/agent.json +70 -9
- package/AdoptionSpecialist.ouro/psyche/SOUL.md +5 -2
- package/AdoptionSpecialist.ouro/psyche/identities/monty.md +2 -2
- package/README.md +147 -205
- package/assets/ouroboros.png +0 -0
- package/changelog.json +325 -0
- package/dist/heart/active-work.js +178 -0
- package/dist/heart/bridges/manager.js +358 -0
- package/dist/heart/bridges/state-machine.js +135 -0
- package/dist/heart/bridges/store.js +123 -0
- package/dist/heart/config.js +57 -23
- package/dist/heart/core.js +236 -90
- package/dist/heart/cross-chat-delivery.js +146 -0
- package/dist/heart/daemon/agent-discovery.js +81 -0
- package/dist/heart/daemon/auth-flow.js +351 -0
- package/dist/heart/daemon/daemon-cli.js +1173 -227
- package/dist/heart/daemon/daemon-entry.js +55 -6
- package/dist/heart/daemon/daemon-runtime-sync.js +212 -0
- package/dist/heart/daemon/daemon.js +189 -10
- package/dist/heart/daemon/hatch-animation.js +10 -3
- package/dist/heart/daemon/hatch-flow.js +4 -82
- package/dist/heart/daemon/hooks/bundle-meta.js +92 -0
- package/dist/heart/daemon/launchd.js +159 -0
- package/dist/heart/daemon/log-tailer.js +4 -3
- package/dist/heart/daemon/message-router.js +17 -8
- package/dist/heart/daemon/ouro-bot-entry.js +0 -0
- package/dist/heart/daemon/ouro-bot-global-installer.js +128 -0
- package/dist/heart/daemon/ouro-entry.js +0 -0
- package/dist/heart/daemon/ouro-path-installer.js +178 -0
- package/dist/heart/daemon/ouro-uti.js +11 -2
- package/dist/heart/daemon/process-manager.js +14 -1
- package/dist/heart/daemon/run-hooks.js +37 -0
- package/dist/heart/daemon/runtime-logging.js +58 -15
- package/dist/heart/daemon/runtime-metadata.js +219 -0
- package/dist/heart/daemon/runtime-mode.js +67 -0
- package/dist/heart/daemon/sense-manager.js +307 -0
- package/dist/heart/daemon/socket-client.js +202 -0
- package/dist/heart/daemon/specialist-orchestrator.js +53 -84
- package/dist/heart/daemon/specialist-prompt.js +64 -5
- package/dist/heart/daemon/specialist-tools.js +213 -58
- package/dist/heart/daemon/staged-restart.js +114 -0
- package/dist/heart/daemon/subagent-installer.js +48 -7
- package/dist/heart/daemon/thoughts.js +379 -0
- package/dist/heart/daemon/update-checker.js +111 -0
- package/dist/heart/daemon/update-hooks.js +138 -0
- package/dist/heart/daemon/wrapper-publish-guard.js +86 -0
- package/dist/heart/delegation.js +62 -0
- package/dist/heart/identity.js +122 -19
- package/dist/heart/kicks.js +1 -19
- package/dist/heart/model-capabilities.js +40 -0
- package/dist/heart/progress-story.js +42 -0
- package/dist/heart/providers/anthropic.js +74 -9
- package/dist/heart/providers/azure.js +86 -7
- package/dist/heart/providers/minimax.js +4 -0
- package/dist/heart/providers/openai-codex.js +12 -3
- package/dist/heart/safe-workspace.js +228 -0
- package/dist/heart/sense-truth.js +61 -0
- package/dist/heart/session-activity.js +169 -0
- package/dist/heart/session-recall.js +116 -0
- package/dist/heart/streaming.js +100 -22
- package/dist/heart/target-resolution.js +123 -0
- package/dist/heart/turn-coordinator.js +28 -0
- package/dist/mind/associative-recall.js +14 -2
- package/dist/mind/bundle-manifest.js +70 -0
- package/dist/mind/context.js +27 -11
- package/dist/mind/first-impressions.js +16 -2
- package/dist/mind/friends/channel.js +35 -0
- package/dist/mind/friends/group-context.js +144 -0
- package/dist/mind/friends/store-file.js +19 -0
- package/dist/mind/friends/trust-explanation.js +74 -0
- package/dist/mind/friends/types.js +8 -0
- package/dist/mind/memory.js +27 -26
- package/dist/mind/pending.js +72 -9
- package/dist/mind/phrases.js +1 -0
- package/dist/mind/prompt.js +299 -77
- package/dist/mind/token-estimate.js +8 -12
- package/dist/nerves/cli-logging.js +15 -2
- package/dist/nerves/coverage/run-artifacts.js +1 -1
- package/dist/repertoire/ado-client.js +4 -2
- package/dist/repertoire/coding/feedback.js +134 -0
- package/dist/repertoire/coding/index.js +4 -1
- package/dist/repertoire/coding/manager.js +62 -4
- package/dist/repertoire/coding/spawner.js +3 -3
- package/dist/repertoire/coding/tools.js +41 -2
- package/dist/repertoire/data/ado-endpoints.json +188 -0
- package/dist/repertoire/tasks/board.js +12 -0
- package/dist/repertoire/tasks/index.js +23 -9
- package/dist/repertoire/tasks/transitions.js +1 -2
- package/dist/repertoire/tools-base.js +629 -251
- package/dist/repertoire/tools-bluebubbles.js +93 -0
- package/dist/repertoire/tools-teams.js +58 -25
- package/dist/repertoire/tools.js +92 -48
- package/dist/senses/bluebubbles-client.js +210 -5
- package/dist/senses/bluebubbles-entry.js +2 -0
- package/dist/senses/bluebubbles-inbound-log.js +109 -0
- package/dist/senses/bluebubbles-media.js +339 -0
- package/dist/senses/bluebubbles-model.js +12 -4
- package/dist/senses/bluebubbles-mutation-log.js +45 -5
- package/dist/senses/bluebubbles-runtime-state.js +109 -0
- package/dist/senses/bluebubbles-session-cleanup.js +72 -0
- package/dist/senses/bluebubbles.js +890 -45
- package/dist/senses/cli-layout.js +87 -0
- package/dist/senses/cli.js +345 -144
- package/dist/senses/continuity.js +94 -0
- package/dist/senses/debug-activity.js +148 -0
- package/dist/senses/inner-dialog-worker.js +47 -18
- package/dist/senses/inner-dialog.js +330 -84
- package/dist/senses/pipeline.js +278 -0
- package/dist/senses/teams.js +570 -129
- package/dist/senses/trust-gate.js +112 -2
- package/package.json +14 -3
- package/subagents/README.md +46 -33
- package/subagents/work-doer.md +28 -24
- package/subagents/work-merger.md +24 -30
- package/subagents/work-planner.md +44 -27
- package/dist/heart/daemon/specialist-session.js +0 -142
- package/dist/inner-worker-entry.js +0 -4
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runSpecialistSession = runSpecialistSession;
|
|
4
|
-
const runtime_1 = require("../../nerves/runtime");
|
|
5
|
-
/**
|
|
6
|
-
* Run the specialist conversation session loop.
|
|
7
|
-
*
|
|
8
|
-
* The loop:
|
|
9
|
-
* 1. Initialize messages with system prompt
|
|
10
|
-
* 2. Prompt user -> add to messages -> call streamTurn -> process result
|
|
11
|
-
* 3. If result has no tool calls: push assistant message, re-prompt
|
|
12
|
-
* 4. If result has final_answer sole call: extract answer, emit via callbacks, done
|
|
13
|
-
* 5. If result has other tool calls: execute each, push tool results, continue loop
|
|
14
|
-
* 6. On abort signal: clean exit
|
|
15
|
-
* 7. Return { hatchedAgentName } -- name from hatch_agent if called
|
|
16
|
-
*/
|
|
17
|
-
async function runSpecialistSession(deps) {
|
|
18
|
-
const { providerRuntime, systemPrompt, tools, execTool, readline, callbacks, signal } = deps;
|
|
19
|
-
(0, runtime_1.emitNervesEvent)({
|
|
20
|
-
component: "daemon",
|
|
21
|
-
event: "daemon.specialist_session_start",
|
|
22
|
-
message: "starting specialist session loop",
|
|
23
|
-
meta: {},
|
|
24
|
-
});
|
|
25
|
-
const messages = [
|
|
26
|
-
{ role: "system", content: systemPrompt },
|
|
27
|
-
];
|
|
28
|
-
let hatchedAgentName = null;
|
|
29
|
-
let done = false;
|
|
30
|
-
try {
|
|
31
|
-
while (!done) {
|
|
32
|
-
if (signal?.aborted)
|
|
33
|
-
break;
|
|
34
|
-
// Get user input
|
|
35
|
-
const userInput = await readline.question("> ");
|
|
36
|
-
if (!userInput.trim())
|
|
37
|
-
continue;
|
|
38
|
-
messages.push({ role: "user", content: userInput });
|
|
39
|
-
providerRuntime.resetTurnState(messages);
|
|
40
|
-
// Inner loop: process tool calls until we get a final_answer or plain text
|
|
41
|
-
let turnDone = false;
|
|
42
|
-
while (!turnDone) {
|
|
43
|
-
if (signal?.aborted) {
|
|
44
|
-
done = true;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
callbacks.onModelStart();
|
|
48
|
-
const result = await providerRuntime.streamTurn({
|
|
49
|
-
messages,
|
|
50
|
-
activeTools: tools,
|
|
51
|
-
callbacks,
|
|
52
|
-
signal,
|
|
53
|
-
});
|
|
54
|
-
// Build assistant message
|
|
55
|
-
const assistantMsg = {
|
|
56
|
-
role: "assistant",
|
|
57
|
-
};
|
|
58
|
-
if (result.content)
|
|
59
|
-
assistantMsg.content = result.content;
|
|
60
|
-
if (result.toolCalls.length) {
|
|
61
|
-
assistantMsg.tool_calls = result.toolCalls.map((tc) => ({
|
|
62
|
-
id: tc.id,
|
|
63
|
-
type: "function",
|
|
64
|
-
function: { name: tc.name, arguments: tc.arguments },
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
if (!result.toolCalls.length) {
|
|
68
|
-
// Plain text response -- push and re-prompt
|
|
69
|
-
messages.push(assistantMsg);
|
|
70
|
-
turnDone = true;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
// Check for final_answer
|
|
74
|
-
const isSoleFinalAnswer = result.toolCalls.length === 1 && result.toolCalls[0].name === "final_answer";
|
|
75
|
-
if (isSoleFinalAnswer) {
|
|
76
|
-
let answer;
|
|
77
|
-
try {
|
|
78
|
-
const parsed = JSON.parse(result.toolCalls[0].arguments);
|
|
79
|
-
if (typeof parsed === "string") {
|
|
80
|
-
answer = parsed;
|
|
81
|
-
}
|
|
82
|
-
else if (parsed.answer != null) {
|
|
83
|
-
answer = parsed.answer;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
// malformed
|
|
88
|
-
}
|
|
89
|
-
if (answer != null) {
|
|
90
|
-
callbacks.onTextChunk(answer);
|
|
91
|
-
messages.push(assistantMsg);
|
|
92
|
-
done = true;
|
|
93
|
-
turnDone = true;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
// Malformed final_answer -- ask model to retry
|
|
97
|
-
messages.push(assistantMsg);
|
|
98
|
-
messages.push({
|
|
99
|
-
role: "tool",
|
|
100
|
-
tool_call_id: result.toolCalls[0].id,
|
|
101
|
-
content: "your final_answer was incomplete or malformed. call final_answer again with your complete response.",
|
|
102
|
-
});
|
|
103
|
-
providerRuntime.appendToolOutput(result.toolCalls[0].id, "retry");
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
// Execute tool calls
|
|
107
|
-
messages.push(assistantMsg);
|
|
108
|
-
for (const tc of result.toolCalls) {
|
|
109
|
-
if (signal?.aborted)
|
|
110
|
-
break;
|
|
111
|
-
let args = {};
|
|
112
|
-
try {
|
|
113
|
-
args = JSON.parse(tc.arguments);
|
|
114
|
-
}
|
|
115
|
-
catch {
|
|
116
|
-
// ignore parse error
|
|
117
|
-
}
|
|
118
|
-
callbacks.onToolStart(tc.name, args);
|
|
119
|
-
let toolResult;
|
|
120
|
-
try {
|
|
121
|
-
toolResult = await execTool(tc.name, args);
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
toolResult = `error: ${e}`;
|
|
125
|
-
}
|
|
126
|
-
callbacks.onToolEnd(tc.name, tc.name, true);
|
|
127
|
-
// Track hatchling name
|
|
128
|
-
if (tc.name === "hatch_agent" && args.name) {
|
|
129
|
-
hatchedAgentName = args.name;
|
|
130
|
-
}
|
|
131
|
-
messages.push({ role: "tool", tool_call_id: tc.id, content: toolResult });
|
|
132
|
-
providerRuntime.appendToolOutput(tc.id, toolResult);
|
|
133
|
-
}
|
|
134
|
-
// After processing tool calls, continue inner loop for tool result processing
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
finally {
|
|
139
|
-
readline.close();
|
|
140
|
-
}
|
|
141
|
-
return { hatchedAgentName };
|
|
142
|
-
}
|