@ouro.bot/cli 0.1.0-alpha.657 → 0.1.0-alpha.658
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/README.md +13 -13
- package/changelog.json +9 -0
- package/dist/arc/evolution.js +1 -1
- package/dist/arc/flight-recorder.js +369 -0
- package/dist/arc/obligations.js +24 -2
- package/dist/heart/active-work.js +1 -1
- package/dist/heart/config-registry.js +5 -5
- package/dist/heart/daemon/agent-config-check.js +1 -1
- package/dist/heart/daemon/agent-service.js +18 -17
- package/dist/heart/daemon/cli-exec.js +27 -12
- package/dist/heart/daemon/cli-help.js +14 -0
- package/dist/heart/daemon/cli-parse.js +26 -0
- package/dist/heart/daemon/daemon-entry.js +1 -1
- package/dist/heart/daemon/daemon.js +3 -3
- package/dist/heart/daemon/hooks/bundle-meta.js +29 -9
- package/dist/heart/daemon/inner-status.js +4 -15
- package/dist/heart/habits/habit-parser.js +64 -1
- package/dist/heart/hatch/hatch-flow.js +17 -9
- package/dist/heart/hatch/specialist-tools.js +15 -11
- package/dist/heart/kept-notes.js +5 -73
- package/dist/heart/mailbox/readers/runtime-readers.js +21 -49
- package/dist/heart/mcp/mcp-server.js +8 -8
- package/dist/heart/session-events.js +1 -31
- package/dist/heart/start-of-turn-packet.js +8 -2
- package/dist/heart/tool-description.js +15 -3
- package/dist/heart/turn-context.js +27 -7
- package/dist/heart/work-card.js +386 -0
- package/dist/mailbox-ui/assets/{index-9-AxCxuB.js → index-Cbasiy6y.js} +1 -1
- package/dist/mailbox-ui/index.html +1 -1
- package/dist/mind/bundle-manifest.js +9 -3
- package/dist/mind/context.js +1 -2
- package/dist/mind/desk-section.js +53 -1
- package/dist/mind/diary.js +2 -3
- package/dist/mind/note-search.js +36 -106
- package/dist/mind/prompt.js +37 -102
- package/dist/mind/record-paths.js +312 -0
- package/dist/repertoire/bundle-templates.js +4 -5
- package/dist/repertoire/tools-bundle.js +1 -1
- package/dist/repertoire/tools-evolution.js +4 -4
- package/dist/repertoire/tools-notes.js +42 -62
- package/dist/repertoire/tools-record.js +16 -11
- package/dist/repertoire/tools-session.js +4 -4
- package/dist/repertoire/tools.js +1 -1
- package/dist/senses/habit-turn-message.js +19 -5
- package/dist/senses/inner-dialog-worker.js +58 -9
- package/dist/senses/inner-dialog.js +30 -11
- package/dist/senses/pipeline.js +135 -1
- package/dist/util/frontmatter.js +17 -1
- package/package.json +3 -3
- package/skills/configure-dev-tools.md +1 -1
- package/skills/travel-planning.md +1 -1
- package/dist/mind/journal-index.js +0 -162
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.indexJournalFiles = indexJournalFiles;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const session_events_1 = require("../heart/session-events");
|
|
40
|
-
const runtime_1 = require("../nerves/runtime");
|
|
41
|
-
const TEXT_EXTENSIONS = new Set([".md", ".txt"]);
|
|
42
|
-
const PREVIEW_CHAR_LIMIT = 500;
|
|
43
|
-
function readExistingIndex(indexPath) {
|
|
44
|
-
try {
|
|
45
|
-
const raw = fs.readFileSync(indexPath, "utf8");
|
|
46
|
-
const parsed = JSON.parse(raw);
|
|
47
|
-
if (!Array.isArray(parsed))
|
|
48
|
-
return [];
|
|
49
|
-
return parsed;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function extractPreview(content) {
|
|
56
|
-
const trimmed = content.trim();
|
|
57
|
-
if (!trimmed)
|
|
58
|
-
return "";
|
|
59
|
-
return trimmed.split("\n")[0].replace(/^#+\s*/, "").trim();
|
|
60
|
-
}
|
|
61
|
-
async function indexJournalFiles(journalDir, indexPath, embedProvider) {
|
|
62
|
-
// Read existing index
|
|
63
|
-
const existingIndex = readExistingIndex(indexPath);
|
|
64
|
-
const indexMap = new Map();
|
|
65
|
-
for (const entry of existingIndex) {
|
|
66
|
-
indexMap.set(entry.filename, entry);
|
|
67
|
-
}
|
|
68
|
-
// Scan journal dir for text files
|
|
69
|
-
let dirEntries;
|
|
70
|
-
try {
|
|
71
|
-
dirEntries = fs.readdirSync(journalDir, { withFileTypes: true });
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
(0, runtime_1.emitNervesEvent)({
|
|
75
|
-
component: "mind",
|
|
76
|
-
event: "mind.journal_index_scan",
|
|
77
|
-
message: "journal dir not found or unreadable",
|
|
78
|
-
meta: { journalDir },
|
|
79
|
-
});
|
|
80
|
-
return 0;
|
|
81
|
-
}
|
|
82
|
-
const textFiles = dirEntries.filter((entry) => {
|
|
83
|
-
if (!entry.isFile())
|
|
84
|
-
return false;
|
|
85
|
-
if (entry.name.startsWith("."))
|
|
86
|
-
return false;
|
|
87
|
-
const ext = path.extname(entry.name).toLowerCase();
|
|
88
|
-
return TEXT_EXTENSIONS.has(ext);
|
|
89
|
-
});
|
|
90
|
-
if (textFiles.length === 0) {
|
|
91
|
-
(0, runtime_1.emitNervesEvent)({
|
|
92
|
-
component: "mind",
|
|
93
|
-
event: "mind.journal_index_scan",
|
|
94
|
-
message: "no text files found in journal",
|
|
95
|
-
meta: { journalDir },
|
|
96
|
-
});
|
|
97
|
-
return 0;
|
|
98
|
-
}
|
|
99
|
-
let newlyIndexed = 0;
|
|
100
|
-
for (const file of textFiles) {
|
|
101
|
-
const filePath = path.join(journalDir, file.name);
|
|
102
|
-
let stat;
|
|
103
|
-
try {
|
|
104
|
-
stat = fs.statSync(filePath);
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
/* v8 ignore next -- filesystem race: file deleted between readdir and stat @preserve */
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
// Check if already indexed with same mtime
|
|
111
|
-
const existing = indexMap.get(file.name);
|
|
112
|
-
if (existing && existing.mtime === stat.mtimeMs) {
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
// Read content for embedding
|
|
116
|
-
let content;
|
|
117
|
-
try {
|
|
118
|
-
content = fs.readFileSync(filePath, "utf8");
|
|
119
|
-
}
|
|
120
|
-
catch {
|
|
121
|
-
/* v8 ignore next -- filesystem race: file deleted between stat and read @preserve */
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
const preview = (0, session_events_1.capStructuredRecordString)(extractPreview(content));
|
|
125
|
-
const embedText = content.slice(0, PREVIEW_CHAR_LIMIT);
|
|
126
|
-
// Generate embedding
|
|
127
|
-
let embedding;
|
|
128
|
-
try {
|
|
129
|
-
const vectors = await embedProvider.embed([embedText]);
|
|
130
|
-
embedding = vectors[0] ?? [];
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
(0, runtime_1.emitNervesEvent)({
|
|
134
|
-
level: "warn",
|
|
135
|
-
component: "mind",
|
|
136
|
-
event: "mind.journal_embedding_error",
|
|
137
|
-
message: "embedding failed for journal file",
|
|
138
|
-
meta: { filename: file.name },
|
|
139
|
-
});
|
|
140
|
-
embedding = [];
|
|
141
|
-
}
|
|
142
|
-
indexMap.set(file.name, {
|
|
143
|
-
filename: file.name,
|
|
144
|
-
embedding,
|
|
145
|
-
mtime: stat.mtimeMs,
|
|
146
|
-
preview,
|
|
147
|
-
});
|
|
148
|
-
newlyIndexed++;
|
|
149
|
-
}
|
|
150
|
-
// Write updated index back
|
|
151
|
-
if (newlyIndexed > 0) {
|
|
152
|
-
const updatedIndex = Array.from(indexMap.values());
|
|
153
|
-
fs.writeFileSync(indexPath, JSON.stringify(updatedIndex, null, 2), "utf8");
|
|
154
|
-
}
|
|
155
|
-
(0, runtime_1.emitNervesEvent)({
|
|
156
|
-
component: "mind",
|
|
157
|
-
event: "mind.journal_index_complete",
|
|
158
|
-
message: "journal indexing complete",
|
|
159
|
-
meta: { journalDir, newlyIndexed, total: indexMap.size },
|
|
160
|
-
});
|
|
161
|
-
return newlyIndexed;
|
|
162
|
-
}
|