@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
@@ -126,6 +126,14 @@ export declare function mcpServerAt(url: URL, signal: AbortSignal, network: OAut
126
126
  } | {
127
127
  address: string | undefined;
128
128
  }>;
129
+ /** Where a read of a calendar's file at `url` may go (calendar/fetch.ts, each redirect hop): `mcpServerAt`'s rule, the
130
+ * server's one, in the calendar's words. Dialled with dialAt. */
131
+ export declare function calendarAt(url: URL, signal: AbortSignal, network: OAuthNetwork, reach?: Reach): Promise<{
132
+ refused: string;
133
+ unresolved?: true;
134
+ } | {
135
+ address: string | undefined;
136
+ }>;
129
137
  /** A fetch to the MCP server `mcpServerAt` checked: dialled at `address` (the network's dial, else its fetch), or as
130
138
  * written when there is none (a loopback URL a local install allows), through `plain`. */
131
139
  export declare const dialAt: (network: OAuthNetwork, address: string | undefined, plain?: typeof fetch) => (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
package/dist/mcp-oauth.js CHANGED
@@ -255,6 +255,13 @@ export async function mcpServerAt(url, signal, network, reach = {}) {
255
255
  return { address: undefined };
256
256
  return checked(`the MCP server at ${url.host}`, url.href, signal, network, reach);
257
257
  }
258
+ /** Where a read of a calendar's file at `url` may go (calendar/fetch.ts, each redirect hop): `mcpServerAt`'s rule, the
259
+ * server's one, in the calendar's words. Dialled with dialAt. */
260
+ export async function calendarAt(url, signal, network, reach = {}) {
261
+ if (reach.loopback && loopbackAllowed(url, url.href, reach.own ?? []))
262
+ return { address: undefined };
263
+ return checked(`the calendar at ${url.host}`, url.href, signal, network, reach);
264
+ }
258
265
  /** A fetch to the MCP server `mcpServerAt` checked: dialled at `address` (the network's dial, else its fetch), or as
259
266
  * written when there is none (a loopback URL a local install allows), through `plain`. */
260
267
  export const dialAt = (network, address, plain = fetch) => (input, init = {}) => {
@@ -19,6 +19,19 @@ export declare function privateAllowed(address: string, own: readonly string[]):
19
19
  export declare function privateOAuthHosts(store: {
20
20
  settings: Pick<Settings, "get">;
21
21
  }): Promise<string[]>;
22
+ /** The store.settings key a server keeps its own addresses under at each start (Serve.own: where it listens, and its
23
+ * public address when that is on loopback): `{ own: string[] }`. Addresses alone, never its loopback opt-in, which each
24
+ * process reads from its own environment: a runner in its own process with its own opt-in reads them so its runs never
25
+ * reach that server's ports on loopback (runner/main.ts runnerLoop), whatever port the server was started on. */
26
+ export declare const MCP_SERVER_OWN_KEY = "mcp.server_own";
27
+ /** The server's start: its own addresses, replacing the last start's. */
28
+ export declare function saveServerOwn(store: {
29
+ settings: Pick<Settings, "put">;
30
+ }, own: readonly string[]): Promise<void>;
31
+ /** The addresses the server kept at its last start (saveServerOwn), read at each use; none before a server started. */
32
+ export declare function serverOwn(store: {
33
+ settings: Pick<Settings, "get">;
34
+ }): Promise<string[]>;
22
35
  /** The list replaced with `hosts` (already checked: checkPrivateHosts). */
23
36
  export declare function savePrivateOAuthHosts(store: {
24
37
  settings: Pick<Settings, "put">;
@@ -62,6 +62,22 @@ function hostsOf(value) {
62
62
  export async function privateOAuthHosts(store) {
63
63
  return hostsOf(await store.settings.get(MCP_PRIVATE_HOSTS_KEY));
64
64
  }
65
+ /** The store.settings key a server keeps its own addresses under at each start (Serve.own: where it listens, and its
66
+ * public address when that is on loopback): `{ own: string[] }`. Addresses alone, never its loopback opt-in, which each
67
+ * process reads from its own environment: a runner in its own process with its own opt-in reads them so its runs never
68
+ * reach that server's ports on loopback (runner/main.ts runnerLoop), whatever port the server was started on. */
69
+ export const MCP_SERVER_OWN_KEY = "mcp.server_own";
70
+ /** The server's start: its own addresses, replacing the last start's. */
71
+ export async function saveServerOwn(store, own) {
72
+ await store.settings.put(MCP_SERVER_OWN_KEY, { own: [...own] });
73
+ }
74
+ /** The addresses the server kept at its last start (saveServerOwn), read at each use; none before a server started. */
75
+ export async function serverOwn(store) {
76
+ const value = await store.settings.get(MCP_SERVER_OWN_KEY);
77
+ if (typeof value !== "object" || value === null || !Array.isArray(value.own))
78
+ return [];
79
+ return (value.own).filter((one) => typeof one === "string");
80
+ }
65
81
  /** The list replaced with `hosts` (already checked: checkPrivateHosts). */
66
82
  export async function savePrivateOAuthHosts(store, hosts) {
67
83
  await store.settings.put(MCP_PRIVATE_HOSTS_KEY, { hosts: [...hosts] });
package/dist/openapi.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { type TriggerAdapter } from "./trigger-adapter.js";
2
2
  import "./mcp-secret-writes.js";
3
3
  import "./email/routes.js";
4
+ import "./calendar/routes.js";
4
5
  import "./computers.js";
5
6
  type Json = Record<string, unknown>;
6
7
  /** Why each capability this server turns off answers 501, by the route's capability. */