@agentrific/server 0.5.0 → 0.5.1
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/CHANGELOG.md +6 -0
- package/cli.js +15 -4
- package/cli.js.map +2 -2
- package/index.js +31 -23
- package/index.js.map +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
// src/warnings.ts
|
|
2
|
-
var handlers = process.rawListeners("warning");
|
|
3
|
-
process.removeAllListeners("warning");
|
|
4
|
-
process.on("warning", (warning) => {
|
|
5
|
-
if (warning.name === "ExperimentalWarning" && warning.message === "SQLite is an experimental feature and might change at any time")
|
|
6
|
-
return;
|
|
7
|
-
for (const handler of handlers) handler.call(process, warning);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
// src/push.ts
|
|
11
|
-
import {
|
|
12
|
-
generateKeyPairSync,
|
|
13
|
-
createPrivateKey,
|
|
14
|
-
createPublicKey,
|
|
15
|
-
sign,
|
|
16
|
-
randomUUID
|
|
17
|
-
} from "node:crypto";
|
|
18
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
19
|
-
import path from "node:path";
|
|
20
|
-
import { Effect } from "effect";
|
|
21
|
-
|
|
22
1
|
// ../../packages/contracts/src/push.ts
|
|
23
2
|
import { z } from "zod";
|
|
24
3
|
var PUSH_API_URL = "https://api.agentrific.com";
|
|
4
|
+
var PUSH_SANDBOX_API_URL = "https://sandbox-api.agentrific.com";
|
|
25
5
|
var PushKindSchema = z.enum([
|
|
26
6
|
"started",
|
|
27
7
|
"completed",
|
|
@@ -85,7 +65,26 @@ function pushSigningText(installationId, operation, request) {
|
|
|
85
65
|
].join("\n");
|
|
86
66
|
}
|
|
87
67
|
|
|
68
|
+
// src/warnings.ts
|
|
69
|
+
var handlers = process.rawListeners("warning");
|
|
70
|
+
process.removeAllListeners("warning");
|
|
71
|
+
process.on("warning", (warning) => {
|
|
72
|
+
if (warning.name === "ExperimentalWarning" && warning.message === "SQLite is an experimental feature and might change at any time")
|
|
73
|
+
return;
|
|
74
|
+
for (const handler of handlers) handler.call(process, warning);
|
|
75
|
+
});
|
|
76
|
+
|
|
88
77
|
// src/push.ts
|
|
78
|
+
import {
|
|
79
|
+
generateKeyPairSync,
|
|
80
|
+
createPrivateKey,
|
|
81
|
+
createPublicKey,
|
|
82
|
+
sign,
|
|
83
|
+
randomUUID
|
|
84
|
+
} from "node:crypto";
|
|
85
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
86
|
+
import path from "node:path";
|
|
87
|
+
import { Effect } from "effect";
|
|
89
88
|
function pushKind(session, previous) {
|
|
90
89
|
if (session.gitDelivery?.status === "pr_opened" && previous?.gitDelivery?.status !== "pr_opened")
|
|
91
90
|
return "pr_created";
|
|
@@ -1112,7 +1111,7 @@ async function startControl(directory, security2, status, maintenance2) {
|
|
|
1112
1111
|
// package.json
|
|
1113
1112
|
var package_default = {
|
|
1114
1113
|
name: "@agentrific/server",
|
|
1115
|
-
version: "0.5.
|
|
1114
|
+
version: "0.5.1",
|
|
1116
1115
|
description: "Self-hosted control plane for long-running coding agents",
|
|
1117
1116
|
keywords: [
|
|
1118
1117
|
"agentrific",
|
|
@@ -3924,10 +3923,19 @@ var releaseLock = await acquireServerLock(dataRoot);
|
|
|
3924
3923
|
var effects = ManagedRuntime.make(SessionStore.layer(path9.join(dataRoot, "sessions.sqlite")));
|
|
3925
3924
|
var store = await effects.runPromise(SessionStore);
|
|
3926
3925
|
var security = new ServerSecurity(store, await Effect17.runPromise(store.serverIdentity()));
|
|
3926
|
+
var sandboxPushUrl = process.env.AGENTRIFIC_PUSH_SANDBOX === "1" ? PUSH_SANDBOX_API_URL : void 0;
|
|
3927
|
+
if (sandboxPushUrl && process.env.AGENTRIFIC_TEST_MODE !== "1")
|
|
3928
|
+
throw new Error("Sandbox push requires explicit test mode.");
|
|
3927
3929
|
var testPushUrl = process.env.AGENTRIFIC_PUSH_TEST_URL;
|
|
3928
3930
|
if (testPushUrl && (process.env.AGENTRIFIC_TEST_MODE !== "1" || !new URL(testPushUrl).hostname.endsWith(".ts.net") || new URL(testPushUrl).protocol !== "https:"))
|
|
3929
3931
|
throw new Error("Test relay requires explicit test mode and Tailscale HTTPS.");
|
|
3930
|
-
var push = new ServerPush(
|
|
3932
|
+
var push = new ServerPush(
|
|
3933
|
+
store,
|
|
3934
|
+
security.serverId,
|
|
3935
|
+
dataRoot,
|
|
3936
|
+
fetch,
|
|
3937
|
+
testPushUrl ?? sandboxPushUrl
|
|
3938
|
+
);
|
|
3931
3939
|
var allowedOrigins = [
|
|
3932
3940
|
.../* @__PURE__ */ new Set([
|
|
3933
3941
|
"agentrific-desktop://app",
|