instar 1.3.1338 → 1.3.1340
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 +119 -13
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +15 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +14 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionRefresh.d.ts +21 -0
- package/dist/core/SessionRefresh.d.ts.map +1 -1
- package/dist/core/SessionRefresh.js +81 -30
- package/dist/core/SessionRefresh.js.map +1 -1
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +6 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/types.d.ts +20 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/monitoring/A2ARedeliverySentinel.d.ts +145 -6
- package/dist/monitoring/A2ARedeliverySentinel.d.ts.map +1 -1
- package/dist/monitoring/A2ARedeliverySentinel.js +451 -11
- package/dist/monitoring/A2ARedeliverySentinel.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +4 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +76 -4
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +71 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/dist/threadline/A2ADeliveryTracker.d.ts +55 -1
- package/dist/threadline/A2ADeliveryTracker.d.ts.map +1 -1
- package/dist/threadline/A2ADeliveryTracker.js +97 -5
- package/dist/threadline/A2ADeliveryTracker.js.map +1 -1
- package/dist/threadline/ThreadlineMCPServer.d.ts +15 -0
- package/dist/threadline/ThreadlineMCPServer.d.ts.map +1 -1
- package/dist/threadline/ThreadlineMCPServer.js +3 -0
- package/dist/threadline/ThreadlineMCPServer.js.map +1 -1
- package/dist/threadline/client/ThreadlineClient.d.ts +47 -0
- package/dist/threadline/client/ThreadlineClient.d.ts.map +1 -1
- package/dist/threadline/client/ThreadlineClient.js +93 -0
- package/dist/threadline/client/ThreadlineClient.js.map +1 -1
- package/dist/threadline/mcp-http-client.d.ts.map +1 -1
- package/dist/threadline/mcp-http-client.js +2 -0
- package/dist/threadline/mcp-http-client.js.map +1 -1
- package/dist/threadline/peerDark.d.ts +165 -0
- package/dist/threadline/peerDark.d.ts.map +1 -0
- package/dist/threadline/peerDark.js +204 -0
- package/dist/threadline/peerDark.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +63 -63
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/src/scaffold/templates.ts +4 -0
- package/upgrades/1.3.1339.md +20 -0
- package/upgrades/1.3.1340.md +32 -0
- package/upgrades/side-effects/a2a-peer-dark-reporting.md +149 -0
- package/upgrades/side-effects/sessions-refresh-prebind.md +113 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAwGA,OAAO,EAAE,cAAc,EAAwD,MAAM,2BAA2B,CAAC;AAUjH,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA4BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAqI7D,OAAO,KAAK,EAAW,oBAAoB,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B,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CA8yBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAwjxBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -18060,17 +18060,57 @@ export async function startServer(options) {
|
|
|
18060
18060
|
// backoff (body recovered from the canonical outbox), and after the attempt
|
|
18061
18061
|
// cap raises ONE aggregated attention item per dark peer. Recording/sending
|
|
18062
18062
|
// only — no blocking authority. Ships OFF (it re-sends + escalates).
|
|
18063
|
+
// REWORKED (a2a-single-agent-identity §3): constructed when EITHER
|
|
18064
|
+
// `monitoring.a2aRedelivery.enabled` OR the resolved `threadline.peerDarkNotice`
|
|
18065
|
+
// gate is on; `redeliver` only under the former (escalate-only otherwise).
|
|
18066
|
+
// Under the peer-dark gate the operator notice is per PEER with the
|
|
18067
|
+
// deterministic id `a2a-peer-dark:<agent>:<peerFp>`, raised by the AWAKE
|
|
18068
|
+
// machine after it healed its own side, resolved from pool-scope evidence,
|
|
18069
|
+
// 12 h cooldown; a local relay outage collapses to ONE aggregated item.
|
|
18070
|
+
// Dry-run (default) logs would-raise rows to logs/a2a-peer-dark.jsonl.
|
|
18063
18071
|
try {
|
|
18064
18072
|
const a2aDelivCfg = config.monitoring?.a2aRedelivery ?? {};
|
|
18065
|
-
|
|
18073
|
+
const { resolvePeerDarkNoticeConfig, createPeerDarkAuditWriter, resolvePeerDarkAuditPath } = await import('../threadline/peerDark.js');
|
|
18074
|
+
const peerDarkCfg = resolvePeerDarkNoticeConfig(config);
|
|
18075
|
+
if ((a2aDelivCfg.enabled || peerDarkCfg.enabled) && a2aDeliveryTracker) {
|
|
18066
18076
|
const { A2ARedeliverySentinel, DEFAULT_A2A_REDELIVERY_CONFIG } = await import('../monitoring/A2ARedeliverySentinel.js');
|
|
18077
|
+
const priorityMap = {
|
|
18078
|
+
high: 'HIGH', medium: 'NORMAL', low: 'LOW',
|
|
18079
|
+
};
|
|
18080
|
+
// Pool-scope read of one peer's health on my OTHER machines (raise AND
|
|
18081
|
+
// resolve both read it — a peer that answered on another machine is not
|
|
18082
|
+
// dark). Bounded per peer; a dark/slow peer machine is simply absent.
|
|
18083
|
+
const poolPeerHealth = async (peerFp) => {
|
|
18084
|
+
const urls = _resolvePeerUrls?.() ?? [];
|
|
18085
|
+
if (urls.length === 0)
|
|
18086
|
+
return [];
|
|
18087
|
+
const rows = await Promise.allSettled(urls.map(async ({ machineId, url }) => {
|
|
18088
|
+
const ac = new AbortController();
|
|
18089
|
+
const t = setTimeout(() => ac.abort(), 5000);
|
|
18090
|
+
try {
|
|
18091
|
+
const r = await fetch(`${url}/threadline/peers/${encodeURIComponent(peerFp)}/health`, {
|
|
18092
|
+
headers: { Authorization: `Bearer ${config.authToken ?? ''}`, 'X-Instar-AgentId': config.projectName ?? '' },
|
|
18093
|
+
signal: ac.signal,
|
|
18094
|
+
});
|
|
18095
|
+
if (!r.ok)
|
|
18096
|
+
throw new Error(`HTTP ${r.status}`);
|
|
18097
|
+
const b = await r.json();
|
|
18098
|
+
return { machineId, lastAckedAt: b.lastAckedAt ?? null, lastInboundAt: b.lastInboundAt ?? null, lastDeliveredAt: b.lastDeliveredAt ?? null };
|
|
18099
|
+
}
|
|
18100
|
+
finally {
|
|
18101
|
+
clearTimeout(t);
|
|
18102
|
+
}
|
|
18103
|
+
}));
|
|
18104
|
+
return rows.flatMap((r) => (r.status === 'fulfilled' ? [r.value] : []));
|
|
18105
|
+
};
|
|
18067
18106
|
const a2aRedeliverySentinel = new A2ARedeliverySentinel({
|
|
18068
18107
|
tracker: a2aDeliveryTracker,
|
|
18108
|
+
agentId: config.projectName,
|
|
18069
18109
|
// Re-send: recover the body from the canonical outbox by messageId,
|
|
18070
18110
|
// then re-emit via the relay. Body missing → return false (the
|
|
18071
18111
|
// sentinel leaves it awaiting-ack and escalates at the cap, never
|
|
18072
|
-
// fabricating a send).
|
|
18073
|
-
redeliver: (threadlineRelayClient && listenerManager)
|
|
18112
|
+
// fabricating a send). Only under the legacy gate.
|
|
18113
|
+
redeliver: (a2aDelivCfg.enabled && threadlineRelayClient && listenerManager)
|
|
18074
18114
|
? (entry) => {
|
|
18075
18115
|
const stored = listenerManager.readCanonicalOutboxEntry(entry.messageId);
|
|
18076
18116
|
if (!stored)
|
|
@@ -18081,27 +18121,93 @@ export async function startServer(options) {
|
|
|
18081
18121
|
: undefined,
|
|
18082
18122
|
raiseAttention: telegram
|
|
18083
18123
|
? async (item) => {
|
|
18084
|
-
|
|
18085
|
-
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18124
|
+
// Legacy per-message escalation keeps its stamped id; the §3
|
|
18125
|
+
// items carry a deterministic id and REOPEN on a later episode.
|
|
18126
|
+
if (!item.id) {
|
|
18127
|
+
return telegram.createAttentionItem({
|
|
18128
|
+
id: `a2a-redelivery-${Date.now()}`,
|
|
18129
|
+
title: item.title,
|
|
18130
|
+
summary: item.body.slice(0, 160),
|
|
18131
|
+
description: item.body,
|
|
18132
|
+
category: 'a2a-redelivery',
|
|
18133
|
+
priority: priorityMap[item.priority ?? 'medium'] ?? 'NORMAL',
|
|
18134
|
+
sourceContext: item.source ?? 'a2a-redelivery',
|
|
18135
|
+
});
|
|
18136
|
+
}
|
|
18137
|
+
return telegram.upsertAttentionItem({
|
|
18138
|
+
id: item.id,
|
|
18089
18139
|
title: item.title,
|
|
18090
18140
|
summary: item.body.slice(0, 160),
|
|
18091
18141
|
description: item.body,
|
|
18092
|
-
category: 'a2a-
|
|
18142
|
+
category: 'a2a-peer-dark',
|
|
18093
18143
|
priority: priorityMap[item.priority ?? 'medium'] ?? 'NORMAL',
|
|
18094
|
-
sourceContext: item.source ?? 'a2a-
|
|
18144
|
+
sourceContext: item.source ?? 'a2a-peer-dark',
|
|
18145
|
+
});
|
|
18146
|
+
}
|
|
18147
|
+
: undefined,
|
|
18148
|
+
// Resolve: the resolve line lands on the hub through the same upsert
|
|
18149
|
+
// (body changed → re-posted), then the item is closed silently.
|
|
18150
|
+
resolveAttention: telegram
|
|
18151
|
+
? async (id, line) => {
|
|
18152
|
+
const existing = telegram.getAttentionItem(id);
|
|
18153
|
+
if (!existing)
|
|
18154
|
+
return false;
|
|
18155
|
+
await telegram.upsertAttentionItem({
|
|
18156
|
+
id,
|
|
18157
|
+
title: existing.title,
|
|
18158
|
+
summary: line.slice(0, 160),
|
|
18159
|
+
description: line,
|
|
18160
|
+
category: existing.category,
|
|
18161
|
+
priority: existing.priority,
|
|
18162
|
+
sourceContext: existing.sourceContext,
|
|
18095
18163
|
});
|
|
18164
|
+
return telegram.updateAttentionStatus(id, 'DONE', { silent: true });
|
|
18165
|
+
}
|
|
18166
|
+
: undefined,
|
|
18167
|
+
attentionState: telegram
|
|
18168
|
+
? (id) => {
|
|
18169
|
+
const it = telegram.getAttentionItem(id);
|
|
18170
|
+
return it ? { status: it.status, updatedAt: it.updatedAt, createdAt: it.createdAt } : null;
|
|
18096
18171
|
}
|
|
18097
18172
|
: undefined,
|
|
18098
|
-
|
|
18173
|
+
relayState: () => {
|
|
18174
|
+
const rc = threadlineRelayClient;
|
|
18175
|
+
if (!rc)
|
|
18176
|
+
return 'not-configured';
|
|
18177
|
+
if (rc.connectionState === 'connected')
|
|
18178
|
+
return 'connected';
|
|
18179
|
+
return threadlineGetLastRelayEvent?.()?.terminal === true ? 'displaced' : 'disconnected';
|
|
18180
|
+
},
|
|
18181
|
+
// §3.3: a standby's relay is disconnected BY DESIGN; only the awake
|
|
18182
|
+
// (telegram-polling) machine may heal or raise. The boot-time standby
|
|
18183
|
+
// fact is the same one the relay-forward route reads.
|
|
18184
|
+
isAwake: () => !(_a2aRelayForwardCtx?.relaySuppressedByStandby === true),
|
|
18185
|
+
reconnectRelay: threadlineRelayClient ? () => threadlineRelayClient.reconnectRelay() : undefined,
|
|
18186
|
+
refreshPresence: threadlineRelayClient ? () => threadlineRelayClient.refreshPresence() : undefined,
|
|
18187
|
+
peerConnectedNow: threadlineRelayClient ? (fp) => threadlineRelayClient.peerConnectedNow(fp) : undefined,
|
|
18188
|
+
peerPresence: threadlineRelayClient ? (fp) => threadlineRelayClient.peerPresence(fp) : undefined,
|
|
18189
|
+
// identitySelfCheck (§2) is wired by the identity-coherence check once
|
|
18190
|
+
// it lands; absent, the heal records `unknown` and never supersedes.
|
|
18191
|
+
poolPeerHealth,
|
|
18192
|
+
audit: createPeerDarkAuditWriter(resolvePeerDarkAuditPath(config.stateDir), (l) => console.warn(l)),
|
|
18193
|
+
}, {
|
|
18194
|
+
...mergeDefaults(DEFAULT_A2A_REDELIVERY_CONFIG, a2aDelivCfg),
|
|
18195
|
+
enabled: a2aDelivCfg.enabled === true,
|
|
18196
|
+
peerDark: {
|
|
18197
|
+
enabled: peerDarkCfg.enabled,
|
|
18198
|
+
dryRun: peerDarkCfg.dryRun,
|
|
18199
|
+
queuedDarkAfterMs: peerDarkCfg.queuedDarkAfterMs,
|
|
18200
|
+
perPeer: peerDarkCfg.perPeer,
|
|
18201
|
+
cooldownMs: peerDarkCfg.cooldownMs,
|
|
18202
|
+
},
|
|
18203
|
+
});
|
|
18099
18204
|
a2aRedeliverySentinel.start();
|
|
18100
18205
|
globalThis.__instarA2ARedeliverySentinel = a2aRedeliverySentinel;
|
|
18101
|
-
console.log(pc.green(
|
|
18206
|
+
console.log(pc.green(` A2ARedeliverySentinel: armed (redelivery ${a2aDelivCfg.enabled ? 'on' : 'off'}; ` +
|
|
18207
|
+
`peer-dark notice ${peerDarkCfg.enabled ? (peerDarkCfg.dryRun ? 'dry-run' : 'LIVE') : 'off'})`));
|
|
18102
18208
|
}
|
|
18103
18209
|
else {
|
|
18104
|
-
console.log(pc.dim(' A2ARedeliverySentinel: disabled (monitoring.a2aRedelivery.enabled=false; the ship-OFF default)'));
|
|
18210
|
+
console.log(pc.dim(' A2ARedeliverySentinel: disabled (monitoring.a2aRedelivery.enabled=false and threadline.peerDarkNotice dark; the ship-OFF default)'));
|
|
18105
18211
|
}
|
|
18106
18212
|
}
|
|
18107
18213
|
catch (err) {
|