@drakon-systems/ekho-sdk 0.4.6 → 0.4.8

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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to Ekho are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.4.8] - 2026-08-31
8
+
9
+ ### Changed
10
+ - Published dual CommonJS and ESM entry points. Existing `require()` consumers keep the CommonJS build; `import` consumers receive `dist/esm`. No protocol or client API changed.
11
+
12
+ ## [0.4.7] - 2026-08-29
13
+
14
+ ### Notes
15
+ - No SDK surface change. Version bumped in lockstep with the OpenClaw plugin warning-throttle release; no agent protocol break.
16
+
7
17
  ## [0.4.6] - 2026-08-27
8
18
 
9
19
  ### Notes
package/dist/adapter.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AgentCredentials, InboxMessage, ControlMessage, SendMessagePayload, ProposeActionPayload, ActionResultPayload } from "./types";
1
+ import type { AgentCredentials, InboxMessage, ControlMessage, SendMessagePayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
2
2
  export type AdapterHooks = {
3
3
  onMessage?: (message: InboxMessage, adapter: EkhoAgentAdapter) => Promise<void>;
4
4
  beforeAction?: (action: ProposeActionPayload, adapter: EkhoAgentAdapter) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,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IAC1F,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF,CAAC;AAMF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,qBAAqB,CAAqB;gBAEtC,WAAW,EAAE,gBAAgB,EAAE,KAAK,GAAE,YAAiB;IAKnE,IAAI,OAAO,WAAkC;IAEvC,KAAK;IAOX,IAAI;IAEE,IAAI,CAAC,OAAO,EAAE,kBAAkB;;;;;IAIhC,aAAa,CAAC,MAAM,EAAE,oBAAoB;;;;;;IAqB1C,kBAAkB,CAAC,OAAO,EAAE,mBAAmB;;;YAIvC,aAAa;YAeb,SAAS;YAmBT,aAAa;CAK5B"}
package/dist/adapter.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EkhoAgentAdapter = void 0;
4
- const client_1 = require("./client");
4
+ const client_js_1 = require("./client.js");
5
5
  function sleep(ms) {
6
6
  return new Promise((resolve) => setTimeout(resolve, ms));
7
7
  }
@@ -12,7 +12,7 @@ class EkhoAgentAdapter {
12
12
  paused = false;
13
13
  activeConversationIds = new Set();
14
14
  constructor(credentials, hooks = {}) {
15
- this.client = new client_1.EkhoAgentClient(credentials);
15
+ this.client = new client_js_1.EkhoAgentClient(credentials);
16
16
  this.hooks = hooks;
17
17
  }
18
18
  get agentId() { return this.client.agentId; }
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter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MessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types";
1
+ import type { AgentCredentials, ActionDecision, AttachmentUploadInput, InboxResponse, MessageSnapshot, SendMessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
2
2
  export type FloorResult = {
3
3
  granted: boolean;
4
4
  holder_agent_id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC,CAAC;AASF,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,gBAAgB;IAE1D,OAAO,CAAC,aAAa;YAeP,OAAO;IAiBrB,IAAI,OAAO,WAAuC;IAClD,IAAI,mBAAmB,WAA4E;IACnG,IAAI,wBAAwB,WAAsF;IAElH,WAAW,CAAC,OAAO,EAAE,kBAAkB;oBACH,MAAM;gBAAU,MAAM;mBAAa,MAAM;;IAG7E;;;;;;;OAOG;IACH,UAAU,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;YACrC,MAAM;cAAQ,MAAM;oBAAc,MAAM;iBAAW,MAAM,EAAE;;IAKvF,QAAQ,CAAC,KAAK,SAAK;IAInB;8DAC0D;IAC1D,mBAAmB,CAAC,SAAS,EAAE,MAAM;gBACL,MAAM;;IAGtC,WAAW,CAAC,IAAI,EAAE,KAAK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QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;YAC9E,OAAO;kBAAY,OAAO;;IAGtD,SAAS,CAAC,OAAO,EAAE,gBAAgB;YACP,OAAO;oCAA8B,MAAM;;IAGvE,aAAa,CAAC,OAAO,EAAE,oBAAoB;IAI3C,WAAW,CAAC,UAAU,EAAE,MAAM;YAEtB,MAAM;gBAAU,MAAM;qBAAe,MAAM;oBAAc,MAAM;iBAC1D,MAAM;sBAAgB,MAAM;qBAAe,MAAM,GAAG,IAAI;;IAIrE,YAAY,CAAC,OAAO,EAAE,mBAAmB;YACb,OAAO;;IAGnC,gBAAgB,CAAC,KAAK,EAAE,qBAAqB;YAGjB,MAAM;kBAAY,MAAM;cAAQ,MAAM;oBAAc,MAAM;oBAAc,MAAM;;IAMpG,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAajG"}
@@ -0,0 +1,36 @@
1
+ import type { AgentCredentials, InboxMessage, ControlMessage, SendMessagePayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
2
+ export type AdapterHooks = {
3
+ onMessage?: (message: InboxMessage, adapter: EkhoAgentAdapter) => Promise<void>;
4
+ beforeAction?: (action: ProposeActionPayload, adapter: EkhoAgentAdapter) => Promise<void>;
5
+ onControl?: (control: ControlMessage, adapter: EkhoAgentAdapter) => Promise<void>;
6
+ onApprovalPending?: (approvalId: string, adapter: EkhoAgentAdapter) => Promise<void>;
7
+ };
8
+ export declare class EkhoAgentAdapter {
9
+ private readonly client;
10
+ private readonly hooks;
11
+ private running;
12
+ private paused;
13
+ private activeConversationIds;
14
+ constructor(credentials: AgentCredentials, hooks?: AdapterHooks);
15
+ get agentId(): string;
16
+ start(): Promise<void>;
17
+ stop(): void;
18
+ send(payload: SendMessagePayload): Promise<{
19
+ message_id: string;
20
+ status: string;
21
+ queued_at: string;
22
+ }>;
23
+ proposeAction(action: ProposeActionPayload): Promise<{
24
+ decision: "allow";
25
+ } | {
26
+ decision: "pending_approval";
27
+ approval_id: string;
28
+ }>;
29
+ reportActionResult(payload: ActionResultPayload): Promise<{
30
+ ok: boolean;
31
+ }>;
32
+ private heartbeatLoop;
33
+ private inboxLoop;
34
+ private handleControl;
35
+ }
36
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF,CAAC;AAMF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,qBAAqB,CAAqB;gBAEtC,WAAW,EAAE,gBAAgB,EAAE,KAAK,GAAE,YAAiB;IAKnE,IAAI,OAAO,WAAkC;IAEvC,KAAK;IAOX,IAAI;IAEE,IAAI,CAAC,OAAO,EAAE,kBAAkB;;;;;IAIhC,aAAa,CAAC,MAAM,EAAE,oBAAoB;;;;;;IAqB1C,kBAAkB,CAAC,OAAO,EAAE,mBAAmB;;;YAIvC,aAAa;YAeb,SAAS;YAmBT,aAAa;CAK5B"}
@@ -0,0 +1,98 @@
1
+ import { EkhoAgentClient } from "./client.js";
2
+ function sleep(ms) {
3
+ return new Promise((resolve) => setTimeout(resolve, ms));
4
+ }
5
+ export class EkhoAgentAdapter {
6
+ client;
7
+ hooks;
8
+ running = false;
9
+ paused = false;
10
+ activeConversationIds = new Set();
11
+ constructor(credentials, hooks = {}) {
12
+ this.client = new EkhoAgentClient(credentials);
13
+ this.hooks = hooks;
14
+ }
15
+ get agentId() { return this.client.agentId; }
16
+ async start() {
17
+ if (this.running)
18
+ return;
19
+ this.running = true;
20
+ void this.heartbeatLoop();
21
+ void this.inboxLoop();
22
+ }
23
+ stop() { this.running = false; }
24
+ async send(payload) {
25
+ return this.client.sendMessage(payload);
26
+ }
27
+ async proposeAction(action) {
28
+ if (this.hooks.beforeAction)
29
+ await this.hooks.beforeAction(action, this);
30
+ if (this.paused)
31
+ throw new Error("agent is paused by control plane");
32
+ const decision = await this.client.proposeAction(action);
33
+ if (decision.decision === "allow")
34
+ return decision;
35
+ if (decision.decision === "deny")
36
+ throw new Error("action denied by Ekho policy");
37
+ if (this.hooks.onApprovalPending)
38
+ await this.hooks.onApprovalPending(decision.approval_id, this);
39
+ while (this.running) {
40
+ const approval = await this.client.getApproval(decision.approval_id);
41
+ if (approval.status === "approved" || approval.status === "executed")
42
+ return decision;
43
+ if (approval.status === "rejected" || approval.status === "cancelled" || approval.status === "expired") {
44
+ throw new Error(`action ${approval.status} by operator`);
45
+ }
46
+ await sleep(1500);
47
+ }
48
+ throw new Error("adapter stopped while waiting for approval");
49
+ }
50
+ async reportActionResult(payload) {
51
+ return this.client.actionResult(payload);
52
+ }
53
+ async heartbeatLoop() {
54
+ while (this.running) {
55
+ try {
56
+ await this.client.heartbeat({
57
+ status: this.paused ? "degraded" : "healthy",
58
+ active_conversation_ids: [...this.activeConversationIds],
59
+ metrics: { paused: this.paused }
60
+ });
61
+ }
62
+ catch (error) {
63
+ console.error("[ekho-adapter] heartbeat failed", error);
64
+ }
65
+ await sleep(this.client.heartbeatIntervalSeconds * 1000);
66
+ }
67
+ }
68
+ async inboxLoop() {
69
+ while (this.running) {
70
+ try {
71
+ const inbox = await this.client.getInbox();
72
+ for (const control of inbox.controls)
73
+ await this.handleControl(control);
74
+ for (const raw of inbox.messages) {
75
+ this.activeConversationIds.add(raw.conversation_id);
76
+ if (this.hooks.onMessage)
77
+ await this.hooks.onMessage(raw, this);
78
+ await this.client.ackMessages([
79
+ { message_id: raw.message_id, status: "received", received_at: new Date().toISOString() }
80
+ ]);
81
+ }
82
+ }
83
+ catch (error) {
84
+ console.error("[ekho-adapter] inbox loop failed", error);
85
+ }
86
+ await sleep(this.client.pollIntervalSeconds * 1000);
87
+ }
88
+ }
89
+ async handleControl(control) {
90
+ if (control.action === "pause" || control.action === "quarantine")
91
+ this.paused = true;
92
+ if (control.action === "resume")
93
+ this.paused = false;
94
+ if (this.hooks.onControl)
95
+ await this.hooks.onControl(control, this);
96
+ }
97
+ }
98
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiB9C,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,OAAO,gBAAgB;IACV,MAAM,CAAkB;IACxB,KAAK,CAAe;IA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AAK,YAAY;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACtF,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ;YAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACrD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF"}
@@ -0,0 +1,101 @@
1
+ import type { AgentCredentials, ActionDecision, AttachmentUploadInput, InboxResponse, MessageSnapshot, SendMessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
2
+ export type FloorResult = {
3
+ granted: boolean;
4
+ holder_agent_id: string;
5
+ expires_at: string;
6
+ conversation_tail: MessageSnapshot[];
7
+ };
8
+ export declare class EkhoAgentClient {
9
+ private readonly credentials;
10
+ constructor(credentials: AgentCredentials);
11
+ private signedHeaders;
12
+ private request;
13
+ get agentId(): string;
14
+ get pollIntervalSeconds(): number;
15
+ get heartbeatIntervalSeconds(): number;
16
+ sendMessage(payload: SendMessagePayload): Promise<{
17
+ message_id: string;
18
+ status: string;
19
+ queued_at: string;
20
+ }>;
21
+ /**
22
+ * Open a named topic room scoped to a set of fleet agents. Use this when a
23
+ * collaboration has become a real topic worth its own discoverable, scoped
24
+ * thread (instead of repeated 1:1 direct messages). This agent becomes the
25
+ * creator and is auto-added as a member; `memberAgentIds` names the OTHER
26
+ * agents to include (real, non-revoked agents in the same fleet). To post into
27
+ * the room afterward, send with `recipient: { kind: "group", id: <room.id> }`.
28
+ */
29
+ createRoom(payload: {
30
+ name: string;
31
+ member_agent_ids?: string[];
32
+ }): Promise<{
33
+ id: string;
34
+ name: string;
35
+ created_at: string;
36
+ members: string[];
37
+ }>;
38
+ getInbox(limit?: number): Promise<InboxResponse>;
39
+ /** Register (or rotate) this agent's Ed25519 identity public key for
40
+ * agent-to-agent trust. Idempotent on the relay side. */
41
+ registerIdentityKey(publicKey: string): Promise<{
42
+ key_id: string;
43
+ }>;
44
+ ackMessages(acks: Array<{
45
+ message_id: string;
46
+ status: "received";
47
+ received_at: string;
48
+ }>): Promise<{
49
+ updated: number;
50
+ }>;
51
+ /** Acquire a conversation's floor so this agent — and not its peers — takes the
52
+ * next turn. Returns granted + the current holder + a fresh catch-up tail. */
53
+ acquireFloor(conversationId: string, ttlSeconds?: number): Promise<FloorResult>;
54
+ /** Release a conversation's floor once this agent's turn is done. */
55
+ releaseFloor(conversationId: string): Promise<{
56
+ released: boolean;
57
+ }>;
58
+ /** Raise an operator-visible notice that a conversation has stalled (e.g. the
59
+ * peer-turn budget is exhausted with real work withheld). Recorded as a
60
+ * `conversation.stalled` event; idempotent per (fleet, agent, conversation)
61
+ * until the next operator engagement, so it's safe to call best-effort. */
62
+ raiseNotice(payload: {
63
+ conversation_id: string;
64
+ reason?: string;
65
+ pending_count?: number;
66
+ budget?: number;
67
+ }): Promise<{
68
+ ok: boolean;
69
+ recorded: boolean;
70
+ }>;
71
+ heartbeat(payload: HeartbeatPayload): Promise<{
72
+ ok: boolean;
73
+ next_heartbeat_due_seconds: number;
74
+ }>;
75
+ proposeAction(payload: ProposeActionPayload): Promise<ActionDecision>;
76
+ getApproval(approvalId: string): Promise<{
77
+ id: string;
78
+ status: string;
79
+ action_type: string;
80
+ risk_level: string;
81
+ summary: string;
82
+ requested_at: string;
83
+ resolved_at: string | null;
84
+ }>;
85
+ actionResult(payload: ActionResultPayload): Promise<{
86
+ ok: boolean;
87
+ }>;
88
+ uploadAttachment(input: AttachmentUploadInput): Promise<{
89
+ id: string;
90
+ filename: string;
91
+ mime: string;
92
+ size_bytes: number;
93
+ created_at: string;
94
+ }>;
95
+ downloadAttachment(id: string): Promise<{
96
+ bytes: Buffer;
97
+ filename: string;
98
+ mime: string;
99
+ }>;
100
+ }
101
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.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;;gFAG4E;IAC5E,WAAW,CAAC,OAAO,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;YAC9E,OAAO;kBAAY,OAAO;;IAGtD,SAAS,CAAC,OAAO,EAAE,gBAAgB;YACP,OAAO;oCAA8B,MAAM;;IAGvE,aAAa,CAAC,OAAO,EAAE,oBAAoB;IAI3C,WAAW,CAAC,UAAU,EAAE,MAAM;YAEtB,MAAM;gBAAU,MAAM;qBAAe,MAAM;oBAAc,MAAM;iBAC1D,MAAM;sBAAgB,MAAM;qBAAe,MAAM,GAAG,IAAI;;IAIrE,YAAY,CAAC,OAAO,EAAE,mBAAmB;YACb,OAAO;;IAGnC,gBAAgB,CAAC,KAAK,EAAE,qBAAqB;YAGjB,MAAM;kBAAY,MAAM;cAAQ,MAAM;oBAAc,MAAM;oBAAc,MAAM;;IAMpG,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAajG"}
@@ -0,0 +1,116 @@
1
+ import crypto from "node:crypto";
2
+ const DEFAULT_POLL_INTERVAL = 5;
3
+ const DEFAULT_HEARTBEAT_INTERVAL = 30;
4
+ function sha256(input) {
5
+ return crypto.createHash("sha256").update(input).digest("hex");
6
+ }
7
+ export class EkhoAgentClient {
8
+ credentials;
9
+ constructor(credentials) {
10
+ this.credentials = credentials;
11
+ }
12
+ signedHeaders(method, signaturePath, body) {
13
+ const timestamp = new Date().toISOString();
14
+ const nonce = crypto.randomUUID();
15
+ const payload = `${method}\n${signaturePath}\n${timestamp}\n${nonce}\n${sha256(body)}`;
16
+ const signature = crypto.createHmac("sha256", this.credentials.secret).update(payload).digest("hex");
17
+ return {
18
+ "content-type": "application/json",
19
+ "x-ekho-agent-id": this.credentials.agentId,
20
+ "x-ekho-agent-secret": this.credentials.secret,
21
+ "x-ekho-timestamp": timestamp,
22
+ "x-ekho-nonce": nonce,
23
+ "x-ekho-signature": signature
24
+ };
25
+ }
26
+ async request(method, routePath, payload) {
27
+ const body = payload ? JSON.stringify(payload) : "";
28
+ const signaturePath = routePath.split("?")[0] ?? routePath;
29
+ const response = await fetch(`${this.credentials.relayBaseUrl}${routePath}`, {
30
+ method,
31
+ headers: this.signedHeaders(method, signaturePath, body),
32
+ body: method === "GET" ? undefined : body
33
+ });
34
+ if (!response.ok) {
35
+ const text = await response.text();
36
+ throw new Error(`Ekho request failed for ${routePath}: ${response.status} ${text}`);
37
+ }
38
+ return response.json();
39
+ }
40
+ get agentId() { return this.credentials.agentId; }
41
+ get pollIntervalSeconds() { return this.credentials.pollIntervalSeconds ?? DEFAULT_POLL_INTERVAL; }
42
+ get heartbeatIntervalSeconds() { return this.credentials.heartbeatIntervalSeconds ?? DEFAULT_HEARTBEAT_INTERVAL; }
43
+ sendMessage(payload) {
44
+ return this.request("POST", "/v1/messages", payload);
45
+ }
46
+ /**
47
+ * Open a named topic room scoped to a set of fleet agents. Use this when a
48
+ * collaboration has become a real topic worth its own discoverable, scoped
49
+ * thread (instead of repeated 1:1 direct messages). This agent becomes the
50
+ * creator and is auto-added as a member; `memberAgentIds` names the OTHER
51
+ * agents to include (real, non-revoked agents in the same fleet). To post into
52
+ * the room afterward, send with `recipient: { kind: "group", id: <room.id> }`.
53
+ */
54
+ createRoom(payload) {
55
+ return this.request("POST", "/v1/rooms", { name: payload.name, member_agent_ids: payload.member_agent_ids ?? [] });
56
+ }
57
+ getInbox(limit = 25) {
58
+ return this.request("GET", `/v1/inbox?limit=${limit}`);
59
+ }
60
+ /** Register (or rotate) this agent's Ed25519 identity public key for
61
+ * agent-to-agent trust. Idempotent on the relay side. */
62
+ registerIdentityKey(publicKey) {
63
+ return this.request("POST", "/v1/identity-key", { public_key: publicKey });
64
+ }
65
+ ackMessages(acks) {
66
+ return this.request("POST", "/v1/acks", { acks });
67
+ }
68
+ /** Acquire a conversation's floor so this agent — and not its peers — takes the
69
+ * next turn. Returns granted + the current holder + a fresh catch-up tail. */
70
+ acquireFloor(conversationId, ttlSeconds) {
71
+ return this.request("POST", `/v1/conversations/${encodeURIComponent(conversationId)}/floor`, ttlSeconds === undefined ? {} : { ttl_seconds: ttlSeconds });
72
+ }
73
+ /** Release a conversation's floor once this agent's turn is done. */
74
+ releaseFloor(conversationId) {
75
+ return this.request("DELETE", `/v1/conversations/${encodeURIComponent(conversationId)}/floor`);
76
+ }
77
+ /** Raise an operator-visible notice that a conversation has stalled (e.g. the
78
+ * peer-turn budget is exhausted with real work withheld). Recorded as a
79
+ * `conversation.stalled` event; idempotent per (fleet, agent, conversation)
80
+ * until the next operator engagement, so it's safe to call best-effort. */
81
+ raiseNotice(payload) {
82
+ return this.request("POST", "/v1/notices", payload);
83
+ }
84
+ heartbeat(payload) {
85
+ return this.request("POST", "/v1/heartbeats", payload);
86
+ }
87
+ proposeAction(payload) {
88
+ return this.request("POST", "/v1/actions/propose", payload);
89
+ }
90
+ getApproval(approvalId) {
91
+ return this.request("GET", `/v1/actions/${approvalId}`);
92
+ }
93
+ actionResult(payload) {
94
+ return this.request("POST", "/v1/actions/result", payload);
95
+ }
96
+ uploadAttachment(input) {
97
+ // size_bytes derived from the decoded byte length so the server cross-check passes.
98
+ const size_bytes = Buffer.from(input.dataBase64, "base64").length;
99
+ return this.request("POST", "/v1/attachments", { filename: input.filename, mime: input.mime, size_bytes, data_base64: input.dataBase64 });
100
+ }
101
+ async downloadAttachment(id) {
102
+ const routePath = `/v1/attachments/${encodeURIComponent(id)}`;
103
+ const signaturePath = routePath; // no query
104
+ const response = await fetch(`${this.credentials.relayBaseUrl}${routePath}`, {
105
+ method: "GET",
106
+ headers: this.signedHeaders("GET", signaturePath, "") // body "" → signs the same as other GETs
107
+ });
108
+ if (!response.ok)
109
+ throw new Error(`Ekho download failed for ${routePath}: ${response.status} ${await response.text()}`);
110
+ const bytes = Buffer.from(await response.arrayBuffer());
111
+ const cd = response.headers.get("content-disposition") ?? "";
112
+ const filename = /filename="([^"]+)"/.exec(cd)?.[1] ?? id;
113
+ return { bytes, filename, mime: response.headers.get("content-type") ?? "application/octet-stream" };
114
+ }
115
+ }
116
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAoBjC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAEtC,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;IAAG,CAAC;IAEtD,aAAa,CAAC,MAAc,EAAE,aAAqB,EAAE,IAAY;QACvE,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,GAAG,MAAM,KAAK,aAAa,KAAK,SAAS,KAAK,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvF,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrG,OAAO;YACL,cAAc,EAAE,kBAAkB;YAClC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,O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AC3E,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,CAAC,CAAG,yCAAyC;SAClG,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,SAAS,KAAK,QAAQ,CAAC,MAAM,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACxD,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,0BAA0B,EAAE,CAAC;IACvG,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export { EkhoAgentClient } from "./client.js";
2
+ export type { FloorResult } from "./client.js";
3
+ export { EkhoAgentAdapter } from "./adapter.js";
4
+ export type { AdapterHooks } from "./adapter.js";
5
+ export type { AgentCredentials, ActionDecision, AttachmentMeta, AttachmentRef, AttachmentUploadInput, InboxMessage, MessageSnapshot, ControlMessage, RosterEntry, InboxResponse, SendMessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { EkhoAgentClient } from "./client.js";
2
+ export { EkhoAgentAdapter } from "./adapter.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,135 @@
1
+ export type AgentCredentials = {
2
+ agentId: string;
3
+ secret: string;
4
+ relayBaseUrl: string;
5
+ heartbeatIntervalSeconds?: number;
6
+ pollIntervalSeconds?: number;
7
+ };
8
+ export type ActionDecision = {
9
+ decision: "allow";
10
+ } | {
11
+ decision: "deny";
12
+ } | {
13
+ decision: "pending_approval";
14
+ approval_id: string;
15
+ };
16
+ export type AttachmentMeta = {
17
+ id: string;
18
+ filename: string;
19
+ mime: string;
20
+ size_bytes: number;
21
+ };
22
+ export type AttachmentRef = AttachmentMeta;
23
+ export type AttachmentUploadInput = {
24
+ filename: string;
25
+ mime: string;
26
+ dataBase64: string;
27
+ };
28
+ /** A quoted snapshot of another message — a reply target or a history entry. */
29
+ export type MessageSnapshot = {
30
+ message_id: string;
31
+ sender_agent_id: string;
32
+ sender_kind: "operator" | "agent";
33
+ sender_label: string;
34
+ text: string;
35
+ created_at: string;
36
+ /** The quoted message's signature, relayed verbatim so the recipient can
37
+ * CHECK it (#20). Presence proves nothing on its own — an agent must verify
38
+ * before treating quoted text as anything more than context. Null/absent on
39
+ * an unsigned message, and absent entirely on relays older than #43. */
40
+ operator_sig?: string | null;
41
+ agent_sig?: string | null;
42
+ key_id?: string | null;
43
+ sig_canonical?: Record<string, unknown> | null;
44
+ /** Bound by v2 envelopes (#9); a verifier needs them to check the binding. */
45
+ message_type?: string;
46
+ priority?: string;
47
+ /** Attachment ids as the signature binds them (body.attachments). */
48
+ attachments?: string[];
49
+ };
50
+ export type InboxMessage = {
51
+ message_id: string;
52
+ conversation_id: string;
53
+ correlation_id: string;
54
+ sender_agent_id: string;
55
+ /** "operator" iff the sender is the verified fleet operator; otherwise "agent". */
56
+ sender_kind?: "operator" | "agent";
57
+ message_type: string;
58
+ priority: string;
59
+ body: Record<string, unknown>;
60
+ /** Resolved attachment metadata (never bytes). Fetch bytes via downloadAttachment. */
61
+ attachments?: AttachmentMeta[];
62
+ metadata: Record<string, unknown>;
63
+ /** Agent ids this message is addressed to (@mentions). Empty = everyone. */
64
+ mentions?: string[];
65
+ /** Quoted snapshot of the message this replies to, or null. Same-conversation only. */
66
+ reply_to?: MessageSnapshot | null;
67
+ created_at: string;
68
+ deadline_at: string;
69
+ };
70
+ export type ControlMessage = {
71
+ control_id: string;
72
+ action: string;
73
+ reason: string;
74
+ };
75
+ export type RosterEntry = {
76
+ agent_id: string;
77
+ display_name: string;
78
+ runtime: string;
79
+ status: string;
80
+ };
81
+ export type InboxResponse = {
82
+ messages: InboxMessage[];
83
+ controls: ControlMessage[];
84
+ /** Whether this agent recognizes the console operator as its verified principal. */
85
+ operator_trusted?: boolean;
86
+ /** Other agents in the same fleet (excludes the operator identity and self). */
87
+ roster?: RosterEntry[];
88
+ /** Operator-controlled bounded agent-to-agent delegation (live; absent on older relays). */
89
+ peer_autoreply?: boolean;
90
+ /** Per-conversation peer-turn budget set by the operator. */
91
+ peer_turn_budget?: number;
92
+ /** Project-mode rooms this agent belongs to: conversation id -> the higher
93
+ * per-room budget that overrides peer_turn_budget there (absent on older relays). */
94
+ conversation_budgets?: Record<string, number>;
95
+ /** Recent thread per room conversation (id -> chronological snapshots); {} for direct. */
96
+ conversation_history?: Record<string, MessageSnapshot[]>;
97
+ /** Rooms (among this batch) the polling agent is a member of, so a reply can be framed as going to the named room. */
98
+ rooms?: Array<{
99
+ id: string;
100
+ name: string;
101
+ }>;
102
+ };
103
+ export type SendMessagePayload = {
104
+ recipient: {
105
+ kind: "agent" | "group" | "broadcast";
106
+ id?: string;
107
+ };
108
+ message_type: "direct" | "broadcast" | "alert" | "handoff" | "claim" | "complete" | "heartbeat" | "control";
109
+ priority?: "low" | "normal" | "high" | "urgent";
110
+ ttl_seconds?: number;
111
+ requires_approval?: boolean;
112
+ body: Record<string, unknown>;
113
+ metadata?: Record<string, unknown>;
114
+ conversation_id: string;
115
+ correlation_id: string;
116
+ };
117
+ export type HeartbeatPayload = {
118
+ status: "healthy" | "degraded" | "busy" | "idle";
119
+ active_conversation_ids?: string[];
120
+ metrics?: Record<string, unknown>;
121
+ };
122
+ export type ProposeActionPayload = {
123
+ conversation_id: string;
124
+ action_type: string;
125
+ summary: string;
126
+ risk_level: "low" | "medium" | "high" | "critical";
127
+ payload: Record<string, unknown>;
128
+ };
129
+ export type ActionResultPayload = {
130
+ approval_id: string;
131
+ result: "executed" | "cancelled" | "failed";
132
+ completed_at: string;
133
+ output?: Record<string, unknown>;
134
+ };
135
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,CA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W,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { EkhoAgentClient } from "./client";
2
- export type { FloorResult } from "./client";
3
- export { EkhoAgentAdapter } from "./adapter";
4
- export type { AdapterHooks } from "./adapter";
5
- export type { AgentCredentials, ActionDecision, AttachmentMeta, AttachmentRef, AttachmentUploadInput, InboxMessage, MessageSnapshot, ControlMessage, RosterEntry, InboxResponse, SendMessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types";
1
+ export { EkhoAgentClient } from "./client.js";
2
+ export type { FloorResult } from "./client.js";
3
+ export { EkhoAgentAdapter } from "./adapter.js";
4
+ export type { AdapterHooks } from "./adapter.js";
5
+ export type { AgentCredentials, ActionDecision, AttachmentMeta, AttachmentRef, AttachmentUploadInput, InboxMessage, MessageSnapshot, ControlMessage, RosterEntry, InboxResponse, SendMessagePayload, HeartbeatPayload, ProposeActionPayload, ActionResultPayload } from "./types.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EkhoAgentAdapter = exports.EkhoAgentClient = void 0;
4
- var client_1 = require("./client");
5
- Object.defineProperty(exports, "EkhoAgentClient", { enumerable: true, get: function () { return client_1.EkhoAgentClient; } });
6
- var adapter_1 = require("./adapter");
7
- Object.defineProperty(exports, "EkhoAgentAdapter", { enumerable: true, get: function () { return adapter_1.EkhoAgentAdapter; } });
4
+ var client_js_1 = require("./client.js");
5
+ Object.defineProperty(exports, "EkhoAgentClient", { enumerable: true, get: function () { return client_js_1.EkhoAgentClient; } });
6
+ var adapter_js_1 = require("./adapter.js");
7
+ Object.defineProperty(exports, "EkhoAgentAdapter", { enumerable: true, get: function () { return adapter_js_1.EkhoAgentAdapter; } });
8
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AAExB,qCAA6C;AAApC,2GAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AAExB,2CAAgD;AAAvC,8GAAA,gBAAgB,OAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@drakon-systems/ekho-sdk",
3
- "version": "0.4.6",
4
- "description": "Agent SDK for Ekho \u2014 the private communication layer for distributed AI agents.",
3
+ "version": "0.4.8",
4
+ "description": "Agent SDK for Ekho — the private communication layer for distributed AI agents.",
5
5
  "license": "MIT",
6
6
  "author": "Drakon Systems <hello@drakonsystems.com> (https://drakonsystems.com)",
7
7
  "repository": {
@@ -21,13 +21,26 @@
21
21
  ],
22
22
  "main": "dist/index.js",
23
23
  "types": "dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "import": {
27
+ "types": "./dist/esm/index.d.ts",
28
+ "default": "./dist/esm/index.js"
29
+ },
30
+ "require": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
24
37
  "files": [
25
38
  "dist",
26
39
  "CHANGELOG.md",
27
40
  "README.md"
28
41
  ],
29
42
  "scripts": {
30
- "build": "tsc",
43
+ "build": "tsc && tsc -p tsconfig.esm.json && node scripts/mark-esm-output.mjs",
31
44
  "typecheck": "tsc --noEmit",
32
45
  "test": "vitest run",
33
46
  "prepublishOnly": "npm run build"