@peac/cli 0.12.14 → 0.13.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.
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/lib/conformance/validators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAAoB,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAqBhG;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,wBAAwB,CAgCjF;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,wBAAwB,CAUrF;AA6XD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAyCjE,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAoBhE"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/lib/conformance/validators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAAoB,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAqBhG;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,wBAAwB,CAgCjF;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,wBAAwB,CAUrF;AA8XD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAyCjE,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAoBhE"}
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Category-aware validation using the same validators as tests/conformance/*.spec.ts:
5
5
  * - Receipt validation via @peac/schema (ReceiptClaimsSchema)
6
- * - Discovery validation via @peac/disc (parse, validate)
6
+ * - Discovery validation via @peac/policy-kit (parsePolicyDocument), wrapped in a
7
+ * CLI-internal compat helper that preserves v0.13.0 legacy-line tolerance
7
8
  * - Bundle verification via @peac/audit (verifyBundleIntegrity)
8
9
  * - Attestation validation via @peac/schema validators
9
10
  * - Interaction/Workflow validation via ordered validators
@@ -1 +1 @@
1
- {"version":3,"file":"conformance-runner.d.ts","sourceRoot":"","sources":["../../src/lib/conformance-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EAMhB,MAAM,wBAAwB,CAAC;AAmBhC;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,eAAe,GAC1B,iBAAiB,CAgVnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAmClE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAwCtE"}
1
+ {"version":3,"file":"conformance-runner.d.ts","sourceRoot":"","sources":["../../src/lib/conformance-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EAMhB,MAAM,wBAAwB,CAAC;AAmBhC;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,EACtB,SAAS,CAAC,EAAE,eAAe,GAC1B,iBAAiB,CAgVnB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAmClE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAwCtE"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * CLI-internal helper. Preserves the v0.13.0 @peac/disc behavior contract
3
+ * (tolerant two-pass parse + SSRF-aware remote fetch) using public
4
+ * @peac/policy-kit and @peac/net-node primitives, plus PUBLIC @peac/kernel
5
+ * constants where the fields exist.
6
+ *
7
+ * NOT exported from @peac/cli's public surface. Used by:
8
+ * - packages/cli/src/commands/discover.ts
9
+ * - packages/cli/src/lib/conformance/validators.ts (validateDiscoveryInput)
10
+ *
11
+ * External consumers needing the same compatibility behavior should copy
12
+ * this pattern; a packaged public helper may land in a later release if
13
+ * external demand surfaces.
14
+ */
15
+ import { type PolicyDocument } from '@peac/policy-kit';
16
+ export declare const DISCOVER_TIMEOUT_MS = 5000;
17
+ export declare const DISCOVER_MAX_BYTES: 262144;
18
+ export declare const PEAC_TXT_PATH: "/.well-known/peac.txt";
19
+ /** @internal - tests only; resets the one-shot legacy-warning flag. */
20
+ export declare function __resetLegacyWarningForTests(): void;
21
+ export interface CompatParseResult {
22
+ valid: boolean;
23
+ data?: PolicyDocument;
24
+ errors?: string[];
25
+ warnings?: string[];
26
+ }
27
+ /**
28
+ * Tolerant two-pass parser preserving v0.13.0 @peac/disc.parse semantics.
29
+ *
30
+ * Pass 1: hand the raw text to parsePolicyDocument unmodified. Legacy-looking
31
+ * substrings inside YAML comments / block scalars / rule text remain intact.
32
+ *
33
+ * Pass 2 (only if Pass 1 throws AND legacy `verify:` / `public_keys:` /
34
+ * `jwks:` lines are present at top level): strip those lines and retry.
35
+ * Detected legacy lines surface as warnings + a once-per-process structured
36
+ * DeprecationWarning with code PEAC_LEGACY_PEAC_TXT_KEY_FIELD.
37
+ *
38
+ * Returns a structured ParseResult; never throws on policy validation /
39
+ * load failure (those become `errors`). Throws only on programming errors.
40
+ */
41
+ export declare function parsePolicyDocumentCompat(text: string): CompatParseResult;
42
+ export interface FetchPolicyDocumentSuccess {
43
+ ok: true;
44
+ text: string;
45
+ warnings?: string[];
46
+ }
47
+ export interface FetchPolicyDocumentFailure {
48
+ ok: false;
49
+ error: string;
50
+ code?: string;
51
+ }
52
+ export type FetchPolicyDocumentResult = FetchPolicyDocumentSuccess | FetchPolicyDocumentFailure;
53
+ export interface FetchPolicyDocumentOptions {
54
+ /** Override the v0.13.0-equivalent 5_000 ms total timeout. */
55
+ timeoutMs?: number;
56
+ /** Override the v0.13.0-equivalent 256 KiB body cap. */
57
+ maxBytes?: number;
58
+ /** Override the User-Agent header. Defaults to `peac-cli`. */
59
+ userAgent?: string;
60
+ }
61
+ /**
62
+ * Fetch a peac.txt policy document via SSRF-aware HTTP with a body cap and
63
+ * timeout. Returns the raw response text on success. Caller is responsible
64
+ * for parsing via `parsePolicyDocumentCompat`. Always closes the underlying
65
+ * raw response in a `finally` block (no socket leak).
66
+ */
67
+ export declare function fetchPolicyDocumentText(origin: string, options?: FetchPolicyDocumentOptions): Promise<FetchPolicyDocumentResult>;
68
+ //# sourceMappingURL=policy-document-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy-document-discovery.d.ts","sourceRoot":"","sources":["../../src/lib/policy-document-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAS1B,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAClD,eAAO,MAAM,aAAa,yBAAsB,CAAC;AAqBjD,uEAAuE;AACvE,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAmCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CA8BzE;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,yBAAyB,GAAG,0BAA0B,GAAG,0BAA0B,CAAC;AAEhG,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,yBAAyB,CAAC,CA6CpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peac/cli",
3
- "version": "0.12.14",
3
+ "version": "0.13.1",
4
4
  "description": "PEAC protocol command-line tools",
5
5
  "main": "dist/index.cjs",
6
6
  "types": "dist/index.d.ts",
@@ -38,12 +38,13 @@
38
38
  "dependencies": {
39
39
  "chalk": "^4.1.2",
40
40
  "commander": "^11.0.0",
41
- "@peac/audit": "0.12.14",
42
- "@peac/crypto": "0.12.14",
43
- "@peac/disc": "0.12.14",
44
- "@peac/protocol": "0.12.14",
45
- "@peac/policy-kit": "0.12.14",
46
- "@peac/schema": "0.12.14"
41
+ "@peac/audit": "0.13.1",
42
+ "@peac/crypto": "0.13.1",
43
+ "@peac/kernel": "0.13.1",
44
+ "@peac/policy-kit": "0.13.1",
45
+ "@peac/protocol": "0.13.1",
46
+ "@peac/schema": "0.13.1",
47
+ "@peac/net-node": "0.13.1"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@types/node": "^22.19.11",