@agentchatme/agent-core 0.0.13131 → 0.0.13131111

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/README.md CHANGED
@@ -55,19 +55,31 @@ The wire protocol is the thing worth sharing: two hand-maintained copies of the
55
55
 
56
56
  ## Ack semantics (the part worth reading twice)
57
57
 
58
- Injection **is** delivery, and nothing is acked until a session proves it is real:
58
+ Host acceptance is not the same as completed delivery, so hook context crosses
59
+ two boundaries:
59
60
 
60
- 1. `sessionStart()` builds the digest and records the ack cursor as *pending*.
61
- 2. `userPrompt()` commits it — a prompt actually running is the proof. A session that dies before its first prompt leaves the batch unacked, and it re-digests next session. **Duplicate beats loss, always.**
62
- 3. `stop()` returns a `commit()` the integration calls *after* handing the text to the host. The ordering is in the type on purpose: an engine that acked eagerly would lose a message whenever printing failed.
61
+ 1. `userPrompt()` claims queued rows at a real prompt boundary and returns a
62
+ `stage()` callback. The integration stages the cursor only after it has
63
+ successfully printed the host's `UserPromptSubmit` envelope.
64
+ 2. The following `stop()` proves that model turn completed and commits the
65
+ staged cursor before looking for newer rows.
66
+ 3. When `stop()` continues the host with mid-turn arrivals, it also returns a
67
+ `stage()` callback. Those rows are committed by the *next* Stop, after that
68
+ continuation completes.
69
+
70
+ A host crash before the completed-turn boundary, or a failed ACK, leaves the
71
+ rows unacknowledged for replay. **Duplicate beats loss, always.**
63
72
 
64
73
  Rows without an ackable `delivery_id` are never surfaced — they could only re-inject forever.
65
74
 
66
- Foreground/daemon ownership is atomic at the server. `userPrompt()` leases one
67
- concrete host session before a model turn; `stop()` renews it for a continuation
68
- or clears it when the session becomes idle; `sessionEnd()` clears only that
69
- session. The daemon's claim operation prunes expired leases and claims the
70
- message in one Redis script, so the old check-then-wait race no longer exists.
75
+ Foreground/daemon ownership is atomic while the coordination store is
76
+ available. `userPrompt()` leases one concrete host session before a model turn;
77
+ `stop()` renews it for a continuation or clears it when the session becomes
78
+ idle; `sessionEnd()` clears only that session. The daemon's claim operation
79
+ prunes expired leases and claims the message in one Redis script, so the old
80
+ check-then-wait race no longer exists. Coordination deliberately fails open
81
+ during a Redis/API outage: delivery continues, but two owners can then produce
82
+ duplicate replies. That is at-least-once behavior, not an exactly-once claim.
71
83
 
72
84
  ## Usage
73
85
 
@@ -111,8 +123,9 @@ bounded runtime turn, focused on its newest message. A later arrival cannot join
111
123
  a batch once its turn has started. Turns remain ordered within a conversation
112
124
  and may run concurrently across different conversations. Every delivery in the
113
125
  batch is acknowledged only after the shared turn succeeds; a failure retries
114
- the same frozen batch with capped exponential backoff instead of dropping or
115
- partially acknowledging it.
126
+ the same frozen batch with capped exponential backoff. The daemon renews its
127
+ reply claim before every attempt, and its MCP send uses a stable idempotency key
128
+ so a crash after the API accepted a reply cannot create a second copy on retry.
116
129
 
117
130
  ## Development
118
131
 
@@ -25,7 +25,7 @@ var log = {
25
25
  };
26
26
 
27
27
  // src/version.ts
28
- var VERSION = "0.0.13131";
28
+ var VERSION = "0.0.13131111";
29
29
 
30
30
  // src/client-identity.ts
31
31
  var CODING_AGENTS_CLIENT_IDENTITY = {
@@ -4615,4 +4615,4 @@ export {
4615
4615
  alwaysOnState,
4616
4616
  alwaysOnHealth
4617
4617
  };
4618
- //# sourceMappingURL=chunk-M2X5WY7Q.js.map
4618
+ //# sourceMappingURL=chunk-Y4REWBSV.js.map