instar 1.3.841 → 1.3.843
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +31 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/A2aMeshInbox.d.ts +26 -0
- package/dist/core/A2aMeshInbox.d.ts.map +1 -0
- package/dist/core/A2aMeshInbox.js +34 -0
- package/dist/core/A2aMeshInbox.js.map +1 -0
- package/dist/core/MeshRpc.d.ts +8 -0
- package/dist/core/MeshRpc.d.ts.map +1 -1
- package/dist/core/MeshRpc.js +6 -0
- package/dist/core/MeshRpc.js.map +1 -1
- package/dist/core/SpawnAdmission.d.ts +9 -0
- package/dist/core/SpawnAdmission.d.ts.map +1 -1
- package/dist/core/SpawnAdmission.js +34 -3
- package/dist/core/SpawnAdmission.js.map +1 -1
- package/dist/messaging/MenteeReceiverConfig.d.ts +2 -0
- package/dist/messaging/MenteeReceiverConfig.d.ts.map +1 -1
- package/dist/messaging/MenteeReceiverConfig.js.map +1 -1
- package/dist/scheduler/MentorOnboardingRunner.d.ts +3 -0
- package/dist/scheduler/MentorOnboardingRunner.d.ts.map +1 -1
- package/dist/scheduler/MentorOnboardingRunner.js.map +1 -1
- package/dist/server/AgentServer.d.ts +4 -1
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +40 -31
- package/dist/server/AgentServer.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +3 -3
- package/upgrades/1.3.842.md +26 -0
- package/upgrades/1.3.843.md +25 -0
- package/upgrades/side-effects/mentor-cross-machine-a2a-relay.md +67 -0
- package/upgrades/side-effects/spawn-admission-respawn-dead-enforce.md +78 -0
|
@@ -125,7 +125,7 @@ import { buildAutoloopGoal } from '../scheduler/MentorAutonomousGuardian.js';
|
|
|
125
125
|
import { STAGE_A_ALLOWED_TOOLS, buildConversationSurface, parseMenteeReplies, parseMentorSent, } from '../monitoring/MentorStageA.js';
|
|
126
126
|
import { analyzeForensics } from '../scheduler/MentorStageBForensics.js';
|
|
127
127
|
import { TelegramAdapter as MentorTelegramAdapter } from '../messaging/TelegramAdapter.js';
|
|
128
|
-
import {
|
|
128
|
+
import { A2A_VERSION } from '../messaging/AgentTelegramComms.js';
|
|
129
129
|
import { AgentTelegramLedger, defaultLedgerPaths as defaultA2aLedgerPaths } from '../messaging/AgentTelegramLedger.js';
|
|
130
130
|
import { DEFAULT_MENTEE_CONFIG } from '../messaging/MenteeReceiverConfig.js';
|
|
131
131
|
import { ProcessedIdStore } from '../messaging/ProcessedIdStore.js';
|
|
@@ -188,6 +188,7 @@ export class AgentServer {
|
|
|
188
188
|
poolLink;
|
|
189
189
|
poolPollCache;
|
|
190
190
|
meshSelfId;
|
|
191
|
+
deliverA2aToMachine;
|
|
191
192
|
routeContext = null;
|
|
192
193
|
deliverySentinel = null;
|
|
193
194
|
deliveryStore = null;
|
|
@@ -343,6 +344,7 @@ export class AgentServer {
|
|
|
343
344
|
this.poolLink = options.poolLink ?? undefined;
|
|
344
345
|
this.poolPollCache = options.poolPollCache ?? undefined;
|
|
345
346
|
this.meshSelfId = options.meshSelfId ?? undefined;
|
|
347
|
+
this.deliverA2aToMachine = options.deliverA2aToMachine;
|
|
346
348
|
this.state = options.state;
|
|
347
349
|
this.hookEventReceiver = options.hookEventReceiver ?? undefined;
|
|
348
350
|
this.toneGate = options.messagingToneGate ?? null;
|
|
@@ -2904,7 +2906,7 @@ export class AgentServer {
|
|
|
2904
2906
|
* the session is killed and an empty reply is logged — no partial
|
|
2905
2907
|
* transcript is sent.
|
|
2906
2908
|
* 3. Captures the tmux pane transcript as the reply.
|
|
2907
|
-
* 4. Sends the reply back
|
|
2909
|
+
* 4. Sends the reply back through the canonical A2A delivery seam with
|
|
2908
2910
|
* `role='mentor-reply'` and `corr=msg.corr || msg.id` so the
|
|
2909
2911
|
* mentor's `OutstandingPromptTracker` can clear by correlation.
|
|
2910
2912
|
*
|
|
@@ -3016,6 +3018,7 @@ export class AgentServer {
|
|
|
3016
3018
|
// (knownAgents[instar-codey].botId === senderBotId) passes.
|
|
3017
3019
|
fromBotId: self.ownPrimaryBotId(),
|
|
3018
3020
|
toBotId: menteeCfg.knownMentors[msg.from]?.botId,
|
|
3021
|
+
targetMachineId: menteeCfg.knownMentors[msg.from]?.machineId,
|
|
3019
3022
|
});
|
|
3020
3023
|
};
|
|
3021
3024
|
roleHandlers.set('mentor', mentorMessageHandler);
|
|
@@ -3152,37 +3155,42 @@ export class AgentServer {
|
|
|
3152
3155
|
catch (err) {
|
|
3153
3156
|
console.warn(`[a2a] local-inbox delivery attempt failed (to=${opts.toAgent}): ${err instanceof Error ? err.message : String(err)}`);
|
|
3154
3157
|
}
|
|
3155
|
-
// ── Cross-machine
|
|
3156
|
-
//
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3158
|
+
// ── Cross-machine: signed MeshRpc → recipient's EXISTING inbox hook ──
|
|
3159
|
+
// Telegram remains a visible mirror only. It can never make this branch
|
|
3160
|
+
// successful because Telegram bots do not receive other bots' messages.
|
|
3161
|
+
if (opts.targetMachineId && this.deliverA2aToMachine && opts.telegramTopicId !== undefined) {
|
|
3162
|
+
const tsNow = Date.now();
|
|
3163
|
+
const marker = `[a2a:from=${opts.fromAgent} to=${opts.toAgent} role=${opts.role} id=${id} corr=${opts.corr} ts=${tsNow} v=${A2A_VERSION}]`;
|
|
3164
|
+
const result = await this.deliverA2aToMachine({
|
|
3165
|
+
machineId: opts.targetMachineId,
|
|
3166
|
+
targetAgent: opts.toAgent,
|
|
3167
|
+
text: `${marker}\n\n${opts.body}`,
|
|
3168
|
+
topicId: opts.telegramTopicId,
|
|
3169
|
+
senderAgent: opts.fromAgent,
|
|
3170
|
+
senderBotId: opts.fromBotId ?? `${opts.fromAgent}-mesh`,
|
|
3171
|
+
}).catch((err) => ({ ok: false, reason: err instanceof Error ? err.message : String(err) }));
|
|
3172
|
+
if (result.ok && result.agentMessage === true) {
|
|
3173
|
+
try {
|
|
3174
|
+
ledger.appendSent({
|
|
3175
|
+
ts: tsNow, from: opts.fromAgent, to: opts.toAgent, role: opts.role,
|
|
3176
|
+
id, corr: opts.corr, result: 'sent', transport: 'a2a-inbox-mesh',
|
|
3177
|
+
});
|
|
3178
|
+
}
|
|
3179
|
+
catch { /* best-effort */ }
|
|
3180
|
+
console.log(`[a2a] delivered → ${opts.toAgent} via signed mesh inbox (machine=${opts.targetMachineId}, role=${opts.role}, corr=${opts.corr})`);
|
|
3181
|
+
if (opts.visibleEcho) {
|
|
3182
|
+
void sendMentorVisibleEcho(opts.body, opts.visibleEcho).catch((err) => {
|
|
3183
|
+
console.warn(`[mentor-echo] unexpected failure after mesh delivery: ${err instanceof Error ? err.message : String(err)}`);
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
return true;
|
|
3184
3187
|
}
|
|
3188
|
+
console.warn(`[a2a] signed mesh inbox refused (machine=${opts.targetMachineId}, to=${opts.toAgent}, role=${opts.role}, reason=${result.reason ?? 'not-routed'})`);
|
|
3189
|
+
return false;
|
|
3185
3190
|
}
|
|
3191
|
+
// Telegram bot-to-bot sends are never a delivery authority: bots do not
|
|
3192
|
+
// receive other bots' messages. A visible mirror is emitted only above,
|
|
3193
|
+
// after the local or signed-mesh inbox explicitly accepts the envelope.
|
|
3186
3194
|
return false;
|
|
3187
3195
|
}
|
|
3188
3196
|
/** Snapshot of mentee config for the receiver-wiring installer. */
|
|
@@ -3545,6 +3553,7 @@ export class AgentServer {
|
|
|
3545
3553
|
// session) and the Telegram fallback, so the whole exchange moves
|
|
3546
3554
|
// together. Falls back to menteeTopicId (backward-compatible).
|
|
3547
3555
|
telegramTopicId: resolveMentorDeliveryTopic(cfg),
|
|
3556
|
+
targetMachineId: cfg.menteeMachineId,
|
|
3548
3557
|
// fromBotId = echo's mentor-bot id, so the mentee's allowlist
|
|
3549
3558
|
// (knownMentors[echo].botId === senderBotId) passes.
|
|
3550
3559
|
fromBotId: cfg.botToken ? cfg.botToken.split(':')[0] : undefined,
|