@haikeilabs/agentware 0.1.1 → 0.3.0
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 +19 -0
- package/dist/executor/agent_loop.d.ts +9 -0
- package/dist/executor/agent_loop.d.ts.map +1 -1
- package/dist/executor/agent_loop.js +62 -13
- package/dist/executor/executor.d.ts.map +1 -1
- package/dist/executor/executor.js +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/kei/index.d.ts +3 -0
- package/dist/kei/index.d.ts.map +1 -0
- package/dist/kei/index.js +2 -0
- package/dist/kei/runtimeLink.d.ts +280 -0
- package/dist/kei/runtimeLink.d.ts.map +1 -0
- package/dist/kei/runtimeLink.js +590 -0
- package/dist/kei/runtimeLinkRuntime.d.ts +26 -0
- package/dist/kei/runtimeLinkRuntime.d.ts.map +1 -0
- package/dist/kei/runtimeLinkRuntime.js +400 -0
- package/dist/middleware/middleware.js +1 -1
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -43,3 +43,22 @@ Register only the wrapped handler with an agent framework or tool registry.
|
|
|
43
43
|
Keep channel ingress, identity verification, delegated credentials, and
|
|
44
44
|
domain-specific authorization in the host application. Agentware is not a
|
|
45
45
|
policy engine; a policy gate can wrap this same boundary later.
|
|
46
|
+
|
|
47
|
+
## Maintainer releases
|
|
48
|
+
|
|
49
|
+
Releases are deliberately manual and use npm staged publishing. Do not run
|
|
50
|
+
`npm publish` from a workstation or add a registry token to CI.
|
|
51
|
+
|
|
52
|
+
1. Update `typescript/package.json` and `typescript/package-lock.json` to the
|
|
53
|
+
intended semantic version in a pull request, then merge it to `main`.
|
|
54
|
+
2. In GitHub Actions, run **Stage Agentware npm package** from `main`, entering
|
|
55
|
+
that exact version (for example, `0.1.1`). The workflow verifies the version,
|
|
56
|
+
creates the immutable `agentware-v<version>` tag, runs checks, and submits
|
|
57
|
+
the package with `npm stage publish`.
|
|
58
|
+
3. Approve the GitHub `release` environment when prompted.
|
|
59
|
+
4. Review the staged package in npm and approve it. The approving maintainer
|
|
60
|
+
needs npm publish access and 2FA enabled for write actions; a WebAuthn
|
|
61
|
+
security key is supported.
|
|
62
|
+
|
|
63
|
+
The final npm approval is intentional: it is the human gate that makes the
|
|
64
|
+
staged version publicly available.
|
|
@@ -3,6 +3,7 @@ import type { ToolRegistry } from "../tools/index.js";
|
|
|
3
3
|
import type { ResponseValidator } from "../middleware/guardrails/response_validator.js";
|
|
4
4
|
import { ErrorTracker, ErrorCategory } from "../middleware/guardrails/error_tracker.js";
|
|
5
5
|
import { StepEnforcer } from "../middleware/guardrails/step_enforcer.js";
|
|
6
|
+
import { ReasoningAdapter, type ContextTree } from "../reasoning/index.js";
|
|
6
7
|
export declare enum AgentTerminationReason {
|
|
7
8
|
COMPLETE = "complete",
|
|
8
9
|
MAX_ITERATIONS = "max_iterations",
|
|
@@ -18,6 +19,9 @@ export interface AgentLoopConfig {
|
|
|
18
19
|
max_iterations?: number;
|
|
19
20
|
max_nudges?: number;
|
|
20
21
|
require_tool_call?: boolean;
|
|
22
|
+
/** Optional reasoning adapter override for limits and registered model
|
|
23
|
+
* fields. */
|
|
24
|
+
reasoning?: ReasoningAdapter;
|
|
21
25
|
}
|
|
22
26
|
export interface AgentResult {
|
|
23
27
|
final_response: string;
|
|
@@ -26,6 +30,11 @@ export interface AgentResult {
|
|
|
26
30
|
nudges: number;
|
|
27
31
|
termination_reason: AgentTerminationReason;
|
|
28
32
|
conversation: Message[];
|
|
33
|
+
/** Normalized context tree for the last turn that carried reasoning
|
|
34
|
+
* (native reasoning_content and/or thinking tags). Null when no turn
|
|
35
|
+
* carried reasoning. Holds bounded summaries only; raw reasoning is never
|
|
36
|
+
* attached. */
|
|
37
|
+
reasoning_tree: ContextTree | null;
|
|
29
38
|
}
|
|
30
39
|
export declare function registryToolDefinitions(registry: ToolRegistry): ToolDefinition[];
|
|
31
40
|
export declare function categorizeError(message: string): ErrorCategory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_loop.d.ts","sourceRoot":"","sources":["../../src/executor/agent_loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"agent_loop.d.ts","sourceRoot":"","sources":["../../src/executor/agent_loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAOzE,OAAO,EACL,gBAAgB,EAGhB,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;iBACa;IACb,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB;;;mBAGe;IACf,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;CACpC;AAKD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,YAAY,GACrB,cAAc,EAAE,CASlB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CA0B9D;AAiBD,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,eAAe;IAU7B,GAAG,CACP,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,OAAO,EAAO,EACvB,UAAU,GAAE,MAAW,GACtB,OAAO,CAAC,WAAW,CAAC;IA2OvB,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,MAAM;CAmBf"}
|
|
@@ -3,6 +3,7 @@ import { executeTool, Result } from "../tools/index.js";
|
|
|
3
3
|
import { ErrorCategory, } from "../middleware/guardrails/error_tracker.js";
|
|
4
4
|
import { NudgeKind, stepNudge, } from "../middleware/guardrails/nudge.js";
|
|
5
5
|
import { MessageType } from "../middleware/types.js";
|
|
6
|
+
import { ReasoningAdapter, ReasoningError, isContextTreeEmpty, } from "../reasoning/index.js";
|
|
6
7
|
export var AgentTerminationReason;
|
|
7
8
|
(function (AgentTerminationReason) {
|
|
8
9
|
AgentTerminationReason["COMPLETE"] = "complete";
|
|
@@ -10,6 +11,8 @@ export var AgentTerminationReason;
|
|
|
10
11
|
AgentTerminationReason["NUDGES_EXHAUSTED"] = "nudges_exhausted";
|
|
11
12
|
AgentTerminationReason["ERROR"] = "error";
|
|
12
13
|
})(AgentTerminationReason || (AgentTerminationReason = {}));
|
|
14
|
+
// Default adapter strips and normalizes reasoning in the agent loop.
|
|
15
|
+
const defaultAdapter = new ReasoningAdapter();
|
|
13
16
|
export function registryToolDefinitions(registry) {
|
|
14
17
|
return registry.all().map((tool) => ({
|
|
15
18
|
name: tool.name,
|
|
@@ -69,14 +72,19 @@ export class AgentLoop {
|
|
|
69
72
|
config.max_nudges && config.max_nudges > 0 ? config.max_nudges : 3;
|
|
70
73
|
}
|
|
71
74
|
async run(system_prompt, user_message, history = [], session_id = "") {
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
// Cross-language contract: the system prompt leads the conversation,
|
|
76
|
+
// ahead of any caller-supplied history (mirrors Go buildConversation).
|
|
77
|
+
const conversation = [
|
|
78
|
+
{ role: Role.SYSTEM, content: system_prompt },
|
|
79
|
+
...history,
|
|
80
|
+
];
|
|
74
81
|
conversation.push({ role: Role.USER, content: user_message });
|
|
75
82
|
const toolDefs = registryToolDefinitions(this.config.registry);
|
|
76
83
|
let iterations = 0;
|
|
77
84
|
let toolCallsMade = 0;
|
|
78
85
|
let nudges = 0;
|
|
79
86
|
let finalResponse = "";
|
|
87
|
+
let reasoningTree = null;
|
|
80
88
|
while (iterations < this.maxIterations) {
|
|
81
89
|
iterations++;
|
|
82
90
|
let resp;
|
|
@@ -85,17 +93,57 @@ export class AgentLoop {
|
|
|
85
93
|
}
|
|
86
94
|
catch (err) {
|
|
87
95
|
this.config.error_tracker?.recordError(session_id, "", {}, toError(err), ErrorCategory.UNKNOWN);
|
|
88
|
-
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.ERROR, conversation);
|
|
96
|
+
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.ERROR, conversation, reasoningTree);
|
|
89
97
|
}
|
|
90
|
-
|
|
98
|
+
// AR-1 parity: normalize reasoning and strip it before validation.
|
|
99
|
+
// Reasoning can arrive as a native reasoning_content field or as
|
|
100
|
+
// embedded thinking tags in content; both are combined into a synthetic
|
|
101
|
+
// structured input so the adapter sees the full picture. Malformed or
|
|
102
|
+
// unbounded reasoning fails closed: this turn is treated as invalid and
|
|
103
|
+
// retried rather than parsed partially.
|
|
104
|
+
let turnTree = null;
|
|
105
|
+
let cleanContent = resp.content;
|
|
106
|
+
let reasoningFailed = false;
|
|
107
|
+
if (resp.content || resp.reasoning) {
|
|
108
|
+
const reasoningInput = {
|
|
109
|
+
content: resp.content,
|
|
110
|
+
};
|
|
111
|
+
if (resp.reasoning) {
|
|
112
|
+
reasoningInput["reasoning_content"] = resp.reasoning;
|
|
113
|
+
}
|
|
114
|
+
const adapter = this.config.reasoning ?? defaultAdapter;
|
|
115
|
+
try {
|
|
116
|
+
turnTree = adapter.extract(reasoningInput, this.config.backend.modelName(), "agent-loop");
|
|
117
|
+
cleanContent = adapter.strip(reasoningInput);
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
if (e instanceof ReasoningError) {
|
|
121
|
+
reasoningFailed = true;
|
|
122
|
+
// Fail closed: never echo content that may carry reasoning we
|
|
123
|
+
// could not parse.
|
|
124
|
+
cleanContent = "";
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw e;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Keep the last turn that actually carried reasoning; a later plain
|
|
132
|
+
// turn must not blank out the tree the consumer is after.
|
|
133
|
+
if (!isContextTreeEmpty(turnTree)) {
|
|
134
|
+
reasoningTree = turnTree;
|
|
135
|
+
}
|
|
136
|
+
const validation = reasoningFailed
|
|
137
|
+
? { toolCalls: [], nudge: null, needsRetry: true }
|
|
138
|
+
: this.validate(resp, cleanContent);
|
|
91
139
|
if (validation.needsRetry) {
|
|
92
140
|
if (nudges >= this.maxNudges) {
|
|
93
|
-
return this.finish(
|
|
141
|
+
return this.finish(cleanContent, iterations, toolCallsMade, nudges, AgentTerminationReason.NUDGES_EXHAUSTED, conversation, reasoningTree);
|
|
94
142
|
}
|
|
95
143
|
nudges++;
|
|
96
144
|
conversation.push({
|
|
97
145
|
role: Role.ASSISTANT,
|
|
98
|
-
content:
|
|
146
|
+
content: cleanContent,
|
|
99
147
|
meta: { type: MessageType.TEXT_RESPONSE },
|
|
100
148
|
});
|
|
101
149
|
if (validation.nudge) {
|
|
@@ -108,8 +156,8 @@ export class AgentLoop {
|
|
|
108
156
|
continue;
|
|
109
157
|
}
|
|
110
158
|
if (validation.toolCalls.length === 0) {
|
|
111
|
-
finalResponse =
|
|
112
|
-
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.COMPLETE, conversation);
|
|
159
|
+
finalResponse = cleanContent;
|
|
160
|
+
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.COMPLETE, conversation, reasoningTree);
|
|
113
161
|
}
|
|
114
162
|
let stepNudged = false;
|
|
115
163
|
for (const call of validation.toolCalls) {
|
|
@@ -117,7 +165,7 @@ export class AgentLoop {
|
|
|
117
165
|
const [allowed, missing] = this.config.step_enforcer.canExecute(session_id, call.tool);
|
|
118
166
|
if (!allowed) {
|
|
119
167
|
if (nudges >= this.maxNudges) {
|
|
120
|
-
return this.finish(
|
|
168
|
+
return this.finish(cleanContent, iterations, toolCallsMade, nudges, AgentTerminationReason.NUDGES_EXHAUSTED, conversation, reasoningTree);
|
|
121
169
|
}
|
|
122
170
|
nudges++;
|
|
123
171
|
stepNudged = true;
|
|
@@ -178,13 +226,13 @@ export class AgentLoop {
|
|
|
178
226
|
continue;
|
|
179
227
|
}
|
|
180
228
|
}
|
|
181
|
-
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.MAX_ITERATIONS, conversation);
|
|
229
|
+
return this.finish(finalResponse, iterations, toolCallsMade, nudges, AgentTerminationReason.MAX_ITERATIONS, conversation, reasoningTree);
|
|
182
230
|
}
|
|
183
|
-
validate(resp) {
|
|
231
|
+
validate(resp, cleanContent) {
|
|
184
232
|
if (resp.tool_calls.length > 0) {
|
|
185
233
|
return this.config.validator.validateToolCalls(resp.tool_calls.map((tc) => ({ tool: tc.name, args: tc.arguments })));
|
|
186
234
|
}
|
|
187
|
-
const textValidation = this.config.validator.validateTextResponse(
|
|
235
|
+
const textValidation = this.config.validator.validateTextResponse(cleanContent);
|
|
188
236
|
if (textValidation.toolCalls.length > 0) {
|
|
189
237
|
return textValidation;
|
|
190
238
|
}
|
|
@@ -193,7 +241,7 @@ export class AgentLoop {
|
|
|
193
241
|
}
|
|
194
242
|
return { toolCalls: [], nudge: null, needsRetry: false };
|
|
195
243
|
}
|
|
196
|
-
finish(finalResponse, iterations, toolCallsMade, nudges, termination, conversation) {
|
|
244
|
+
finish(finalResponse, iterations, toolCallsMade, nudges, termination, conversation, reasoningTree) {
|
|
197
245
|
return {
|
|
198
246
|
final_response: finalResponse,
|
|
199
247
|
iterations,
|
|
@@ -201,6 +249,7 @@ export class AgentLoop {
|
|
|
201
249
|
nudges,
|
|
202
250
|
termination_reason: termination,
|
|
203
251
|
conversation,
|
|
252
|
+
reasoning_tree: reasoningTree,
|
|
204
253
|
};
|
|
205
254
|
}
|
|
206
255
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/executor/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAIxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBA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M,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,YAAY,EAAE,OAAO,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,aAAa,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,iBAAkB,YAAW,QAAQ;IAChD,OAAO,CAAC,MAAM,CAA0B;gBAE5B,MAAM,EAAE,uBAAuB;IAQ3C,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,aAAa;CA+D5C"}
|
|
@@ -16,8 +16,12 @@ export class InferenceExecutor {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
execute(req) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// Cross-language contract: the system prompt leads the conversation,
|
|
20
|
+
// ahead of any caller-supplied history (mirrors Go buildConversation).
|
|
21
|
+
const conversation = [
|
|
22
|
+
{ role: Role.SYSTEM, content: req.system_prompt },
|
|
23
|
+
...req.history,
|
|
24
|
+
];
|
|
21
25
|
conversation.push({ role: Role.USER, content: req.user_message });
|
|
22
26
|
let iterations = 0;
|
|
23
27
|
let tool_calls_made = 0;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kei/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuntimeLink contract: the harness → Agentware → kei-connector-runtime heartbeat.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript mirror of the Go reference `go/kei/runtimelink` for
|
|
5
|
+
* `docs/specs/runtime-heartbeat-liveness.md` (HAI-141). This module defines
|
|
6
|
+
* configuration, status, identity, failure classes, the child's JSONL wire
|
|
7
|
+
* events, and redacted lifecycle events. Process supervision is implemented
|
|
8
|
+
* in `runtimeLinkRuntime.ts`. The only heartbeat path is harness → RuntimeLink
|
|
9
|
+
* → kei-connector-runtime; Agentware does not call the catalog itself.
|
|
10
|
+
*
|
|
11
|
+
* All three SDK languages share `testing/contracts/runtime-link`. Durations
|
|
12
|
+
* are milliseconds here (`intervalMs`), seconds in Python, and
|
|
13
|
+
* `time.Duration` in Go.
|
|
14
|
+
*/
|
|
15
|
+
/** The child stdout event version ("v") this SDK accepts. */
|
|
16
|
+
export declare const RUNTIME_LINK_CONTRACT_VERSION = 1;
|
|
17
|
+
/** Bound on one child stdout line, excluding the newline. */
|
|
18
|
+
export declare const MAX_CHILD_LINE_BYTES = 4096;
|
|
19
|
+
/** Capacity of the RuntimeLink event ring. */
|
|
20
|
+
export declare const RUNTIME_LINK_EVENT_BUFFER_SIZE = 64;
|
|
21
|
+
export declare const RUNTIME_LINK_SDK_LANG = "typescript";
|
|
22
|
+
export declare const HARNESS_KINDS: readonly ["assistant", "pde", "chat-discord", "chat-slack", "chat-teams", "cli"];
|
|
23
|
+
export type HarnessKind = (typeof HARNESS_KINDS)[number];
|
|
24
|
+
export declare const LINK_STATES: readonly ["disabled", "starting", "connected", "degraded", "reconnecting", "terminal", "stopped"];
|
|
25
|
+
export type LinkState = (typeof LINK_STATES)[number];
|
|
26
|
+
/**
|
|
27
|
+
* Closed failure taxonomy (spec §6.3). Separates harness↔runtime failures
|
|
28
|
+
* from runtime↔catalog failures so alerts route to the right owner.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FAILURE_CLASSES: readonly ["config_invalid", "runtime_unavailable", "runtime_crashloop", "runtime_unresponsive", "contract_mismatch", "catalog_unreachable", "catalog_timeout", "catalog_error", "catalog_backpressure", "installation_unauthorized", "installation_stale", "installation_offline", "audit_backlog", "legacy_runtime_unverified"];
|
|
31
|
+
export type FailureClass = (typeof FAILURE_CLASSES)[number];
|
|
32
|
+
export declare const BEAT_OUTCOMES: readonly ["ok", "catalog_unreachable", "catalog_timeout", "catalog_error", "catalog_backpressure", "catalog_rejected", "unauthorized"];
|
|
33
|
+
export type BeatOutcome = (typeof BEAT_OUTCOMES)[number];
|
|
34
|
+
export declare const LIFECYCLE_EVENT_NAMES: readonly ["runtime.link.started", "runtime.link.connected", "runtime.link.degraded", "runtime.link.reconnecting", "runtime.link.terminal", "runtime.link.stopped"];
|
|
35
|
+
export type LifecycleEventName = (typeof LIFECYCLE_EVENT_NAMES)[number];
|
|
36
|
+
export declare const SDK_LANGS: readonly ["go", "python", "typescript"];
|
|
37
|
+
export type SdkLang = (typeof SDK_LANGS)[number];
|
|
38
|
+
/** The exact environment a runtime child may receive; never `process.env`. */
|
|
39
|
+
export declare const CHILD_ENV_ALLOWLIST: readonly ["KEI_RUNTIME_TOKEN", "KEI_RUNTIME_CONTROL_PLANE_URL", "KEI_HARNESS_KIND", "KEI_HARNESS_VERSION", "KEI_DEPLOYMENT_ENV", "KEI_AGENTWARE_SDK_LANG", "KEI_AGENTWARE_SDK_VERSION", "KEI_HEARTBEAT_RUN_ID", "PATH", "HOME", "TZ"];
|
|
40
|
+
/** Environment variables. KEI_PROXY_* keep their legacy names (runtime contract). */
|
|
41
|
+
export declare const RUNTIME_LINK_ENV: {
|
|
42
|
+
readonly enabled: "KEI_RUNTIME_ENABLED";
|
|
43
|
+
readonly token: "KEI_RUNTIME_TOKEN";
|
|
44
|
+
readonly legacyToken: "KEI_HARNESS_TOKEN";
|
|
45
|
+
readonly controlPlaneUrl: "KEI_RUNTIME_CONTROL_PLANE_URL";
|
|
46
|
+
readonly proxyPath: "KEI_PROXY_PATH";
|
|
47
|
+
readonly proxySha: "KEI_PROXY_SHA";
|
|
48
|
+
readonly interval: "KEI_HEARTBEAT_INTERVAL";
|
|
49
|
+
readonly timeout: "KEI_HEARTBEAT_TIMEOUT";
|
|
50
|
+
readonly restartMin: "KEI_HEARTBEAT_RESTART_MIN";
|
|
51
|
+
readonly restartMax: "KEI_HEARTBEAT_RESTART_MAX";
|
|
52
|
+
readonly stableSeconds: "KEI_HEARTBEAT_STABLE_SECONDS";
|
|
53
|
+
readonly logCount: "KEI_HEARTBEAT_LOG_COUNT";
|
|
54
|
+
readonly harnessKind: "KEI_HARNESS_KIND";
|
|
55
|
+
readonly harnessVersion: "KEI_HARNESS_VERSION";
|
|
56
|
+
readonly deploymentEnv: "KEI_DEPLOYMENT_ENV";
|
|
57
|
+
};
|
|
58
|
+
/** The distribution keeps the kei-proxy name; the repo is kei-connector-runtime. */
|
|
59
|
+
export declare const DEFAULT_RUNTIME_BINARY_PATH = "kei-proxy";
|
|
60
|
+
/**
|
|
61
|
+
* Bounds. Interval is clamped; everything else is rejected when out of range
|
|
62
|
+
* so a typo fails closed instead of silently changing behavior.
|
|
63
|
+
*/
|
|
64
|
+
export declare const RUNTIME_LINK_BOUNDS: {
|
|
65
|
+
readonly minIntervalMs: 15000;
|
|
66
|
+
readonly maxIntervalMs: 300000;
|
|
67
|
+
readonly maxGraceMs: 300000;
|
|
68
|
+
readonly minRestartMs: 1000;
|
|
69
|
+
readonly maxRestartMs: 3600000;
|
|
70
|
+
readonly minStableResetMs: 1000;
|
|
71
|
+
readonly maxStableResetMs: 3600000;
|
|
72
|
+
readonly minStopTimeoutMs: 1000;
|
|
73
|
+
readonly maxStopTimeoutMs: 60000;
|
|
74
|
+
readonly maxLogCount: 100;
|
|
75
|
+
};
|
|
76
|
+
export declare const RUNTIME_LINK_CONFIG_ERROR_CODES: readonly ["invalid_value", "out_of_range", "beat_timeout", "harness_kind", "envelope", "legacy_token", "token_missing", "control_plane_url", "binary"];
|
|
77
|
+
export type RuntimeLinkConfigErrorCode = (typeof RUNTIME_LINK_CONFIG_ERROR_CODES)[number];
|
|
78
|
+
/**
|
|
79
|
+
* Invalid RuntimeLink configuration. Carries the offending field and a stable
|
|
80
|
+
* code, never the offending value, so a misplaced secret cannot leak.
|
|
81
|
+
*/
|
|
82
|
+
export declare class RuntimeLinkConfigError extends Error {
|
|
83
|
+
readonly code: RuntimeLinkConfigErrorCode;
|
|
84
|
+
readonly field: string;
|
|
85
|
+
constructor(code: RuntimeLinkConfigErrorCode, field: string);
|
|
86
|
+
}
|
|
87
|
+
/** The runtime binary and its expected SHA-256 (lowercase hex). */
|
|
88
|
+
export interface BinaryRef {
|
|
89
|
+
path: string;
|
|
90
|
+
sha256: string;
|
|
91
|
+
}
|
|
92
|
+
/** Where the runtime token lives: the env var name only, never the value. */
|
|
93
|
+
export interface SecretSource {
|
|
94
|
+
env: string;
|
|
95
|
+
}
|
|
96
|
+
/** Child restart backoff with full jitter. */
|
|
97
|
+
export interface Backoff {
|
|
98
|
+
minMs: number;
|
|
99
|
+
maxMs: number;
|
|
100
|
+
stableResetMs: number;
|
|
101
|
+
}
|
|
102
|
+
/** Declared, non-authoritative harness metadata. Never used for authorization. */
|
|
103
|
+
export interface HarnessEnvelope {
|
|
104
|
+
kind: string;
|
|
105
|
+
version: string;
|
|
106
|
+
deploymentEnv: string;
|
|
107
|
+
}
|
|
108
|
+
export interface RuntimeLinkConfig {
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
binary: BinaryRef;
|
|
111
|
+
controlPlaneUrl: string;
|
|
112
|
+
token: SecretSource;
|
|
113
|
+
intervalMs: number;
|
|
114
|
+
beatTimeoutMs: number;
|
|
115
|
+
graceMs: number;
|
|
116
|
+
restart: Backoff;
|
|
117
|
+
stopTimeoutMs: number;
|
|
118
|
+
logCount: number;
|
|
119
|
+
harness: HarnessEnvelope;
|
|
120
|
+
}
|
|
121
|
+
/** The spec defaults with the link disabled. */
|
|
122
|
+
export declare function defaultRuntimeLinkConfig(): RuntimeLinkConfig;
|
|
123
|
+
/**
|
|
124
|
+
* Clamp `intervalMs` to [15s, 300s] and validate every other field, throwing
|
|
125
|
+
* RuntimeLinkConfigError on the first violation. A disabled link (local-only
|
|
126
|
+
* mode) is valid, but its declared envelope and timings are still checked so
|
|
127
|
+
* typos fail loudly.
|
|
128
|
+
*/
|
|
129
|
+
export declare function normalizeRuntimeLinkConfig(cfg: RuntimeLinkConfig): RuntimeLinkConfig;
|
|
130
|
+
export type EnvSource = Readonly<Record<string, string | undefined>>;
|
|
131
|
+
/**
|
|
132
|
+
* Build a normalized config from the spec §3.2 variables. Non-empty fields of
|
|
133
|
+
* `harness` override the KEI_HARNESS_* variables. The runtime token is only
|
|
134
|
+
* checked for presence; its value is never retained.
|
|
135
|
+
*/
|
|
136
|
+
export declare function runtimeLinkConfigFromEnv(env?: EnvSource, harness?: Partial<HarnessEnvelope>): RuntimeLinkConfig;
|
|
137
|
+
/**
|
|
138
|
+
* Full-jitter restart delay for attempt n (0-based):
|
|
139
|
+
* `floor(r × min(maxMs, minMs × 2^n))`. `r` is clamped to [0, 1); negative
|
|
140
|
+
* attempts count as 0.
|
|
141
|
+
*/
|
|
142
|
+
export declare function backoffDelayMs(backoff: Pick<Backoff, "minMs" | "maxMs">, attempt: number, r: number): number;
|
|
143
|
+
export interface WaitBackoffOptions {
|
|
144
|
+
signal?: AbortSignal;
|
|
145
|
+
random?: () => number;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Sleep for the jittered delay, or reject with the signal's abort reason as
|
|
149
|
+
* soon as `signal` aborts, so a stop during backoff never waits out the delay.
|
|
150
|
+
*/
|
|
151
|
+
export declare function waitBackoff(backoff: Pick<Backoff, "minMs" | "maxMs">, attempt: number, options?: WaitBackoffOptions): Promise<void>;
|
|
152
|
+
/** Point-in-time snapshot. Diagnostic only: readiness must never depend on it. */
|
|
153
|
+
export interface LinkStatus {
|
|
154
|
+
state: LinkState;
|
|
155
|
+
/** Absent when connected. */
|
|
156
|
+
reason?: FailureClass;
|
|
157
|
+
lastBeatAt?: Date;
|
|
158
|
+
lastCatalogOkAt?: Date;
|
|
159
|
+
consecutiveFails: number;
|
|
160
|
+
runId: string;
|
|
161
|
+
restarts: number;
|
|
162
|
+
}
|
|
163
|
+
/** Authoritative installation identity from catalog whoami, via the runtime. */
|
|
164
|
+
export interface RuntimeIdentity {
|
|
165
|
+
runId: string;
|
|
166
|
+
installationId: string;
|
|
167
|
+
orgId: string;
|
|
168
|
+
workspaceId: string;
|
|
169
|
+
platform: string;
|
|
170
|
+
status: string;
|
|
171
|
+
bindingStatus: string;
|
|
172
|
+
runtimeVersion: string;
|
|
173
|
+
}
|
|
174
|
+
export type ChildLineErrorKind = "line_too_long" | "malformed" | "contract_mismatch";
|
|
175
|
+
/** A child line the SDK must drop and count. */
|
|
176
|
+
export declare class ChildLineError extends Error {
|
|
177
|
+
readonly kind: ChildLineErrorKind;
|
|
178
|
+
constructor(kind: ChildLineErrorKind, detail: string);
|
|
179
|
+
}
|
|
180
|
+
export interface BeatEvent {
|
|
181
|
+
runId: string;
|
|
182
|
+
/** 0 when absent: the runtime omits seq on beats sent before identity. */
|
|
183
|
+
seq: number;
|
|
184
|
+
at: string;
|
|
185
|
+
outcome: BeatOutcome;
|
|
186
|
+
httpStatus: number;
|
|
187
|
+
latencyMs: number;
|
|
188
|
+
nextInMs: number;
|
|
189
|
+
}
|
|
190
|
+
export interface TerminalEvent {
|
|
191
|
+
runId: string;
|
|
192
|
+
reason: string;
|
|
193
|
+
}
|
|
194
|
+
export type ChildEvent = {
|
|
195
|
+
kind: "identity";
|
|
196
|
+
identity: RuntimeIdentity;
|
|
197
|
+
} | {
|
|
198
|
+
kind: "beat";
|
|
199
|
+
beat: BeatEvent;
|
|
200
|
+
} | {
|
|
201
|
+
kind: "terminal";
|
|
202
|
+
terminal: TerminalEvent;
|
|
203
|
+
} | {
|
|
204
|
+
kind: "ignored";
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Parse one line of child stdout (a trailing "\n" / "\r\n" is ignored). Only
|
|
208
|
+
* allowlisted fields survive; payloads, results, reasoning, tokens, or any
|
|
209
|
+
* other key the runtime might emit are dropped. Throws ChildLineError for
|
|
210
|
+
* lines the SDK must drop and count.
|
|
211
|
+
*/
|
|
212
|
+
export declare function parseChildLine(line: string | Uint8Array): ChildEvent;
|
|
213
|
+
/** A lifecycle event has a value outside its closed set or bounds. */
|
|
214
|
+
export declare class InvalidLinkEventError extends Error {
|
|
215
|
+
constructor(detail: string);
|
|
216
|
+
}
|
|
217
|
+
export interface EventHarness {
|
|
218
|
+
kind: HarnessKind;
|
|
219
|
+
version: string;
|
|
220
|
+
deploymentEnv: string;
|
|
221
|
+
sdkLang: SdkLang;
|
|
222
|
+
sdkVersion: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A redacted lifecycle record. Redacted by construction: the type has no
|
|
226
|
+
* field that could carry a token, argv, env, child stderr, provider payload
|
|
227
|
+
* or result, reasoning, customer content, or a subject.
|
|
228
|
+
*/
|
|
229
|
+
export interface LinkEvent {
|
|
230
|
+
name: LifecycleEventName;
|
|
231
|
+
at: Date;
|
|
232
|
+
state: LinkState;
|
|
233
|
+
/** Empty when there is no failure. */
|
|
234
|
+
reason: FailureClass | "";
|
|
235
|
+
runId: string;
|
|
236
|
+
seq: number;
|
|
237
|
+
sdkInstanceId: string;
|
|
238
|
+
harness: EventHarness;
|
|
239
|
+
restarts: number;
|
|
240
|
+
consecutiveFails: number;
|
|
241
|
+
}
|
|
242
|
+
/** The serialized form: exactly these keys, in this order. */
|
|
243
|
+
export interface LinkEventWire {
|
|
244
|
+
name: LifecycleEventName;
|
|
245
|
+
at: string;
|
|
246
|
+
state: LinkState;
|
|
247
|
+
reason: FailureClass | "";
|
|
248
|
+
run_id: string;
|
|
249
|
+
seq: number;
|
|
250
|
+
sdk_instance_id: string;
|
|
251
|
+
harness: {
|
|
252
|
+
kind: HarnessKind;
|
|
253
|
+
version: string;
|
|
254
|
+
deployment_env: string;
|
|
255
|
+
sdk_lang: SdkLang;
|
|
256
|
+
sdk_version: string;
|
|
257
|
+
};
|
|
258
|
+
restarts: number;
|
|
259
|
+
consecutive_fails: number;
|
|
260
|
+
}
|
|
261
|
+
/** Throws InvalidLinkEventError unless every closed set and bound holds. */
|
|
262
|
+
export declare function validateLinkEvent(ev: LinkEvent): LinkEvent;
|
|
263
|
+
/** Build an event from allowlisted wire keys only; everything else is dropped. */
|
|
264
|
+
export declare function linkEventFromWire(raw: unknown): LinkEvent;
|
|
265
|
+
/** Validate and emit exactly the allowlisted keys; `at` is UTC with millisecond precision. */
|
|
266
|
+
export declare function linkEventToWire(ev: LinkEvent): LinkEventWire;
|
|
267
|
+
/**
|
|
268
|
+
* Supervises the harness→runtime heartbeat. `start` returns promptly and
|
|
269
|
+
* rejects only for invalid config, never for network or runtime state.
|
|
270
|
+
* Aborting the signal passed to `start`, or calling `stop`, ends the link;
|
|
271
|
+
* `stop` is idempotent and bounded by `stopTimeoutMs`.
|
|
272
|
+
*/
|
|
273
|
+
export interface RuntimeLink {
|
|
274
|
+
start(signal?: AbortSignal): Promise<void>;
|
|
275
|
+
stop(): Promise<void>;
|
|
276
|
+
status(): LinkStatus;
|
|
277
|
+
identity(): RuntimeIdentity | undefined;
|
|
278
|
+
events(): AsyncIterable<LinkEvent>;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=runtimeLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeLink.d.ts","sourceRoot":"","sources":["../../src/kei/runtimeLink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,8CAA8C;AAC9C,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,eAAO,MAAM,aAAa,kFAOhB,CA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