@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @agentrific/server
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Add a separate sandbox push service and require explicit test mode for sandbox grants so TestFlight purchases cannot unlock production notifications.
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/cli.js CHANGED
@@ -30,7 +30,7 @@ var init_package = __esm({
30
30
  "package.json"() {
31
31
  package_default = {
32
32
  name: "@agentrific/server",
33
- version: "0.5.0",
33
+ version: "0.5.1",
34
34
  description: "Self-hosted control plane for long-running coding agents",
35
35
  keywords: [
36
36
  "agentrific",
@@ -973,11 +973,12 @@ function pushSigningText(installationId, operation, request) {
973
973
  request.payload
974
974
  ].join("\n");
975
975
  }
976
- var PUSH_API_URL, PushKindSchema, PushPreferencesSchema, PushPublicKeySchema, PushInstallationSchema, PushRegistrationSchema, PushEnrollmentSchema, PushGrantSchema, PushPullRequestUrlSchema, PushEventSchema, PushSignedRequestSchema, PushEntitlementSchema, PushServerStatusSchema;
976
+ var PUSH_API_URL, PUSH_SANDBOX_API_URL, PushKindSchema, PushPreferencesSchema, PushPublicKeySchema, PushInstallationSchema, PushRegistrationSchema, PushEnrollmentSchema, PushGrantSchema, PushPullRequestUrlSchema, PushEventSchema, PushSignedRequestSchema, PushEntitlementSchema, PushServerStatusSchema;
977
977
  var init_push = __esm({
978
978
  "../../packages/contracts/src/push.ts"() {
979
979
  "use strict";
980
980
  PUSH_API_URL = "https://api.agentrific.com";
981
+ PUSH_SANDBOX_API_URL = "https://sandbox-api.agentrific.com";
981
982
  PushKindSchema = z6.enum([
982
983
  "started",
983
984
  "completed",
@@ -4512,10 +4513,11 @@ async function withSessionTaskLock(id, operation) {
4512
4513
  const lockId = session ? await sessionTaskLockId(store, session) : `session-${id}`;
4513
4514
  return withTaskLock(lockId, operation);
4514
4515
  }
4515
- var host, port, defaultProjectsRoot, worktreesRoot, execFileAsync, app, dataRoot, releaseLock, effects, store, security, testPushUrl, push, allowedOrigins, attachmentEffects, attachments, attachmentCleanup, models, delivery, preparation, agentEffects, runtime, worktreeCleanup, maxWorktreeAgeDays, pruneWorktrees, worktreeCleanupTimer, updates, maintenance, stopUpdateDiscovery, HistoryQuery, StartTaskBody, automation, automationTimer, closeControl;
4516
+ var host, port, defaultProjectsRoot, worktreesRoot, execFileAsync, app, dataRoot, releaseLock, effects, store, security, sandboxPushUrl, testPushUrl, push, allowedOrigins, attachmentEffects, attachments, attachmentCleanup, models, delivery, preparation, agentEffects, runtime, worktreeCleanup, maxWorktreeAgeDays, pruneWorktrees, worktreeCleanupTimer, updates, maintenance, stopUpdateDiscovery, HistoryQuery, StartTaskBody, automation, automationTimer, closeControl;
4516
4517
  var init_index = __esm({
4517
4518
  async "src/index.ts"() {
4518
4519
  "use strict";
4520
+ init_push();
4519
4521
  init_warnings();
4520
4522
  init_push2();
4521
4523
  init_attachments();
@@ -4571,10 +4573,19 @@ var init_index = __esm({
4571
4573
  effects = ManagedRuntime.make(SessionStore.layer(path11.join(dataRoot, "sessions.sqlite")));
4572
4574
  store = await effects.runPromise(SessionStore);
4573
4575
  security = new ServerSecurity(store, await Effect17.runPromise(store.serverIdentity()));
4576
+ sandboxPushUrl = process.env.AGENTRIFIC_PUSH_SANDBOX === "1" ? PUSH_SANDBOX_API_URL : void 0;
4577
+ if (sandboxPushUrl && process.env.AGENTRIFIC_TEST_MODE !== "1")
4578
+ throw new Error("Sandbox push requires explicit test mode.");
4574
4579
  testPushUrl = process.env.AGENTRIFIC_PUSH_TEST_URL;
4575
4580
  if (testPushUrl && (process.env.AGENTRIFIC_TEST_MODE !== "1" || !new URL(testPushUrl).hostname.endsWith(".ts.net") || new URL(testPushUrl).protocol !== "https:"))
4576
4581
  throw new Error("Test relay requires explicit test mode and Tailscale HTTPS.");
4577
- push = new ServerPush(store, security.serverId, dataRoot, fetch, testPushUrl);
4582
+ push = new ServerPush(
4583
+ store,
4584
+ security.serverId,
4585
+ dataRoot,
4586
+ fetch,
4587
+ testPushUrl ?? sandboxPushUrl
4588
+ );
4578
4589
  allowedOrigins = [
4579
4590
  .../* @__PURE__ */ new Set([
4580
4591
  "agentrific-desktop://app",