@peac/protocol 0.13.1 → 0.13.3

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/dist/issue.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { JsonValue, EvidencePillar, PolicyBlock } from '@peac/kernel';
6
6
  import { PEACReceiptClaims, SubjectProfileSnapshot, type PEACError, type PurposeToken, type CanonicalPurpose, type PurposeReason, type WorkflowContext } from '@peac/schema';
7
7
  import { type TelemetryHook } from './telemetry.js';
8
8
  /**
9
- * Wire 0.1 receipt options (frozen legacy).
9
+ * Wire 0.1 record options (frozen legacy).
10
10
  *
11
11
  * @deprecated Use {@link IssueWire02Options} (or the {@link IssueOptions} alias)
12
12
  * for current stable issuance.
@@ -100,39 +100,39 @@ export declare class IssueError extends Error {
100
100
  constructor(peacError: PEACError);
101
101
  }
102
102
  /**
103
- * Issue a Wire 0.1 PEAC receipt.
103
+ * Issue a Wire 0.1 PEAC record.
104
104
  *
105
105
  * @deprecated Wire 0.1 issuance is frozen legacy. Use {@link issue} (current stable format)
106
- * or {@link issueWire02} (explicit wire-pinned API) for Wire 0.2 receipts.
106
+ * or {@link issueWire02} (explicit wire-pinned API) for Wire 0.2 records.
107
107
  *
108
- * @param options - Wire 0.1 receipt options
108
+ * @param options - Wire 0.1 record options
109
109
  * @returns Issue result with JWS and optional subject_snapshot
110
110
  * @throws IssueError if evidence contains non-JSON-safe values
111
111
  */
112
112
  export declare function issueWire01(options: IssueWire01Options): Promise<IssueResult>;
113
113
  /**
114
- * Issue a Wire 0.1 PEAC receipt and return just the JWS string
114
+ * Issue a Wire 0.1 PEAC record and return just the JWS string
115
115
  *
116
116
  * @deprecated Wire 0.1 issuance is frozen legacy. Use {@link issue} for the current stable format.
117
117
  *
118
- * @param options - Wire 0.1 receipt options
118
+ * @param options - Wire 0.1 record options
119
119
  * @returns JWS compact serialization
120
120
  */
121
121
  export declare function issueJws(options: IssueWire01Options): Promise<string>;
122
122
  /**
123
- * Issue a PEAC receipt in the current stable public format.
123
+ * Issue a PEAC record in the current stable public format.
124
124
  *
125
- * This is the canonical public issuance API. It issues Wire 0.2 receipts
125
+ * This is the canonical public issuance API. It issues Wire 0.2 records
126
126
  * (`typ: interaction-record+jwt`). For an explicit wire-pinned API, use
127
127
  * {@link issueWire02} directly.
128
128
  *
129
- * @param options - Receipt options (same as {@link IssueWire02Options})
129
+ * @param options - Record options (same as {@link IssueWire02Options})
130
130
  * @returns Issue result with JWS
131
131
  * @throws IssueError if iss is not canonical or schema validation fails
132
132
  */
133
133
  export declare function issue(options: IssueWire02Options): Promise<IssueResult>;
134
134
  /**
135
- * Options for issuing a Wire 0.2 receipt
135
+ * Options for issuing a Wire 0.2 record
136
136
  */
137
137
  export interface IssueWire02Options {
138
138
  /**
@@ -186,7 +186,7 @@ export interface IssueWire02Options {
186
186
  */
187
187
  export type IssueOptions = IssueWire02Options;
188
188
  /**
189
- * Issue a Wire 0.2 receipt (explicit wire-pinned API).
189
+ * Issue a Wire 0.2 record (explicit wire-pinned API).
190
190
  *
191
191
  * Most callers should use {@link issue} instead, which delegates here.
192
192
  * Use `issueWire02` directly for conformance tests, benchmarks, and
@@ -195,7 +195,7 @@ export type IssueOptions = IssueWire02Options;
195
195
  * Validates the iss canonical form and Wire02ClaimsSchema before signing.
196
196
  * Always sets typ to 'interaction-record+jwt' (WIRE_02_JWS_TYP).
197
197
  *
198
- * @param options - Wire 0.2 receipt options
198
+ * @param options - Wire 0.2 record options
199
199
  * @returns Issue result with JWS
200
200
  * @throws IssueError if iss is not canonical or schema validation fails
201
201
  */
@@ -1 +1 @@
1
- {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../src/issue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EACL,iBAAiB,EAEjB,sBAAsB,EAOtB,KAAK,SAAS,EACd,KAAK,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ex>'`.
25
25
  *
26
26
  * This is the normative digest format for the policy.digest field in
27
- * Wire 0.2 receipts. The format is stable and identical across
27
+ * Wire 0.2 records. The format is stable and identical across
28
28
  * implementations. Output is byte-identical to
29
29
  * `computeJsonDocumentDigestJcs(policy)` from `document-binding.ts`.
30
30
  *
@@ -624,6 +624,14 @@ function pruneStale() {
624
624
  while (SHADOW_LOG.length > 0 && SHADOW_LOG[0].timestamp < cutoffIso) SHADOW_LOG.shift();
625
625
  }
626
626
 
627
+ // src/_internal/legacy-path.ts
628
+ function readLegacyPathFlag(options) {
629
+ if (options?._internal?.legacyPath === true) return true;
630
+ if (typeof process === "undefined" || process === null) return false;
631
+ const env = process.env;
632
+ return env?.PEAC_INTERNAL_LEGACY_PATH === "1";
633
+ }
634
+
627
635
  // src/_internal/shadow-observe.ts
628
636
  function realObservationForVerifyLocalSuccess(warnings) {
629
637
  if (!warnings || warnings.length === 0) return EMPTY_ACCEPTED;
@@ -676,6 +684,7 @@ function sanitizeParseIssues(issues) {
676
684
  }));
677
685
  }
678
686
  async function verifyLocal(jws, publicKey, options = {}) {
687
+ void readLegacyPathFlag(options);
679
688
  const {
680
689
  issuer,
681
690
  subjectUri,