@tenuo/core 0.2.5-beta.0 → 0.3.0-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.
Files changed (51) hide show
  1. package/README.md +18 -6
  2. package/dist/api.d.ts +30 -5
  3. package/dist/api.js.map +1 -1
  4. package/dist/client.d.ts +7 -1
  5. package/dist/client.js +22 -18
  6. package/dist/client.js.map +1 -1
  7. package/dist/connect.d.ts +53 -0
  8. package/dist/connect.js +177 -0
  9. package/dist/connect.js.map +1 -0
  10. package/dist/constraints.d.ts +4 -2
  11. package/dist/constraints.js +23 -19
  12. package/dist/constraints.js.map +1 -1
  13. package/dist/errors.d.ts +0 -1
  14. package/dist/errors.js.map +1 -1
  15. package/dist/generated/tenuo_wasm.d.ts +31 -4
  16. package/dist/generated/tenuo_wasm.js +65 -4
  17. package/dist/generated/tenuo_wasm_bg.wasm +0 -0
  18. package/dist/generated/tenuo_wasm_bg.wasm.d.ts +3 -0
  19. package/dist/identity.d.ts +25 -0
  20. package/dist/identity.js +61 -0
  21. package/dist/identity.js.map +1 -0
  22. package/dist/index.d.ts +8 -2
  23. package/dist/index.js +4 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp.d.ts +3 -4
  26. package/dist/mcp.js +11 -20
  27. package/dist/mcp.js.map +1 -1
  28. package/dist/nonce.d.ts +0 -1
  29. package/dist/nonce.js.map +1 -1
  30. package/dist/receipts.d.ts +27 -0
  31. package/dist/receipts.js +128 -0
  32. package/dist/receipts.js.map +1 -0
  33. package/dist/runtime.d.ts +51 -0
  34. package/dist/runtime.js +102 -0
  35. package/dist/runtime.js.map +1 -0
  36. package/dist/session.d.ts +7 -1
  37. package/dist/session.js +14 -0
  38. package/dist/session.js.map +1 -1
  39. package/dist/wasm.d.ts +48 -4
  40. package/dist/wasm.js +53 -6
  41. package/dist/wasm.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/api.d.ts.map +0 -1
  44. package/dist/client.d.ts.map +0 -1
  45. package/dist/constraints.d.ts.map +0 -1
  46. package/dist/errors.d.ts.map +0 -1
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/mcp.d.ts.map +0 -1
  49. package/dist/nonce.d.ts.map +0 -1
  50. package/dist/session.d.ts.map +0 -1
  51. package/dist/wasm.d.ts.map +0 -1
package/README.md CHANGED
@@ -38,18 +38,30 @@ ceiling. `devRoot()` requires `NODE_ENV=development` or `test`,
38
38
  `devRoot({ allowInProduction: true })`, or `TENUO_ALLOW_DEV=1`. Unset
39
39
  `NODE_ENV` is not treated as development.
40
40
 
41
- Production loads an issued warrant and a trusted root:
41
+ Production loads an issued warrant and a trusted root. Prefer `Runtime` when
42
+ the same holder identity, roots, revocation list, and receipt buffer should
43
+ outlive a single call:
42
44
 
43
45
  ```ts
44
- const tenuo = createTenuo({
46
+ const identity = createTenuo.identity(createTenuo.holderKeyFromEnv("TENUO_HOLDER_SECRET"));
47
+ const runtime = createTenuo.runtime({
48
+ identity,
45
49
  trustedRoots: [createTenuo.publicKeyFromEnv("TENUO_ROOT_PUBLIC_KEY")],
50
+ receipts: "collect",
46
51
  });
47
- const session = tenuo.sessionFromWire({
48
- warrant: process.env.TENUO_WARRANT!,
49
- holderKey: createTenuo.holderKeyFromEnv("TENUO_HOLDER_SECRET"),
50
- });
52
+ const session = runtime.sessionFromWire(process.env.TENUO_WARRANT!);
53
+ await readFile.execute({ path: "/data/q3.pdf" }, { session });
54
+ const receipts = session.drainReceipts(); // persist, then upload
51
55
  ```
52
56
 
57
+ `createTenuo.parseConnectToken(raw)` decodes a `tenuo_ct_…` token. It does not
58
+ read environment variables or invent an origin. Relative `/v1` endpoints need
59
+ `token.resolveEndpoint({ localBase })`. Callers append `/v1/…` to the bare
60
+ origin.
61
+
62
+ See [Receipt delivery](../../README.md#receipt-delivery) for peek / drain / ack
63
+ guarantees. This package does not perform HTTP, discovery, or upload.
64
+
53
65
  Delegation to another agent rebinds a narrower child to that agent's key. The
54
66
  current holder signs; core refuses any child that is not within its parent
55
67
  before a token exists; a copied chain fails `TENUO_INVALID_POP` under any other
package/dist/api.d.ts CHANGED
@@ -4,7 +4,11 @@
4
4
  * Names and shapes here are the review surface — do not grow this file with
5
5
  * protocol vocabulary (`Warrant`, `mint`, `guard`) as the lead API.
6
6
  */
7
- export type TenuoErrorCode = "TENUO_NOT_READY" | "TENUO_CONFIGURATION" | "TENUO_CONSTRAINT_VIOLATION" | "TENUO_TOOL_NOT_AUTHORIZED" | "TENUO_WARRANT_EXPIRED" | "TENUO_UNTRUSTED_ROOT" | "TENUO_INVALID_POP" | "TENUO_SIGNATURE_INVALID" | "TENUO_CHAIN_INVALID" | "TENUO_DEPTH_EXCEEDED" | "TENUO_REVOKED" | "TENUO_APPROVAL_REQUIRED" | "TENUO_INSUFFICIENT_APPROVALS" | "TENUO_CANONICALIZATION" | "TENUO_NOT_IMPLEMENTED";
7
+ /** Canonical kebab-case codes from Rust `ErrorCode::name()` / `Denial::code()`. */
8
+ export type ProtocolDenialCode = "signature-invalid" | "untrusted-root" | "chain-broken" | "depth-exceeded" | "warrant-expired" | "tool-not-authorized" | "constraint-violation" | "pop-signature-invalid" | "approval-required" | "insufficient-approvals" | "warrant-revoked";
9
+ /** Legacy SCREAMING_SNAKE aliases accepted by existing TypeScript callers. */
10
+ export type LegacyTenuoErrorCode = "TENUO_NOT_READY" | "TENUO_CONFIGURATION" | "TENUO_CONSTRAINT_VIOLATION" | "TENUO_TOOL_NOT_AUTHORIZED" | "TENUO_WARRANT_EXPIRED" | "TENUO_UNTRUSTED_ROOT" | "TENUO_INVALID_POP" | "TENUO_SIGNATURE_INVALID" | "TENUO_CHAIN_INVALID" | "TENUO_DEPTH_EXCEEDED" | "TENUO_REVOKED" | "TENUO_APPROVAL_REQUIRED" | "TENUO_INSUFFICIENT_APPROVALS" | "TENUO_CANONICALIZATION" | "TENUO_NOT_IMPLEMENTED";
11
+ export type TenuoErrorCode = ProtocolDenialCode | LegacyTenuoErrorCode;
8
12
  /** Path-traversal-safe prefix. Core evaluates this; TypeScript does not. */
9
13
  export type UnderConstraint = {
10
14
  readonly kind: "under";
@@ -112,13 +116,16 @@ export type ToolLike<TArgs extends Record<string, unknown> = Record<string, unkn
112
116
  readonly parameters?: unknown;
113
117
  execute: (args: TArgs, options?: unknown) => TResult | Promise<TResult>;
114
118
  };
115
- export type ToolPolicy = {
119
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
120
+ export type ToolPolicy<TArgs = undefined> = {
116
121
  /**
117
122
  * Host ceiling. AND'd with the session in Rust.
118
123
  * Non-empty maps are zero-trust: every call argument must be named here.
119
124
  * `{}` means no extra ceiling (session/warrant only).
120
125
  */
121
- readonly allow: AllowPolicy;
126
+ readonly allow: [NonNullable<TArgs>] extends [object] ? [KeysOfUnion<NonNullable<TArgs>>] extends [never] ? AllowPolicy : string extends KeysOfUnion<NonNullable<TArgs>> ? AllowPolicy : number extends KeysOfUnion<NonNullable<TArgs>> ? AllowPolicy : symbol extends KeysOfUnion<NonNullable<TArgs>> ? AllowPolicy : {
127
+ readonly [Field in KeysOfUnion<NonNullable<TArgs>>]?: ConstraintExpr;
128
+ } : AllowPolicy;
122
129
  readonly capability?: string;
123
130
  };
124
131
  /** Compile-time brand only — never assigned at runtime. Do not `in`/`has` this key. */
@@ -430,6 +437,8 @@ export type CreateTenuoOptions = {
430
437
  readonly root?: DevRoot | IssuerKey | PublicKeyHandle;
431
438
  /** Published SignedRevocationList (hex or standard base64). Verified against a trusted root. */
432
439
  readonly revocationList?: string | Uint8Array;
440
+ /** 32-byte holder seed used to sign verifier receipts. Runtime supplies this. */
441
+ readonly receiptSigner?: Uint8Array;
433
442
  };
434
443
  export type ApprovalRequestSummary = {
435
444
  readonly tool: string;
@@ -501,6 +510,23 @@ export interface Session {
501
510
  dedupKey(tool: string, args: Readonly<Record<string, unknown>>): string;
502
511
  /** Holder public key, depth, ceiling, lifetime, tools. Never the secret. */
503
512
  inspect(): SessionInfo;
513
+ /**
514
+ * Receipt helpers below are required for `createTenuo.runtime({ receipts:
515
+ * "collect" })`. Implementers that are not runtime sessions can return
516
+ * empty snapshots and `0` from acknowledge.
517
+ */
518
+ /**
519
+ * Receipts collected for this session and not yet drained. Empty when the
520
+ * session was not created by a Runtime with `receipts: "collect"`.
521
+ */
522
+ peekReceipts(): readonly string[];
523
+ /**
524
+ * Snapshot of collected receipts. Same as `peekReceipts`; nothing is removed
525
+ * until `acknowledgeReceipts`.
526
+ */
527
+ drainReceipts(): readonly string[];
528
+ /** Remove the first `count` pending receipts. */
529
+ acknowledgeReceipts(count: number): number;
504
530
  }
505
531
  export interface Tenuo {
506
532
  /**
@@ -509,7 +535,7 @@ export interface Tenuo {
509
535
  */
510
536
  tool<T extends {
511
537
  execute: (args: never) => unknown;
512
- }>(inner: T, policy: ToolPolicy): ProtectedTool<T>;
538
+ }>(inner: T, policy: ToolPolicy<Parameters<T["execute"]>[0]>): ProtectedTool<T>;
513
539
  session(input: SessionInput): Session;
514
540
  /** Import a warrant minted elsewhere (Rust / Python / another process). */
515
541
  sessionFromWire(input: SessionFromWireInput): Session;
@@ -641,4 +667,3 @@ export interface TenuoMcp {
641
667
  jsonRpcError(error: unknown): McpJsonRpcError;
642
668
  }
643
669
  export {};
644
- //# sourceMappingURL=api.d.ts.map
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Frozen public contract for `@tenuo/core`.\n *\n * Names and shapes here are the review surface — do not grow this file with\n * protocol vocabulary (`Warrant`, `mint`, `guard`) as the lead API.\n */\n\n/** Canonical kebab-case codes from Rust `ErrorCode::name()` / `Denial::code()`. */\nexport type ProtocolDenialCode =\n | \"signature-invalid\"\n | \"untrusted-root\"\n | \"chain-broken\"\n | \"depth-exceeded\"\n | \"warrant-expired\"\n | \"tool-not-authorized\"\n | \"constraint-violation\"\n | \"pop-signature-invalid\"\n | \"approval-required\"\n | \"insufficient-approvals\"\n | \"warrant-revoked\";\n\n/** Legacy SCREAMING_SNAKE aliases accepted by existing TypeScript callers. */\nexport type LegacyTenuoErrorCode =\n | \"TENUO_NOT_READY\"\n | \"TENUO_CONFIGURATION\"\n | \"TENUO_CONSTRAINT_VIOLATION\"\n | \"TENUO_TOOL_NOT_AUTHORIZED\"\n | \"TENUO_WARRANT_EXPIRED\"\n | \"TENUO_UNTRUSTED_ROOT\"\n | \"TENUO_INVALID_POP\"\n | \"TENUO_SIGNATURE_INVALID\"\n | \"TENUO_CHAIN_INVALID\"\n | \"TENUO_DEPTH_EXCEEDED\"\n | \"TENUO_REVOKED\"\n | \"TENUO_APPROVAL_REQUIRED\"\n | \"TENUO_INSUFFICIENT_APPROVALS\"\n | \"TENUO_CANONICALIZATION\"\n | \"TENUO_NOT_IMPLEMENTED\";\n\nexport type TenuoErrorCode = ProtocolDenialCode | LegacyTenuoErrorCode;\n\n// ---------------------------------------------------------------------------\n// Constraints. Every kind is evaluated in the Rust core; TypeScript only\n// builds the marker object. The set matches the core `Constraint` enum.\n// ---------------------------------------------------------------------------\n\n/** Path-traversal-safe prefix. Core evaluates this; TypeScript does not. */\nexport type UnderConstraint = {\n readonly kind: \"under\";\n readonly root: string;\n /** Default true. */\n readonly caseSensitive?: boolean;\n /** Whether the root itself is allowed. Default true. */\n readonly allowEqual?: boolean;\n};\n\nexport type EmailConstraint = {\n readonly kind: \"email\";\n readonly domain: string;\n};\n\nexport type MaxConstraint = {\n readonly kind: \"max\";\n readonly value: number;\n};\n\nexport type MinConstraint = {\n readonly kind: \"min\";\n readonly value: number;\n};\n\nexport type RangeConstraint = {\n readonly kind: \"range\";\n readonly min?: number;\n readonly max?: number;\n readonly minExclusive?: boolean;\n readonly maxExclusive?: boolean;\n};\n\nexport type OneOfConstraint = {\n readonly kind: \"oneOf\";\n readonly values: readonly string[];\n};\n\nexport type NotOneOfConstraint = {\n readonly kind: \"notOneOf\";\n readonly values: readonly string[];\n};\n\nexport type PatternConstraint = {\n readonly kind: \"pattern\";\n readonly pattern: string;\n};\n\nexport type RegexConstraint = {\n readonly kind: \"regex\";\n readonly source: string;\n};\n\nexport type ExactConstraint = {\n readonly kind: \"exact\";\n readonly value: string | number | boolean;\n};\n\nexport type WildcardConstraint = {\n readonly kind: \"wildcard\";\n};\n\nexport type CidrConstraint = {\n readonly kind: \"cidr\";\n readonly network: string;\n};\n\nexport type UrlPatternConstraint = {\n readonly kind: \"urlPattern\";\n readonly pattern: string;\n};\n\nexport type UrlSafeConstraint = {\n readonly kind: \"urlSafe\";\n readonly schemes?: readonly string[];\n readonly allowDomains?: readonly string[];\n readonly denyDomains?: readonly string[];\n};\n\nexport type ShlexConstraint = {\n readonly kind: \"shlex\";\n readonly allow: readonly string[];\n};\n\nexport type ContainsConstraint = {\n readonly kind: \"contains\";\n readonly values: readonly (string | number | boolean)[];\n};\n\nexport type SubsetConstraint = {\n readonly kind: \"subset\";\n readonly values: readonly (string | number | boolean)[];\n};\n\nexport type AnyOfConstraint = {\n readonly kind: \"anyOf\";\n readonly constraints: readonly ConstraintExpr[];\n};\n\nexport type AllConstraint = {\n readonly kind: \"all\";\n readonly constraints: readonly ConstraintExpr[];\n};\n\nexport type NotConstraint = {\n readonly kind: \"not\";\n readonly constraint: ConstraintExpr;\n};\n\nexport type CelConstraint = {\n readonly kind: \"cel\";\n readonly expression: string;\n};\n\nexport type ConstraintExpr =\n | UnderConstraint\n | EmailConstraint\n | MaxConstraint\n | MinConstraint\n | RangeConstraint\n | OneOfConstraint\n | NotOneOfConstraint\n | PatternConstraint\n | RegexConstraint\n | ExactConstraint\n | WildcardConstraint\n | CidrConstraint\n | UrlPatternConstraint\n | UrlSafeConstraint\n | ShlexConstraint\n | ContainsConstraint\n | SubsetConstraint\n | AnyOfConstraint\n | AllConstraint\n | NotConstraint\n | CelConstraint;\n\n/** Per-argument allow policy. Not a Zod schema. */\nexport type AllowPolicy = {\n readonly [field: string]: ConstraintExpr;\n};\n\n/**\n * Framework tool shape we wrap. No dependency on `ai` / Mastra.\n * `parameters` is host-schema (usually Zod) and is never treated as authority.\n */\nexport type ToolLike<\n TArgs extends Record<string, unknown> = Record<string, unknown>,\n TResult = unknown,\n> = {\n readonly description?: string;\n readonly parameters?: unknown;\n execute: (args: TArgs, options?: unknown) => TResult | Promise<TResult>;\n};\n\ntype KeysOfUnion<T> = T extends unknown ? keyof T : never;\n\nexport type ToolPolicy<TArgs = undefined> = {\n /**\n * Host ceiling. AND'd with the session in Rust.\n * Non-empty maps are zero-trust: every call argument must be named here.\n * `{}` means no extra ceiling (session/warrant only).\n */\n readonly allow: [NonNullable<TArgs>] extends [object]\n ? [KeysOfUnion<NonNullable<TArgs>>] extends [never]\n ? AllowPolicy\n : string extends KeysOfUnion<NonNullable<TArgs>>\n ? AllowPolicy\n : number extends KeysOfUnion<NonNullable<TArgs>>\n ? AllowPolicy\n : symbol extends KeysOfUnion<NonNullable<TArgs>>\n ? AllowPolicy\n : { readonly [Field in KeysOfUnion<NonNullable<TArgs>>]?: ConstraintExpr }\n : AllowPolicy;\n readonly capability?: string;\n};\n\n/** Compile-time brand only — never assigned at runtime. Do not `in`/`has` this key. */\ndeclare const protectedBrand: unique symbol;\n\nexport type ExecuteOptions = {\n readonly session?: Session;\n /** Already-signed approval envelopes (hex, standard base64, or CBOR bytes). */\n readonly approvals?: readonly (string | Uint8Array)[];\n /**\n * Signed evidence of the decision. Not a security hook.\n * Exceptions (sync or rejected Promise) are isolated and never deny or\n * fail the tool.\n */\n readonly onReceipt?: (receipt: string) => void | Promise<void>;\n /**\n * Correlation handle written to the receipt. Use whatever id the host\n * already has — a JSON-RPC id, a trace or span id — so a receipt can be\n * matched against your own logs. Not an identity: nothing enforces\n * uniqueness, and distinguishing repeated calls is the receipt chain's job.\n */\n readonly requestId?: string;\n};\n\ntype ExtraExecuteOptions<T extends { execute: (args: never) => unknown }> =\n T[\"execute\"] extends (args: never, options?: infer O) => unknown\n ? unknown extends O\n ? object\n : Omit<NonNullable<O>, keyof ExecuteOptions>\n : object;\n\n/** Wrapped tool. `execute` still authorizes; optional `{ session }` overrides ALS. */\nexport type ProtectedTool<T extends { execute: (args: never) => unknown }> = Omit<T, \"execute\"> & {\n execute: (\n args: Parameters<T[\"execute\"]>[0],\n options?: ExecuteOptions & ExtraExecuteOptions<T>,\n ) => Promise<Awaited<ReturnType<T[\"execute\"]>>>;\n readonly [protectedBrand]: true;\n};\n\n// ---------------------------------------------------------------------------\n// Approvals\n// ---------------------------------------------------------------------------\n\n/** Per-argument trigger for an approval gate. */\nexport type ArgApprovalGate =\n /** Every value of this argument fires the gate. */\n | \"all\"\n /** Only values satisfying the constraint fire the gate. */\n | { readonly when: ConstraintExpr }\n /** Every value except those satisfying the constraint fires the gate. Narrowable across delegation. */\n | { readonly exempt: ConstraintExpr };\n\n/** Gate on one tool: a message for the approver and optional per-argument triggers. */\nexport type ToolApprovalGate = {\n readonly message?: string;\n /** Absent: the whole tool is gated. */\n readonly args?: { readonly [field: string]: ArgApprovalGate };\n};\n\n/** Approval requirement. Host collects SignedApproval envelopes; Rust decides. */\nexport type RequireApproval = {\n readonly approvers: readonly PublicKeyHandle[];\n readonly min: number;\n /** Whole-tool gates. Defaults to every tool in the session when `gates` is absent too. */\n readonly tools?: readonly string[];\n /** Per-tool gates with messages and per-argument triggers. */\n readonly gates?: { readonly [tool: string]: ToolApprovalGate };\n};\n\n/** What an approval service needs to present a call to a human. Not a signed artifact. */\nexport type ApprovalRequest = {\n readonly requestId: string;\n readonly warrantId: string;\n readonly tool: string;\n readonly args: Readonly<Record<string, unknown>>;\n /** Hex SHA-256 committing to warrant id, tool, canonical args, and holder. */\n readonly requestHash: string;\n readonly holderPublicKey: string;\n readonly requiredApprovers: readonly string[];\n readonly minApprovals: number;\n /** Unix seconds. An approval cannot outlive the warrant. */\n readonly warrantExpiresAt: number;\n readonly createdAt: number;\n readonly message: string;\n};\n\n/** Holder-signed statement that it is the one asking. Carried in a control-plane request. */\nexport type ApprovalContextAttestation = {\n readonly version: number;\n readonly canonicalization: string;\n readonly warrantId: string;\n readonly tool: string;\n readonly requestHash: string;\n readonly holderKeyHex: string;\n readonly argsCanonicalCborB64: string;\n readonly signerKeyHex: string;\n readonly signatureB64: string;\n};\n\n/** Wire body for a control-plane approval API. Field names are the wire names. */\nexport type ControlPlaneApprovalRequestV1 = {\n readonly schema_version: 1;\n readonly request_id_hex: string;\n readonly warrant_id: string;\n readonly tool: string;\n readonly arguments: Readonly<Record<string, unknown>>;\n readonly request_hash_hex: string;\n readonly holder_public_key_hex: string;\n readonly required_approver_keys_hex: readonly string[];\n readonly min_approvals: number;\n readonly warrant_expires_at_unix: number;\n readonly created_at_unix: number;\n readonly attestation?: Readonly<Record<string, unknown>>;\n readonly temporal?: Readonly<Record<string, string>>;\n readonly message?: string;\n};\n\nexport type ControlPlaneApprovalResponseV1 = {\n readonly status: string;\n readonly signed_approvals_b64?: readonly string[];\n readonly error?: string;\n readonly server_request_id?: string;\n};\n\nexport type SignApprovalOptions = {\n /** Who approved, in the approver system's own terms. Required. */\n readonly externalId: string;\n /** Approval lifetime. Default one hour, always clamped to the warrant's expiry when given. */\n readonly ttlSeconds?: number;\n readonly warrantExpiresAt?: number;\n};\n\n/** Decoded approval envelope. Not authorization. */\nexport type ApprovalInfo = {\n readonly approverPublicKey: string;\n readonly requestHash: string;\n readonly externalId: string;\n readonly approvedAt: number;\n readonly expiresAt: number;\n readonly expired: boolean;\n readonly signatureValid: boolean;\n readonly error?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Sessions\n// ---------------------------------------------------------------------------\n\nexport type SessionAllow = {\n readonly [capability: string]: AllowPolicy;\n};\n\n/** Named level or a number 0-255. Delegation can only lower it. */\nexport type Clearance =\n | number\n | \"untrusted\"\n | \"external\"\n | \"partner\"\n | \"internal\"\n | \"privileged\"\n | \"system\";\n\nexport type SessionInput = {\n /** Capability map. Optional when `tools` is set. Issuer sessions may omit it. */\n readonly allow?: SessionAllow;\n /** Wrapped tools from `tenuo.tool()`. Their `allow` is minted into the session. */\n readonly tools?: readonly object[];\n readonly ttlSeconds?: number;\n readonly requireApproval?: RequireApproval;\n /**\n * Issue to another agent's key instead of a fresh local holder. The\n * returned session cannot authorize here (it has no holder secret); send\n * `toWire()` to that agent, which imports it with `sessionFromWire()`.\n */\n readonly holder?: PublicKeyHandle;\n /**\n * How many times this authority may be delegated below the root.\n * `0` makes the session terminal. Omit for the protocol maximum.\n * Delegation can lower this ceiling and never raise it.\n */\n readonly maxDepth?: number;\n /**\n * `\"execution\"` (default) can call tools. `\"issuer\"` cannot call tools; its\n * holder can mint execution sessions with `tenuo.issue()` for the tools in\n * `issuableTools`, within `constraintBounds`, without the root key.\n */\n readonly kind?: \"execution\" | \"issuer\";\n readonly clearance?: Clearance;\n /** Free-form task correlation id. Inherited unchanged through delegation. */\n readonly sessionId?: string;\n /** Free-form agent label. Delegation may change it. */\n readonly agentId?: string;\n /** Issuer sessions only. */\n readonly issuableTools?: readonly string[];\n /** Issuer sessions only: ceiling on the constraints of anything issued, by field. */\n readonly constraintBounds?: AllowPolicy;\n /** Issuer sessions only: how deep issued sessions may themselves delegate. */\n readonly maxIssueDepth?: number;\n};\n\n/** Options for `tenuo.narrow()`. All optional; the default keeps the holder. */\nexport type NarrowOptions = {\n /**\n * Bind the child to another agent's key. This is delegation: the current\n * holder signs, the child belongs to `holder`, and the returned session\n * cannot authorize here. Hand `toWire()` to that agent.\n */\n readonly holder?: PublicKeyHandle;\n /** Child lifetime. Clamped to what the parent has left. */\n readonly ttlSeconds?: number;\n /** The child's holder cannot delegate further. */\n readonly terminal?: boolean;\n /** Lower the delegation ceiling. Cannot exceed the parent's. */\n readonly maxDepth?: number;\n /** Lower the clearance. Cannot exceed the parent's. */\n readonly clearance?: Clearance;\n readonly agentId?: string;\n /** Approvers can only be added. */\n readonly addApprovers?: readonly PublicKeyHandle[];\n /** The threshold can only go up. */\n readonly minApprovals?: number;\n};\n\n/** Options for `tenuo.issue()`: an execution session minted from an issuer session. */\nexport type IssueInput = {\n readonly allow: SessionAllow;\n /** The distinct agent that will use it. Issuer/holder separation is enforced. */\n readonly holder: PublicKeyHandle;\n readonly ttlSeconds?: number;\n readonly maxDepth?: number;\n readonly clearance?: Clearance;\n readonly sessionId?: string;\n readonly agentId?: string;\n /** Approval policy for the issued execution session. Defaults to gating every issued tool. */\n readonly requireApproval?: RequireApproval;\n};\n\n/** Public view of a session's leaf. Never includes the holder secret. */\nexport type SessionInfo = {\n readonly kind: \"execution\" | \"issuer\";\n /** Hex public key the leaf is bound to. */\n readonly holderPublicKey: string;\n /** Hex public key that signed the root of the chain. */\n readonly rootPublicKey: string;\n /** 0 for a root session, +1 per delegation. */\n readonly depth: number;\n /** Delegation ceiling in force for this leaf. */\n readonly maxDepth: number;\n /** True when `depth >= maxDepth`: cannot be narrowed further. */\n readonly terminal: boolean;\n /** Unix seconds. */\n readonly expiresAt: number;\n readonly tools: readonly string[];\n /** Warrant ids, root first. */\n readonly warrantIds: readonly string[];\n /**\n * True when this process holds the leaf's holder secret. False for a\n * session issued or delegated to another agent: `toWire()` works,\n * `execute` and `narrow` do not.\n */\n readonly canAuthorize: boolean;\n readonly clearance?: number;\n readonly sessionId?: string;\n readonly agentId?: string;\n readonly issuableTools?: readonly string[];\n readonly maxIssueDepth?: number;\n readonly requiredApprovers?: readonly string[];\n readonly minApprovals?: number;\n readonly approvalGatedTools: readonly string[];\n};\n\n/** One constrained argument in an `explain()` result. */\nexport type ExplainedField = {\n readonly field: string;\n /** Core constraint type name, e.g. `\"Subpath\"`, `\"Range\"`. */\n readonly kind: string;\n /** The constraint as core serializes it. */\n readonly constraint: unknown;\n /** Absent when the argument was not supplied. */\n readonly value?: unknown;\n readonly satisfied: boolean;\n readonly reason?: string;\n};\n\n/** What a session would decide for `tool(args)`, field by field. No proof-of-possession involved. */\nexport type Explanation = {\n readonly tool: string;\n readonly kind: \"execution\" | \"issuer\";\n readonly outcome: \"allow\" | \"deny\";\n readonly code?: TenuoErrorCode;\n readonly field?: string;\n readonly message?: string;\n readonly toolGranted: boolean;\n readonly fields: readonly ExplainedField[];\n /** Arguments the session does not name. Zero-trust policies reject these. */\n readonly unknownFields: readonly string[];\n /** Constrained arguments the call did not supply. */\n readonly missingFields: readonly string[];\n readonly expired: boolean;\n readonly expiresAt: number;\n readonly chainValid: boolean;\n readonly chainError?: TenuoErrorCode;\n};\n\nexport type DevRoot = {\n readonly kind: \"dev-root\";\n /**\n * Required when `NODE_ENV` is unset or is not `development` / `test`.\n * Unset `NODE_ENV` is not treated as development.\n */\n readonly allowInProduction?: boolean;\n};\n\n/** A stable issuer secret: this process is a control plane. */\nexport type IssuerKey = {\n readonly kind: \"issuer-key\";\n readonly secret: Uint8Array;\n};\n\nexport type PublicKeyHandle = {\n readonly kind: \"public-key\";\n readonly source: \"env\" | \"hex\" | \"bytes\";\n readonly hex: string;\n};\n\nexport type WarrantPart = {\n readonly payload_hex: string;\n readonly signature_hex: string;\n};\n\nexport type SessionFromWireInput = {\n readonly warrant: string | readonly string[] | readonly WarrantPart[];\n readonly holderKey: Uint8Array;\n};\n\n/** Field-level (`{ path: under(\"/data\") }`) or per-capability (`{ read_file: { path: ... } }`). */\nexport type NarrowInput = AllowPolicy | SessionAllow;\n\nexport type CreateTenuoOptions = {\n readonly trustedRoots?: readonly PublicKeyHandle[];\n /**\n * `devRoot()` for development; an `issuerKey*` for a control plane that\n * mints with a stable key; a public key for a verifier. An issuer key\n * trusts itself plus `trustedRoots`.\n */\n readonly root?: DevRoot | IssuerKey | PublicKeyHandle;\n /** Published SignedRevocationList (hex or standard base64). Verified against a trusted root. */\n readonly revocationList?: string | Uint8Array;\n /** 32-byte holder seed used to sign verifier receipts. Runtime supplies this. */\n readonly receiptSigner?: Uint8Array;\n};\n\nexport type ApprovalRequestSummary = {\n readonly tool: string;\n readonly required: number;\n readonly received: number;\n};\n\nexport type Decision =\n | { readonly outcome: \"allow\"; readonly args: Readonly<Record<string, unknown>> }\n | { readonly outcome: \"deny\"; readonly code: TenuoErrorCode; readonly field?: string }\n | { readonly outcome: \"approval_required\"; readonly request: ApprovalRequestSummary };\n\n// ---------------------------------------------------------------------------\n// Revocation and receipts\n// ---------------------------------------------------------------------------\n\nexport type RevocationListInput = {\n readonly revoke: readonly string[];\n /** Monotonic; verifiers refuse an older version. Default 1. */\n readonly version?: number;\n};\n\nexport type RevocationListInfo = {\n readonly version: number;\n readonly issuedAt: number;\n readonly issuerPublicKey: string;\n readonly revokedIds: readonly string[];\n readonly signatureValid: boolean;\n};\n\n/** Signature authenticity of a receipt. Not authorization. */\nexport type ReceiptInfo = {\n readonly authentic: true;\n /** Hex key the receipt is signed under — resolve against your own authorizer set. */\n readonly signerKey: string;\n readonly outcome: \"allow\" | \"deny\";\n readonly action: string;\n readonly decisionCode?: string;\n readonly requestId: string;\n readonly srlVersion?: number;\n readonly srlHash?: string;\n readonly requestHash?: string;\n readonly policyDefinitionHash?: string;\n readonly prevReceiptHash?: string;\n readonly trustedRootsHash?: string;\n};\n\n/** Root-anchored receipt check: the embedded chain against trusted roots at decision time. */\nexport type ReceiptChainInfo = {\n readonly signerKey: string;\n readonly outcome: \"allow\" | \"deny\";\n readonly decisionCode?: string;\n readonly timestamp: number;\n readonly chainValid: boolean;\n readonly chainError?: string;\n readonly corroboratesDenial?: boolean;\n readonly rootIssuer?: string;\n readonly leafHolder?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Presenting authority across any boundary\n// ---------------------------------------------------------------------------\n\n/** Warrant chain plus proof-of-possession for one call. Transport-agnostic. */\nexport type PresentedCall = {\n readonly warrant: string;\n readonly signature: string;\n readonly approvals?: readonly string[];\n};\n\nexport interface Session {\n readonly [Symbol.toStringTag]: \"TenuoSession\";\n /** Warrant tokens, root first. Does not include the holder secret. */\n toWire(): readonly string[];\n /** SHA-256 of `(warrant_id, tool, canonical args)`. App-level idempotency, not PoP. */\n dedupKey(tool: string, args: Readonly<Record<string, unknown>>): string;\n /** Holder public key, depth, ceiling, lifetime, tools. Never the secret. */\n inspect(): SessionInfo;\n /**\n * Receipt helpers below are required for `createTenuo.runtime({ receipts:\n * \"collect\" })`. Implementers that are not runtime sessions can return\n * empty snapshots and `0` from acknowledge.\n */\n /**\n * Receipts collected for this session and not yet drained. Empty when the\n * session was not created by a Runtime with `receipts: \"collect\"`.\n */\n peekReceipts(): readonly string[];\n /**\n * Snapshot of collected receipts. Same as `peekReceipts`; nothing is removed\n * until `acknowledgeReceipts`.\n */\n drainReceipts(): readonly string[];\n /** Remove the first `count` pending receipts. */\n acknowledgeReceipts(count: number): number;\n}\n\nexport interface Tenuo {\n /**\n * Wrap any `{ execute }` tool (Vercel AI SDK, Mastra, plain object).\n * `parameters` / Zod stay on the inner tool and are never treated as authority.\n */\n tool<T extends { execute: (args: never) => unknown }>(\n inner: T,\n policy: ToolPolicy<Parameters<T[\"execute\"]>[0]>,\n ): ProtectedTool<T>;\n session(input: SessionInput): Session;\n /** Import a warrant minted elsewhere (Rust / Python / another process). */\n sessionFromWire(input: SessionFromWireInput): Session;\n withSession<R>(session: Session, fn: () => R): R;\n /**\n * Child session with less authority. Without options the same holder keeps\n * it; with `options.holder` it is delegated to another agent's key. Core\n * rejects any child that is not within its parent before a token exists.\n */\n narrow(session: Session, allow: NarrowInput, options?: NarrowOptions): Session;\n /**\n * Mint an execution session from an issuer session, signed by the issuer\n * session's holder. Core checks tools against `issuableTools`, constraints\n * against `constraintBounds`, clearance, and issue depth. No root key.\n */\n issue(issuer: Session, input: IssueInput): Session;\n /**\n * Public key of the local issuer (dev root or issuer key). Other processes\n * put it in `trustedRoots` to accept warrants this context mints.\n */\n issuerPublicKey(): PublicKeyHandle;\n /** What the session would decide for `tool(args)`, field by field. Never runs the tool. */\n explain(session: Session, tool: string, args: Readonly<Record<string, unknown>>): Explanation;\n /** Everything an approval service needs to present `tool(args)` to a human. */\n approvalRequest(session: Session, tool: string, args: Readonly<Record<string, unknown>>): ApprovalRequest;\n /** Holder-signed proof that this session is the one asking for `tool(args)`. */\n attestApprovalRequest(\n session: Session,\n tool: string,\n args: Readonly<Record<string, unknown>>,\n ): ApprovalContextAttestation;\n /** Authorize locally, then produce warrant + proof-of-possession for another boundary to verify. */\n present(\n session: Session,\n tool: string,\n args: Readonly<Record<string, unknown>>,\n options?: McpAttachOptions,\n ): PresentedCall;\n /** Verify a presented call at any boundary. Resolves with the authorized arguments; the tool must not run otherwise. */\n verify(\n presented: PresentedCall,\n tool: string,\n args: Readonly<Record<string, unknown>>,\n options?: McpVerifyOptions,\n ): Promise<Readonly<Record<string, unknown>>>;\n /** Sign a revocation list with this context's issuer key. Load it with `revoke()` where this issuer is trusted. */\n revocationList(input: RevocationListInput): string;\n /** Load a published SignedRevocationList. Rust verifies the issuer against trusted roots. */\n revoke(list: string | Uint8Array): void;\n /** MCP `_meta.tenuo` attach / verify. No MCP SDK dependency. */\n readonly mcp: TenuoMcp;\n ready(): void;\n}\n\n/** Wire envelope Python and TypeScript both read from `params._meta`. */\nexport type TenuoMcpMeta = {\n readonly tenuo: PresentedCall;\n};\n\nexport type McpAttachOptions = {\n readonly approvals?: readonly (string | Uint8Array)[];\n readonly onReceipt?: (receipt: string) => void | Promise<void>;\n /**\n * Correlation handle written to the receipt. Use whatever id the host\n * already has — a JSON-RPC id, a trace or span id — so a receipt can be\n * matched against your own logs. Not an identity: nothing enforces\n * uniqueness, and distinguishing repeated calls is the receipt chain's job.\n */\n readonly requestId?: string;\n};\n\n/** Host ceiling and optional receipt hook on `mcp.handler()`. */\nexport type McpHandlerPolicy = {\n readonly allow?: AllowPolicy;\n readonly onReceipt?: (receipt: string) => void | Promise<void>;\n readonly nonceStore?: NonceStore;\n /**\n * Isolated. Called when `nonceStore.checkAndRecord` throws or rejects.\n * The client only ever sees \"Replay store unavailable\".\n */\n readonly onNonceStoreError?: (error: unknown) => void | Promise<void>;\n};\n\nexport type McpVerifyOptions = {\n readonly allow?: AllowPolicy;\n readonly onReceipt?: (receipt: string) => void | Promise<void>;\n /**\n * Opt-in exact-PoP replay check. `checkAndRecord` may return a Promise\n * (Redis). A rejected Promise fails closed. In-memory stores do not work\n * across processes. PoP v1 is otherwise replayable in-window, including\n * envelopes that already carry approvals.\n */\n readonly nonceStore?: NonceStore;\n /**\n * Isolated. Called when `nonceStore.checkAndRecord` throws or rejects.\n * The client only ever sees \"Replay store unavailable\".\n */\n readonly onNonceStoreError?: (error: unknown) => void | Promise<void>;\n /**\n * Correlation handle written to the receipt. Use whatever id the host\n * already has — a JSON-RPC id, a trace or span id — so a receipt can be\n * matched against your own logs. Not an identity: nothing enforces\n * uniqueness, and distinguishing repeated calls is the receipt chain's job.\n */\n readonly requestId?: string;\n};\n\n/**\n * Returns true if the PoP is fresh and recorded; false if this exact token\n * was already consumed. Async stores (Redis) return `Promise<boolean>`.\n * `verify()` / handlers await the result. Never return a Promise from a\n * store that is only consulted synchronously — that used to fail open.\n */\nexport type NonceStore = {\n checkAndRecord(popSignature: string): boolean | Promise<boolean>;\n};\n\nexport type McpCallParams = {\n readonly name: string;\n readonly arguments: Readonly<Record<string, unknown>>;\n readonly _meta: TenuoMcpMeta;\n};\n\nexport type McpJsonRpcError = {\n readonly code: -32602 | -32001 | -32002;\n readonly message: string;\n readonly data?: { readonly tenuo?: { readonly code: TenuoErrorCode } };\n};\n\nexport interface TenuoMcp {\n /** Local authorize, then put warrant + PoP on `_meta.tenuo`. */\n attach(\n session: Session,\n name: string,\n args: Readonly<Record<string, unknown>>,\n options?: McpAttachOptions,\n ): McpCallParams;\n /**\n * Server path. Verifies a presented warrant + PoP. Tool handler must not\n * run unless this returns.\n */\n verify(\n name: string,\n args: Readonly<Record<string, unknown>>,\n meta: unknown,\n options?: McpVerifyOptions,\n ): Promise<Readonly<Record<string, unknown>>>;\n /** Wrap a handler: verify from `extra._meta` / `extra.meta`, then execute. */\n handler<TArgs extends Record<string, unknown>, TResult>(\n name: string,\n execute: (args: TArgs) => TResult | Promise<TResult>,\n ): (\n args: TArgs,\n extra?: { readonly _meta?: unknown; readonly meta?: unknown },\n ) => Promise<TResult>;\n handler<TArgs extends Record<string, unknown>, TResult>(\n name: string,\n policy: McpHandlerPolicy,\n execute: (args: TArgs) => TResult | Promise<TResult>,\n ): (\n args: TArgs,\n extra?: { readonly _meta?: unknown; readonly meta?: unknown },\n ) => Promise<TResult>;\n jsonRpcError(error: unknown): McpJsonRpcError;\n}\n"]}
package/dist/client.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { ApprovalContextAttestation, ApprovalInfo, ApprovalRequest, ControlPlaneApprovalRequestV1, ControlPlaneApprovalResponseV1, CreateTenuoOptions, DevRoot, IssuerKey, PublicKeyHandle, ReceiptChainInfo, ReceiptInfo, RevocationListInfo, RevocationListInput, SignApprovalOptions, Tenuo } from "./api.ts";
2
+ import { parseConnectToken } from "./connect.ts";
3
+ import { generateIdentity, identityFromKey } from "./identity.ts";
4
+ import { createRuntime } from "./runtime.ts";
2
5
  export declare function devRoot(options?: {
3
6
  readonly allowInProduction?: boolean;
4
7
  }): DevRoot;
@@ -65,5 +68,8 @@ export declare const createTenuo: ((options?: CreateTenuoOptions) => Tenuo) & {
65
68
  verifyReceiptChain: typeof verifyReceiptChain;
66
69
  controlPlaneApprovalRequestV1: typeof controlPlaneApprovalRequestV1;
67
70
  signedApprovalsFromResponseV1: typeof signedApprovalsFromResponseV1;
71
+ parseConnectToken: typeof parseConnectToken;
72
+ identity: typeof identityFromKey;
73
+ generateIdentity: typeof generateIdentity;
74
+ runtime: (options: Parameters<typeof createRuntime>[1]) => ReturnType<typeof createRuntime>;
68
75
  };
69
- //# sourceMappingURL=client.d.ts.map
package/dist/client.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import { randomBytes } from "node:crypto";
3
+ import { parseConnectToken } from "./connect.js";
4
+ import { generateIdentity, identityFromKey } from "./identity.js";
3
5
  import { createMcp, presentCall, verifyPresented } from "./mcp.js";
6
+ import { collectReceipt, emitIsolatedReceipt, inheritSessionCollector } from "./receipts.js";
7
+ import { createRuntime } from "./runtime.js";
4
8
  import { AuthorizationDeniedError, ApprovalRequiredError, TenuoConfigurationError, TenuoError } from "./errors.js";
5
9
  import { Session, isSession, nativeSession } from "./session.js";
6
10
  import { createDevContext, createIssuerContext, createVerifierContext, importSessionFromChain, importSessionFromWire, loadWasm, protocolLimits, publicKeyHexFromHolderKey, } from "./wasm.js";
@@ -207,18 +211,18 @@ class TenuoClient {
207
211
  decide;
208
212
  constructor(options) {
209
213
  if (options.root?.kind === "dev-root") {
210
- this.context = createDevContext();
214
+ this.context = createDevContext(options.receiptSigner);
211
215
  this.canMint = true;
212
216
  }
213
217
  else if (options.root?.kind === "issuer-key") {
214
218
  if (!(options.root.secret instanceof Uint8Array) || options.root.secret.length !== 32) {
215
219
  throw new TenuoConfigurationError("root: issuer key must be a 32-byte secret");
216
220
  }
217
- this.context = createIssuerContext(options.root.secret, rootHexes(options));
221
+ this.context = createIssuerContext(options.root.secret, rootHexes(options), options.receiptSigner);
218
222
  this.canMint = true;
219
223
  }
220
224
  else {
221
- this.context = createVerifierContext(rootHexes(options));
225
+ this.context = createVerifierContext(rootHexes(options), undefined, options.receiptSigner);
222
226
  this.canMint = false;
223
227
  }
224
228
  if (options.revocationList !== undefined) {
@@ -227,7 +231,7 @@ class TenuoClient {
227
231
  this.decide = (decision, tool, native, args) => {
228
232
  this.applyDecision(decision, tool, native, args);
229
233
  };
230
- this.mcp = createMcp(this.context, this.decide);
234
+ this.mcp = createMcp(this.context, this.decide, this);
231
235
  }
232
236
  applyDecision(decision, tool, native, args) {
233
237
  if (decision.outcome === "allow") {
@@ -257,7 +261,7 @@ class TenuoClient {
257
261
  const session = resolveSession(callOptions);
258
262
  const native = nativeSession(session);
259
263
  const decision = this.context.authorize(native, capability, args, approvalsFrom(callOptions), policy.allow, requestIdFrom(callOptions));
260
- emitReceipt(callOptions, decision.receipt);
264
+ emitReceipt(callOptions, decision.receipt, session, this);
261
265
  if (decision.outcome === "allow") {
262
266
  return original(plainArgs(decision.args), forwardExecuteOptions(callOptions));
263
267
  }
@@ -398,7 +402,9 @@ class TenuoClient {
398
402
  }
399
403
  const native = options === undefined ? undefined : narrowOptionsJson(options);
400
404
  try {
401
- return new Session(this.context.narrow(nativeSession(session), allow, native));
405
+ const child = new Session(this.context.narrow(nativeSession(session), allow, native));
406
+ inheritSessionCollector(session, child);
407
+ return child;
402
408
  }
403
409
  catch (error) {
404
410
  throw chainError(error);
@@ -493,10 +499,11 @@ class TenuoClient {
493
499
  if (!isSession(session)) {
494
500
  throw new TenuoConfigurationError("present() requires a Tenuo Session, not a plain object");
495
501
  }
496
- return presentCall(this.context, this.decide, session, tool, args, options, "present()").presented;
502
+ return presentCall(this.context, this.decide, session, tool, args, options, "present()", this)
503
+ .presented;
497
504
  }
498
505
  verify(presented, tool, args, options) {
499
- return verifyPresented(this.context, this.decide, presented, tool, args, options, "verify()");
506
+ return verifyPresented(this.context, this.decide, presented, tool, args, options, "verify()", this);
500
507
  }
501
508
  revocationList(input) {
502
509
  if (!this.canMint) {
@@ -715,7 +722,8 @@ function normalizeWireBytes(value) {
715
722
  }
716
723
  return bytesToHex(value);
717
724
  }
718
- function emitReceipt(callOptions, receipt) {
725
+ function emitReceipt(callOptions, receipt, session, host) {
726
+ collectReceipt(receipt, session, host);
719
727
  if (receipt === undefined || callOptions === null || typeof callOptions !== "object") {
720
728
  return;
721
729
  }
@@ -726,15 +734,7 @@ function emitReceipt(callOptions, receipt) {
726
734
  if (typeof onReceipt !== "function") {
727
735
  return;
728
736
  }
729
- try {
730
- const result = onReceipt(receipt);
731
- if (result !== null && typeof result === "object" && "then" in result && typeof result.then === "function") {
732
- void Promise.resolve(result).catch(() => undefined);
733
- }
734
- }
735
- catch {
736
- // Receipt hooks must not deny or fail the tool.
737
- }
737
+ emitIsolatedReceipt(onReceipt, receipt);
738
738
  }
739
739
  function requestIdFrom(callOptions) {
740
740
  if (callOptions !== null && typeof callOptions === "object" && "requestId" in callOptions) {
@@ -1039,5 +1039,9 @@ export const createTenuo = Object.assign(createTenuoImpl, {
1039
1039
  verifyReceiptChain,
1040
1040
  controlPlaneApprovalRequestV1,
1041
1041
  signedApprovalsFromResponseV1,
1042
+ parseConnectToken,
1043
+ identity: identityFromKey,
1044
+ generateIdentity,
1045
+ runtime: (options) => createRuntime(createTenuoImpl, options),
1042
1046
  });
1043
1047
  //# sourceMappingURL=client.js.map