@parcha/agentrun-serve 0.1.0-beta.41 → 0.1.0-beta.43

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 (164) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/NOTICE +2 -0
  3. package/README.md +85 -19
  4. package/dist/agent-rows.d.ts +1 -1
  5. package/dist/agents-store.js +3 -1
  6. package/dist/calendar/address.d.ts +49 -0
  7. package/dist/calendar/address.js +153 -0
  8. package/dist/calendar/fetch.d.ts +24 -0
  9. package/dist/calendar/fetch.js +146 -0
  10. package/dist/calendar/ics-faux.d.ts +39 -0
  11. package/dist/calendar/ics-faux.js +236 -0
  12. package/dist/calendar/labels.d.ts +3 -0
  13. package/dist/calendar/labels.js +61 -0
  14. package/dist/calendar/names.d.ts +52 -0
  15. package/dist/calendar/names.js +54 -0
  16. package/dist/calendar/parse.d.ts +108 -0
  17. package/dist/calendar/parse.js +625 -0
  18. package/dist/calendar/routes.d.ts +17 -0
  19. package/dist/calendar/routes.js +81 -0
  20. package/dist/calendar/tools.d.ts +23 -0
  21. package/dist/calendar/tools.js +124 -0
  22. package/dist/cli.js +3 -1
  23. package/dist/computer-record.d.ts +55 -0
  24. package/dist/computer-record.js +315 -0
  25. package/dist/computer-setting.d.ts +1 -0
  26. package/dist/computer-setting.js +15 -2
  27. package/dist/computers.js +2 -14
  28. package/dist/console/assets/index-BrcDSBD8.css +1 -0
  29. package/dist/console/assets/index-Bz6IWncl.js +711 -0
  30. package/dist/console/index.html +2 -2
  31. package/dist/decisions.js +0 -4
  32. package/dist/eval-feed.d.ts +2 -2
  33. package/dist/eval-feed.js +9 -5
  34. package/dist/feed/parse.d.ts +3 -2
  35. package/dist/feed/parse.js +9 -18
  36. package/dist/feed/pointer.d.ts +2 -0
  37. package/dist/feed/pointer.js +17 -0
  38. package/dist/file-types.js +1 -0
  39. package/dist/host-command.d.ts +3 -0
  40. package/dist/host-command.js +18 -0
  41. package/dist/host.d.ts +3 -0
  42. package/dist/host.js +3 -0
  43. package/dist/import-sources.js +25 -5
  44. package/dist/learn/audit.d.ts +123 -0
  45. package/dist/learn/audit.js +159 -0
  46. package/dist/learn/check.d.ts +14 -0
  47. package/dist/learn/check.js +194 -14
  48. package/dist/learn/compile.d.ts +75 -78
  49. package/dist/learn/compile.js +175 -176
  50. package/dist/learn/folder.d.ts +9 -0
  51. package/dist/learn/folder.js +13 -2
  52. package/dist/learn/promote.d.ts +138 -196
  53. package/dist/learn/promote.js +68 -184
  54. package/dist/learn/replay-calls.d.ts +5 -0
  55. package/dist/learn/replay-calls.js +12 -1
  56. package/dist/learn/secrets.d.ts +8 -0
  57. package/dist/learn/secrets.js +12 -0
  58. package/dist/learn/skills.js +2 -4
  59. package/dist/learn/workflow-nodes.d.ts +1 -2
  60. package/dist/learn/workflow-nodes.js +2 -3
  61. package/dist/learned-nodes.d.ts +9 -34
  62. package/dist/learned-nodes.js +11 -23
  63. package/dist/learned-workflow.d.ts +6 -8
  64. package/dist/learned-workflow.js +18 -57
  65. package/dist/learning-batch.d.ts +13 -5
  66. package/dist/learning-batch.js +34 -8
  67. package/dist/learning-cost.d.ts +11 -4
  68. package/dist/learning-cost.js +4 -2
  69. package/dist/learning-routes.js +1 -1
  70. package/dist/learning-setting.d.ts +38 -0
  71. package/dist/learning-setting.js +83 -0
  72. package/dist/learning-words.d.ts +3 -0
  73. package/dist/learning-words.js +3 -0
  74. package/dist/learning.d.ts +3 -2
  75. package/dist/learning.js +5 -3
  76. package/dist/mcp-oauth.d.ts +8 -0
  77. package/dist/mcp-oauth.js +7 -0
  78. package/dist/mcp-private-hosts.d.ts +13 -0
  79. package/dist/mcp-private-hosts.js +16 -0
  80. package/dist/openapi.d.ts +1 -0
  81. package/dist/openapi.js +195 -59
  82. package/dist/run-files.d.ts +6 -2
  83. package/dist/run-files.js +29 -7
  84. package/dist/run-launch.d.ts +6 -3
  85. package/dist/run-launch.js +2 -0
  86. package/dist/run-learning-served.d.ts +2 -2
  87. package/dist/run-reads-over-store.d.ts +5 -1
  88. package/dist/run-reads-over-store.js +8 -4
  89. package/dist/run-recordings.d.ts +20 -0
  90. package/dist/run-recordings.js +133 -0
  91. package/dist/runner/adapter-loop.d.ts +5 -1
  92. package/dist/runner/adapter-loop.js +20 -8
  93. package/dist/runner/adapter-run-spec.d.ts +16 -1
  94. package/dist/runner/adapter-run-spec.js +36 -11
  95. package/dist/runner/audit.d.ts +64 -0
  96. package/dist/runner/audit.js +338 -0
  97. package/dist/runner/beside.js +2 -2
  98. package/dist/runner/cli-run-spec.js +25 -12
  99. package/dist/runner/feedback-round.d.ts +9 -25
  100. package/dist/runner/feedback-round.js +19 -40
  101. package/dist/runner/harness-loops.js +1 -15
  102. package/dist/runner/journal-kinds.d.ts +0 -7
  103. package/dist/runner/journal-kinds.js +0 -7
  104. package/dist/runner/learning-dispatch.d.ts +0 -16
  105. package/dist/runner/learning-dispatch.js +4 -47
  106. package/dist/runner/learning-end.d.ts +62 -13
  107. package/dist/runner/learning-end.js +180 -74
  108. package/dist/runner/learning-factory.d.ts +1 -1
  109. package/dist/runner/learning-factory.js +1 -4
  110. package/dist/runner/learning-loop.d.ts +2 -38
  111. package/dist/runner/learning-loop.js +8 -116
  112. package/dist/runner/main.d.ts +11 -0
  113. package/dist/runner/main.js +30 -3
  114. package/dist/runner/mcp-run.d.ts +2 -2
  115. package/dist/runner/promotion.d.ts +78 -50
  116. package/dist/runner/promotion.js +371 -503
  117. package/dist/runner/reflect-hook.d.ts +15 -0
  118. package/dist/runner/reflect-hook.js +28 -14
  119. package/dist/runner/store-secrets.js +3 -1
  120. package/dist/runner/workflow-first.d.ts +6 -11
  121. package/dist/runner/workflow-first.js +24 -25
  122. package/dist/runs-over-store.d.ts +1 -1
  123. package/dist/sdk/runs.js +2 -1
  124. package/dist/secrets.js +2 -2
  125. package/dist/server.d.ts +4 -3
  126. package/dist/server.js +132 -26
  127. package/dist/store/agent-body.d.ts +5 -3
  128. package/dist/store/agent-body.js +14 -10
  129. package/dist/store/sqlite/store.js +1 -0
  130. package/dist/store/store.d.ts +3 -0
  131. package/dist/store-reads/learning.d.ts +18 -7
  132. package/dist/store-reads/learning.js +36 -23
  133. package/dist/store-reads/loop.d.ts +5 -39
  134. package/dist/store-reads/loop.js +21 -80
  135. package/dist/store-view.d.ts +5 -0
  136. package/dist/store-view.js +16 -2
  137. package/dist/template-eval.d.ts +7 -0
  138. package/dist/template-eval.js +54 -6
  139. package/dist/templates.d.ts +3 -1
  140. package/dist/templates.js +14 -1
  141. package/dist/timeline/computer.js +2 -1
  142. package/dist/tool-list.js +1 -0
  143. package/dist/tools.d.ts +7 -0
  144. package/dist/tools.js +11 -0
  145. package/dist/trigger-feed.js +67 -18
  146. package/dist/validate.js +7 -2
  147. package/dist/workspace/computer-for-claim.d.ts +7 -0
  148. package/dist/workspace/computer-for-claim.js +12 -2
  149. package/dist/workspace/paths.d.ts +4 -0
  150. package/dist/workspace/paths.js +9 -0
  151. package/dist/workspace/resolve-computer.d.ts +3 -1
  152. package/dist/workspace/run-tools.d.ts +1 -1
  153. package/dist/workspace/run-tools.js +14 -3
  154. package/launcher/agentrun-serve +31 -24
  155. package/package.json +10 -9
  156. package/templates/README.md +11 -2
  157. package/dist/console/assets/index-C3gNPz58.css +0 -1
  158. package/dist/console/assets/index-COGhx_2Z.js +0 -711
  159. package/dist/learn/general.d.ts +0 -69
  160. package/dist/learn/general.js +0 -75
  161. package/dist/learn/refit.d.ts +0 -48
  162. package/dist/learn/refit.js +0 -264
  163. package/dist/runner/step-guard.d.ts +0 -62
  164. package/dist/runner/step-guard.js +0 -93
@@ -0,0 +1,108 @@
1
+ import ICAL from "ical.js";
2
+ type Component = InstanceType<typeof ICAL.Component>;
3
+ /** A person on an event: their name (CN) and address. */
4
+ export type Person = {
5
+ name: string | null;
6
+ email: string | null;
7
+ };
8
+ /** One event of an answer. */
9
+ export type CalendarEvent = {
10
+ title: string;
11
+ start: string;
12
+ end: string;
13
+ all_day: boolean;
14
+ location: string | null;
15
+ description: string | null;
16
+ status: "confirmed" | "tentative";
17
+ recurring: boolean;
18
+ organizer: Person | null;
19
+ attendees: Person[];
20
+ attendees_omitted?: number;
21
+ };
22
+ /** A zone an instant is read in, and a wall-clock time is placed in. */
23
+ type Zone = {
24
+ name: string;
25
+ offsetAt(instant: number): number;
26
+ toInstant(wall: number): number;
27
+ };
28
+ /** A calendar file, parsed: its own name and zone, and its events, by series. */
29
+ export type ParsedCalendar = {
30
+ /** X-WR-CALNAME, or null. */
31
+ name: string | null;
32
+ /** The zone floating times and the window's dates are read in: X-WR-TIMEZONE where it is an IANA zone, else the server's. */
33
+ zone: string;
34
+ /** The series and single events (each with its overrides), cancelled ones included. */
35
+ series: Series[];
36
+ };
37
+ /** A VEVENT and the overrides of its instances (RECURRENCE-ID), or a lone override whose series the file lacks. */
38
+ type Series = {
39
+ main: Component;
40
+ overrides: Component[];
41
+ host: Hosted;
42
+ };
43
+ /** What reading a component's times needs: the calendar's zone, and its VTIMEZONEs by TZID. */
44
+ type Hosted = {
45
+ zone: Zone;
46
+ tzs: Map<string, Zone>;
47
+ };
48
+ /** `name` as an IANA zone the runtime knows (a vendor's path ending in one, /mozilla.org/…/Europe/Madrid, read as it), or
49
+ * undefined. */
50
+ export declare function ianaZone(name: string | null | undefined): string | undefined;
51
+ /** The server's own zone. */
52
+ export declare const serverZone: () => string;
53
+ /** `instant` as an ISO date-time with `zone`'s offset there, to the second. */
54
+ export declare function isoIn(instant: number, zone: {
55
+ offsetAt(instant: number): number;
56
+ }): string;
57
+ /** The calendar's zone, by name. */
58
+ export declare const zoneNamed: (name: string) => Zone;
59
+ /** The file read: its name and zone, its time zones, and its events grouped by series (UID). Throws, in words, on a
60
+ * file that is not an iCalendar calendar. */
61
+ export declare function parseCalendar(text: string, host: string): ParsedCalendar;
62
+ /** A call's window that does not read, or is refused, in words. */
63
+ export declare class WindowError extends Error {
64
+ }
65
+ /** A window of time: [start, end). */
66
+ export type Window = {
67
+ start: number;
68
+ end: number;
69
+ };
70
+ /** A call's `from` and `to` read as a window in `zone`, at `now`: a date is that whole day in the zone (to's day
71
+ * included), a date-time with an offset that instant, one without it the wall-clock time in the zone. Absent: from now,
72
+ * WINDOW_DAYS_DEFAULT days on from `from`. Throws, in words, on one that does not read (a part that names no time, Feb 30
73
+ * or 25:00, included), a `to` not after `from`, or a window over WINDOW_DAYS_MAX days. */
74
+ export declare function windowOf(args: {
75
+ from?: unknown;
76
+ to?: unknown;
77
+ }, zoneName: string, now: number): Window;
78
+ /** A read stopped at its work budget: the calendar has too many repeating events to read. Its message is the words. */
79
+ export declare class RepeatsError extends Error {
80
+ readonly by: "steps" | "time";
81
+ /** Which part of the budget ran out: its steps, or its time (the ceiling for rule shapes whose steps cost far more). */
82
+ constructor(by: "steps" | "time");
83
+ }
84
+ /** What a read takes besides its window: `scrub`, run on each of an event's texts before it is cut (address.ts
85
+ * scrubAddress: the calendar's address cut out whole, before a cut could leave part of it). */
86
+ export type ReadOptions = {
87
+ scrub?: (text: string) => string;
88
+ /** The work budget, for tests alone: its steps, its time and the clock it is read on (defaults READ_STEPS_MAX,
89
+ * READ_WORK_MS, performance.now). The server never passes it. */
90
+ work?: {
91
+ steps?: number;
92
+ ms?: number;
93
+ clock?: () => number;
94
+ };
95
+ };
96
+ /** The calendar's events in `window`, sorted by start (then title), at most EVENTS_MAX; `truncated` when there were more.
97
+ * One read, under one work budget: past it, RepeatsError. */
98
+ export declare function eventsIn(calendar: ParsedCalendar, window: Window, options?: ReadOptions): {
99
+ events: CalendarEvent[];
100
+ truncated: boolean;
101
+ };
102
+ /** How many events the calendar holds (its series and single events, not cancelled), and its next one from `now` within
103
+ * WINDOW_DAYS_MAX days: what a test of it says. One read, under one work budget: past it, RepeatsError. */
104
+ export declare function summaryOf(calendar: ParsedCalendar, now: number, options?: ReadOptions): {
105
+ count: number;
106
+ next?: CalendarEvent;
107
+ };
108
+ export {};