@ouro.bot/cli 0.1.0-alpha.2 → 0.1.0-alpha.4
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/dist/heart/daemon/hatch-specialist.js +6 -1
- package/dist/heart/daemon/ouro-bot-entry.js +0 -0
- package/dist/heart/daemon/ouro-bot-wrapper.js +4 -3
- package/dist/heart/daemon/ouro-entry.js +0 -0
- package/dist/heart/daemon/runtime-logging.js +9 -5
- package/dist/heart/providers/anthropic.js +3 -0
- package/dist/heart/streaming.js +3 -0
- package/package.json +3 -3
|
@@ -42,7 +42,12 @@ const os = __importStar(require("os"));
|
|
|
42
42
|
const path = __importStar(require("path"));
|
|
43
43
|
const runtime_1 = require("../../nerves/runtime");
|
|
44
44
|
function getSpecialistIdentitySourceDir() {
|
|
45
|
-
|
|
45
|
+
// Prefer ~/AgentBundles/ if it exists (user may have customized identities)
|
|
46
|
+
const userSource = path.join(os.homedir(), "AgentBundles", "AdoptionSpecialist.ouro", "psyche", "identities");
|
|
47
|
+
if (fs.existsSync(userSource))
|
|
48
|
+
return userSource;
|
|
49
|
+
// Fall back to the bundled copy shipped with the npm package
|
|
50
|
+
return path.join(__dirname, "..", "..", "..", "AdoptionSpecialist.ouro", "psyche", "identities");
|
|
46
51
|
}
|
|
47
52
|
function getRepoSpecialistIdentitiesDir() {
|
|
48
53
|
return path.join(process.cwd(), "AdoptionSpecialist.ouro", "psyche", "identities");
|
|
File without changes
|
|
@@ -37,8 +37,9 @@ exports.runOuroBotWrapper = runOuroBotWrapper;
|
|
|
37
37
|
const runtime_1 = require("../../nerves/runtime");
|
|
38
38
|
const daemon_cli_1 = require("./daemon-cli");
|
|
39
39
|
async function defaultLoadCanonicalRunner() {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// Use the subpath export so we get the daemon-cli module directly,
|
|
41
|
+
// NOT the root entry point which has side-effects (immediately runs the CLI).
|
|
42
|
+
const specifier = "@ouro.bot/cli/runOuroCli";
|
|
42
43
|
const loaded = await Promise.resolve(`${specifier}`).then(s => __importStar(require(s)));
|
|
43
44
|
const candidate = Object.prototype.hasOwnProperty.call(loaded, "runOuroCli")
|
|
44
45
|
? loaded["runOuroCli"]
|
|
@@ -46,7 +47,7 @@ async function defaultLoadCanonicalRunner() {
|
|
|
46
47
|
if (typeof candidate === "function") {
|
|
47
48
|
return candidate;
|
|
48
49
|
}
|
|
49
|
-
throw new Error("@ouro.bot/cli does not export runOuroCli");
|
|
50
|
+
throw new Error("@ouro.bot/cli/runOuroCli does not export runOuroCli");
|
|
50
51
|
}
|
|
51
52
|
function defaultWriteStdout(_text) {
|
|
52
53
|
// Wrapper is intentionally silent by default to avoid duplicate terminal output.
|
|
File without changes
|
|
@@ -43,23 +43,27 @@ const DEFAULT_RUNTIME_LOGGING = {
|
|
|
43
43
|
level: "info",
|
|
44
44
|
sinks: ["terminal", "ndjson"],
|
|
45
45
|
};
|
|
46
|
+
function defaultLevelForProcess(processName) {
|
|
47
|
+
return processName === "daemon" ? "info" : "warn";
|
|
48
|
+
}
|
|
46
49
|
function isLogLevel(value) {
|
|
47
50
|
return value === "debug" || value === "info" || value === "warn" || value === "error";
|
|
48
51
|
}
|
|
49
|
-
function resolveRuntimeLoggingConfig(configPath) {
|
|
52
|
+
function resolveRuntimeLoggingConfig(configPath, processName) {
|
|
53
|
+
const defaultLevel = defaultLevelForProcess(processName);
|
|
50
54
|
let parsed = null;
|
|
51
55
|
try {
|
|
52
56
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
53
57
|
parsed = JSON.parse(raw);
|
|
54
58
|
}
|
|
55
59
|
catch {
|
|
56
|
-
return { ...DEFAULT_RUNTIME_LOGGING };
|
|
60
|
+
return { ...DEFAULT_RUNTIME_LOGGING, level: defaultLevel };
|
|
57
61
|
}
|
|
58
62
|
if (!parsed || typeof parsed !== "object") {
|
|
59
|
-
return { ...DEFAULT_RUNTIME_LOGGING };
|
|
63
|
+
return { ...DEFAULT_RUNTIME_LOGGING, level: defaultLevel };
|
|
60
64
|
}
|
|
61
65
|
const candidate = parsed;
|
|
62
|
-
const level = isLogLevel(candidate.level) ? candidate.level :
|
|
66
|
+
const level = isLogLevel(candidate.level) ? candidate.level : defaultLevel;
|
|
63
67
|
const sinks = Array.isArray(candidate.sinks)
|
|
64
68
|
? candidate.sinks.filter((entry) => entry === "terminal" || entry === "ndjson")
|
|
65
69
|
: DEFAULT_RUNTIME_LOGGING.sinks;
|
|
@@ -71,7 +75,7 @@ function resolveRuntimeLoggingConfig(configPath) {
|
|
|
71
75
|
function configureDaemonRuntimeLogger(processName, options = {}) {
|
|
72
76
|
const homeDir = options.homeDir ?? os.homedir();
|
|
73
77
|
const configPath = options.configPath ?? path.join(homeDir, ".agentstate", "daemon", "logging.json");
|
|
74
|
-
const config = resolveRuntimeLoggingConfig(configPath);
|
|
78
|
+
const config = resolveRuntimeLoggingConfig(configPath, processName);
|
|
75
79
|
const sinks = config.sinks.map((sinkName) => {
|
|
76
80
|
if (sinkName === "terminal") {
|
|
77
81
|
return (0, nerves_1.createTerminalSink)();
|
|
@@ -98,6 +98,9 @@ function toAnthropicMessages(messages) {
|
|
|
98
98
|
}
|
|
99
99
|
if (assistant.tool_calls) {
|
|
100
100
|
for (const toolCall of assistant.tool_calls) {
|
|
101
|
+
/* v8 ignore next -- type narrowing: OpenAI SDK only emits function tool_calls @preserve */
|
|
102
|
+
if (toolCall.type !== "function")
|
|
103
|
+
continue;
|
|
101
104
|
blocks.push({
|
|
102
105
|
type: "tool_use",
|
|
103
106
|
id: toolCall.id,
|
package/dist/heart/streaming.js
CHANGED
|
@@ -106,6 +106,9 @@ function toResponsesInput(messages) {
|
|
|
106
106
|
}
|
|
107
107
|
if (a.tool_calls) {
|
|
108
108
|
for (const tc of a.tool_calls) {
|
|
109
|
+
/* v8 ignore next -- type narrowing: OpenAI SDK only emits function tool_calls @preserve */
|
|
110
|
+
if (tc.type !== "function")
|
|
111
|
+
continue;
|
|
109
112
|
input.push({
|
|
110
113
|
type: "function_call",
|
|
111
114
|
call_id: tc.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"main": "dist/heart/daemon/ouro-entry.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ouro": "dist/heart/daemon/ouro-entry.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"subagents/"
|
|
13
13
|
],
|
|
14
14
|
"exports": {
|
|
15
|
-
".": "./dist/heart/daemon/
|
|
15
|
+
".": "./dist/heart/daemon/daemon-cli.js",
|
|
16
16
|
"./runOuroCli": "./dist/heart/daemon/daemon-cli.js"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
32
32
|
"@microsoft/teams.apps": "^2.0.5",
|
|
33
33
|
"@microsoft/teams.dev": "^2.0.5",
|
|
34
|
-
"openai": "^
|
|
34
|
+
"openai": "^6.27.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@vitest/coverage-v8": "^4.0.18",
|