@avasapp/agent-bridge 0.2.0 → 0.4.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.
Files changed (35) hide show
  1. package/README.md +220 -20
  2. package/dist/adapters/ably.cjs +22 -4
  3. package/dist/adapters/ably.d.cts +8 -1
  4. package/dist/adapters/expo-router.cjs +22 -1
  5. package/dist/adapters/expo-router.d.cts +5 -1
  6. package/dist/adapters/react-native-mmkv.cjs +1 -0
  7. package/dist/adapters/react-native-mmkv.d.cts +1 -1
  8. package/dist/adapters/react-native-webview.cjs +672 -0
  9. package/dist/adapters/react-native-webview.d.cts +79 -0
  10. package/dist/adapters/socket-io.cjs +3 -1
  11. package/dist/adapters/socket-io.d.cts +1 -1
  12. package/dist/adapters/tanstack-query.cjs +256 -17
  13. package/dist/adapters/tanstack-query.d.cts +1 -1
  14. package/dist/adapters/zustand.cjs +152 -12
  15. package/dist/adapters/zustand.d.cts +19 -3
  16. package/dist/{chunk-LBYZ5JHF.js → chunk-AJD3XTNT.js} +329 -46
  17. package/dist/cli.js +848 -98
  18. package/dist/client/index.cjs +311 -47
  19. package/dist/client/index.d.ts +64 -3
  20. package/dist/client/index.js +5 -3
  21. package/dist/expo/index.d.cts +1 -1
  22. package/dist/network/index.cjs +434 -66
  23. package/dist/network/index.d.cts +53 -3
  24. package/dist/noop/index.cjs +12 -0
  25. package/dist/noop/network.cjs +7 -1
  26. package/dist/noop/react-native-webview.cjs +31 -0
  27. package/dist/realtime/index.cjs +2 -1
  28. package/dist/realtime/index.d.cts +3 -1
  29. package/dist/runtime/index.cjs +1067 -111
  30. package/dist/runtime/index.d.cts +51 -5
  31. package/dist/types-BmpykP1P.d.cts +137 -0
  32. package/entries/react-native-webview.cjs +9 -0
  33. package/package.json +18 -6
  34. package/skills/agent-bridge/SKILL.md +226 -8
  35. package/dist/types-C6DUUHnB.d.cts +0 -76
@@ -1,76 +0,0 @@
1
- /** `agent-bridge assert-absent` fails when a bundle contains this string. */
2
- declare const RUNTIME_MARKER = "@avasapp/agent-bridge/runtime";
3
- type CallMessage = {
4
- id: string;
5
- tool: string;
6
- args?: unknown[];
7
- /** Device to run on. Expo's socket broadcasts, so every app sees every call. */
8
- to?: string;
9
- };
10
- /** An error or warning the app logged, threw or left unhandled. */
11
- type LogEntry = {
12
- level: 'error' | 'warn';
13
- message: string;
14
- /** First lines of the stack, when there was an Error. */
15
- stack?: string;
16
- /** Date.now() in the app. */
17
- at: number;
18
- /** The tool that was running when it was logged. */
19
- during?: string;
20
- /** Otherwise, the last tool that had finished. */
21
- after?: string;
22
- };
23
- /** `logs`: errors the app recorded since its previous reply. Old clients ignore it. */
24
- type ResultMessage = ({
25
- id: string;
26
- from: string;
27
- ok: true;
28
- value: unknown;
29
- ms: number;
30
- } | {
31
- id: string;
32
- from: string;
33
- ok: false;
34
- error: string;
35
- ms: number;
36
- }) & {
37
- logs?: LogEntry[];
38
- };
39
- type ToolInfo = {
40
- name: string;
41
- description?: string;
42
- };
43
- type DeviceInfo = {
44
- deviceId: string;
45
- name: string;
46
- platform: string;
47
- protocol: number;
48
- tools: ToolInfo[];
49
- };
50
-
51
- type ToolFn = (...args: any[]) => unknown;
52
- type ToolDefinition = ToolFn | {
53
- description?: string;
54
- run: ToolFn;
55
- };
56
- /** Tools by name. Namespace them with a dot, e.g. `query.pin`. */
57
- type Tools = Record<string, ToolDefinition>;
58
- type TransportContext = {
59
- info: () => DeviceInfo;
60
- dispatch: (call: CallMessage) => Promise<ResultMessage>;
61
- };
62
- type Transport = {
63
- name: string;
64
- /** Starts listening; returns a function that stops. */
65
- start: (context: TransportContext) => () => void;
66
- };
67
- type AgentBridgeOptions = {
68
- /** Your tools, or a function returning them (read on every call). */
69
- tools?: Tools | (() => Tools);
70
- /** How this app shows up in `agent-bridge devices`. */
71
- name?: string;
72
- /** Defaults to CDP only. Add `expoTransport()` on Expo. */
73
- transports?: Transport[];
74
- };
75
-
76
- export { type AgentBridgeOptions as A, type CallMessage as C, type DeviceInfo as D, type LogEntry as L, RUNTIME_MARKER as R, type Tools as T, type Transport as a, type ResultMessage as b, type ToolDefinition as c, type ToolFn as d, type ToolInfo as e };