@sema-agent/server 1.305.0 → 1.306.0
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/config.d.ts +7 -0
- package/dist/config.js +7 -0
- package/dist/main.js +10 -2
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -164,6 +164,7 @@ export interface ServiceConfig {
|
|
|
164
164
|
};
|
|
165
165
|
snapshotBlobSqlMaxBytes?: number;
|
|
166
166
|
snapshotBlobAllowSql: boolean;
|
|
167
|
+
bindHost?: string;
|
|
167
168
|
attachmentOrphanGraceMs: number;
|
|
168
169
|
workspaceFileMaxBytes: number;
|
|
169
170
|
sendUserFile?: {
|
|
@@ -315,4 +316,10 @@ export declare function logConfigDiagnostics(logger: {
|
|
|
315
316
|
}): void;
|
|
316
317
|
export declare function applyAutoCompactWindow(m: Model, explicit?: number): void;
|
|
317
318
|
export declare function loadConfig(): ServiceConfig;
|
|
319
|
+
export declare function resolveBindHost(config: {
|
|
320
|
+
bindHost?: string;
|
|
321
|
+
allowUnauthedWrites?: boolean;
|
|
322
|
+
authToken?: string;
|
|
323
|
+
authTokens?: Record<string, string>;
|
|
324
|
+
}): string | undefined;
|
|
318
325
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
CHANGED
|
@@ -538,6 +538,7 @@ export function loadConfig() {
|
|
|
538
538
|
: undefined,
|
|
539
539
|
snapshotBlobSqlMaxBytes: optFinitePositiveEnv("SNAPSHOT_BLOB_SQL_MAX_BYTES"),
|
|
540
540
|
snapshotBlobAllowSql: process.env.SNAPSHOT_BLOB_ALLOW_SQL_BYTES === "true",
|
|
541
|
+
bindHost: process.env.BIND_HOST || process.env.HOST || undefined,
|
|
541
542
|
attachmentOrphanGraceMs: ((v) => (v !== undefined && Number.isFinite(v) && v >= 0 ? v : 3_600_000))(process.env.ATTACHMENT_ORPHAN_GRACE_MS !== undefined ? Number(process.env.ATTACHMENT_ORPHAN_GRACE_MS) : undefined),
|
|
542
543
|
workspaceFileMaxBytes: optFinitePositiveEnv("WORKSPACE_FILE_MAX_BYTES") ?? 8 * 1024 * 1024,
|
|
543
544
|
sendUserFile: (process.env.MINIO_ENDPOINT || process.env.S3_ENDPOINT) && process.env.MINIO_ACCESS_KEY && process.env.MINIO_SECRET_KEY
|
|
@@ -727,4 +728,10 @@ export function loadConfig() {
|
|
|
727
728
|
configLocalDir: process.env.CONFIG_LOCAL_DIR || undefined,
|
|
728
729
|
};
|
|
729
730
|
}
|
|
731
|
+
export function resolveBindHost(config) {
|
|
732
|
+
if (config.bindHost)
|
|
733
|
+
return config.bindHost;
|
|
734
|
+
const anyServiceAuth = Boolean(config.authToken) || Object.keys(config.authTokens ?? {}).length > 0;
|
|
735
|
+
return config.allowUnauthedWrites && !anyServiceAuth ? "127.0.0.1" : undefined;
|
|
736
|
+
}
|
|
730
737
|
//# sourceMappingURL=config.js.map
|
package/dist/main.js
CHANGED
|
@@ -24,7 +24,7 @@ import { stat as fsStat, readFile as fsReadFile } from "node:fs/promises";
|
|
|
24
24
|
import { acceptShellScratchpadDir, buildEnvFacts, egressForRemoteExec, ensureScratchpadDir, purgeScratchpadDir, sweepStaleScratchpads, resumeFactsForLane } from "./env-facts.js";
|
|
25
25
|
import { normalizeSuggestNextPrompts, normalizeResilience, normalizeAttachments, normalizeResumeAtMode, resolveTaskLimits, taskAgentsSpecFragment, retainBackgroundProcessesFromBody, toolNameListFromBody, promptProfileFromBody } from "./spec-fields.js";
|
|
26
26
|
import { createBrain, brainSummary } from "./brain.js";
|
|
27
|
-
import { loadConfig, logConfigDiagnostics } from "./config.js";
|
|
27
|
+
import { loadConfig, logConfigDiagnostics, resolveBindHost } from "./config.js";
|
|
28
28
|
import { resourceSuspendOptIn } from "./resource-suspend.js";
|
|
29
29
|
import { createSessionStore, ensureChildSessionDurableWithPromotion } from "./plugins/session-store.js";
|
|
30
30
|
import { ForkRoutingSessionStore } from "./plugins/fork-routing-session-store.js";
|
|
@@ -2340,7 +2340,15 @@ async function main() {
|
|
|
2340
2340
|
},
|
|
2341
2341
|
});
|
|
2342
2342
|
runDenySweep = server.denyExpiredApprovals;
|
|
2343
|
-
|
|
2343
|
+
const bindHost = resolveBindHost(config);
|
|
2344
|
+
await new Promise((resolve) => (bindHost ? server.listen(config.port, bindHost, resolve) : server.listen(config.port, resolve)));
|
|
2345
|
+
logger.info("listening", {
|
|
2346
|
+
port: config.port,
|
|
2347
|
+
bindHost: bindHost ?? "0.0.0.0/::(all interfaces)",
|
|
2348
|
+
...(bindHost === "127.0.0.1" && !config.bindHost
|
|
2349
|
+
? { note: "auto-narrowed to loopback: write face is unauthenticated (ALLOW_UNAUTHED_WRITES with no service token). Set BIND_HOST explicitly to override." }
|
|
2350
|
+
: {}),
|
|
2351
|
+
});
|
|
2344
2352
|
const fleetClient = startFleetClientFromEnv(config, {
|
|
2345
2353
|
instanceId,
|
|
2346
2354
|
version: serviceVersion(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.306.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|