instar 1.3.1327 → 1.3.1329
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 +26 -30
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +27 -0
- package/dist/core/PostUpdateMigrator.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 +11 -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/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +6 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +135 -6
- package/dist/server/routes.js.map +1 -1
- package/dist/threadline/InboundIdLedger.d.ts +37 -2
- package/dist/threadline/InboundIdLedger.d.ts.map +1 -1
- package/dist/threadline/InboundIdLedger.js +64 -2
- package/dist/threadline/InboundIdLedger.js.map +1 -1
- package/dist/threadline/ThreadlineBootstrap.d.ts.map +1 -1
- package/dist/threadline/ThreadlineBootstrap.js +7 -16
- package/dist/threadline/ThreadlineBootstrap.js.map +1 -1
- package/dist/threadline/ThreadlineEndpoints.d.ts.map +1 -1
- package/dist/threadline/ThreadlineEndpoints.js +11 -1
- package/dist/threadline/ThreadlineEndpoints.js.map +1 -1
- package/dist/threadline/ThreadlineRouter.d.ts +8 -0
- package/dist/threadline/ThreadlineRouter.d.ts.map +1 -1
- package/dist/threadline/ThreadlineRouter.js +5 -5
- package/dist/threadline/ThreadlineRouter.js.map +1 -1
- package/dist/threadline/autoAck.d.ts +113 -0
- package/dist/threadline/autoAck.d.ts.map +1 -0
- package/dist/threadline/autoAck.js +157 -0
- package/dist/threadline/autoAck.js.map +1 -0
- package/dist/threadline/client/ThreadlineClient.d.ts +9 -0
- package/dist/threadline/client/ThreadlineClient.d.ts.map +1 -1
- package/dist/threadline/client/ThreadlineClient.js +15 -5
- package/dist/threadline/client/ThreadlineClient.js.map +1 -1
- package/dist/threadline/inboundIdLedgerWiring.js +1 -1
- package/dist/threadline/inboundIdLedgerWiring.js.map +1 -1
- package/dist/threadline/localRouteTrust.d.ts +120 -0
- package/dist/threadline/localRouteTrust.d.ts.map +1 -0
- package/dist/threadline/localRouteTrust.js +116 -0
- package/dist/threadline/localRouteTrust.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 +6 -0
- package/upgrades/1.3.1328.md +84 -0
- package/upgrades/1.3.1329.md +29 -0
- package/upgrades/a2a-local-route-trust.eli16.md +23 -0
- package/upgrades/docs-coverage-class-floor.eli16.md +44 -0
- package/upgrades/side-effects/a2a-ack-never-acked.md +130 -0
- package/upgrades/side-effects/a2a-cross-namespace-label.md +123 -0
- package/upgrades/side-effects/a2a-local-route-trust.md +146 -0
- package/upgrades/1.3.1327.md +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAuGA,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;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"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ChB,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,CA+1wBtE;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
|
@@ -238,6 +238,7 @@ import { ConversationStore } from '../threadline/ConversationStore.js';
|
|
|
238
238
|
import { ThreadLog } from '../threadline/ThreadLog.js';
|
|
239
239
|
import { ThreadMessageRecorder } from '../threadline/recordThreadMessage.js';
|
|
240
240
|
import { recordInboundAck } from '../threadline/recordInboundAck.js';
|
|
241
|
+
import { isAutoAckInbound, autoAckRecognition, looksLikeAutoAckText, createAckRateLimiter, runRelayAckStage } from '../threadline/autoAck.js';
|
|
241
242
|
import { WarrantsReplyGate, evaluateAndRecordInbound } from '../threadline/WarrantsReplyGate.js';
|
|
242
243
|
import { CollaborationSurfacer } from '../threadline/CollaborationSurfacer.js';
|
|
243
244
|
import { ListenerSessionManager } from '../threadline/ListenerSessionManager.js';
|
|
@@ -17171,24 +17172,9 @@ export async function startServer(options) {
|
|
|
17171
17172
|
}
|
|
17172
17173
|
return syntheticThreadIds.get(fingerprint);
|
|
17173
17174
|
}
|
|
17174
|
-
// Per-sender ack rate limiter
|
|
17175
|
-
|
|
17176
|
-
const
|
|
17177
|
-
const ACK_WINDOW_MS = 60 * 1000;
|
|
17178
|
-
function isAckRateLimited(fingerprint) {
|
|
17179
|
-
const now = Date.now();
|
|
17180
|
-
let timestamps = ackTimestamps.get(fingerprint);
|
|
17181
|
-
if (!timestamps) {
|
|
17182
|
-
timestamps = [];
|
|
17183
|
-
ackTimestamps.set(fingerprint, timestamps);
|
|
17184
|
-
}
|
|
17185
|
-
const filtered = timestamps.filter(t => now - t < ACK_WINDOW_MS);
|
|
17186
|
-
ackTimestamps.set(fingerprint, filtered);
|
|
17187
|
-
if (filtered.length >= ACK_RATE_LIMIT)
|
|
17188
|
-
return true;
|
|
17189
|
-
filtered.push(now);
|
|
17190
|
-
return false;
|
|
17191
|
-
}
|
|
17175
|
+
// Per-sender ack rate limiter (flood protection; an ack itself is never
|
|
17176
|
+
// acked — see runRelayAckStage / docs/specs/a2a-ack-never-acked.md).
|
|
17177
|
+
const isAckRateLimited = createAckRateLimiter(config.threadline?.ackRateLimit ?? 5, 60 * 1000);
|
|
17192
17178
|
// Wire router reference into InboundMessageGate
|
|
17193
17179
|
if (threadline.inboundGate) {
|
|
17194
17180
|
threadline.inboundGate.setRouter(threadlineRouter);
|
|
@@ -17231,7 +17217,8 @@ export async function startServer(options) {
|
|
|
17231
17217
|
// rather than sender fingerprint or agent name. Fall back to the
|
|
17232
17218
|
// legacy fingerprint/name lookup only if no threadId is present,
|
|
17233
17219
|
// for compatibility with older senders.
|
|
17234
|
-
const
|
|
17220
|
+
const msgType = typeof msg.content === 'object' && msg.content !== null ? msg.content.type : undefined;
|
|
17221
|
+
const isAutoAck = isAutoAckInbound({ type: msgType, text: textContent });
|
|
17235
17222
|
let waiter = msg.threadId ? threadlineReplyWaiters.get(msg.threadId) : undefined;
|
|
17236
17223
|
if (!waiter) {
|
|
17237
17224
|
// Legacy fallback: try by sender fingerprint, then by resolved name
|
|
@@ -17256,19 +17243,28 @@ export async function startServer(options) {
|
|
|
17256
17243
|
waiter = threadlineReplyWaiters.get(resolvedName);
|
|
17257
17244
|
}
|
|
17258
17245
|
}
|
|
17259
|
-
if (waiter && !isAutoAck) {
|
|
17246
|
+
if (waiter && !isAutoAck && !looksLikeAutoAckText(textContent)) {
|
|
17260
17247
|
waiter.resolve(textContent);
|
|
17261
17248
|
// Don't return — still process the message normally for routing
|
|
17262
17249
|
}
|
|
17263
|
-
//
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17250
|
+
// Ack stage (docs/specs/a2a-ack-never-acked.md). INVARIANT: an ack is
|
|
17251
|
+
// never acked, never reaches the warrants gate or any router, and never
|
|
17252
|
+
// spawns a session — it only records delivery. So an inbound ack records
|
|
17253
|
+
// the implicit delivery ack + the ledger disposition `no-reply` and the
|
|
17254
|
+
// handler RETURNS here, before the auto-ack send, the inbox append, the
|
|
17255
|
+
// Telegram mirror and the gate. Any other message gets our own ack
|
|
17256
|
+
// (post-trust-verification, never for status messages, rate-limited).
|
|
17257
|
+
const recordRelayDelivery = () => recordInboundAck({ a2aDeliveryTracker }, { threadId: msg.threadId, senderFingerprint, senderName: senderName ?? null });
|
|
17258
|
+
const ackStage = runRelayAckStage({
|
|
17259
|
+
autoAckEnabled: config.threadline?.autoAck !== false,
|
|
17260
|
+
autoAckMessage: config.threadline?.autoAckMessage,
|
|
17261
|
+
isAckRateLimited,
|
|
17262
|
+
sendAck: (to, text, threadId) => { threadlineRelayClient.sendAck(to, text, threadId); },
|
|
17263
|
+
recordDelivery: recordRelayDelivery,
|
|
17264
|
+
}, { isAutoAck, trustLevel, msgType, senderFingerprint, threadId: msg.threadId, ticket: ledgerTicket });
|
|
17265
|
+
if (ackStage === 'ack-consumed') {
|
|
17266
|
+
console.log(`[relay] delivery ack from ${senderName} (thread: ${msg.threadId ?? 'none'}, by ${autoAckRecognition({ type: msgType, text: textContent })}) recorded — not acked, not routed`);
|
|
17267
|
+
return;
|
|
17272
17268
|
}
|
|
17273
17269
|
// Canonical inbox write — single source of truth across all routing branches.
|
|
17274
17270
|
// Runs once at relay-ingest, BEFORE pipe / warm-listener / cold-spawn branching,
|
|
@@ -17301,7 +17297,7 @@ export async function startServer(options) {
|
|
|
17301
17297
|
// so every inbound-receive path records the ack via one helper. Here the
|
|
17302
17298
|
// senderFingerprint is the peer's real routing fingerprint, so liveness
|
|
17303
17299
|
// keys correctly without a thread-owner lookup. Recording-only.
|
|
17304
|
-
|
|
17300
|
+
recordRelayDelivery();
|
|
17305
17301
|
// Threadline → Telegram bridge: mirror inbound message into a per-thread
|
|
17306
17302
|
// Telegram topic so the user has visibility into agent-to-agent
|
|
17307
17303
|
// conversations. Relay-only — TelegramBridgeConfig owns the gate
|