@agfpd/iapeer-memory-core 0.1.6 → 0.1.7
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/package.json +1 -1
- package/src/config.ts +14 -1
- package/src/index.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agfpd/iapeer-memory-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "iapeer-memory core — host-neutral TypeScript memory primitive: vault schema/taxonomy config, search engine, memoryd, context renderer, role contracts. Consumed by the @agfpd/iapeer-memory facade; version kept in lockstep by its release flow (docs/10-distribution.md).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/config.ts
CHANGED
|
@@ -89,7 +89,7 @@ export type CoreConfig = {
|
|
|
89
89
|
* to BM25. Adding the exact endpoint host to NO_PROXY is idempotent and
|
|
90
90
|
* monotonic — it only bypasses the explicitly configured host.
|
|
91
91
|
*/
|
|
92
|
-
function ensureEndpointNotProxied(endpoint: string): void {
|
|
92
|
+
export function ensureEndpointNotProxied(endpoint: string): void {
|
|
93
93
|
let host: string;
|
|
94
94
|
try {
|
|
95
95
|
host = new URL(endpoint).hostname;
|
|
@@ -106,6 +106,19 @@ function ensureEndpointNotProxied(endpoint: string): void {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Loopback NEVER goes through a proxy — fleet-class defect (B-приёмка
|
|
111
|
+
* 10.06, boris): every peer's shell carries HTTP(S)_PROXY (VPN tinyproxy),
|
|
112
|
+
* Bun's fetch honours it for 127.0.0.1 too → the status probe of the LIVE
|
|
113
|
+
* memoryd port detoured to the proxy and lied «nothing listening» (proven:
|
|
114
|
+
* lsof caught tinyproxy SYN_SENT to 8766; `env -u HTTP_PROXY` → truthful).
|
|
115
|
+
* Call before ANY loopback fetch from CLI paths that run in agent shells.
|
|
116
|
+
*/
|
|
117
|
+
export function ensureLoopbackNotProxied(): void {
|
|
118
|
+
ensureEndpointNotProxied("http://127.0.0.1/");
|
|
119
|
+
ensureEndpointNotProxied("http://localhost/");
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
function envString(name: string, fallback = ""): string {
|
|
110
123
|
const value = process.env[name];
|
|
111
124
|
return typeof value === "string" && value.length > 0 ? value : fallback;
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// config
|
|
11
|
-
export {
|
|
11
|
+
export {
|
|
12
|
+
configFromEnv,
|
|
13
|
+
ensureEndpointNotProxied,
|
|
14
|
+
ensureLoopbackNotProxied,
|
|
15
|
+
type CoreConfig,
|
|
16
|
+
} from "./config.js";
|
|
12
17
|
|
|
13
18
|
// taxonomy (ADR-002/011)
|
|
14
19
|
export {
|