@jaccard-ai/eve-auth 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -26,8 +26,16 @@ pnpm add @jaccard-ai/eve-auth
26
26
 
27
27
  eve 0.78.0 or later is a peer dependency: the tool-stub grant and the
28
28
  forwarder check need it, and eve 0.78 needs Node 24, so this package does too.
29
- `@jaccard-ai/eve-sandbox` runs on eve 0.78 too, so one agent can install
30
- both.
29
+ One release serves both eve lines (`>=0.78.0 || >=1.0.0-rc.8`): the source
30
+ type-checks and its tests pass against eve 0.78.0 and 1.0.0. 0.2.2, on
31
+ `latest`, is the first release built and tested for eve 1.0 (its
32
+ prereleases, 0.2.2-rc.N, are on `next`); an eve 0.78 agent can take it too.
33
+ `@jaccard-ai/eve-sandbox` and `@jaccard-ai/eve-metrics` each have one line
34
+ per eve minor; install the ones that match the agent's eve.
35
+
36
+ From 0.2.2 every key set fetch sends `x-jaccard-client:
37
+ @jaccard-ai/eve-auth@<version> eve@<version>` (JAC-2967), so the platform can
38
+ tell which releases deployed agents still run.
31
39
 
32
40
  Releases are cut from CI by a tag (`eve-auth-v<version>`), never by a local
33
41
  `pnpm publish`: `docs/runbooks/eve-packages-npm.md`.
@@ -0,0 +1,7 @@
1
+ export declare const CLIENT_HEADER = "x-jaccard-client";
2
+ /** Built in, not read at runtime; client.test.ts holds it equal to package.json's. */
3
+ export declare const PACKAGE_VERSION = "0.2.2";
4
+ /** `@jaccard-ai/eve-auth@<version>`, then `eve@<version>` when eve's manifest resolves. */
5
+ export declare function clientHeader(eveVersion: string | undefined): string;
6
+ /** eve's version from its own manifest; undefined where a bundle left eve out. */
7
+ export declare function installedEveVersion(): string | undefined;
package/dist/client.js ADDED
@@ -0,0 +1,27 @@
1
+ // The `x-jaccard-client` header (JAC-2967): which release of this package, and
2
+ // which eve, made a call, so the platform can tell which versions are still deployed.
3
+ import { createRequire } from 'node:module';
4
+ export const CLIENT_HEADER = 'x-jaccard-client';
5
+ /** Built in, not read at runtime; client.test.ts holds it equal to package.json's. */
6
+ export const PACKAGE_VERSION = '0.2.2';
7
+ /** `@jaccard-ai/eve-auth@<version>`, then `eve@<version>` when eve's manifest resolves. */
8
+ export function clientHeader(eveVersion) {
9
+ const self = `@jaccard-ai/eve-auth@${PACKAGE_VERSION}`;
10
+ return eveVersion === undefined ? self : `${self} eve@${eveVersion}`;
11
+ }
12
+ /** eve's version from its own manifest; undefined where a bundle left eve out. */
13
+ export function installedEveVersion() {
14
+ try {
15
+ const manifest = createRequire(import.meta.url)('eve/package.json');
16
+ return hasVersion(manifest) ? manifest.version : undefined;
17
+ }
18
+ catch {
19
+ return undefined;
20
+ }
21
+ }
22
+ function hasVersion(manifest) {
23
+ return (typeof manifest === 'object' &&
24
+ manifest !== null &&
25
+ 'version' in manifest &&
26
+ typeof manifest.version === 'string');
27
+ }
package/dist/verify.d.ts CHANGED
@@ -7,10 +7,17 @@
7
7
  import type { AuthResult } from 'eve/channels/auth';
8
8
  import type { IdentitySettings } from './config.js';
9
9
  export type VerifyFailure = 'malformed' | 'key-set-unavailable' | 'unknown-key' | 'invalid-signature' | 'wrong-issuer' | 'wrong-audience' | 'expired' | 'too-old' | 'invalid-identity';
10
+ /**
11
+ * The acceptance, with the tool-stub grant eve's channel reads at runtime. eve 1.0
12
+ * types the grant on `EveAuthResult` only, which eve 0.78 lacks; this compiles on both.
13
+ */
14
+ export type IdentityResult = AuthResult & {
15
+ readonly allowToolStubs?: boolean;
16
+ };
10
17
  /** `subject` on a rejection is the token's `sub`, decoded without verification. */
11
18
  export type VerifyOutcome = {
12
19
  ok: true;
13
- record: AuthResult;
20
+ record: IdentityResult;
14
21
  subject: string | undefined;
15
22
  } | {
16
23
  ok: false;
package/dist/verify.js CHANGED
@@ -5,6 +5,7 @@
5
5
  * only a reason and the token's own `sub`, never the token.
6
6
  */
7
7
  import { createRemoteJWKSet, customFetch, decodeJwt, errors, jwtVerify } from 'jose';
8
+ import { CLIENT_HEADER, clientHeader, installedEveVersion } from './client.js';
8
9
  import { ISSUER } from './constants.js';
9
10
  const ALGORITHM = 'ES256';
10
11
  const CLOCK_TOLERANCE_SECONDS = 30;
@@ -128,6 +129,7 @@ function keySetAt(jwksUrl) {
128
129
  cacheMaxAge: 600_000,
129
130
  cooldownDuration: 30_000,
130
131
  timeoutDuration: 5_000,
132
+ headers: { [CLIENT_HEADER]: clientHeader(installedEveVersion()) },
131
133
  [customFetch]: fetchKeySet,
132
134
  });
133
135
  keySets.set(jwksUrl, keys);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaccard-ai/eve-auth",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Route auth for eve agents on the Jaccard platform: verifies the identity token that the platform's auth service signs for each allowed request.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "homepage": "https://www.jaccard.ai",
@@ -26,17 +26,18 @@
26
26
  "README.md"
27
27
  ],
28
28
  "dependencies": {
29
- "jose": "6.2.3"
29
+ "jose": "6.2.17"
30
30
  },
31
31
  "peerDependencies": {
32
- "eve": ">=0.78.0"
32
+ "eve": ">=0.78.0 || >=1.0.0-rc.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^22.13.1",
36
- "@vitest/coverage-v8": "^4.1.11",
37
- "eve": "0.78.0",
38
- "typescript": "^5.7.3",
39
- "vitest": "^4.1.11"
36
+ "@vitest/coverage-v8": "^5.1.0",
37
+ "ai": "^7.0.172",
38
+ "eve": "1.0.0",
39
+ "typescript": "^7.0.2",
40
+ "vitest": "^5.1.0"
40
41
  },
41
42
  "publishConfig": {
42
43
  "access": "public"