@inbrowser/agent 0.2.0 → 0.3.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.
- package/README.md +2 -2
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/fixtures.d.ts +2 -2
- package/dist/cli/fixtures.d.ts.map +1 -1
- package/dist/cli/fixtures.js +7 -16
- package/dist/cli/fixtures.js.map +1 -1
- package/dist/cli/llm/openrouter.d.ts +4 -4
- package/dist/cli/llm/openrouter.d.ts.map +1 -1
- package/dist/cli/llm/openrouter.js +20 -31
- package/dist/cli/llm/openrouter.js.map +1 -1
- package/dist/diagnostics/truthfulness.js.map +1 -1
- package/dist/eval/runner.d.ts +4 -4
- package/dist/eval/runner.d.ts.map +1 -1
- package/dist/eval/runner.js +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/llm-adapter.d.ts +30 -34
- package/dist/llm-adapter.d.ts.map +1 -1
- package/dist/llm-adapter.js +61 -51
- package/dist/llm-adapter.js.map +1 -1
- package/dist/mcp/connect.d.ts +68 -0
- package/dist/mcp/connect.d.ts.map +1 -0
- package/dist/mcp/connect.js +111 -0
- package/dist/mcp/connect.js.map +1 -0
- package/dist/metrics.js +4 -4
- package/dist/metrics.js.map +1 -1
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -0
- package/dist/node.js.map +1 -1
- package/dist/retrieval.d.ts +74 -0
- package/dist/retrieval.d.ts.map +1 -0
- package/dist/retrieval.js +287 -0
- package/dist/retrieval.js.map +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +8 -2
- package/dist/session.js.map +1 -1
- package/dist/strategy.d.ts +2 -1
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +36 -26
- package/dist/strategy.js.map +1 -1
- package/dist/types/agent.d.ts +2 -3
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/agent.js +1 -1
- package/dist/types/chat.d.ts +0 -15
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/llm.d.ts +11 -64
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +7 -8
- package/dist/types/llm.js.map +1 -1
- package/dist/types/metrics.d.ts +2 -2
- package/dist/types/metrics.d.ts.map +1 -1
- package/dist/types/session.d.ts +2 -2
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/strategy.d.ts +13 -4
- package/dist/types/strategy.d.ts.map +1 -1
- package/dist/types/trace.d.ts +11 -9
- package/dist/types/trace.d.ts.map +1 -1
- package/package.json +5 -2
package/dist/types/trace.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* completed — that the eval harness uses to split language-model
|
|
23
23
|
* time from tool-dispatch time.
|
|
24
24
|
*/
|
|
25
|
-
import type {
|
|
25
|
+
import type { ModelMessage } from './llm.js';
|
|
26
26
|
/**
|
|
27
27
|
* Wire-level snapshot of a single LLM request as it leaves the
|
|
28
28
|
* strategy. Captured exactly once per ReAct iteration — N times per
|
|
@@ -39,7 +39,7 @@ export interface LlmRequestTrace {
|
|
|
39
39
|
/** 0-indexed ReAct iteration within this turn. */
|
|
40
40
|
iteration: number;
|
|
41
41
|
/** Wall-clock ms captured immediately before the strategy hands
|
|
42
|
-
* the request to `
|
|
42
|
+
* the request to `ModelClient.chat()`. Pair with
|
|
43
43
|
* `LlmResponseTrace.ts` (response completed) and
|
|
44
44
|
* `TurnDispatchCompleteTrace.ts` (tool dispatch completed) to
|
|
45
45
|
* derive the language-model vs tool-dispatch wall-clock split for
|
|
@@ -52,7 +52,7 @@ export interface LlmRequestTrace {
|
|
|
52
52
|
* the synthesized leading system message, the prior history, the
|
|
53
53
|
* current user prompt, and any assistant+tool entries the ReAct
|
|
54
54
|
* loop appended this turn. */
|
|
55
|
-
messages:
|
|
55
|
+
messages: ModelMessage[];
|
|
56
56
|
/** Tool declarations as filtered + shaped by the strategy. The
|
|
57
57
|
* `parameters` value is captured opaquely — providers normalize
|
|
58
58
|
* it (Gemini sanitizes; OpenRouter is permissive), so the trace
|
|
@@ -68,10 +68,11 @@ export interface LlmRequestTrace {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
-
* Tool-decl row as the agent loop produced it pre-provider.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* the
|
|
71
|
+
* Tool-decl row as the agent loop produced it pre-provider. The
|
|
72
|
+
* agent loop builds nested `ToolSpec`s for the `ModelRequest`; this
|
|
73
|
+
* flat view is the canonical pre-provider snapshot the trace exposes.
|
|
74
|
+
* Not coupled to the in-process `ToolHandler` type — the trace is a
|
|
75
|
+
* wire snapshot, not a live handle.
|
|
75
76
|
*/
|
|
76
77
|
export interface ToolDeclarationView {
|
|
77
78
|
name: string;
|
|
@@ -89,8 +90,9 @@ export interface LlmResponseTrace {
|
|
|
89
90
|
/** Same id as the matching `LlmRequestTrace.requestId`. */
|
|
90
91
|
requestId: string;
|
|
91
92
|
/** Wall-clock ms captured immediately after the `chat()` iterator
|
|
92
|
-
* has
|
|
93
|
-
*
|
|
93
|
+
* has drained for this iteration (the `usage` event arrives just
|
|
94
|
+
* before the iterable returns, or `error` on a streaming failure).
|
|
95
|
+
* Not
|
|
94
96
|
* emitted on mid-stream error — callers should treat a missing
|
|
95
97
|
* `llm_response` as "language-model time unknown for this
|
|
96
98
|
* iteration." */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/types/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/types/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,U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H,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB;+DAC2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;uCACmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB;;gDAE4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;;uBAEmB;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,wBAAwB,CAAC;IAAC,IAAI,EAAE,yBAAyB,CAAA;CAAE,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inbrowser/agent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Agent runtime + CLI. Library exports AgentSession, AgentStrategy, ToolRegistry,
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Agent runtime + CLI. Library exports AgentSession, AgentStrategy, ToolRegistry, ModelClient, MetricsCollector, SandboxObserver. Ships an `agent` binary with NDJSON output, --json stdin, --dry-run, schema introspection, and inverse-mode MCP serve. Domain-agnostic — hosts wire their own AgentDefinitions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"types": "./dist/index.d.ts",
|
|
@@ -25,10 +26,12 @@
|
|
|
25
26
|
"files": ["dist", "bin", "skills", "AGENTS.md", "README.md"],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsc",
|
|
29
|
+
"prepublishOnly": "bun run build",
|
|
28
30
|
"test": "bun test",
|
|
29
31
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
34
|
+
"@inbrowser/model": "^0.2.0",
|
|
32
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
33
36
|
"@opentui/core": "^0.1.0",
|
|
34
37
|
"@opentui/react": "^0.1.0",
|