@zcloak/ai-agent 1.0.17 → 1.0.20

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.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Run `npm run generate-types` to regenerate this file.
5
5
  * Source: registryIdlFactory in src/idl.ts
6
- * Generated: 2026-03-11T09:17:56.608Z
6
+ * Generated: 2026-03-12T11:14:41.618Z
7
7
  *
8
8
  * These types are derived from the Candid IDL definitions and correspond to
9
9
  * the canister's runtime interface. Edit idl.ts to change type definitions.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Run `npm run generate-types` to regenerate this file.
5
5
  * Source: signIdlFactory in src/idl.ts
6
- * Generated: 2026-03-11T09:17:56.607Z
6
+ * Generated: 2026-03-12T11:14:41.617Z
7
7
  *
8
8
  * These types are derived from the Candid IDL definitions and correspond to
9
9
  * the canister's runtime interface. Edit idl.ts to change type definitions.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Run `npm run generate-types` to regenerate this file.
5
5
  * Source: signIdlFactory in src/idl.ts
6
- * Generated: 2026-03-11T09:17:56.607Z
6
+ * Generated: 2026-03-12T11:14:41.617Z
7
7
  *
8
8
  * These types are derived from the Candid IDL definitions and correspond to
9
9
  * the canister's runtime interface. Edit idl.ts to change type definitions.
package/dist/vetkey.d.ts CHANGED
@@ -31,4 +31,58 @@ import type { Session } from './session.js';
31
31
  * @param session - CLI session with parsed args and canister access
32
32
  */
33
33
  export declare function run(session: Session): Promise<void>;
34
+ /**
35
+ * Background daemon health check — fire-and-forget.
36
+ *
37
+ * Called by cli.ts after Session creation to keep both standard daemons
38
+ * ("default" and "Mail") alive. If a daemon is dead, spawns it in the
39
+ * background WITHOUT waiting for it to be ready (non-blocking).
40
+ *
41
+ * Prerequisites:
42
+ * - The PEM file must exist (user has already created an identity)
43
+ * - If PEM doesn't exist, silently skips (no identity = no daemon possible)
44
+ *
45
+ * All errors are silently swallowed — this is a best-effort health check
46
+ * and must never block or fail the main command.
47
+ *
48
+ * @param pemPath - Path to the identity PEM file
49
+ * @param principal - The principal ID derived from the PEM
50
+ */
51
+ export declare function ensureDaemonsBackground(pemPath: string, principal: string): void;
52
+ /** Tag entry in a Kind17 envelope: ["to", principal], ["payload_type", "text"], etc. */
53
+ export type EnvelopeTag = [string, ...string[]];
54
+ /**
55
+ * Kind 17 envelope for encrypted messages — compatible with zMail protocol.
56
+ *
57
+ * The sender IBE-encrypts the message and wraps the ciphertext as `content`.
58
+ * Metadata like recipient, payload type, and IBE identity are carried in `tags`.
59
+ * The envelope ID is a SHA-256 hash of the canonical serialization.
60
+ * Signature uses BIP-340 Schnorr over the ID hash.
61
+ */
62
+ export interface Kind17Envelope {
63
+ /** SHA-256 hash of canonical serialization [0, ai_id, created_at, 17, tags, content] */
64
+ id: string;
65
+ /** Fixed event kind: 17 */
66
+ kind: 17;
67
+ /** Sender's ICP principal (ai_id) */
68
+ ai_id: string;
69
+ /** Unix timestamp in seconds */
70
+ created_at: number;
71
+ /** Tags carrying recipient and optional metadata */
72
+ tags: EnvelopeTag[];
73
+ /** Encrypted content: base64 IBE ciphertext (string for single recipient) */
74
+ content: string;
75
+ /** BIP-340 Schnorr signature over the envelope ID */
76
+ sig: string;
77
+ }
78
+ /**
79
+ * Extract the raw 32-byte secp256k1 private key from the session identity.
80
+ * The Secp256k1KeyIdentity.toJSON() returns [publicKeyHex, privateKeyHex].
81
+ */
82
+ export declare function extractPrivateKeyHex(session: Session): string;
83
+ /**
84
+ * Extract the BIP-340 Schnorr public key (x-only, 32 bytes hex) from an SPKI hex string.
85
+ * The x-coordinate sits at a fixed offset in the uncompressed secp256k1 SPKI DER structure.
86
+ */
87
+ export declare function schnorrPubkeyFromSpki(spkiHex: string): string;
34
88
  //# sourceMappingURL=vetkey.d.ts.map