@peac/disc 0.12.5 → 0.12.6
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 +62 -3
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @peac/disc
|
|
2
2
|
|
|
3
|
-
PEAC discovery
|
|
3
|
+
PEAC issuer discovery: ABNF-compliant `.well-known/peac.txt` parser, generator, and remote fetcher.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,9 +8,68 @@ PEAC discovery with ≤20 lines enforcement
|
|
|
8
8
|
pnpm add @peac/disc
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## What It Does
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`@peac/disc` parses and generates `.well-known/peac.txt` discovery documents that allow verifiers to find an issuer's public keys and policy information. It enforces the normative 20-line limit, validates document structure against the ABNF grammar, and provides a convenience `discover()` function for remote resolution.
|
|
14
|
+
|
|
15
|
+
## How Do I Use It?
|
|
16
|
+
|
|
17
|
+
### Parse a discovery document
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { parse, validate } from '@peac/disc';
|
|
21
|
+
|
|
22
|
+
const result = parse(`
|
|
23
|
+
version: peac/0.1
|
|
24
|
+
issuer: https://example.com
|
|
25
|
+
jwks: https://example.com/.well-known/jwks.json
|
|
26
|
+
`);
|
|
27
|
+
|
|
28
|
+
if (result.valid) {
|
|
29
|
+
console.log(result.discovery.issuer); // 'https://example.com'
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Generate a discovery document
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { emit } from '@peac/disc';
|
|
37
|
+
|
|
38
|
+
const txt = emit({
|
|
39
|
+
version: 'peac/0.1',
|
|
40
|
+
issuer: 'https://example.com',
|
|
41
|
+
jwks_uri: 'https://example.com/.well-known/jwks.json',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Serve at /.well-known/peac.txt
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Fetch and parse from a remote origin
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { discover, WELL_KNOWN_PATH } from '@peac/disc';
|
|
51
|
+
|
|
52
|
+
const result = await discover('https://example.com');
|
|
53
|
+
if (result.valid) {
|
|
54
|
+
console.log(result.discovery);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log(WELL_KNOWN_PATH); // '/.well-known/peac.txt'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Integrates With
|
|
61
|
+
|
|
62
|
+
- `@peac/policy-kit`: Policy compilation generates `peac.txt` artifacts
|
|
63
|
+
- `@peac/protocol` (Layer 3): Issuer resolution during receipt verification
|
|
64
|
+
- `@peac/jwks-cache`: Fetches JWKS from the URI discovered via `peac.txt`
|
|
65
|
+
|
|
66
|
+
## For Agent Developers
|
|
67
|
+
|
|
68
|
+
If you are building an AI agent or MCP server that needs evidence receipts:
|
|
69
|
+
|
|
70
|
+
- Start with [`@peac/mcp-server`](https://www.npmjs.com/package/@peac/mcp-server) for a ready-to-use MCP tool server
|
|
71
|
+
- Use `@peac/protocol` for programmatic receipt issuance and verification
|
|
72
|
+
- See the [llms.txt](https://github.com/peacprotocol/peac/blob/main/llms.txt) for a concise overview
|
|
14
73
|
|
|
15
74
|
## License
|
|
16
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peac/disc",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6",
|
|
4
4
|
"description": "PEAC discovery with ≤20 lines enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -27,14 +27,20 @@
|
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"peac",
|
|
30
|
+
"peacprotocol",
|
|
31
|
+
"interaction-records",
|
|
32
|
+
"signed-records",
|
|
33
|
+
"receipts",
|
|
34
|
+
"originary",
|
|
30
35
|
"discovery",
|
|
31
36
|
"well-known",
|
|
32
|
-
"
|
|
37
|
+
"issuer-config",
|
|
38
|
+
"peac-txt"
|
|
33
39
|
],
|
|
34
40
|
"license": "Apache-2.0",
|
|
35
41
|
"repository": {
|
|
36
42
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/peacprotocol/peac.git",
|
|
43
|
+
"url": "git+https://github.com/peacprotocol/peac.git",
|
|
38
44
|
"directory": "packages/discovery"
|
|
39
45
|
},
|
|
40
46
|
"bugs": {
|
|
@@ -45,6 +51,7 @@
|
|
|
45
51
|
"access": "public"
|
|
46
52
|
},
|
|
47
53
|
"sideEffects": false,
|
|
54
|
+
"author": "PEAC Protocol Contributors",
|
|
48
55
|
"scripts": {
|
|
49
56
|
"prebuild": "rm -rf dist",
|
|
50
57
|
"build": "pnpm run build:js && pnpm run build:types",
|