instar 1.3.782 → 1.3.784
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 +41 -15
- package/dist/commands/server.js.map +1 -1
- package/dist/core/MachineIdentity.d.ts +13 -0
- package/dist/core/MachineIdentity.d.ts.map +1 -1
- package/dist/core/MachineIdentity.js +31 -0
- package/dist/core/MachineIdentity.js.map +1 -1
- package/dist/core/MeteredSpendGate.d.ts +127 -0
- package/dist/core/MeteredSpendGate.d.ts.map +1 -0
- package/dist/core/MeteredSpendGate.js +248 -0
- package/dist/core/MeteredSpendGate.js.map +1 -0
- package/dist/core/MeteredSpendLedger.d.ts +154 -0
- package/dist/core/MeteredSpendLedger.d.ts.map +1 -0
- package/dist/core/MeteredSpendLedger.js +434 -0
- package/dist/core/MeteredSpendLedger.js.map +1 -0
- package/dist/core/PinAttemptStore.d.ts +35 -0
- package/dist/core/PinAttemptStore.d.ts.map +1 -0
- package/dist/core/PinAttemptStore.js +85 -0
- package/dist/core/PinAttemptStore.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts +7 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +24 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/RenderedPlanStore.d.ts +61 -0
- package/dist/core/RenderedPlanStore.d.ts.map +1 -0
- package/dist/core/RenderedPlanStore.js +92 -0
- package/dist/core/RenderedPlanStore.js.map +1 -0
- package/dist/core/RoutingSpendCapsStore.d.ts +113 -0
- package/dist/core/RoutingSpendCapsStore.d.ts.map +1 -0
- package/dist/core/RoutingSpendCapsStore.js +241 -0
- package/dist/core/RoutingSpendCapsStore.js.map +1 -0
- package/dist/core/SpendAlertDispatcher.d.ts +94 -0
- package/dist/core/SpendAlertDispatcher.d.ts.map +1 -0
- package/dist/core/SpendAlertDispatcher.js +168 -0
- package/dist/core/SpendAlertDispatcher.js.map +1 -0
- package/dist/core/SpendAlertEmitters.d.ts +118 -0
- package/dist/core/SpendAlertEmitters.d.ts.map +1 -0
- package/dist/core/SpendAlertEmitters.js +220 -0
- package/dist/core/SpendAlertEmitters.js.map +1 -0
- package/dist/core/SpendAlertResolver.d.ts +89 -0
- package/dist/core/SpendAlertResolver.d.ts.map +1 -0
- package/dist/core/SpendAlertResolver.js +175 -0
- package/dist/core/SpendAlertResolver.js.map +1 -0
- package/dist/core/TelegramSpendTopicChannel.d.ts +50 -0
- package/dist/core/TelegramSpendTopicChannel.d.ts.map +1 -0
- package/dist/core/TelegramSpendTopicChannel.js +106 -0
- package/dist/core/TelegramSpendTopicChannel.js.map +1 -0
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +17 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +9 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/routingSpendView.d.ts +10 -2
- package/dist/core/routingSpendView.d.ts.map +1 -1
- package/dist/core/routingSpendView.js +18 -10
- package/dist/core/routingSpendView.js.map +1 -1
- package/dist/core/types.d.ts +45 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/server/AgentServer.d.ts +25 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +304 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/routes.d.ts +10 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +196 -4
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +206 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +64 -64
- package/upgrades/1.3.783.md +66 -0
- package/upgrades/1.3.784.md +59 -0
- package/upgrades/side-effects/routing-spend-increment-b.md +44 -0
- package/upgrades/side-effects/routing-spend-increment-c.md +44 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwDH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAyBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA6H7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAgmDD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,oBAAoB,GAAG,IAAI,GACxC;IACD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1C,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,MAA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C,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAQrD,oBAAoB,CAAC,EAAE,MAAM;IAC3B,YAAY,EAAE,OAAO,kBAAkB,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,CAonBN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAstmBtE;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
|
@@ -5801,6 +5801,14 @@ export async function startServer(options) {
|
|
|
5801
5801
|
});
|
|
5802
5802
|
}
|
|
5803
5803
|
catch { /* never break the LLM path on a degradation report */ }
|
|
5804
|
+
// Increment C fallback counting (spec "Fallback used"): every served
|
|
5805
|
+
// fallback (a swap-tail/degrade position answering instead of the
|
|
5806
|
+
// primary) increments the Near-Silent hourly counter; a Telegram digest
|
|
5807
|
+
// line fires ONLY on the rate-spike ceiling. Observer-isolated.
|
|
5808
|
+
try {
|
|
5809
|
+
_agentServerRef?.getSpendAlertEmitters?.()?.onNatureRoutePlan({ dryRun: false, servedFallback: true });
|
|
5810
|
+
}
|
|
5811
|
+
catch { /* @silent-fallback-ok: observer isolation (I-9) — the fallback counter is a notifier, never the LLM path */ }
|
|
5804
5812
|
},
|
|
5805
5813
|
// Never-silent tracking (Resilient Degradation Ladder §4): a non-gating call that
|
|
5806
5814
|
// exhausts the ladder (→ caller heuristic) opens a tracked degradation; a successful
|
|
@@ -5835,23 +5843,41 @@ export async function startServer(options) {
|
|
|
5835
5843
|
};
|
|
5836
5844
|
},
|
|
5837
5845
|
onNatureRoutePlan: (plan) => {
|
|
5838
|
-
//
|
|
5839
|
-
//
|
|
5840
|
-
//
|
|
5846
|
+
// I-9 (Increment C): onNatureRoutePlan is a SINGLE optional callback —
|
|
5847
|
+
// fan out to each subscriber with observer ISOLATION (throw-swallow per
|
|
5848
|
+
// subscriber; one throwing never breaks the LLM path or double-fires
|
|
5849
|
+
// the others). Subscribers: (1) the A2.1 env-gated console breadcrumb;
|
|
5850
|
+
// (2) the spend-alert emitters (door-dark / fallback-spike), resolved
|
|
5851
|
+
// LATE via the AgentServer accessor so construction order never races.
|
|
5841
5852
|
try {
|
|
5842
|
-
if (process.env.INSTAR_NATURE_ROUTING_LOG
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
+
if (process.env.INSTAR_NATURE_ROUTING_LOG === '1') {
|
|
5854
|
+
const r = plan.resolution;
|
|
5855
|
+
const detail = r && r.outcome === 'route'
|
|
5856
|
+
? `chain=${r.resolvedChain} primary=${r.primary.door}/${r.primary.modelId}` +
|
|
5857
|
+
`${r.primary.clamped ? ' (clamped)' : ''} tail=${r.swapTail.length}`
|
|
5858
|
+
: plan.failClosed
|
|
5859
|
+
? 'FAIL-CLOSED (critical gate, no door)'
|
|
5860
|
+
: `outcome=${r?.outcome ?? 'n/a'}`;
|
|
5861
|
+
console.log(`[nature-routing] ${plan.component ?? '(none)'} (${plan.category}) ${detail} ` +
|
|
5862
|
+
`dryRun=${plan.dryRun}`);
|
|
5863
|
+
}
|
|
5864
|
+
}
|
|
5865
|
+
catch { /* @silent-fallback-ok: the env-gated console breadcrumb is observability — never break the LLM path on an observation */ }
|
|
5866
|
+
try {
|
|
5867
|
+
const emitters = _agentServerRef?.getSpendAlertEmitters?.();
|
|
5868
|
+
emitters?.onNatureRoutePlan({
|
|
5869
|
+
component: plan.component,
|
|
5870
|
+
dryRun: plan.dryRun,
|
|
5871
|
+
failClosed: plan.failClosed,
|
|
5872
|
+
resolution: plan.resolution,
|
|
5873
|
+
// A served fallback = a swap/degrade position answering instead of
|
|
5874
|
+
// the primary. That signal rides the router's onDegrade callback
|
|
5875
|
+
// (wired below in this file) — at RESOLUTION time only fail-closed
|
|
5876
|
+
// (door-dark) is derivable here.
|
|
5877
|
+
servedFallback: false,
|
|
5878
|
+
});
|
|
5853
5879
|
}
|
|
5854
|
-
catch { /* never
|
|
5880
|
+
catch { /* @silent-fallback-ok: observer isolation (I-9) — a notifier failure never breaks the LLM path */ }
|
|
5855
5881
|
},
|
|
5856
5882
|
});
|
|
5857
5883
|
}
|