slashvibe-mcp 0.9.10 → 0.9.11
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/arrival.js +25 -1
- package/package.json +1 -1
- package/tools/line.js +7 -1
package/arrival.js
CHANGED
|
@@ -252,6 +252,30 @@ function record(threads, me, { since = 0, roster = [], bindingFor = null, env =
|
|
|
252
252
|
return out;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* What this side's agent just said for its person over an open line, queued so
|
|
257
|
+
* the person is SHOWN it by the hook after the answering tool call. The promise
|
|
258
|
+
* is that they are always told afterwards; measured, the agent forgot to say it
|
|
259
|
+
* in six runs of eight, so it no longer depends on the agent. The row is not an
|
|
260
|
+
* arrival: `kind: 'told'` keeps it from ever being answered.
|
|
261
|
+
*/
|
|
262
|
+
function told({ me, to, said, id }, env = process.env) {
|
|
263
|
+
const safe = safeId(`told-${id}`);
|
|
264
|
+
const mine = String(me || '').toLowerCase();
|
|
265
|
+
if (!safe || !mine) return false;
|
|
266
|
+
const who = inertField(to, 40);
|
|
267
|
+
try {
|
|
268
|
+
const dir = spoolDir(env);
|
|
269
|
+
ensureDir(dir);
|
|
270
|
+
writeAtomic(path.join(dir, `${safe}.json`), {
|
|
271
|
+
id: safe, kind: 'told', to: mine, from: mine, at: Date.now(),
|
|
272
|
+
context: `/vibe — the person you are working with has just been shown, word for word, what you answered @${who} over the open line. Do not repeat it. Carry on with their task.`,
|
|
273
|
+
line: `/vibe · your agent answered @${who} over your open line: "${inertField(said, 200)}"`,
|
|
274
|
+
});
|
|
275
|
+
return true;
|
|
276
|
+
} catch { return false; }
|
|
277
|
+
}
|
|
278
|
+
|
|
255
279
|
/**
|
|
256
280
|
* Housekeeping, run by the server process: drop spool rows that are stale or
|
|
257
281
|
* addressed to an account that is no longer the one signed in here, and old
|
|
@@ -319,7 +343,7 @@ async function wroteLastPeople(threads, me, { kindOf = null, limit = 3, ...opts
|
|
|
319
343
|
|
|
320
344
|
module.exports = {
|
|
321
345
|
wroteLastPeople,
|
|
322
|
-
spoolDir, safeId, claim, isClaimed, isSpooled,
|
|
346
|
+
spoolDir, safeId, claim, isClaimed, isSpooled, told,
|
|
323
347
|
render, pickArrivals, record, prune, wroteLast,
|
|
324
348
|
SPOOL_TTL_MS, ARRIVAL_SLACK_MS,
|
|
325
349
|
};
|
package/package.json
CHANGED
package/tools/line.js
CHANGED
|
@@ -129,7 +129,11 @@ const answerDefinition = {
|
|
|
129
129
|
function arrived(id) {
|
|
130
130
|
const safe = arrival.safeId(String(id || '').replace(/^#/, ''));
|
|
131
131
|
if (!safe) return null;
|
|
132
|
-
try {
|
|
132
|
+
try {
|
|
133
|
+
const row = JSON.parse(fs.readFileSync(path.join(arrival.spoolDir(), `${safe}.json`), 'utf8'));
|
|
134
|
+
// Only something that ARRIVED. The note of what this side said is not one.
|
|
135
|
+
return row && row.kind !== 'told' ? row : null;
|
|
136
|
+
} catch { return null; }
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
async function answerHandler(args = {}) {
|
|
@@ -152,6 +156,8 @@ async function answerHandler(args = {}) {
|
|
|
152
156
|
const sent = await deliver({ to, message: message + line.ANSWERED(me), replyTo: id, origin: 'agent_line' });
|
|
153
157
|
if (!sent.data || !sent.data.sent) return sent;
|
|
154
158
|
line.record({ kind: 'answered', with: to, id: sent.data.message_id, answers: id, asked: line.stripMark(row.text || ''), said: message });
|
|
159
|
+
// The person is shown the answer by the hook, not by the agent's memory.
|
|
160
|
+
arrival.told({ me, to, said: message, id: sent.data.message_id });
|
|
155
161
|
return {
|
|
156
162
|
display: `Answered @${to} over the open line. Now tell the person here, in one line: @${to} asked "${inertField(line.stripMark(row.text || ''), 120)}" and you told them "${inertField(message, 160)}". Then carry on with their task.`,
|
|
157
163
|
data: { sent: true, message_id: sent.data.message_id, to },
|