@inbrowser/agent 0.0.0-placeholder → 0.2.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/AGENTS.md +270 -0
- package/LICENSE +21 -0
- package/README.md +117 -2
- package/bin/agent.ts +10 -0
- package/dist/cli/commands/describe.d.ts +14 -0
- package/dist/cli/commands/describe.d.ts.map +1 -0
- package/dist/cli/commands/describe.js +179 -0
- package/dist/cli/commands/describe.js.map +1 -0
- package/dist/cli/commands/events.d.ts +21 -0
- package/dist/cli/commands/events.d.ts.map +1 -0
- package/dist/cli/commands/events.js +59 -0
- package/dist/cli/commands/events.js.map +1 -0
- package/dist/cli/commands/fleet.d.ts +15 -0
- package/dist/cli/commands/fleet.d.ts.map +1 -0
- package/dist/cli/commands/fleet.js +149 -0
- package/dist/cli/commands/fleet.js.map +1 -0
- package/dist/cli/commands/help.d.ts +15 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +93 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +27 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +109 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/run.d.ts +38 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +535 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/schema.d.ts +8 -0
- package/dist/cli/commands/schema.d.ts.map +1 -0
- package/dist/cli/commands/schema.js +12 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +39 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +65 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/undo.d.ts +36 -0
- package/dist/cli/commands/undo.d.ts.map +1 -0
- package/dist/cli/commands/undo.js +132 -0
- package/dist/cli/commands/undo.js.map +1 -0
- package/dist/cli/fixtures.d.ts +17 -0
- package/dist/cli/fixtures.d.ts.map +1 -0
- package/dist/cli/fixtures.js +107 -0
- package/dist/cli/fixtures.js.map +1 -0
- package/dist/cli/hardening.d.ts +39 -0
- package/dist/cli/hardening.d.ts.map +1 -0
- package/dist/cli/hardening.js +68 -0
- package/dist/cli/hardening.js.map +1 -0
- package/dist/cli/index.d.ts +28 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/llm/openrouter.d.ts +33 -0
- package/dist/cli/llm/openrouter.d.ts.map +1 -0
- package/dist/cli/llm/openrouter.js +285 -0
- package/dist/cli/llm/openrouter.js.map +1 -0
- package/dist/cli/main.d.ts +32 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +106 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/output.d.ts +36 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +95 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/parse.d.ts +26 -0
- package/dist/cli/parse.d.ts.map +1 -0
- package/dist/cli/parse.js +160 -0
- package/dist/cli/parse.js.map +1 -0
- package/dist/cli/session-log.d.ts +34 -0
- package/dist/cli/session-log.d.ts.map +1 -0
- package/dist/cli/session-log.js +52 -0
- package/dist/cli/session-log.js.map +1 -0
- package/dist/cli/spec.d.ts +62 -0
- package/dist/cli/spec.d.ts.map +1 -0
- package/dist/cli/spec.js +510 -0
- package/dist/cli/spec.js.map +1 -0
- package/dist/cli/ui/RunView.d.ts +134 -0
- package/dist/cli/ui/RunView.d.ts.map +1 -0
- package/dist/cli/ui/RunView.js +341 -0
- package/dist/cli/ui/RunView.js.map +1 -0
- package/dist/diagnostics/index.d.ts +5 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +3 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/timing.d.ts +48 -0
- package/dist/diagnostics/timing.d.ts.map +1 -0
- package/dist/diagnostics/timing.js +85 -0
- package/dist/diagnostics/timing.js.map +1 -0
- package/dist/diagnostics/truthfulness.d.ts +36 -0
- package/dist/diagnostics/truthfulness.d.ts.map +1 -0
- package/dist/diagnostics/truthfulness.js +180 -0
- package/dist/diagnostics/truthfulness.js.map +1 -0
- package/dist/dispatch-memoization.d.ts +84 -0
- package/dist/dispatch-memoization.d.ts.map +1 -0
- package/dist/dispatch-memoization.js +197 -0
- package/dist/dispatch-memoization.js.map +1 -0
- package/dist/eval/comparison-report.d.ts +164 -0
- package/dist/eval/comparison-report.d.ts.map +1 -0
- package/dist/eval/comparison-report.js +316 -0
- package/dist/eval/comparison-report.js.map +1 -0
- package/dist/eval/fixture.d.ts +74 -0
- package/dist/eval/fixture.d.ts.map +1 -0
- package/dist/eval/fixture.js +217 -0
- package/dist/eval/fixture.js.map +1 -0
- package/dist/eval/index.d.ts +13 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +7 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/load-node.d.ts +16 -0
- package/dist/eval/load-node.d.ts.map +1 -0
- package/dist/eval/load-node.js +58 -0
- package/dist/eval/load-node.js.map +1 -0
- package/dist/eval/metric-collector.d.ts +209 -0
- package/dist/eval/metric-collector.d.ts.map +1 -0
- package/dist/eval/metric-collector.js +293 -0
- package/dist/eval/metric-collector.js.map +1 -0
- package/dist/eval/run-record.d.ts +76 -0
- package/dist/eval/run-record.d.ts.map +1 -0
- package/dist/eval/run-record.js +32 -0
- package/dist/eval/run-record.js.map +1 -0
- package/dist/eval/runner.d.ts +140 -0
- package/dist/eval/runner.d.ts.map +1 -0
- package/dist/eval/runner.js +310 -0
- package/dist/eval/runner.js.map +1 -0
- package/dist/eval/spec-framework.d.ts +113 -0
- package/dist/eval/spec-framework.d.ts.map +1 -0
- package/dist/eval/spec-framework.js +100 -0
- package/dist/eval/spec-framework.js.map +1 -0
- package/dist/eval/spec-helpers.d.ts +245 -0
- package/dist/eval/spec-helpers.d.ts.map +1 -0
- package/dist/eval/spec-helpers.js +605 -0
- package/dist/eval/spec-helpers.js.map +1 -0
- package/dist/events/codec.d.ts +79 -0
- package/dist/events/codec.d.ts.map +1 -0
- package/dist/events/codec.js +142 -0
- package/dist/events/codec.js.map +1 -0
- package/dist/events/log-core.d.ts +76 -0
- package/dist/events/log-core.d.ts.map +1 -0
- package/dist/events/log-core.js +73 -0
- package/dist/events/log-core.js.map +1 -0
- package/dist/events/log.d.ts +60 -0
- package/dist/events/log.d.ts.map +1 -0
- package/dist/events/log.js +193 -0
- package/dist/events/log.js.map +1 -0
- package/dist/events/replay.d.ts +106 -0
- package/dist/events/replay.d.ts.map +1 -0
- package/dist/events/replay.js +137 -0
- package/dist/events/replay.js.map +1 -0
- package/dist/events/wrap.d.ts +100 -0
- package/dist/events/wrap.d.ts.map +1 -0
- package/dist/events/wrap.js +141 -0
- package/dist/events/wrap.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/llm-adapter.d.ts +96 -0
- package/dist/llm-adapter.d.ts.map +1 -0
- package/dist/llm-adapter.js +132 -0
- package/dist/llm-adapter.js.map +1 -0
- package/dist/mcp/serve.d.ts +70 -0
- package/dist/mcp/serve.d.ts.map +1 -0
- package/dist/mcp/serve.js +154 -0
- package/dist/mcp/serve.js.map +1 -0
- package/dist/metrics/runs.d.ts +58 -0
- package/dist/metrics/runs.d.ts.map +1 -0
- package/dist/metrics/runs.js +99 -0
- package/dist/metrics/runs.js.map +1 -0
- package/dist/metrics.d.ts +38 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +123 -0
- package/dist/metrics.js.map +1 -0
- package/dist/node.d.ts +23 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +23 -0
- package/dist/node.js.map +1 -0
- package/dist/planner-executor.d.ts +132 -0
- package/dist/planner-executor.d.ts.map +1 -0
- package/dist/planner-executor.js +274 -0
- package/dist/planner-executor.js.map +1 -0
- package/dist/session.d.ts +10 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +179 -0
- package/dist/session.js.map +1 -0
- package/dist/skill-catalog.d.ts +81 -0
- package/dist/skill-catalog.d.ts.map +1 -0
- package/dist/skill-catalog.js +388 -0
- package/dist/skill-catalog.js.map +1 -0
- package/dist/skill-router.d.ts +95 -0
- package/dist/skill-router.d.ts.map +1 -0
- package/dist/skill-router.js +130 -0
- package/dist/skill-router.js.map +1 -0
- package/dist/storage.d.ts +14 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +58 -0
- package/dist/storage.js.map +1 -0
- package/dist/strategy.d.ts +45 -0
- package/dist/strategy.d.ts.map +1 -0
- package/dist/strategy.js +520 -0
- package/dist/strategy.js.map +1 -0
- package/dist/tools.d.ts +40 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +147 -0
- package/dist/tools.js.map +1 -0
- package/dist/types/agent.d.ts +94 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +17 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/capabilities.d.ts +17 -0
- package/dist/types/capabilities.d.ts.map +1 -0
- package/dist/types/capabilities.js +13 -0
- package/dist/types/capabilities.js.map +1 -0
- package/dist/types/chat.d.ts +74 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/chat.js +10 -0
- package/dist/types/chat.js.map +1 -0
- package/dist/types/events.d.ts +115 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +30 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/llm.d.ts +89 -0
- package/dist/types/llm.d.ts.map +1 -0
- package/dist/types/llm.js +12 -0
- package/dist/types/llm.js.map +1 -0
- package/dist/types/metrics.d.ts +34 -0
- package/dist/types/metrics.d.ts.map +1 -0
- package/dist/types/metrics.js +10 -0
- package/dist/types/metrics.js.map +1 -0
- package/dist/types/observer.d.ts +41 -0
- package/dist/types/observer.d.ts.map +1 -0
- package/dist/types/observer.js +41 -0
- package/dist/types/observer.js.map +1 -0
- package/dist/types/project-context.d.ts +18 -0
- package/dist/types/project-context.d.ts.map +1 -0
- package/dist/types/project-context.js +11 -0
- package/dist/types/project-context.js.map +1 -0
- package/dist/types/runtime.d.ts +71 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +21 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/session.d.ts +103 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +11 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/storage.d.ts +20 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +41 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/types/strategy.d.ts +124 -0
- package/dist/types/strategy.d.ts.map +1 -0
- package/dist/types/strategy.js +10 -0
- package/dist/types/strategy.js.map +1 -0
- package/dist/types/tools.d.ts +154 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +11 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/trace.d.ts +175 -0
- package/dist/types/trace.d.ts.map +1 -0
- package/dist/types/trace.js +26 -0
- package/dist/types/trace.js.map +1 -0
- package/dist/types/workspace.d.ts +29 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types/workspace.js +18 -0
- package/dist/types/workspace.js.map +1 -0
- package/package.json +45 -14
- package/skills/agent-cli.md +218 -0
- package/index.js +0 -2
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry + dispatch + handler types.
|
|
3
|
+
*
|
|
4
|
+
* The `ToolRegistry` is a configuration concern (what tools exist);
|
|
5
|
+
* `ToolDispatch` is a runtime concern (run the named one against this
|
|
6
|
+
* context). Splitting them lets a host wire the catalog at startup
|
|
7
|
+
* with `registry.register(handler)` and lets concurrent sessions
|
|
8
|
+
* share a stateless dispatcher.
|
|
9
|
+
*/
|
|
10
|
+
import type { Capabilities } from './capabilities.js';
|
|
11
|
+
import type { JsonSchema } from './llm.js';
|
|
12
|
+
import type { RuntimeState } from './runtime.js';
|
|
13
|
+
import type { StitchContext, Workspace } from './workspace.js';
|
|
14
|
+
export interface ToolHandler<A = unknown, D = unknown> {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
parameters: JsonSchema;
|
|
18
|
+
/** Capability gate — handler is excluded from `list()` when this returns false. */
|
|
19
|
+
available?(capabilities: Capabilities): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Opt-in: the dispatcher is allowed to run this tool concurrently with
|
|
22
|
+
* other `parallelSafe` tools issued in the same turn. Absent or `false`
|
|
23
|
+
* means the conservative default — the dispatcher treats it as not safe
|
|
24
|
+
* to parallelize. Read this field via {@link isParallelSafe} so the
|
|
25
|
+
* default is applied uniformly. Pure-tool dispatchers (parallel
|
|
26
|
+
* scheduling) consume this; tag-only branches do not change runtime
|
|
27
|
+
* behavior.
|
|
28
|
+
*/
|
|
29
|
+
parallelSafe?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Opt-in: calling this tool with the same arguments against the same
|
|
32
|
+
* workspace state always produces the same result, so a content-addressed
|
|
33
|
+
* cache may serve repeat calls. Absent or `false` means the conservative
|
|
34
|
+
* default — the dispatch layer must execute the handler every call. Read
|
|
35
|
+
* this field via {@link isPure} so the default is applied uniformly.
|
|
36
|
+
*/
|
|
37
|
+
pure?: boolean;
|
|
38
|
+
execute(args: A, ctx: ToolContext): Promise<ToolResult<D>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Session-scoped context handed to every tool's `execute`. Kept
|
|
42
|
+
* narrow per F8 — only `signal` is required; everything else is
|
|
43
|
+
* optional so headless hosts (Deployment Agent, MCP server) don't
|
|
44
|
+
* have to mock playground-shaped state.
|
|
45
|
+
*
|
|
46
|
+
* Per F2 + F5, factories capture their own deps at construction
|
|
47
|
+
* time (closure) and tool handlers only read from {deps, args, ctx}.
|
|
48
|
+
* Don't grow this interface to satisfy specific factories.
|
|
49
|
+
*/
|
|
50
|
+
export interface ToolContext {
|
|
51
|
+
/** Cancellation signal — tools should respect it for long-running ops. */
|
|
52
|
+
signal: AbortSignal;
|
|
53
|
+
/** Playground / session workspace (rules source, agent JS, etc.). */
|
|
54
|
+
workspace?: Workspace;
|
|
55
|
+
/** Playground / session runtime state (last sandbox run, etc.). */
|
|
56
|
+
runtime?: RuntimeState;
|
|
57
|
+
/** Per-session sandbox handle, when the host has one. */
|
|
58
|
+
sandbox?: SandboxHandle;
|
|
59
|
+
/** Pure-function lint, injected for testability. */
|
|
60
|
+
lint?: LintFn;
|
|
61
|
+
/** Optional Stitch client — absent when capability disables it. */
|
|
62
|
+
stitch?: StitchClient;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Minimal sandbox surface tools need. The host injects a concrete
|
|
66
|
+
* adapter (today: `@pyric/sandbox` runner). Kept narrow so tool tests
|
|
67
|
+
* can stub it without pulling in the whole sandbox package.
|
|
68
|
+
*/
|
|
69
|
+
export interface SandboxHandle {
|
|
70
|
+
run(code: string, signal?: AbortSignal): Promise<{
|
|
71
|
+
ok: boolean;
|
|
72
|
+
durationMs: number;
|
|
73
|
+
docsTouched: number;
|
|
74
|
+
errors: number;
|
|
75
|
+
entries: unknown[];
|
|
76
|
+
}>;
|
|
77
|
+
deployRules(source: string): Promise<{
|
|
78
|
+
ok: boolean;
|
|
79
|
+
messages: {
|
|
80
|
+
severity: 'info' | 'warn' | 'error';
|
|
81
|
+
text: string;
|
|
82
|
+
line?: number;
|
|
83
|
+
column?: number;
|
|
84
|
+
}[];
|
|
85
|
+
}>;
|
|
86
|
+
readState(opts?: {
|
|
87
|
+
path?: string;
|
|
88
|
+
maxDepth?: number;
|
|
89
|
+
}): Promise<unknown>;
|
|
90
|
+
reseed(opts: {
|
|
91
|
+
presetId: string;
|
|
92
|
+
}): void;
|
|
93
|
+
dispose(): void;
|
|
94
|
+
}
|
|
95
|
+
export type LintFn = (source: string) => {
|
|
96
|
+
warnings: LintWarning[];
|
|
97
|
+
};
|
|
98
|
+
export interface LintWarning {
|
|
99
|
+
severity: 'info' | 'warn' | 'error';
|
|
100
|
+
message: string;
|
|
101
|
+
line?: number;
|
|
102
|
+
column?: number;
|
|
103
|
+
}
|
|
104
|
+
/** Optional Stitch design client. Absent in headless / capability-off runs. */
|
|
105
|
+
export interface StitchClient {
|
|
106
|
+
hasKey(): boolean;
|
|
107
|
+
context(): StitchContext;
|
|
108
|
+
}
|
|
109
|
+
export interface ToolResult<D = unknown> {
|
|
110
|
+
ok: boolean;
|
|
111
|
+
/** One-line human-readable summary the model can quote back. */
|
|
112
|
+
summary: string;
|
|
113
|
+
data?: D;
|
|
114
|
+
/** Patches applied by the session to its own state. */
|
|
115
|
+
workspacePatch?: Partial<Workspace>;
|
|
116
|
+
runtimePatch?: Partial<RuntimeState>;
|
|
117
|
+
}
|
|
118
|
+
export interface ToolCall {
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
args: unknown;
|
|
122
|
+
}
|
|
123
|
+
export interface ToolRegistry {
|
|
124
|
+
/**
|
|
125
|
+
* Register a new handler. **Throws** if `handler.name` is already
|
|
126
|
+
* present — catches the "accidentally registered two factories
|
|
127
|
+
* with overlapping tools" footgun (F6). Use `replace` for explicit
|
|
128
|
+
* overlays.
|
|
129
|
+
*/
|
|
130
|
+
register(handler: ToolHandler): void;
|
|
131
|
+
/**
|
|
132
|
+
* Idempotent registration. Replaces an existing handler with the
|
|
133
|
+
* same name, or registers fresh. The standard shape for
|
|
134
|
+
* decoration via `.map` before register (F7):
|
|
135
|
+
*
|
|
136
|
+
* ```ts
|
|
137
|
+
* for (const t of createXxxTools(deps).map(wrapMutating)) {
|
|
138
|
+
* registry.register(t); // or replace(t) if re-wrapping
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
replace(handler: ToolHandler): void;
|
|
143
|
+
unregister(name: string): boolean;
|
|
144
|
+
list(opts?: {
|
|
145
|
+
capabilities?: Capabilities;
|
|
146
|
+
}): ToolHandler[];
|
|
147
|
+
has(name: string): boolean;
|
|
148
|
+
/** Copy-on-write fork for per-session catalog overrides. */
|
|
149
|
+
fork(): ToolRegistry;
|
|
150
|
+
}
|
|
151
|
+
export interface ToolDispatch {
|
|
152
|
+
execute(call: ToolCall, ctx: ToolContext): Promise<ToolResult>;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,mFAAmF;IACnF,SAAS,CAAC,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC;IAChD;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5D;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,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GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAChE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry + dispatch + handler types.
|
|
3
|
+
*
|
|
4
|
+
* The `ToolRegistry` is a configuration concern (what tools exist);
|
|
5
|
+
* `ToolDispatch` is a runtime concern (run the named one against this
|
|
6
|
+
* context). Splitting them lets a host wire the catalog at startup
|
|
7
|
+
* with `registry.register(handler)` and lets concurrent sessions
|
|
8
|
+
* share a stateless dispatcher.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-loop request/response trace surface.
|
|
3
|
+
*
|
|
4
|
+
* Captures the exact shape of every LLM request the strategy
|
|
5
|
+
* dispatches — system prompt + messages + tool decls + model — at
|
|
6
|
+
* the layer the agent author thinks in (`@inbrowser/agent` types), not
|
|
7
|
+
* the provider-specific transform below it. A provider-level trace
|
|
8
|
+
* (Gemini's `GeminiBody`, OpenRouter's `messages[].content` parts)
|
|
9
|
+
* is a complementary concern that belongs to `@inbrowser/relay`;
|
|
10
|
+
* this surface is for "what did the model see, in agent terms."
|
|
11
|
+
*
|
|
12
|
+
* Emission is opt-in. A `Tracer` plugs into `AgentSessionConfig`
|
|
13
|
+
* (which threads it through `StrategyRunInput`); strategies that
|
|
14
|
+
* support tracing call `tracer.emit(...)` at well-defined moments.
|
|
15
|
+
* Strategies without a tracer field — or sessions that don't pass
|
|
16
|
+
* one — incur zero cost.
|
|
17
|
+
*
|
|
18
|
+
* Phase 1 captures `llm_request` only (the priority the playground
|
|
19
|
+
* needs to ship a prompt visualizer). `llm_response` and
|
|
20
|
+
* `turn_dispatch_complete` complete the per-iteration wall-clock
|
|
21
|
+
* triple — request-dispatched, response-completed, tool-dispatch-
|
|
22
|
+
* completed — that the eval harness uses to split language-model
|
|
23
|
+
* time from tool-dispatch time.
|
|
24
|
+
*/
|
|
25
|
+
import type { NormalizedMessage } from './chat.js';
|
|
26
|
+
/**
|
|
27
|
+
* Wire-level snapshot of a single LLM request as it leaves the
|
|
28
|
+
* strategy. Captured exactly once per ReAct iteration — N times per
|
|
29
|
+
* user prompt, where N >= 1 (final-answer turn) and grows by 1 per
|
|
30
|
+
* tool-using iteration.
|
|
31
|
+
*/
|
|
32
|
+
export interface LlmRequestTrace {
|
|
33
|
+
/** Stable per-iteration id, scoped to its session. The recommended
|
|
34
|
+
* format is `${turnId}#${iteration}`; the agent loop generates
|
|
35
|
+
* the value, hosts treat it as opaque. */
|
|
36
|
+
requestId: string;
|
|
37
|
+
/** The session-scoped turn id (matches `SessionEvent.turnId`). */
|
|
38
|
+
turnId: string;
|
|
39
|
+
/** 0-indexed ReAct iteration within this turn. */
|
|
40
|
+
iteration: number;
|
|
41
|
+
/** Wall-clock ms captured immediately before the strategy hands
|
|
42
|
+
* the request to `LlmClient.chat()`. Pair with
|
|
43
|
+
* `LlmResponseTrace.ts` (response completed) and
|
|
44
|
+
* `TurnDispatchCompleteTrace.ts` (tool dispatch completed) to
|
|
45
|
+
* derive the language-model vs tool-dispatch wall-clock split for
|
|
46
|
+
* this iteration. */
|
|
47
|
+
ts: number;
|
|
48
|
+
/** The system-prompt string the strategy received from
|
|
49
|
+
* `StrategyRunInput.systemPrompt`. Captured verbatim. */
|
|
50
|
+
systemPrompt: string;
|
|
51
|
+
/** The messages array exactly as the provider will see it. Includes
|
|
52
|
+
* the synthesized leading system message, the prior history, the
|
|
53
|
+
* current user prompt, and any assistant+tool entries the ReAct
|
|
54
|
+
* loop appended this turn. */
|
|
55
|
+
messages: NormalizedMessage[];
|
|
56
|
+
/** Tool declarations as filtered + shaped by the strategy. The
|
|
57
|
+
* `parameters` value is captured opaquely — providers normalize
|
|
58
|
+
* it (Gemini sanitizes; OpenRouter is permissive), so the trace
|
|
59
|
+
* shows the pre-provider canonical view. */
|
|
60
|
+
tools: ToolDeclarationView[];
|
|
61
|
+
/** Agent-loop-level model identity. The host enriches this with
|
|
62
|
+
* provider label / model label / temperature / reasoning-effort
|
|
63
|
+
* at consumption time — those values aren't visible to the
|
|
64
|
+
* strategy. */
|
|
65
|
+
llm: {
|
|
66
|
+
id: string;
|
|
67
|
+
supportsTools: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Tool-decl row as the agent loop produced it pre-provider. Mirrors
|
|
72
|
+
* the `toolDecls` shape strategy.ts builds when constructing the
|
|
73
|
+
* `ChatRequest`. Not coupled to the in-process `ToolHandler` type —
|
|
74
|
+
* the trace is a wire snapshot, not a live handle.
|
|
75
|
+
*/
|
|
76
|
+
export interface ToolDeclarationView {
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
parameters: unknown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Response-side snapshot. Emitted once per ReAct iteration, paired
|
|
83
|
+
* one-to-one with `LlmRequestTrace` via `requestId`. Captures the
|
|
84
|
+
* full assistant output and the timestamp at which the chat()
|
|
85
|
+
* iterator drained — `ts - LlmRequestTrace.ts` is the iteration's
|
|
86
|
+
* language-model wall-clock segment.
|
|
87
|
+
*/
|
|
88
|
+
export interface LlmResponseTrace {
|
|
89
|
+
/** Same id as the matching `LlmRequestTrace.requestId`. */
|
|
90
|
+
requestId: string;
|
|
91
|
+
/** Wall-clock ms captured immediately after the `chat()` iterator
|
|
92
|
+
* has yielded its terminal event for this iteration (typically
|
|
93
|
+
* `turn_complete`, or `error` on a streaming failure). Not
|
|
94
|
+
* emitted on mid-stream error — callers should treat a missing
|
|
95
|
+
* `llm_response` as "language-model time unknown for this
|
|
96
|
+
* iteration." */
|
|
97
|
+
ts: number;
|
|
98
|
+
/** Full assistant text emitted this iteration. */
|
|
99
|
+
text: string;
|
|
100
|
+
/** Hidden reasoning when the model surfaces it. Empty string for
|
|
101
|
+
* non-reasoning models. */
|
|
102
|
+
thinking: string;
|
|
103
|
+
/** Tool calls the model chose to emit this iteration. */
|
|
104
|
+
toolCalls: {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
args: unknown;
|
|
108
|
+
signature?: string;
|
|
109
|
+
}[];
|
|
110
|
+
/** Provider-reported usage; absent on error / streaming-cancel /
|
|
111
|
+
* for providers that don't surface usage. */
|
|
112
|
+
usage?: {
|
|
113
|
+
promptTokens: number;
|
|
114
|
+
outputTokens: number;
|
|
115
|
+
cachedTokens?: number;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* End-of-iteration tool-dispatch marker. Emitted once per ReAct
|
|
120
|
+
* iteration that actually ran tool calls, immediately after the
|
|
121
|
+
* per-turn dispatch loop drained. Paired one-to-one with
|
|
122
|
+
* `LlmResponseTrace` via `requestId`. NOT emitted for the final
|
|
123
|
+
* assistant turn (no tool calls → no dispatch segment to close).
|
|
124
|
+
*
|
|
125
|
+
* `ts - LlmResponseTrace.ts` is the iteration's tool-dispatch
|
|
126
|
+
* wall-clock segment; `ts - LlmRequestTrace.ts` is the iteration's
|
|
127
|
+
* total wall-clock from request dispatch through tool-result append.
|
|
128
|
+
*
|
|
129
|
+
* Only the aggregate is captured. Per-tool wall-clock can be added
|
|
130
|
+
* later — the existing `tool_call`/`tool_result` events on the
|
|
131
|
+
* strategy event stream are the right place for that, not the
|
|
132
|
+
* trace.
|
|
133
|
+
*/
|
|
134
|
+
export interface TurnDispatchCompleteTrace {
|
|
135
|
+
/** Same id as the matching `LlmRequestTrace.requestId`. */
|
|
136
|
+
requestId: string;
|
|
137
|
+
/** Mirror of `LlmRequestTrace.turnId`, carried for grouping
|
|
138
|
+
* consumers that key by turn rather than by iteration. */
|
|
139
|
+
turnId: string;
|
|
140
|
+
/** 0-indexed ReAct iteration within the turn. Mirrors
|
|
141
|
+
* `LlmRequestTrace.iteration`. */
|
|
142
|
+
iteration: number;
|
|
143
|
+
/** Wall-clock ms captured immediately after the last tool result
|
|
144
|
+
* for this iteration was appended to the messages array, before
|
|
145
|
+
* the loop steps to the next iteration. */
|
|
146
|
+
ts: number;
|
|
147
|
+
/** Number of tool calls executed in this iteration. Always >= 1
|
|
148
|
+
* in practice (an iteration with zero tool calls does not emit
|
|
149
|
+
* this event). */
|
|
150
|
+
toolCallCount: number;
|
|
151
|
+
}
|
|
152
|
+
export type TraceEvent = {
|
|
153
|
+
kind: 'llm_request';
|
|
154
|
+
data: LlmRequestTrace;
|
|
155
|
+
} | {
|
|
156
|
+
kind: 'llm_response';
|
|
157
|
+
data: LlmResponseTrace;
|
|
158
|
+
} | {
|
|
159
|
+
kind: 'turn_dispatch_complete';
|
|
160
|
+
data: TurnDispatchCompleteTrace;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Pluggable trace sink. Hosts implement `emit()` to push events to a
|
|
164
|
+
* UI store, a NDJSON file, an eval harness, etc. The agent loop
|
|
165
|
+
* never inspects the implementation — it just hands off the event.
|
|
166
|
+
*
|
|
167
|
+
* Implementations MUST be synchronous and non-throwing. The agent
|
|
168
|
+
* loop intentionally doesn't `await` emit; surfacing a trace must
|
|
169
|
+
* never delay an LLM dispatch or fail it. If a host needs async
|
|
170
|
+
* work (network ship, etc.), it should queue internally.
|
|
171
|
+
*/
|
|
172
|
+
export interface Tracer {
|
|
173
|
+
emit(event: TraceEvent): void;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/types/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,W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C3D,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-loop request/response trace surface.
|
|
3
|
+
*
|
|
4
|
+
* Captures the exact shape of every LLM request the strategy
|
|
5
|
+
* dispatches — system prompt + messages + tool decls + model — at
|
|
6
|
+
* the layer the agent author thinks in (`@inbrowser/agent` types), not
|
|
7
|
+
* the provider-specific transform below it. A provider-level trace
|
|
8
|
+
* (Gemini's `GeminiBody`, OpenRouter's `messages[].content` parts)
|
|
9
|
+
* is a complementary concern that belongs to `@inbrowser/relay`;
|
|
10
|
+
* this surface is for "what did the model see, in agent terms."
|
|
11
|
+
*
|
|
12
|
+
* Emission is opt-in. A `Tracer` plugs into `AgentSessionConfig`
|
|
13
|
+
* (which threads it through `StrategyRunInput`); strategies that
|
|
14
|
+
* support tracing call `tracer.emit(...)` at well-defined moments.
|
|
15
|
+
* Strategies without a tracer field — or sessions that don't pass
|
|
16
|
+
* one — incur zero cost.
|
|
17
|
+
*
|
|
18
|
+
* Phase 1 captures `llm_request` only (the priority the playground
|
|
19
|
+
* needs to ship a prompt visualizer). `llm_response` and
|
|
20
|
+
* `turn_dispatch_complete` complete the per-iteration wall-clock
|
|
21
|
+
* triple — request-dispatched, response-completed, tool-dispatch-
|
|
22
|
+
* completed — that the eval harness uses to split language-model
|
|
23
|
+
* time from tool-dispatch time.
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/types/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Workspace` — the user-authored half of the playground's state.
|
|
3
|
+
*
|
|
4
|
+
* Pure data. Immutable updates via the `WorkspaceTransitions`
|
|
5
|
+
* functions; no I/O, no React, no `localStorage`. Persistence is the
|
|
6
|
+
* host's job (Zustand in the React IDE, in-memory in the CLI).
|
|
7
|
+
*
|
|
8
|
+
* Distinct from `RuntimeState` (`./runtime.ts`), which holds what the
|
|
9
|
+
* agent's tools have produced — separate concerns, separate types.
|
|
10
|
+
*/
|
|
11
|
+
export interface Workspace {
|
|
12
|
+
/** Identifier of the active preset (e.g. "chess", "lobby", "owner"). */
|
|
13
|
+
presetId: string;
|
|
14
|
+
/** Firestore rules source the user / agent is currently editing. */
|
|
15
|
+
rules: string;
|
|
16
|
+
/** JavaScript code source for the agent's `runCode` tool. */
|
|
17
|
+
code: string;
|
|
18
|
+
/** TSX source for the App-panel rendered preview. */
|
|
19
|
+
appSource: string;
|
|
20
|
+
/** Stitch design context — orthogonal to rules/code/app, but session-scoped. */
|
|
21
|
+
stitch: StitchContext;
|
|
22
|
+
}
|
|
23
|
+
export interface StitchContext {
|
|
24
|
+
projectId: string | null;
|
|
25
|
+
latestScreenUrl: string | null;
|
|
26
|
+
brief: string | null;
|
|
27
|
+
}
|
|
28
|
+
export declare const EMPTY_WORKSPACE: Workspace;
|
|
29
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/types/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,SAMf,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Workspace` — the user-authored half of the playground's state.
|
|
3
|
+
*
|
|
4
|
+
* Pure data. Immutable updates via the `WorkspaceTransitions`
|
|
5
|
+
* functions; no I/O, no React, no `localStorage`. Persistence is the
|
|
6
|
+
* host's job (Zustand in the React IDE, in-memory in the CLI).
|
|
7
|
+
*
|
|
8
|
+
* Distinct from `RuntimeState` (`./runtime.ts`), which holds what the
|
|
9
|
+
* agent's tools have produced — separate concerns, separate types.
|
|
10
|
+
*/
|
|
11
|
+
export const EMPTY_WORKSPACE = Object.freeze({
|
|
12
|
+
presetId: '',
|
|
13
|
+
rules: '',
|
|
14
|
+
code: '',
|
|
15
|
+
appSource: '',
|
|
16
|
+
stitch: Object.freeze({ projectId: null, latestScreenUrl: null, brief: null }),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/types/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqBH,MAAM,CAAC,MAAM,eAAe,GAAc,MAAM,CAAC,MAAM,CAAC;IACtD,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAkB;CAChG,CAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inbrowser/agent",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Agent runtime + CLI. Library exports AgentSession, AgentStrategy, ToolRegistry, LlmClient, 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
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cli": {
|
|
14
|
+
"types": "./dist/cli/index.d.ts",
|
|
15
|
+
"import": "./dist/cli/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./node": {
|
|
18
|
+
"types": "./dist/node.d.ts",
|
|
19
|
+
"import": "./dist/node.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"agent": "./bin/agent.ts"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "bin", "skills", "AGENTS.md", "README.md"],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "bun test",
|
|
29
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
33
|
+
"@opentui/core": "^0.1.0",
|
|
34
|
+
"@opentui/react": "^0.1.0",
|
|
35
|
+
"react": "^19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/bun": "latest",
|
|
39
|
+
"@types/react": "^19.0.0",
|
|
40
|
+
"typescript": "^5.7.0"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/davideast/inbrowser-agent.git",
|
|
45
|
+
"directory": "packages/agent"
|
|
46
|
+
},
|
|
47
|
+
"license": "MIT"
|
|
17
48
|
}
|