agent-neckbeard 1.1.28 → 1.1.30

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 (51) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +28 -30
  3. package/dist/archil.d.ts +73 -0
  4. package/dist/archil.js +673 -0
  5. package/dist/build.cjs +129 -5160
  6. package/dist/build.d.cts +9 -5
  7. package/dist/build.d.ts +9 -5
  8. package/dist/build.js +4 -6
  9. package/dist/{chunk-JF5YPOBY.js → chunk-FHNQ5DNA.js} +3235 -511
  10. package/dist/{chunk-M7XNBKG4.js → chunk-I5GIWADK.js} +29 -7
  11. package/dist/chunk-I5NULOJP.js +129 -0
  12. package/dist/chunk-PKUGXECR.js +13 -0
  13. package/dist/chunk-QA4L7ZI2.js +72 -0
  14. package/dist/{chunk-KG6SJM74.js → chunk-VHBDBB3N.js} +8 -5
  15. package/dist/cli.cjs +124 -5154
  16. package/dist/cli.js +7 -8
  17. package/dist/define-gdmBe9RA.d.ts +227 -0
  18. package/dist/durable.d.ts +53 -0
  19. package/dist/durable.js +92 -0
  20. package/dist/index.cjs +720 -833
  21. package/dist/index.d.cts +139 -78
  22. package/dist/index.d.ts +139 -78
  23. package/dist/index.js +12 -11
  24. package/dist/inside.d.ts +15 -0
  25. package/dist/inside.js +530 -0
  26. package/dist/{invoke-client-P2CPBYTF.js → invoke-client-QB2NTZ3L.js} +1 -2
  27. package/dist/pi-watch-legacy.d.ts +4503 -0
  28. package/dist/serve.cjs +9 -309
  29. package/dist/serve.d.cts +14 -1
  30. package/dist/serve.d.ts +14 -1
  31. package/dist/serve.js +3 -5
  32. package/docs/AGENT.md +95 -59
  33. package/docs/DAYTONA.md +2 -0
  34. package/docs/DOCKER.md +0 -1
  35. package/docs/E2B.md +1 -1
  36. package/docs/LEGACY.md +1 -8
  37. package/docs/MODAL.md +1 -1
  38. package/package.json +57 -23
  39. package/types/pi-watch.d.cts +68 -0
  40. package/dist/chunk-33IXN6MM.js +0 -21
  41. package/dist/chunk-6P5I7ZCH.js +0 -2552
  42. package/dist/chunk-M3FISP7J.js +0 -377
  43. package/dist/sandbox-capabilities-CFjnZ_kB.d.cts +0 -77
  44. package/dist/sandbox-capabilities-CFjnZ_kB.d.ts +0 -77
  45. package/dist/serve-Dan1HQKN.d.cts +0 -89
  46. package/dist/serve-Dan1HQKN.d.ts +0 -89
  47. package/dist/supervisor.cjs +0 -5731
  48. package/dist/supervisor.d.cts +0 -482
  49. package/dist/supervisor.d.ts +0 -482
  50. package/dist/supervisor.js +0 -3187
  51. package/docs/SUPERVISOR.md +0 -258
@@ -1,89 +0,0 @@
1
- /**
2
- * Wire contract between `Agent` on the host and `serve()` in the sandbox. See docs/AGENT.md.
3
- */
4
- declare const TURN_PROTOCOL_VERSION = 2;
5
- /** One record of a turn's stream. `seq` starts at 0 and increases by one per record. */
6
- type TurnRecord<TEvent = unknown> = {
7
- seq: number;
8
- type: 'event';
9
- event: TEvent;
10
- } | {
11
- seq: number;
12
- type: 'end';
13
- outcome: TurnOutcome;
14
- error?: string;
15
- };
16
- type TurnOutcome = 'completed' | 'aborted' | 'failed';
17
- interface StartTurnRequest {
18
- /** Caller-chosen, stable per turn, so a retried start never runs the turn twice. */
19
- turnId: string;
20
- message: string;
21
- /** Set in the agent's `process.env` for this turn only, then restored. */
22
- env?: Record<string, string>;
23
- }
24
- interface TurnHealth {
25
- ok: true;
26
- protocolVersion: number;
27
- busy: boolean;
28
- turnId: string | null;
29
- }
30
- type PiTurnResult = {
31
- completed: true;
32
- text: string | null;
33
- } | {
34
- completed: false;
35
- error: string;
36
- };
37
- /**
38
- * How a turn of a Pi session ended, from its records: completed when they include its `end`
39
- * record, the turn ended normally, and its last assistant message stopped on its own, with that
40
- * message's text. Records without an `end` record have not shown how the turn ended.
41
- */
42
- declare function getPiTurnResult(records: readonly TurnRecord[]): PiTurnResult;
43
-
44
- /** The parts of a Pi `AgentSession` the bridge drives. */
45
- interface ServedSession {
46
- subscribe(listener: (event: unknown) => void): () => void;
47
- prompt(text: string): Promise<void>;
48
- abort(): Promise<void>;
49
- /**
50
- * Runs once each turn's outcome is known: outside its deadline, so it can't fail the turn, and
51
- * before its end record, so a host that deletes the sandbox at the end loses nothing, as when
52
- * sending the turn's trace. An abort that arrives meanwhile changes nothing. Keep it bounded; it
53
- * delays the end record. Its errors are ignored.
54
- */
55
- afterTurn?(): Promise<void>;
56
- }
57
- interface ServeOptions {
58
- /** Creates the agent's session before its first turn; the session is reused for every later turn. */
59
- createSession(): Promise<ServedSession>;
60
- /** Converts a session event for the wire. Defaults to Pi's JSON event form. */
61
- toWireEvent?: (event: unknown) => unknown;
62
- /** Defaults to `NECKBEARD_PORT`, then 8080. */
63
- port?: number;
64
- host?: string;
65
- /** Aborts a turn that runs longer, ending it `failed`. */
66
- maxTurnDurationMs?: number;
67
- /**
68
- * How long an aborted or timed-out turn may take to stop before its end record is written anyway,
69
- * since Pi waits for a running tool. The runtime stays busy until the prompt returns. Defaults to 10 seconds.
70
- */
71
- abortGraceMs?: number;
72
- }
73
- interface ServeHandle {
74
- port: number;
75
- close(): Promise<void>;
76
- }
77
- /**
78
- * Pi's JSON event form, which its JSON and RPC modes write: `message_update` drops the
79
- * cumulative `partial` message, which the deltas rebuild, and keeps the usage.
80
- */
81
- declare function toPiJsonEvent(event: unknown): unknown;
82
- /**
83
- * Serves a Pi session over HTTP for `Agent` on the host. Run it as the sandbox image's main
84
- * process. One turn runs at a time, a turn keeps running when its stream disconnects, and a
85
- * stream resumes from any `seq` of the current or previous turn.
86
- */
87
- declare function serve(options: ServeOptions): Promise<ServeHandle>;
88
-
89
- export { type PiTurnResult as P, type StartTurnRequest as S, type TurnRecord as T, type TurnHealth as a, type ServedSession as b, type ServeHandle as c, TURN_PROTOCOL_VERSION as d, type TurnOutcome as e, type ServeOptions as f, getPiTurnResult as g, serve as s, toPiJsonEvent as t };