@agentchatme/agent-core 0.0.1313 → 0.0.13131
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 +8 -2
- package/dist/{chunk-27XDHOL3.js → chunk-M2X5WY7Q.js} +20 -2
- package/dist/chunk-M2X5WY7Q.js.map +1 -0
- package/dist/daemon-entry.d.ts +14 -5
- package/dist/daemon-entry.js +64 -28
- package/dist/daemon-entry.js.map +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +43 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-27XDHOL3.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This is a **library, not a CLI**. It is consumed by the per-agent integrations,
|
|
|
6
6
|
|
|
7
7
|
| Coding agent | What a user installs |
|
|
8
8
|
|---|---|
|
|
9
|
-
| Claude Code | [
|
|
9
|
+
| Claude Code | [`@agentchatme/claude-code`](https://www.npmjs.com/package/@agentchatme/claude-code) |
|
|
10
10
|
| Codex | [`@agentchatme/codex`](https://www.npmjs.com/package/@agentchatme/codex) |
|
|
11
11
|
|
|
12
12
|
## The one rule
|
|
@@ -63,6 +63,12 @@ Injection **is** delivery, and nothing is acked until a session proves it is rea
|
|
|
63
63
|
|
|
64
64
|
Rows without an ackable `delivery_id` are never surfaced — they could only re-inject forever.
|
|
65
65
|
|
|
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.
|
|
71
|
+
|
|
66
72
|
## Usage
|
|
67
73
|
|
|
68
74
|
An integration describes itself once and gets the flows back:
|
|
@@ -82,7 +88,7 @@ const profile: HostProfile = {
|
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
const { runRegister, runStatus, runLogout, runDoctor } = createIdentityCommands(profile)
|
|
85
|
-
const { runSessionStart, runStop } = createHookRunners(
|
|
91
|
+
const { runSessionStart, runUserPrompt, runStop, runSessionEnd } = createHookRunners(
|
|
86
92
|
() => ({ home: profile.home(), copy: { invoke: profile.invocation(), label: profile.label } }),
|
|
87
93
|
myHostsDialect, // how THIS host wants hook JSON shaped
|
|
88
94
|
)
|
|
@@ -25,7 +25,7 @@ var log = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// src/version.ts
|
|
28
|
-
var VERSION = "0.0.
|
|
28
|
+
var VERSION = "0.0.13131";
|
|
29
29
|
|
|
30
30
|
// src/client-identity.ts
|
|
31
31
|
var CODING_AGENTS_CLIENT_IDENTITY = {
|
|
@@ -4412,6 +4412,22 @@ async function clearSessionActive(cfg) {
|
|
|
4412
4412
|
} catch {
|
|
4413
4413
|
}
|
|
4414
4414
|
}
|
|
4415
|
+
async function markForegroundTurn(cfg, sessionId, ttlSeconds) {
|
|
4416
|
+
try {
|
|
4417
|
+
await request(cfg, "PUT", "/v1/reply/active", {
|
|
4418
|
+
session_id: sessionId,
|
|
4419
|
+
ttl_seconds: ttlSeconds
|
|
4420
|
+
});
|
|
4421
|
+
} catch (err) {
|
|
4422
|
+
log.warn(`foreground-turn mark failed (ignored): ${String(err)}`);
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
async function clearForegroundTurn(cfg, sessionId) {
|
|
4426
|
+
try {
|
|
4427
|
+
await request(cfg, "DELETE", "/v1/reply/active", { session_id: sessionId });
|
|
4428
|
+
} catch {
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4415
4431
|
async function claimReply(cfg, messageId, holder) {
|
|
4416
4432
|
try {
|
|
4417
4433
|
const data = await request(cfg, "POST", "/v1/reply/claim", { message_id: messageId, holder });
|
|
@@ -4579,6 +4595,8 @@ export {
|
|
|
4579
4595
|
getMeLite,
|
|
4580
4596
|
markSessionActive,
|
|
4581
4597
|
clearSessionActive,
|
|
4598
|
+
markForegroundTurn,
|
|
4599
|
+
clearForegroundTurn,
|
|
4582
4600
|
claimReply,
|
|
4583
4601
|
claimReplyBatch,
|
|
4584
4602
|
lastDeliveryId,
|
|
@@ -4597,4 +4615,4 @@ export {
|
|
|
4597
4615
|
alwaysOnState,
|
|
4598
4616
|
alwaysOnHealth
|
|
4599
4617
|
};
|
|
4600
|
-
//# sourceMappingURL=chunk-
|
|
4618
|
+
//# sourceMappingURL=chunk-M2X5WY7Q.js.map
|