agentfootprint 7.18.0 → 7.19.1

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 (137) hide show
  1. package/AGENTS.md +7 -5
  2. package/README.md +3 -3
  3. package/ai-instructions/claude-code/SKILL.md +7 -5
  4. package/dist/adapters/hosting/agentcore.js +23 -9
  5. package/dist/adapters/hosting/agentcore.js.map +1 -1
  6. package/dist/core/Agent.js +6 -0
  7. package/dist/core/Agent.js.map +1 -1
  8. package/dist/core/agent/AgentBuilder.js +9 -0
  9. package/dist/core/agent/AgentBuilder.js.map +1 -1
  10. package/dist/core/agent/memoryRecallInjections.js +8 -0
  11. package/dist/core/agent/memoryRecallInjections.js.map +1 -1
  12. package/dist/core/agent/stages/toolCalls.js +13 -0
  13. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  14. package/dist/core/durabilityBarrier.js +68 -0
  15. package/dist/core/durabilityBarrier.js.map +1 -0
  16. package/dist/core/slots/buildMessagesSlot.js +23 -4
  17. package/dist/core/slots/buildMessagesSlot.js.map +1 -1
  18. package/dist/esm/adapters/hosting/agentcore.d.ts +4 -4
  19. package/dist/esm/adapters/hosting/agentcore.js +24 -10
  20. package/dist/esm/adapters/hosting/agentcore.js.map +1 -1
  21. package/dist/esm/core/Agent.js +6 -0
  22. package/dist/esm/core/Agent.js.map +1 -1
  23. package/dist/esm/core/agent/AgentBuilder.d.ts +5 -0
  24. package/dist/esm/core/agent/AgentBuilder.js +9 -0
  25. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  26. package/dist/esm/core/agent/memoryRecallInjections.js +8 -0
  27. package/dist/esm/core/agent/memoryRecallInjections.js.map +1 -1
  28. package/dist/esm/core/agent/stages/toolCalls.d.ts +21 -0
  29. package/dist/esm/core/agent/stages/toolCalls.js +13 -0
  30. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  31. package/dist/esm/core/durabilityBarrier.d.ts +61 -0
  32. package/dist/esm/core/durabilityBarrier.js +63 -0
  33. package/dist/esm/core/durabilityBarrier.js.map +1 -0
  34. package/dist/esm/core/slots/buildMessagesSlot.d.ts +16 -2
  35. package/dist/esm/core/slots/buildMessagesSlot.js +23 -4
  36. package/dist/esm/core/slots/buildMessagesSlot.js.map +1 -1
  37. package/dist/esm/hosting/durability.d.ts +92 -0
  38. package/dist/esm/hosting/durability.js +174 -0
  39. package/dist/esm/hosting/durability.js.map +1 -0
  40. package/dist/esm/hosting/envelope.d.ts +75 -14
  41. package/dist/esm/hosting/envelope.js +141 -16
  42. package/dist/esm/hosting/envelope.js.map +1 -1
  43. package/dist/esm/hosting/errors.d.ts +60 -11
  44. package/dist/esm/hosting/errors.js +92 -18
  45. package/dist/esm/hosting/errors.js.map +1 -1
  46. package/dist/esm/hosting/httpHost.d.ts +17 -1
  47. package/dist/esm/hosting/httpHost.js +42 -6
  48. package/dist/esm/hosting/httpHost.js.map +1 -1
  49. package/dist/esm/hosting/index.d.ts +7 -4
  50. package/dist/esm/hosting/index.js +6 -3
  51. package/dist/esm/hosting/index.js.map +1 -1
  52. package/dist/esm/hosting/nodeHost.d.ts +4 -2
  53. package/dist/esm/hosting/nodeHost.js +14 -3
  54. package/dist/esm/hosting/nodeHost.js.map +1 -1
  55. package/dist/esm/hosting/standingAgent.d.ts +22 -7
  56. package/dist/esm/hosting/standingAgent.js +144 -32
  57. package/dist/esm/hosting/standingAgent.js.map +1 -1
  58. package/dist/esm/hosting/types.d.ts +193 -19
  59. package/dist/esm/lib/injection-engine/factories/defineFact.d.ts +7 -11
  60. package/dist/esm/lib/injection-engine/factories/defineFact.js +9 -7
  61. package/dist/esm/lib/injection-engine/factories/defineFact.js.map +1 -1
  62. package/dist/esm/lib/injection-engine/factories/defineInstruction.d.ts +10 -19
  63. package/dist/esm/lib/injection-engine/factories/defineInstruction.js +6 -4
  64. package/dist/esm/lib/injection-engine/factories/defineInstruction.js.map +1 -1
  65. package/dist/esm/lib/injection-engine/messagesSlotRefusal.d.ts +31 -0
  66. package/dist/esm/lib/injection-engine/messagesSlotRefusal.js +40 -0
  67. package/dist/esm/lib/injection-engine/messagesSlotRefusal.js.map +1 -0
  68. package/dist/esm/lib/injection-engine/types.d.ts +12 -1
  69. package/dist/esm/lib/injection-engine/types.js.map +1 -1
  70. package/dist/esm/lib/mcp/mcpServe.d.ts +8 -0
  71. package/dist/esm/lib/mcp/mcpServe.js +25 -0
  72. package/dist/esm/lib/mcp/mcpServe.js.map +1 -1
  73. package/dist/esm/lib/mcp/types.d.ts +26 -0
  74. package/dist/hosting/durability.js +178 -0
  75. package/dist/hosting/durability.js.map +1 -0
  76. package/dist/hosting/envelope.js +146 -18
  77. package/dist/hosting/envelope.js.map +1 -1
  78. package/dist/hosting/errors.js +95 -19
  79. package/dist/hosting/errors.js.map +1 -1
  80. package/dist/hosting/httpHost.js +42 -6
  81. package/dist/hosting/httpHost.js.map +1 -1
  82. package/dist/hosting/index.js +10 -2
  83. package/dist/hosting/index.js.map +1 -1
  84. package/dist/hosting/nodeHost.js +14 -3
  85. package/dist/hosting/nodeHost.js.map +1 -1
  86. package/dist/hosting/standingAgent.js +142 -30
  87. package/dist/hosting/standingAgent.js.map +1 -1
  88. package/dist/lib/injection-engine/factories/defineFact.js +9 -7
  89. package/dist/lib/injection-engine/factories/defineFact.js.map +1 -1
  90. package/dist/lib/injection-engine/factories/defineInstruction.js +6 -4
  91. package/dist/lib/injection-engine/factories/defineInstruction.js.map +1 -1
  92. package/dist/lib/injection-engine/messagesSlotRefusal.js +44 -0
  93. package/dist/lib/injection-engine/messagesSlotRefusal.js.map +1 -0
  94. package/dist/lib/injection-engine/types.js.map +1 -1
  95. package/dist/lib/mcp/mcpServe.js +25 -0
  96. package/dist/lib/mcp/mcpServe.js.map +1 -1
  97. package/dist/types/adapters/hosting/agentcore.d.ts +4 -4
  98. package/dist/types/adapters/hosting/agentcore.d.ts.map +1 -1
  99. package/dist/types/core/Agent.d.ts.map +1 -1
  100. package/dist/types/core/agent/AgentBuilder.d.ts +5 -0
  101. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
  102. package/dist/types/core/agent/memoryRecallInjections.d.ts.map +1 -1
  103. package/dist/types/core/agent/stages/toolCalls.d.ts +21 -0
  104. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  105. package/dist/types/core/durabilityBarrier.d.ts +62 -0
  106. package/dist/types/core/durabilityBarrier.d.ts.map +1 -0
  107. package/dist/types/core/slots/buildMessagesSlot.d.ts +16 -2
  108. package/dist/types/core/slots/buildMessagesSlot.d.ts.map +1 -1
  109. package/dist/types/hosting/durability.d.ts +93 -0
  110. package/dist/types/hosting/durability.d.ts.map +1 -0
  111. package/dist/types/hosting/envelope.d.ts +75 -14
  112. package/dist/types/hosting/envelope.d.ts.map +1 -1
  113. package/dist/types/hosting/errors.d.ts +60 -11
  114. package/dist/types/hosting/errors.d.ts.map +1 -1
  115. package/dist/types/hosting/httpHost.d.ts +17 -1
  116. package/dist/types/hosting/httpHost.d.ts.map +1 -1
  117. package/dist/types/hosting/index.d.ts +7 -4
  118. package/dist/types/hosting/index.d.ts.map +1 -1
  119. package/dist/types/hosting/nodeHost.d.ts +4 -2
  120. package/dist/types/hosting/nodeHost.d.ts.map +1 -1
  121. package/dist/types/hosting/standingAgent.d.ts +22 -7
  122. package/dist/types/hosting/standingAgent.d.ts.map +1 -1
  123. package/dist/types/hosting/types.d.ts +193 -19
  124. package/dist/types/hosting/types.d.ts.map +1 -1
  125. package/dist/types/lib/injection-engine/factories/defineFact.d.ts +7 -11
  126. package/dist/types/lib/injection-engine/factories/defineFact.d.ts.map +1 -1
  127. package/dist/types/lib/injection-engine/factories/defineInstruction.d.ts +10 -19
  128. package/dist/types/lib/injection-engine/factories/defineInstruction.d.ts.map +1 -1
  129. package/dist/types/lib/injection-engine/messagesSlotRefusal.d.ts +32 -0
  130. package/dist/types/lib/injection-engine/messagesSlotRefusal.d.ts.map +1 -0
  131. package/dist/types/lib/injection-engine/types.d.ts +12 -1
  132. package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
  133. package/dist/types/lib/mcp/mcpServe.d.ts +8 -0
  134. package/dist/types/lib/mcp/mcpServe.d.ts.map +1 -1
  135. package/dist/types/lib/mcp/types.d.ts +26 -0
  136. package/dist/types/lib/mcp/types.d.ts.map +1 -1
  137. package/package.json +1 -1
@@ -1,21 +1,31 @@
1
1
  "use strict";
2
2
  /**
3
- * hosting/envelope — pack a conversation for storage, and refuse to unpack one
4
- * you cannot read.
3
+ * hosting/envelope — pack a session for storage, and refuse to unpack one you
4
+ * cannot read.
5
5
  *
6
- * Two functions and one rule: **an unknown format is refused by name, never
7
- * guessed at.** A store outlives the code that wrote to it. Somebody will
8
- * deploy a newer runtime, it will write a newer format, and an older instance
9
- * still running will read it. The only honest thing that older instance can do
10
- * is say which format it found, which ones it knows, and stop — because
11
- * "restore what I can and hope" means an agent answering from a conversation
12
- * that is missing whatever the older reader did not understand.
6
+ * One rule, and everything here is a consequence of it: **an envelope this
7
+ * runtime cannot read is refused BY NAME, never guessed at.** A store outlives
8
+ * the code that wrote to it. Somebody will deploy a newer runtime, it will write
9
+ * a newer format, and an older instance still running will read it. The only
10
+ * honest thing that older instance can do is say which format it found, which
11
+ * ones it knows, and stop — because "restore what I can and hope" means an agent
12
+ * answering from a session that is missing whatever the older reader did not
13
+ * understand.
14
+ *
15
+ * ── Two formats, two readers, and why they refuse each other ─────────────────
16
+ * `readEnvelope` unpacks a CONVERSATION; `readPausedRun` unpacks a PAUSED RUN.
17
+ * Each refuses the other's format by name and points at its sibling. That looks
18
+ * fussy until you notice the alternative: one reader that quietly returned the
19
+ * conversation inside a paused run would hand back a session that LOOKS finished
20
+ * while a person is still waiting on a question nobody mentioned. That is a
21
+ * half-restore wearing a happy path, which is the exact failure the format field
22
+ * exists to prevent.
13
23
  */
14
24
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readEnvelope = exports.toEnvelope = void 0;
25
+ exports.checkEnvelope = exports.readPausedRun = exports.readEnvelope = exports.toPausedEnvelope = exports.toEnvelope = void 0;
16
26
  const runCheckpoint_js_1 = require("../core/runCheckpoint.js");
17
27
  /** Every format this runtime can read. Add, never redefine. */
18
- const KNOWN_FORMATS = ['conversation-v1'];
28
+ const KNOWN_FORMATS = ['conversation-v1', 'flowchart-v1'];
19
29
  /**
20
30
  * Pack a conversation checkpoint for storage.
21
31
  *
@@ -27,6 +37,30 @@ function toEnvelope(checkpoint) {
27
37
  return { format: 'conversation-v1', data: checkpoint, savedAt: Date.now() };
28
38
  }
29
39
  exports.toEnvelope = toEnvelope;
40
+ /**
41
+ * Pack a paused run for storage — the engine checkpoint, the conversation as of
42
+ * the pause, and the question it is waiting on.
43
+ *
44
+ * Store it anywhere that speaks JSON. Note what JSON does and does not preserve
45
+ * here: `agent.resume()` reads `checkpoint.sharedState`, which round-trips
46
+ * unchanged; the engine's diagnostic halves lose their explicitly-`undefined`
47
+ * properties, because that is what `JSON.stringify` does to them. See
48
+ * {@link PausedRun}.
49
+ *
50
+ * @example
51
+ * const outcome = await agent.run({ message });
52
+ * if (isPaused(outcome)) {
53
+ * await sessions.persist(sessionId, toPausedEnvelope({
54
+ * checkpoint: outcome.checkpoint,
55
+ * conversation: agent.checkpoint()!,
56
+ * pending: { pauseData: outcome.pauseData },
57
+ * }));
58
+ * }
59
+ */
60
+ function toPausedEnvelope(paused) {
61
+ return { format: 'flowchart-v1', data: paused, savedAt: Date.now() };
62
+ }
63
+ exports.toPausedEnvelope = toPausedEnvelope;
30
64
  /**
31
65
  * Unpack a stored envelope back into a conversation checkpoint.
32
66
  *
@@ -34,21 +68,115 @@ exports.toEnvelope = toEnvelope;
34
68
  * else wrote, in a format this runtime may not know, and typing the parameter
35
69
  * as the happy shape would be assuming the very thing that needs checking.
36
70
  *
37
- * @throws TypeError naming the format when it is one this runtime cannot read,
38
- * and naming the missing field when the conversation inside is malformed.
71
+ * @throws TypeError naming the format when it is one this runtime cannot read;
72
+ * naming the missing field when the conversation inside is malformed; and
73
+ * pointing at {@link readPausedRun} when the envelope holds a paused run,
74
+ * which is a session with a question outstanding rather than a conversation.
39
75
  */
40
76
  function readEnvelope(envelope) {
41
- if (!envelope || typeof envelope !== 'object') {
42
- throw new TypeError(`[hosting] stored session is not an envelope (got ${envelope === null ? 'null' : typeof envelope}). ` + `Expected { format, data, savedAt } as written by toEnvelope().`);
77
+ if (readFormat(envelope) === 'flowchart-v1') {
78
+ throw new TypeError(`[hosting] this envelope holds a PAUSED RUN ('flowchart-v1'), not a conversation. ` +
79
+ `Read it with readPausedRun(envelope) — it is waiting on a person's decision, and ` +
80
+ `handing back only the conversation inside it would restore a session that looks ` +
81
+ `finished while somebody is still waiting to be asked.`);
82
+ }
83
+ return (0, runCheckpoint_js_1.validateCheckpoint)(envelope.data);
84
+ }
85
+ exports.readEnvelope = readEnvelope;
86
+ /**
87
+ * Unpack a stored envelope back into a paused run.
88
+ *
89
+ * @throws TypeError naming the format when it is one this runtime cannot read;
90
+ * pointing at {@link readEnvelope} when the envelope holds a plain
91
+ * conversation; and naming the missing field when the paused run inside is
92
+ * malformed.
93
+ */
94
+ function readPausedRun(envelope) {
95
+ if (readFormat(envelope) === 'conversation-v1') {
96
+ throw new TypeError(`[hosting] this envelope holds a conversation ('conversation-v1'), not a paused run. ` +
97
+ `Read it with readEnvelope(envelope). Nothing is waiting on a decision here.`);
98
+ }
99
+ return validatePausedRun(envelope.data);
100
+ }
101
+ exports.readPausedRun = readPausedRun;
102
+ /**
103
+ * Check that an envelope is one this runtime can read, and hand it back
104
+ * unchanged — without committing to which half you wanted.
105
+ *
106
+ * This is what a STORE wants. A store's job is to notice that the bytes it is
107
+ * about to hand over are unreadable, so the refusal names the store that
108
+ * produced them rather than whoever read them next; it has no business caring
109
+ * whether the session inside is mid-conversation or mid-question.
110
+ *
111
+ * @throws TypeError naming the format when this runtime cannot read it, or the
112
+ * missing field when the payload is malformed.
113
+ *
114
+ * @example
115
+ * async hydrate(sessionId) {
116
+ * const stored = await myStore.get(sessionId);
117
+ * return stored === undefined ? undefined : checkEnvelope(stored);
118
+ * }
119
+ */
120
+ function checkEnvelope(envelope) {
121
+ if (readFormat(envelope) === 'flowchart-v1') {
122
+ validatePausedRun(envelope.data);
123
+ }
124
+ else {
125
+ (0, runCheckpoint_js_1.validateCheckpoint)(envelope.data);
126
+ }
127
+ return envelope;
128
+ }
129
+ exports.checkEnvelope = checkEnvelope;
130
+ /**
131
+ * The one place a `format` is checked, so every refusal in this file says the
132
+ * same thing in the same words.
133
+ */
134
+ function readFormat(envelope) {
135
+ if (!envelope || typeof envelope !== 'object' || Array.isArray(envelope)) {
136
+ throw new TypeError(`[hosting] stored session is not an envelope (got ${envelope === null ? 'null' : Array.isArray(envelope) ? 'an array' : typeof envelope}). Expected { format, data, savedAt } as written by toEnvelope() / toPausedEnvelope().`);
43
137
  }
44
138
  const found = envelope.format;
45
139
  if (typeof found !== 'string' || !KNOWN_FORMATS.includes(found)) {
46
140
  throw new TypeError(`[hosting] unknown checkpoint format '${String(found)}'. ` +
47
141
  `This runtime reads: ${KNOWN_FORMATS.join(', ')}. ` +
48
- `Refusing rather than restoring a conversation it cannot read — a newer envelope ` +
142
+ `Refusing rather than restoring a session it cannot read — a newer envelope ` +
49
143
  `needs a runtime that knows the format that wrote it.`);
50
144
  }
51
- return (0, runCheckpoint_js_1.validateCheckpoint)(envelope.data);
145
+ return found;
146
+ }
147
+ /**
148
+ * Validate a paused run at deserialization time, naming the missing piece.
149
+ *
150
+ * Only the fields resume actually consumes are required. `executionTree` and
151
+ * `subflowResults` are the engine's diagnostic halves — a checkpoint that lost
152
+ * them in transit still resumes, so demanding them would refuse a session that
153
+ * would have worked.
154
+ */
155
+ function validatePausedRun(value) {
156
+ if (!value || typeof value !== 'object') {
157
+ throw new TypeError('[hosting] paused run is not an object.');
158
+ }
159
+ const run = value;
160
+ const cp = run.checkpoint;
161
+ if (!cp || typeof cp !== 'object') {
162
+ throw new TypeError(`[hosting] paused run is missing required field: checkpoint. ` +
163
+ `It is the engine checkpoint agent.resume() continues from; without it the run ` +
164
+ `cannot be continued at all.`);
165
+ }
166
+ if (typeof cp.pausedStageId !== 'string' ||
167
+ !cp.sharedState ||
168
+ typeof cp.sharedState !== 'object') {
169
+ throw new TypeError(`[hosting] paused run's checkpoint is missing required fields (pausedStageId, ` +
170
+ `sharedState) — the two agent.resume() rebuilds the cursor and the run's state from.`);
171
+ }
172
+ if (!Array.isArray(cp.subflowPath)) {
173
+ throw new TypeError(`[hosting] paused run's checkpoint is missing required field: subflowPath.`);
174
+ }
175
+ if (!run.pending || typeof run.pending !== 'object') {
176
+ throw new TypeError(`[hosting] paused run is missing required field: pending — the question it is ` +
177
+ `waiting on. A stored pause nobody can describe is a session that hangs.`);
178
+ }
179
+ (0, runCheckpoint_js_1.validateCheckpoint)(run.conversation);
180
+ return run;
52
181
  }
53
- exports.readEnvelope = readEnvelope;
54
182
  //# sourceMappingURL=envelope.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../src/hosting/envelope.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,+DAAuF;AAGvF,+DAA+D;AAC/D,MAAM,aAAa,GAAsB,CAAC,iBAAiB,CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,UAA8B;IACvD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AAC9E,CAAC;AAFD,gCAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAAC,QAAiB;IAC5C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CACjB,oDACE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,QACtC,KAAK,GAAG,gEAAgE,CACzE,CAAC;IACJ,CAAC;IACD,MA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C1B,CAAC"}
@@ -4,18 +4,22 @@
4
4
  * same words.
5
5
  *
6
6
  * A refusal that varies by adapter is a refusal nobody can write a test or a
7
- * runbook against. These three carry a stable `code`, name WHO refused, and say
7
+ * runbook against. These five carry a stable `code`, name WHO refused, and say
8
8
  * what the caller should do instead. Adapters map the codes onto whatever their
9
9
  * transport uses to say "no" — that mapping is the adapter's business and lives
10
10
  * in the adapter, never here.
11
11
  *
12
- * `requireCapability` is the fourth refusal and the only one that is a
12
+ * Note what is NOT here: a run that paused. That is unfinished work rather than
13
+ * a refusal, and it leaves through `reply.awaiting(...)` — its own terminal —
14
+ * not through an error dressed up as one.
15
+ *
16
+ * `requireCapability` is the last refusal and the only one that is a
13
17
  * programming mistake rather than a runtime condition, so it throws a plain
14
18
  * `Error`: nothing branches on "I forgot to feature-detect", it just needs to
15
19
  * say so loudly and name the adapter it is talking about.
16
20
  */
17
21
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.requireCapability = exports.PauseNotCarriedError = exports.ConcurrentRunError = exports.HostClosedError = void 0;
22
+ exports.requireCapability = exports.NoPendingAskError = exports.AwaitingDecisionError = exports.PauseNotCarriedError = exports.ConcurrentRunError = exports.HostClosedError = void 0;
19
23
  /**
20
24
  * Thrown when a request arrives at a host that is shutting down or shut down.
21
25
  *
@@ -65,40 +69,112 @@ class ConcurrentRunError extends Error {
65
69
  }
66
70
  exports.ConcurrentRunError = ConcurrentRunError;
67
71
  /**
68
- * Raised when a run paused to ask a person something and the reply cannot carry
69
- * a pause.
72
+ * Raised when a run paused to ask a person something and there is **nowhere to
73
+ * keep it**.
70
74
  *
71
75
  * **The run did not fail.** A pause is unfinished work: the agent stopped to ask
72
- * and is waiting for an answer. What cannot happen here is storing it — the
73
- * `'conversation-v1'` envelope holds a conversation, and a paused run is a
74
- * conversation plus an engine checkpoint. So nothing is written, and the
75
- * session keeps exactly the conversation it had before this request.
76
+ * and is waiting for an answer. Since 7.19 a paused run is stored as
77
+ * `'flowchart-v1'` and continued by a later request carrying a decision — so the
78
+ * one case left where a pause genuinely cannot be carried is a request with no
79
+ * session id. There is no session to store it under, and therefore no later
80
+ * request that could ever answer it.
81
+ *
82
+ * The other half of the old meaning — "the reply cannot carry a pause" — is
83
+ * gone: {@link HostReply.awaiting} carries it now. An adapter that has not
84
+ * implemented that terminal still gets its pause STORED (the store is not the
85
+ * transport's business) and this refusal on the wire, naming the session it can
86
+ * be answered on.
76
87
  */
77
88
  class PauseNotCarriedError extends Error {
78
89
  code = 'ERR_PAUSE_NOT_CARRIED';
79
90
  /** The tool that asked, when the run recorded which one it was. */
80
91
  toolName;
81
- /** The session whose stored conversation was left untouched. */
92
+ /** The session the paused run was stored under, when there was one. */
82
93
  sessionId;
83
- constructor(toolName, sessionId) {
94
+ /** Whether the paused run was stored. `false` means it is gone. */
95
+ stored;
96
+ constructor(toolName, sessionId, stored = false) {
84
97
  super(`[hosting] the run paused to ask a person about ` +
85
98
  (toolName ? `'${toolName}'` : 'a tool') +
86
- ` and this reply cannot carry a pause. ` +
87
- `The run did not fail — it is unfinished, waiting on an answer. ` +
88
- `Nothing was written: ` +
89
- (sessionId ? `session '${sessionId}'` : 'the session') +
90
- ` still holds the conversation it held before this request. ` +
91
- `The 'conversation-v1' envelope stores a conversation; a paused run is a ` +
92
- `conversation plus an engine checkpoint, and storing half of it would be worse ` +
93
- `than storing none. Carry the pause yourself with agent.run() / agent.resume().`);
99
+ `. The run did not fail — it is unfinished, waiting on an answer. ` +
100
+ (stored
101
+ ? `It IS stored: send another request for session '${String(sessionId)}' carrying ` +
102
+ `a 'decision' to continue it. This reply could not describe the question ` +
103
+ `because the host it arrived on does not implement reply.awaiting(); read the ` +
104
+ `pending ask from the session store, or serve on a host that has it.`
105
+ : `Nothing was written: ` +
106
+ (sessionId === undefined
107
+ ? `this request carried no session id, so there is nowhere to store a paused ` +
108
+ `run and no later request that could ever answer it. Send a sessionId, or `
109
+ : `session '${sessionId}' still holds what it held before this request. `) +
110
+ `carry the pause yourself with agent.run() / agent.resume().`));
94
111
  this.name = 'PauseNotCarriedError';
95
112
  if (toolName !== undefined)
96
113
  this.toolName = toolName;
97
114
  if (sessionId !== undefined)
98
115
  this.sessionId = sessionId;
116
+ this.stored = stored;
99
117
  }
100
118
  }
101
119
  exports.PauseNotCarriedError = PauseNotCarriedError;
120
+ /**
121
+ * Thrown when a new message arrives for a session whose run is waiting on a
122
+ * person's decision.
123
+ *
124
+ * The message is NOT run and the pause is NOT discarded — those are the two ways
125
+ * this could have gone wrong. Answering the message would step over an
126
+ * outstanding consent gate; dropping the paused run to make room for the message
127
+ * would throw away work a person was asked about. So the request is refused, the
128
+ * pending question is named, and the session sits exactly where it was.
129
+ *
130
+ * Answer it by sending the same session a request carrying
131
+ * {@link HostRequest.decision}.
132
+ */
133
+ class AwaitingDecisionError extends Error {
134
+ code = 'ERR_AWAITING_DECISION';
135
+ /** The session that is waiting. */
136
+ sessionId;
137
+ /** What it is waiting on — the same payload `reply.awaiting()` delivered. */
138
+ pending;
139
+ constructor(sessionId, pending) {
140
+ const asked = pending.question ?? pending.ask?.question ?? pending.checkIn?.evidence.willDo ?? 'a decision';
141
+ super(`[hosting] session '${sessionId}' is waiting on a person: ` +
142
+ (pending.tool ? `'${pending.tool}' asked "${asked}"` : `"${asked}"`) +
143
+ `. This message was NOT run and the paused run was NOT discarded — answering a ` +
144
+ `new message would step over the question, and dropping the question to answer ` +
145
+ `the message would throw away work somebody was asked to approve. ` +
146
+ `Send this session a request carrying 'decision' (checkInApproved(...) / ` +
147
+ `checkInDeclined(...) for a check-in or a middleware ask) to continue the run.`);
148
+ this.name = 'AwaitingDecisionError';
149
+ this.sessionId = sessionId;
150
+ this.pending = pending;
151
+ }
152
+ }
153
+ exports.AwaitingDecisionError = AwaitingDecisionError;
154
+ /**
155
+ * Thrown when a request carries a decision for a session that is not waiting on
156
+ * one.
157
+ *
158
+ * Usually a duplicate delivery: the run was already continued, or already
159
+ * answered, and the same decision arrived twice. Running it as an ordinary
160
+ * message would put a raw approval into the conversation as if the user had
161
+ * typed it, so it is refused by name instead.
162
+ */
163
+ class NoPendingAskError extends Error {
164
+ code = 'ERR_NO_PENDING_ASK';
165
+ /** The session the decision was addressed to. */
166
+ sessionId;
167
+ constructor(sessionId) {
168
+ super(`[hosting] this request carries a 'decision' but session '${sessionId}' is not ` +
169
+ `waiting on one — nothing is paused. The run it answered has most likely already ` +
170
+ `been continued (a duplicate delivery). Refusing rather than treating an approval ` +
171
+ `as if a person had typed it into the conversation. Send it as 'input' if that is ` +
172
+ `genuinely what you meant.`);
173
+ this.name = 'NoPendingAskError';
174
+ this.sessionId = sessionId;
175
+ }
176
+ }
177
+ exports.NoPendingAskError = NoPendingAskError;
102
178
  /**
103
179
  * Assert that a host can do something, and throw a corrective error naming the
104
180
  * adapter when it cannot.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/hosting/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH;;;;;GAKG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAC/B,IAAI,GAAG,iBAA0B,CAAC;IAC3C,6BAA6B;IACpB,QAAQ,CAAS;IAE1B,YAAY,QAAgB;QAC1B,KAAK,CACH,kBAAkB,QAAQ,sDAAsD;YAC9E,wFAAwF;YACxF,iDAAiD,CACpD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAdD,0CAcC;AAED;;;;;;;;GAQG;AACH,MAAa,kBAAmB,SAAQ,KAAK;IAClC,IAAI,GAAG,oBAA6B,CAAC;IAC9C,gDAAgD;IACvC,SAAS,CAAS;IAC3B,mEAAmE;IAC1D,WAAW,CAAU;IAE9B,YAAY,SAAiB,EAAE,WAAoB;QACjD,KAAK,CACH,sBAAsB,SAAS,+BAA+B;YAC5D,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,WAAW,IAAI,CAA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,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,CAAC,IAAI,4BAA4B,UAAU,KAAK;QACpE,eAAe,GAAG,wBAAwB;QAC1C,+BAA+B,UAAU,uCAAuC;QAChF,oFAAoF,CACvF,CAAC;AACJ,CAAC;AATD,8CASC"}
@@ -59,17 +59,27 @@ const errors_js_1 = require("./errors.js");
59
59
  /**
60
60
  * Status codes mapped by refusal code. Anything else is a 500.
61
61
  *
62
- * None of the three is a 5xx: none of them is the agent breaking. A closed host
63
- * is shutting down (503), a concurrent turn conflicts with the run already
64
- * going (409), and a paused run conflicts with the state this reply can carry
65
- * (409) — the run is unfinished, not failed, and a 500 would say otherwise to
66
- * every dashboard that ever sees it.
62
+ * Not one of them is a 5xx: none of them is the agent breaking. A closed host is
63
+ * shutting down (503); the other four are conflicts with the state the session
64
+ * is already in (409) — a run already going, a question already outstanding, a
65
+ * decision with nothing to decide, a pause this reply cannot describe. A 500
66
+ * would tell every dashboard that ever sees it something untrue.
67
67
  */
68
68
  const STATUS_BY_CODE = {
69
69
  ERR_HOST_CLOSED: 503,
70
70
  ERR_CONCURRENT_RUN: 409,
71
71
  ERR_PAUSE_NOT_CARRIED: 409,
72
+ ERR_AWAITING_DECISION: 409,
73
+ ERR_NO_PENDING_ASK: 409,
72
74
  };
75
+ /**
76
+ * What a run that stopped to ask a person answers with: **202 Accepted.**
77
+ *
78
+ * The request was understood and acted on, and the work is not finished — which
79
+ * is what 202 means and what nothing else in the 2xx range means. Not 200: there
80
+ * is no answer. Not 4xx or 5xx: nothing was refused and nothing broke.
81
+ */
82
+ const AWAITING_STATUS = 202;
73
83
  const DEFAULT_CAPABILITIES = ['streaming'];
74
84
  /**
75
85
  * An HTTP host for one handler, speaking the dialect you hand it.
@@ -153,7 +163,7 @@ async function serveOne(req, res, handler, wire) {
153
163
  }
154
164
  const headers = lowerCased(req.headers);
155
165
  const query = new URLSearchParams((req.url ?? '').split('?')[1] ?? '');
156
- const { input, sessionId } = wire.readRequest({ body, headers, query });
166
+ const { input, sessionId, decision } = wire.readRequest({ body, headers, query });
157
167
  if (wantsStream) {
158
168
  res.writeHead(200, {
159
169
  'content-type': 'text/event-stream',
@@ -188,6 +198,31 @@ async function serveOne(req, res, handler, wire) {
188
198
  sendJson(res, 200, wire.output(output));
189
199
  }
190
200
  },
201
+ awaiting(pending) {
202
+ if (settled)
203
+ return;
204
+ // A wire that cannot describe a question must not answer 202 with an
205
+ // empty body — that would look like a completed request. Fall through to
206
+ // the named refusal, which at least says what happened and where the
207
+ // paused run is.
208
+ if (!wire.awaiting) {
209
+ const refusal = new Error(`[hosting] the run is waiting on a person and this host's wire has no ` +
210
+ `awaiting() body shape, so the question cannot be described on the wire. ` +
211
+ `The paused run is stored; read the pending ask from the session store.`);
212
+ refusal.code = 'ERR_PAUSE_NOT_CARRIED';
213
+ reply.fail(refusal);
214
+ return;
215
+ }
216
+ settled = true;
217
+ const payload = wire.awaiting(pending);
218
+ if (wantsStream) {
219
+ res.write((0, stream_js_1.encodeSSE)('awaiting', payload));
220
+ res.end();
221
+ }
222
+ else {
223
+ sendJson(res, AWAITING_STATUS, payload);
224
+ }
225
+ },
191
226
  fail(error) {
192
227
  if (settled)
193
228
  return;
@@ -207,6 +242,7 @@ async function serveOne(req, res, handler, wire) {
207
242
  await handler({
208
243
  input,
209
244
  ...(sessionId !== undefined && { sessionId }),
245
+ ...(decision !== undefined && { decision }),
210
246
  headers,
211
247
  signal: controller.signal,
212
248
  }, reply);
@@ -1 +1 @@
1
- {"version":3,"file":"httpHost.js","sourceRoot":"","sources":["../../src/hosting/httpHost.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,4CAAyC;AACzC,2CAA8C;AA+E9C;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAqC;IACvD,eAAe,EAAE,GAAG;IACpB,kBAAkB,EAAE,GAAG;IACvB,qBAAqB,EAAE,GAAG;CAC3B,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CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CACzB,KAAuB,EACvB,IAAY,EACZ,GAAG,SAAmB;IAEtB,KAAK,MAAM,SAAS,IAAI,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IAClE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAVD,kCAUC"}
@@ -34,9 +34,12 @@
34
34
  * another. Two paths and five body shapes are all a second HTTP adapter
35
35
  * re-decides.
36
36
  * • `memorySessions()` — conversations in a Map, for tests and local dev.
37
- * • `standingAgent({ agent, sessions, host })` — the composer.
37
+ * • `standingAgent({ agent, sessions, host, durability? })` — the composer.
38
38
  * • `toEnvelope` / `readEnvelope` — pack a conversation, and refuse by name to
39
39
  * unpack a format this runtime does not know.
40
+ * • `toPausedEnvelope` / `readPausedRun` — the same for a run that stopped to
41
+ * ask a person something (`'flowchart-v1'`). `checkEnvelope` validates
42
+ * either without committing to which half you wanted — what a STORE wants.
40
43
  * • `requireCapability` — feature-detection with teeth.
41
44
  *
42
45
  * @example An agent that stays up and remembers
@@ -51,7 +54,7 @@
51
54
  * process.on('SIGTERM', () => void handle.close());
52
55
  */
53
56
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.PauseNotCarriedError = exports.ConcurrentRunError = exports.HostClosedError = exports.requireCapability = exports.standingAgent = exports.readEnvelope = exports.toEnvelope = exports.memorySessions = exports.headerValue = exports.httpHost = exports.jsonWire = exports.nodeHost = void 0;
57
+ exports.NoPendingAskError = exports.AwaitingDecisionError = exports.PauseNotCarriedError = exports.ConcurrentRunError = exports.HostClosedError = exports.requireCapability = exports.standingAgent = exports.checkEnvelope = exports.readPausedRun = exports.readEnvelope = exports.toPausedEnvelope = exports.toEnvelope = exports.memorySessions = exports.headerValue = exports.httpHost = exports.jsonWire = exports.nodeHost = void 0;
55
58
  var nodeHost_js_1 = require("./nodeHost.js");
56
59
  Object.defineProperty(exports, "nodeHost", { enumerable: true, get: function () { return nodeHost_js_1.nodeHost; } });
57
60
  Object.defineProperty(exports, "jsonWire", { enumerable: true, get: function () { return nodeHost_js_1.jsonWire; } });
@@ -62,7 +65,10 @@ var memorySessions_js_1 = require("./memorySessions.js");
62
65
  Object.defineProperty(exports, "memorySessions", { enumerable: true, get: function () { return memorySessions_js_1.memorySessions; } });
63
66
  var envelope_js_1 = require("./envelope.js");
64
67
  Object.defineProperty(exports, "toEnvelope", { enumerable: true, get: function () { return envelope_js_1.toEnvelope; } });
68
+ Object.defineProperty(exports, "toPausedEnvelope", { enumerable: true, get: function () { return envelope_js_1.toPausedEnvelope; } });
65
69
  Object.defineProperty(exports, "readEnvelope", { enumerable: true, get: function () { return envelope_js_1.readEnvelope; } });
70
+ Object.defineProperty(exports, "readPausedRun", { enumerable: true, get: function () { return envelope_js_1.readPausedRun; } });
71
+ Object.defineProperty(exports, "checkEnvelope", { enumerable: true, get: function () { return envelope_js_1.checkEnvelope; } });
66
72
  var standingAgent_js_1 = require("./standingAgent.js");
67
73
  Object.defineProperty(exports, "standingAgent", { enumerable: true, get: function () { return standingAgent_js_1.standingAgent; } });
68
74
  var errors_js_1 = require("./errors.js");
@@ -70,4 +76,6 @@ Object.defineProperty(exports, "requireCapability", { enumerable: true, get: fun
70
76
  Object.defineProperty(exports, "HostClosedError", { enumerable: true, get: function () { return errors_js_1.HostClosedError; } });
71
77
  Object.defineProperty(exports, "ConcurrentRunError", { enumerable: true, get: function () { return errors_js_1.ConcurrentRunError; } });
72
78
  Object.defineProperty(exports, "PauseNotCarriedError", { enumerable: true, get: function () { return errors_js_1.PauseNotCarriedError; } });
79
+ Object.defineProperty(exports, "AwaitingDecisionError", { enumerable: true, get: function () { return errors_js_1.AwaitingDecisionError; } });
80
+ Object.defineProperty(exports, "NoPendingAskError", { enumerable: true, get: function () { return errors_js_1.NoPendingAskError; } });
73
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hosting/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;;;AAEH,6CAAmD;AAA1C,uGAAA,QAAQ,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAG3B,6CAAsD;AAA7C,uGAAA,QAAQ,OAAA;AAAE,0GAAA,WAAW,OAAA;AAS9B,yDAAqD;AAA5C,mHAAA,cAAc,OAAA;AACvB,6CAAyD;AAAhD,yGAAA,UAAU,OAAA;AAAE,2GAAA,YAAY,OAAA;AACjC,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AAEtB,yCAKqB;AAJnB,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,+GAAA,kBAAkB,OAAA;AAClB,iHAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hosting/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;;;AAEH,6CAAmD;AAA1C,uGAAA,QAAQ,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAG3B,6CAAsD;AAA7C,uGAAA,QAAQ,OAAA;AAAE,0GAAA,WAAW,OAAA;AAS9B,yDAAqD;AAA5C,mHAAA,cAAc,OAAA;AACvB,6CAMuB;AALrB,yGAAA,UAAU,OAAA;AACV,+GAAA,gBAAgB,OAAA;AAChB,2GAAA,YAAY,OAAA;AACZ,4GAAA,aAAa,OAAA;AACb,4GAAA,aAAa,OAAA;AAEf,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AAEtB,yCAOqB;AANnB,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,+GAAA,kBAAkB,OAAA;AAClB,iHAAA,oBAAoB,OAAA;AACpB,kHAAA,qBAAqB,OAAA;AACrB,8GAAA,iBAAiB,OAAA"}
@@ -8,8 +8,10 @@
8
8
  * reply.complete(await answer(request.input));
9
9
  * });
10
10
  *
11
- * Two routes: `POST /invoke` takes `{ input, sessionId? }` and answers
12
- * `{ output }`; `GET /health` answers `{ status: 'ok' }`. Both paths are
11
+ * Two routes: `POST /invoke` takes `{ input, sessionId?, decision? }` and
12
+ * answers `{ output }` — or `{ awaiting }` with a **202** when the run stopped
13
+ * to ask a person something, which a later `POST` carrying `decision` continues;
14
+ * `GET /health` answers `{ status: 'ok' }`. Both paths are
13
15
  * options, because the paths are the part most likely to be dictated to you by
14
16
  * whatever is in front of the process — a load balancer, a container contract,
15
17
  * a colleague's convention. A path is a deployment detail, so it is a knob
@@ -47,12 +49,21 @@ exports.jsonWire = {
47
49
  // caller that sets both is not surprised by which one the server preferred.
48
50
  const fromBody = typeof facts.body.sessionId === 'string' ? facts.body.sessionId : undefined;
49
51
  const sessionId = fromBody ?? facts.headers['x-session-id'];
50
- return sessionId !== undefined ? { input, sessionId } : { input };
52
+ // Read as-is and never coerced: `decision` is a person's answer to whatever
53
+ // a tool asked, and this dialect does not get to decide what that looks
54
+ // like. Its PRESENCE is the whole signal.
55
+ const decision = facts.body.decision;
56
+ return {
57
+ input,
58
+ ...(sessionId !== undefined && { sessionId }),
59
+ ...(decision !== undefined && { decision }),
60
+ };
51
61
  },
52
62
  health: (uptimeMs) => ({ status: 'ok', uptimeMs }),
53
63
  output: (output) => ({ output }),
54
64
  failure: (error, code) => ({ error, ...(code !== undefined && { code }) }),
55
65
  chunk: (text) => ({ text }),
66
+ awaiting: (pending) => ({ awaiting: pending }),
56
67
  };
57
68
  /**
58
69
  * An HTTP host for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