@tenuo/core 0.2.4-beta.0 → 0.2.5-beta.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.
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CreateTenuoOptions, DevRoot, PublicKeyHandle, Tenuo } from "./api.ts";
1
+ import type { ApprovalContextAttestation, ApprovalInfo, ApprovalRequest, ControlPlaneApprovalRequestV1, ControlPlaneApprovalResponseV1, CreateTenuoOptions, DevRoot, IssuerKey, PublicKeyHandle, ReceiptChainInfo, ReceiptInfo, RevocationListInfo, RevocationListInput, SignApprovalOptions, Tenuo } from "./api.ts";
2
2
  export declare function devRoot(options?: {
3
3
  readonly allowInProduction?: boolean;
4
4
  }): DevRoot;
@@ -7,6 +7,43 @@ export declare function publicKeyFromHex(hex: string): PublicKeyHandle;
7
7
  export declare function publicKeyFromBytes(bytes: Uint8Array): PublicKeyHandle;
8
8
  export declare function holderKeyFromEnv(name: string): Uint8Array;
9
9
  export declare function holderKeyFromHex(hex: string): Uint8Array;
10
+ /**
11
+ * A fresh 32-byte Ed25519 secret. One per agent, kept in that agent's
12
+ * process; only its public key (see `publicKeyFromHolderKey`) travels.
13
+ */
14
+ export declare function generateHolderKey(): Uint8Array;
15
+ /** Same shape as a holder key. Named separately so a control plane's key reads as one. */
16
+ export declare function generateIssuerKey(): Uint8Array;
17
+ /** The public half of a holder or issuer secret. */
18
+ export declare function publicKeyFromHolderKey(holderKey: Uint8Array): PublicKeyHandle;
19
+ /** Stable control-plane key from the environment. This process becomes an issuer. */
20
+ export declare function issuerKeyFromEnv(name: string): IssuerKey;
21
+ export declare function issuerKeyFromHex(hex: string): IssuerKey;
22
+ export declare function issuerKeyFromBytes(secret: Uint8Array): IssuerKey;
23
+ /** Sign an approval as an approver. The approver never needs the warrant or the holder key. */
24
+ export declare function signApproval(request: ApprovalRequest | string, approverSecret: Uint8Array, options: SignApprovalOptions): string;
25
+ /** Decode an approval envelope. Not authorization: the call path still decides. */
26
+ export declare function inspectApproval(envelope: string | Uint8Array): ApprovalInfo;
27
+ /** Sign a revocation list with an explicit issuer secret. */
28
+ export declare function signRevocationList(input: RevocationListInput, issuerSecret: Uint8Array): string;
29
+ export declare function inspectRevocationList(wire: string | Uint8Array): RevocationListInfo;
30
+ /** Signature authenticity of a receipt. Not authorization. */
31
+ export declare function verifyReceipt(wire: string | Uint8Array): ReceiptInfo;
32
+ /**
33
+ * Root-anchored receipt check: the embedded warrant chain against `roots`
34
+ * at the receipt's own decision instant. Needs no trust in the signer.
35
+ */
36
+ export declare function verifyReceiptChain(wire: string | Uint8Array, roots: readonly PublicKeyHandle[]): ReceiptChainInfo;
37
+ /**
38
+ * The v1 JSON body a control plane's approval API accepts. Same shape the
39
+ * Python SDK produces, so one approval service serves both.
40
+ */
41
+ export declare function controlPlaneApprovalRequestV1(request: ApprovalRequest, options?: {
42
+ readonly attestation?: ApprovalContextAttestation;
43
+ readonly temporal?: Readonly<Record<string, string>>;
44
+ }): ControlPlaneApprovalRequestV1;
45
+ /** Approval envelopes from a v1 response, ready for `{ approvals }` on the call. Empty unless status is a success. */
46
+ export declare function signedApprovalsFromResponseV1(response: ControlPlaneApprovalResponseV1): string[];
10
47
  export declare const createTenuo: ((options?: CreateTenuoOptions) => Tenuo) & {
11
48
  devRoot: typeof devRoot;
12
49
  publicKeyFromEnv: typeof publicKeyFromEnv;
@@ -14,5 +51,19 @@ export declare const createTenuo: ((options?: CreateTenuoOptions) => Tenuo) & {
14
51
  publicKeyFromBytes: typeof publicKeyFromBytes;
15
52
  holderKeyFromEnv: typeof holderKeyFromEnv;
16
53
  holderKeyFromHex: typeof holderKeyFromHex;
54
+ generateHolderKey: typeof generateHolderKey;
55
+ generateIssuerKey: typeof generateIssuerKey;
56
+ publicKeyFromHolderKey: typeof publicKeyFromHolderKey;
57
+ issuerKeyFromEnv: typeof issuerKeyFromEnv;
58
+ issuerKeyFromHex: typeof issuerKeyFromHex;
59
+ issuerKeyFromBytes: typeof issuerKeyFromBytes;
60
+ signApproval: typeof signApproval;
61
+ inspectApproval: typeof inspectApproval;
62
+ signRevocationList: typeof signRevocationList;
63
+ inspectRevocationList: typeof inspectRevocationList;
64
+ verifyReceipt: typeof verifyReceipt;
65
+ verifyReceiptChain: typeof verifyReceiptChain;
66
+ controlPlaneApprovalRequestV1: typeof controlPlaneApprovalRequestV1;
67
+ signedApprovalsFromResponseV1: typeof signedApprovalsFromResponseV1;
17
68
  };
18
69
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,OAAO,EAEP,eAAe,EAIf,KAAK,EAIN,MAAM,UAAU,CAAC;AA+BlB,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CASnF;AAwBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAgB9D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAMrE;AAoBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAgBzD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAExD;AA6XD,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,KAAK,CAAC,GAAG;IACpE,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,gBAAgB,EAAE,OA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