@astrasyncai/verification-gateway 5.9.0 → 5.11.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.
Files changed (79) hide show
  1. package/dist/adapters/express.js +19 -1
  2. package/dist/adapters/express.js.map +1 -1
  3. package/dist/adapters/express.mjs +19 -1
  4. package/dist/adapters/express.mjs.map +1 -1
  5. package/dist/adapters/mcp.js +19 -1
  6. package/dist/adapters/mcp.js.map +1 -1
  7. package/dist/adapters/mcp.mjs +19 -1
  8. package/dist/adapters/mcp.mjs.map +1 -1
  9. package/dist/adapters/nextjs.js +19 -1
  10. package/dist/adapters/nextjs.js.map +1 -1
  11. package/dist/adapters/nextjs.mjs +19 -1
  12. package/dist/adapters/nextjs.mjs.map +1 -1
  13. package/dist/adapters/sdk.js +19 -1
  14. package/dist/adapters/sdk.js.map +1 -1
  15. package/dist/adapters/sdk.mjs +19 -1
  16. package/dist/adapters/sdk.mjs.map +1 -1
  17. package/dist/agent/index.js +1 -1
  18. package/dist/agent/index.js.map +1 -1
  19. package/dist/agent/index.mjs +1 -1
  20. package/dist/agent/index.mjs.map +1 -1
  21. package/dist/bin/astrasync-claude-hook.js +540 -10
  22. package/dist/bin/astrasync-codex-hook.js +540 -10
  23. package/dist/bin/astrasync-guard.js +629 -65
  24. package/dist/bin/astrasync.js +673 -66
  25. package/dist/browser/background.js +19 -1
  26. package/dist/browser/background.js.map +1 -1
  27. package/dist/browser/background.mjs +19 -1
  28. package/dist/browser/background.mjs.map +1 -1
  29. package/dist/cli/index.d.mts +8 -8
  30. package/dist/cli/index.d.ts +8 -8
  31. package/dist/cli/index.js +22 -64
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/index.mjs +22 -64
  34. package/dist/cli/index.mjs.map +1 -1
  35. package/dist/codex/index.d.mts +5 -0
  36. package/dist/codex/index.d.ts +5 -0
  37. package/dist/codex/index.js +556 -18
  38. package/dist/codex/index.js.map +1 -1
  39. package/dist/codex/index.mjs +558 -20
  40. package/dist/codex/index.mjs.map +1 -1
  41. package/dist/cursor/extension.d.mts +9 -2
  42. package/dist/cursor/extension.d.ts +9 -2
  43. package/dist/cursor/extension.js +522 -5
  44. package/dist/cursor/extension.js.map +1 -1
  45. package/dist/cursor/extension.mjs +524 -5
  46. package/dist/cursor/extension.mjs.map +1 -1
  47. package/dist/edge-config.js +1 -1
  48. package/dist/edge-config.js.map +1 -1
  49. package/dist/edge-config.mjs +1 -1
  50. package/dist/edge-config.mjs.map +1 -1
  51. package/dist/edge-core/index.js +20 -2
  52. package/dist/edge-core/index.js.map +1 -1
  53. package/dist/edge-core/index.mjs +20 -2
  54. package/dist/edge-core/index.mjs.map +1 -1
  55. package/dist/enrolment-store-8DyaIOLe.d.mts +26 -0
  56. package/dist/enrolment-store-8DyaIOLe.d.ts +26 -0
  57. package/dist/gateway/gateway.js +19 -1
  58. package/dist/gateway/gateway.js.map +1 -1
  59. package/dist/gateway/gateway.mjs +19 -1
  60. package/dist/gateway/gateway.mjs.map +1 -1
  61. package/dist/index.d.mts +100 -3
  62. package/dist/index.d.ts +100 -3
  63. package/dist/index.js +3289 -18
  64. package/dist/index.js.map +1 -1
  65. package/dist/index.mjs +3287 -18
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/registration/index.js +1 -1
  68. package/dist/registration/index.js.map +1 -1
  69. package/dist/registration/index.mjs +1 -1
  70. package/dist/registration/index.mjs.map +1 -1
  71. package/dist/transport/index.js +1 -1
  72. package/dist/transport/index.js.map +1 -1
  73. package/dist/transport/index.mjs +1 -1
  74. package/dist/transport/index.mjs.map +1 -1
  75. package/dist/verify.js +19 -1
  76. package/dist/verify.js.map +1 -1
  77. package/dist/verify.mjs +19 -1
  78. package/dist/verify.mjs.map +1 -1
  79. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Where fleet enrolment and the cached signed policy live.
3
+ *
4
+ * Machine scope (written by `astrasync guard enroll --system` / MDM) WINS
5
+ * over user scope. The machine-scope fleet.json is world-readable (0644) —
6
+ * the hook runs as the developer and must read the device credential; that
7
+ * credential can only heartbeat and fetch this device's signed policy, never
8
+ * alter it. User scope lives under ~/.astrasync/fleet/ at 0600.
9
+ *
10
+ * The policy cache + runtime state are user-scope (the hook must be able to
11
+ * refresh them); tampering is caught by the signature check against the JWKS
12
+ * pinned in the enrolment, and a missing cache is re-fetched or fails closed.
13
+ */
14
+
15
+ interface FleetPaths {
16
+ machineDevice: string;
17
+ machinePolicy: string;
18
+ userDir: string;
19
+ userDevice: string;
20
+ userPolicy: string;
21
+ /** Signed key-rotation chain (untrusted storage: each link is verified from the pin). */
22
+ userKeyChain: string;
23
+ state: string;
24
+ }
25
+
26
+ export type { FleetPaths as F };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Where fleet enrolment and the cached signed policy live.
3
+ *
4
+ * Machine scope (written by `astrasync guard enroll --system` / MDM) WINS
5
+ * over user scope. The machine-scope fleet.json is world-readable (0644) —
6
+ * the hook runs as the developer and must read the device credential; that
7
+ * credential can only heartbeat and fetch this device's signed policy, never
8
+ * alter it. User scope lives under ~/.astrasync/fleet/ at 0600.
9
+ *
10
+ * The policy cache + runtime state are user-scope (the hook must be able to
11
+ * refresh them); tampering is caught by the signature check against the JWKS
12
+ * pinned in the enrolment, and a missing cache is re-fetched or fails closed.
13
+ */
14
+
15
+ interface FleetPaths {
16
+ machineDevice: string;
17
+ machinePolicy: string;
18
+ userDir: string;
19
+ userDevice: string;
20
+ userPolicy: string;
21
+ /** Signed key-rotation chain (untrusted storage: each link is verified from the pin). */
22
+ userKeyChain: string;
23
+ state: string;
24
+ }
25
+
26
+ export type { FleetPaths as F };
@@ -3748,7 +3748,7 @@ function getTrustLevel(score) {
3748
3748
  }
3749
3749
 
3750
3750
  // src/version.ts
3751
- var SDK_VERSION = "5.9.0";
3751
+ var SDK_VERSION = "5.11.0";
3752
3752
 
3753
3753
  // src/http.ts
3754
3754
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -4067,6 +4067,24 @@ async function callVerifyAccessAPI(config, request) {
4067
4067
  }
4068
4068
  };
4069
4069
  }
4070
+ if (response.status === 400 && data?.error === "INVALID_AGENT_ID") {
4071
+ const message = typeof data?.message === "string" ? data.message : "Agent identifier must be a canonical ASTRA-* id.";
4072
+ return {
4073
+ success: true,
4074
+ attemptId: typeof data?.attemptId === "string" ? data.attemptId : void 0,
4075
+ access: {
4076
+ allowed: false,
4077
+ reason: "invalid_agent_id",
4078
+ failures: [
4079
+ {
4080
+ dimension: "identity.invalid_agent_id",
4081
+ message,
4082
+ guidance: typeof data?.guidance === "string" ? data.guidance : "Present your canonical ASTRA-* id (discover it via GET /api/agents/request-registration/{requestId} after owner approval)."
4083
+ }
4084
+ ]
4085
+ }
4086
+ };
4087
+ }
4070
4088
  if (!response.ok) {
4071
4089
  if (response.status === 401) {
4072
4090
  return {