@noetaris/harness-types 0.1.0 → 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/dist/index.d.ts +42 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,10 +55,26 @@ interface LLMResponse {
|
|
|
55
55
|
toolCalls: ToolCall[];
|
|
56
56
|
stopReason: 'end' | 'tool_use' | 'max_tokens';
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Payload emitted by LLM adapters as an `"llm.request"` observer event,
|
|
60
|
+
* immediately before the provider call is made.
|
|
61
|
+
*
|
|
62
|
+
* `messages` and `tools` are opt-in — they may contain sensitive data and are
|
|
63
|
+
* typed as `unknown` because adapters pass their internal translated
|
|
64
|
+
* representations; the framework never inspects this content.
|
|
65
|
+
*/
|
|
66
|
+
interface LLMRequestEvent {
|
|
67
|
+
modelId: string;
|
|
68
|
+
providerName: string;
|
|
69
|
+
messages?: unknown;
|
|
70
|
+
tools?: unknown;
|
|
71
|
+
}
|
|
58
72
|
/**
|
|
59
73
|
* Token-usage payload emitted by LLM adapters as an `llm.response` observer event.
|
|
60
74
|
*
|
|
61
75
|
* Adapters that cannot report real token counts (e.g. mock adapters) emit `{ input: 0, output: 0 }`.
|
|
76
|
+
*
|
|
77
|
+
* `output` is opt-in — it may contain sensitive data; adapters default to omitting it.
|
|
62
78
|
*/
|
|
63
79
|
interface LLMUsageEvent {
|
|
64
80
|
tokens: {
|
|
@@ -67,6 +83,31 @@ interface LLMUsageEvent {
|
|
|
67
83
|
};
|
|
68
84
|
modelId: string;
|
|
69
85
|
stopReason: LLMResponse['stopReason'];
|
|
86
|
+
providerName: string;
|
|
87
|
+
output?: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Payload emitted on `"tool.call"` before a tool is dispatched.
|
|
91
|
+
*
|
|
92
|
+
* `input` is opt-in — it may contain sensitive data; omit by default.
|
|
93
|
+
*/
|
|
94
|
+
interface ToolCallEvent {
|
|
95
|
+
toolName: string;
|
|
96
|
+
toolCallId: string;
|
|
97
|
+
input?: unknown;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Payload emitted on `"tool.result"` after a tool completes or throws.
|
|
101
|
+
*
|
|
102
|
+
* `result` and `error` are opt-in — they may contain sensitive data; omit by default.
|
|
103
|
+
* Set `error` when the tool threw; leave it absent on success.
|
|
104
|
+
*/
|
|
105
|
+
interface ToolResultEvent {
|
|
106
|
+
toolName: string;
|
|
107
|
+
toolCallId: string;
|
|
108
|
+
durationMs: number;
|
|
109
|
+
result?: unknown;
|
|
110
|
+
error?: unknown;
|
|
70
111
|
}
|
|
71
112
|
/**
|
|
72
113
|
* Core interface every LLM adapter must implement.
|
|
@@ -88,4 +129,4 @@ interface LLM {
|
|
|
88
129
|
}): Promise<LLMResponse>;
|
|
89
130
|
}
|
|
90
131
|
|
|
91
|
-
export type { LLM, LLMResponse, LLMUsageEvent, Message, Tool, ToolCall };
|
|
132
|
+
export type { LLM, LLMRequestEvent, LLMResponse, LLMUsageEvent, Message, Tool, ToolCall, ToolCallEvent, ToolResultEvent };
|