@parcha/agentrun-serve 0.1.0-beta.32 → 0.1.0-beta.33

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 (163) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +78 -46
  3. package/dist/adapters.d.ts +0 -3
  4. package/dist/adapters.js +0 -7
  5. package/dist/agents.d.ts +1 -1
  6. package/dist/api-only.d.ts +14 -0
  7. package/dist/api-only.js +33 -0
  8. package/dist/archil-routes.d.ts +1 -1
  9. package/dist/box-egress-vm.d.ts +0 -8
  10. package/dist/box-egress-vm.js +0 -10
  11. package/dist/box-egress.d.ts +0 -4
  12. package/dist/box-egress.js +1 -16
  13. package/dist/box-paths.d.ts +25 -2
  14. package/dist/box-paths.js +79 -11
  15. package/dist/box-relay.d.ts +0 -11
  16. package/dist/box-relay.js +0 -20
  17. package/dist/box-settings.d.ts +46 -0
  18. package/dist/box-settings.js +107 -0
  19. package/dist/boxes.d.ts +4 -1
  20. package/dist/browser-cost.js +2 -1
  21. package/dist/browser-person.d.ts +0 -2
  22. package/dist/browser-person.js +0 -2
  23. package/dist/budget.d.ts +0 -4
  24. package/dist/budget.js +0 -7
  25. package/dist/cap.d.ts +0 -7
  26. package/dist/cap.js +0 -22
  27. package/dist/cli.js +23 -8
  28. package/dist/computers.d.ts +1 -1
  29. package/dist/console/assets/index-Dn0ngwG9.js +535 -0
  30. package/dist/console/assets/index-DvW6Aled.css +1 -0
  31. package/dist/console/index.html +2 -2
  32. package/dist/daytona-api.d.ts +0 -11
  33. package/dist/daytona-api.js +1 -82
  34. package/dist/docker-host-addresses.d.ts +37 -0
  35. package/dist/docker-host-addresses.js +110 -0
  36. package/dist/files.d.ts +0 -8
  37. package/dist/files.js +0 -17
  38. package/dist/github-connection.d.ts +1 -1
  39. package/dist/github-connection.js +1 -1
  40. package/dist/harness-install.d.ts +23 -0
  41. package/dist/harness-install.js +99 -4
  42. package/dist/harness.d.ts +4 -3
  43. package/dist/harness.js +16 -1
  44. package/dist/import.js +52 -13
  45. package/dist/learn/secrets.d.ts +2 -1
  46. package/dist/learn/secrets.js +19 -6
  47. package/dist/learned-workflow.d.ts +5 -4
  48. package/dist/learned-workflow.js +6 -3
  49. package/dist/learning-routes.d.ts +9 -46
  50. package/dist/learning-routes.js +25 -29
  51. package/dist/learning-run.d.ts +4 -231
  52. package/dist/learning-run.js +7 -651
  53. package/dist/live/translate.js +1 -1
  54. package/dist/mcp-gateway.d.ts +0 -3
  55. package/dist/mcp-gateway.js +0 -13
  56. package/dist/mcp-probe.d.ts +2 -2
  57. package/dist/mcp-probe.js +2 -2
  58. package/dist/mcp-servers-store.js +1 -1
  59. package/dist/openapi.js +3 -3
  60. package/dist/page.js +3 -1
  61. package/dist/paid-calls.js +3 -2
  62. package/dist/pause.d.ts +0 -2
  63. package/dist/pause.js +1 -8
  64. package/dist/place.d.ts +0 -5
  65. package/dist/place.js +0 -10
  66. package/dist/print.d.ts +2 -1
  67. package/dist/print.js +4 -2
  68. package/dist/run-db.d.ts +0 -2
  69. package/dist/run-db.js +0 -4
  70. package/dist/run-learning-served.d.ts +38 -0
  71. package/dist/run-learning-served.js +9 -0
  72. package/dist/run-secrets.d.ts +33 -0
  73. package/dist/run-secrets.js +53 -0
  74. package/dist/run-timeline-served.js +5 -2
  75. package/dist/run-view.d.ts +5 -9
  76. package/dist/run-view.js +4 -22
  77. package/dist/runner/adapter-loop.d.ts +8 -2
  78. package/dist/runner/adapter-loop.js +44 -12
  79. package/dist/runner/adapter-run-spec.d.ts +8 -0
  80. package/dist/runner/adapter-run-spec.js +6 -5
  81. package/dist/runner/adapters/pi.d.ts +4 -0
  82. package/dist/runner/adapters/pi.js +4 -1
  83. package/dist/runner/beside.js +19 -8
  84. package/dist/runner/claim-secrets.js +1 -1
  85. package/dist/runner/cli-run-spec.js +15 -1
  86. package/dist/runner/journal-kinds.d.ts +6 -0
  87. package/dist/runner/live-ticker.d.ts +1 -1
  88. package/dist/runner/live-ticker.js +28 -4
  89. package/dist/runner/loop-contract.d.ts +3 -2
  90. package/dist/runner/main.d.ts +11 -4
  91. package/dist/runner/main.js +39 -10
  92. package/dist/runner/mcp-claim.d.ts +1 -1
  93. package/dist/runner/mcp-claim.js +1 -1
  94. package/dist/runner/model-route.js +21 -2
  95. package/dist/runner/redact.d.ts +8 -2
  96. package/dist/runner/redact.js +11 -2
  97. package/dist/runner/workflow-spec.js +5 -9
  98. package/dist/runs-over-store.d.ts +1 -1
  99. package/dist/runs-over-store.js +16 -5
  100. package/dist/seal-key.d.ts +54 -15
  101. package/dist/seal-key.js +272 -84
  102. package/dist/sealed-settings.d.ts +2 -2
  103. package/dist/sealed-settings.js +3 -10
  104. package/dist/secrets.d.ts +2 -10
  105. package/dist/secrets.js +21 -17
  106. package/dist/server-secrets-store.js +1 -1
  107. package/dist/server-secrets.js +3 -0
  108. package/dist/server.d.ts +10 -6
  109. package/dist/server.js +89 -41
  110. package/dist/store/index.d.ts +1 -1
  111. package/dist/store/index.js +1 -1
  112. package/dist/store/open.d.ts +12 -2
  113. package/dist/store/open.js +23 -3
  114. package/dist/store/postgres/migrate.js +18 -1
  115. package/dist/store/sqlite/store.js +23 -8
  116. package/dist/store/store.d.ts +3 -0
  117. package/dist/store-reads/journal.d.ts +16 -0
  118. package/dist/store-reads/journal.js +82 -6
  119. package/dist/store-view.js +38 -5
  120. package/dist/tool-keys.d.ts +4 -3
  121. package/dist/tool-keys.js +7 -4
  122. package/dist/tools.d.ts +1 -1
  123. package/dist/tools.js +4 -1
  124. package/dist/trigger-schedule.js +2 -1
  125. package/dist/trigger-secrets-shown.js +5 -1
  126. package/dist/workspace/computer-deps.d.ts +29 -0
  127. package/dist/workspace/computer-deps.js +48 -1
  128. package/dist/workspace/computer-for-claim.d.ts +7 -3
  129. package/dist/workspace/computer-for-claim.js +1 -1
  130. package/dist/workspace/computer-providers.d.ts +6 -2
  131. package/dist/workspace/computer-providers.js +1 -1
  132. package/dist/workspace/index.d.ts +1 -1
  133. package/dist/workspace/index.js +1 -1
  134. package/dist/workspace.d.ts +0 -3
  135. package/dist/workspace.js +0 -3
  136. package/launcher/agentrun-serve +6 -33
  137. package/package.json +14 -14
  138. package/templates/inbound-lead/agent.md +1 -1
  139. package/templates/kyb/agent.md +1 -1
  140. package/dist/app.d.ts +0 -5
  141. package/dist/app.js +0 -514
  142. package/dist/bounds.d.ts +0 -26
  143. package/dist/bounds.js +0 -137
  144. package/dist/console/assets/index-35-7aeIZ.js +0 -519
  145. package/dist/console/assets/index-Cejbov-Y.css +0 -1
  146. package/dist/content-filter.d.ts +0 -7
  147. package/dist/content-filter.js +0 -23
  148. package/dist/disk.d.ts +0 -33
  149. package/dist/disk.js +0 -85
  150. package/dist/door-line.d.ts +0 -23
  151. package/dist/door-line.js +0 -83
  152. package/dist/harness-app.d.ts +0 -69
  153. package/dist/harness-app.js +0 -1162
  154. package/dist/request-start.d.ts +0 -27
  155. package/dist/request-start.js +0 -381
  156. package/dist/run-box.d.ts +0 -205
  157. package/dist/run-box.js +0 -661
  158. package/dist/run-holder.d.ts +0 -52
  159. package/dist/run-holder.js +0 -139
  160. package/dist/runs.d.ts +0 -1200
  161. package/dist/runs.js +0 -4103
  162. package/dist/served-only.d.ts +0 -5
  163. package/dist/served-only.js +0 -12
package/dist/workspace.js CHANGED
@@ -296,6 +296,3 @@ export function assertHardlinkProtection(read = () => readFileSync("/proc/sys/fs
296
296
  if (value !== "1")
297
297
  throw new Error(`agentrun-serve: fs.protected_hardlinks is ${value}, not 1; a run's workspace could hold a link to this server's files`);
298
298
  }
299
- /** Does nothing: the run's host tools file through its Workspace, and nothing copies their files into a remote box any
300
- * more. Kept only so the run's start (app.ts) compiles until its rewrite drops the call. */
301
- export function mirrorWrites(_work, _mirror) { }
@@ -7,17 +7,15 @@
7
7
  #
8
8
  # Each secret named below that is set goes into one pipe as NAME=VALUE and a NUL, AGENTRUN_SECRETS_LEN bytes in all,
9
9
  # on fd AGENTRUN_SECRETS_FD; the server reads exactly that many bytes first thing and closes the pipe. First, each
10
- # secret moves out of the environment into this shell's own memory, so no process it starts (the seal key's, mktemp,
11
- # mkfifo, rm, env) inherits one; only this launcher's own initial environment, gone at the exec, ever held them. The
10
+ # secret moves out of the environment into this shell's own memory, so no process it starts (mktemp, mkfifo, rm, env)
11
+ # inherits one; only this launcher's own initial environment, gone at the exec, ever held them. The
12
12
  # pipe is a FIFO whose name is gone before any secret is written, and only this shell writes it, with its builtin
13
13
  # printf; `env -u` drops every name from what COMMAND inherits too. The condition: this runs before any run's process
14
14
  # exists. A process of the same user started earlier could open the FIFO while it is named.
15
15
  #
16
- # AGENTRUN_SEAL_KEY, the key the server keeps tool keys and MCP server credentials under (src/tool-keys.ts,
17
- # src/mcp-servers.ts), is one of them. Not set, it is the
18
- # one in agentrun/seal.key under XDG_CONFIG_HOME (or ~/.config), made here the first time: 32 random bytes in base64,
19
- # 0600 in a 0700 directory, written by this shell's printf, never on a command line. It is outside the data directory
20
- # on purpose: a copy of that holds the tool keys as ciphertext alone.
16
+ # AGENTRUN_SEAL_KEY, the key the server keeps every secret under (src/seal-key.ts), is one of them. Not set, the
17
+ # server keeps its own in seal/seal.key in its data directory, beside the store, made at its first start: this launcher
18
+ # neither makes nor reads one.
21
19
  #
22
20
  # AGENTRUN_STORE_URL, the store's connection, is one too: its URL may hold the database's password. The server and the
23
21
  # runner each read it from what they were handed (secrets.ts secret), and no run is handed it.
@@ -50,32 +48,7 @@ locale=${LC_ALL-}
50
48
  locale_set=${LC_ALL+x}
51
49
  LC_ALL=C
52
50
 
53
- # Every other process this launcher starts, it starts here, before it writes a secret. First the seal key's, when it is
54
- # not given.
55
- config=${XDG_CONFIG_HOME:-${HOME:+$HOME/.config}}
56
- if [ -z "${agentrun_secret_AGENTRUN_SEAL_KEY+x}" ] && [ -n "$config" ]; then
57
- keys=$config/agentrun
58
- # Its own directory, when the person made it with a plain mkdir (0755) and no key is there yet: tightened to 0700
59
- # before a key is written in it, only when it is this user's. An existing key's directory is never changed, nor a
60
- # symlink's target, which may be shared (the key check below refuses a linked directory anyway).
61
- if [ ! -e "$keys/seal.key" ] && [ ! -L "$keys" ] && [ -d "$keys" ] && [ -O "$keys" ]; then
62
- case $(ls -ld "$keys" 2>/dev/null) in d???------*) ;; *) chmod 700 "$keys" 2>/dev/null || : ;; esac
63
- fi
64
- # Made whole beside its name, then linked to it, which fails if another start made it first: each start reads one.
65
- if [ ! -e "$keys/seal.key" ] && (umask 077 && mkdir -p "$keys") && made=$(head -c 32 /dev/urandom | base64) && [ ${#made} -eq 44 ]; then
66
- (umask 077 && printf '%s\n' "$made" >"$keys/seal.key.$$" && { ln "$keys/seal.key.$$" "$keys/seal.key" 2>/dev/null || :; }) || :
67
- rm -f "$keys/seal.key.$$"
68
- fi
69
- made=
70
- # Only a key no other user can read, in a directory no other user can: one they can is refused, never changed.
71
- case $(ls -ld "$keys" 2>/dev/null):$(ls -l "$keys/seal.key" 2>/dev/null) in
72
- d???------*:-??-------*) IFS= read -r agentrun_secret_AGENTRUN_SEAL_KEY <"$keys/seal.key" || : ;;
73
- esac
74
- if [ -z "${agentrun_secret_AGENTRUN_SEAL_KEY:-}" ]; then
75
- unset agentrun_secret_AGENTRUN_SEAL_KEY
76
- echo "agentrun-serve: no seal key in $keys/seal.key (none, or another user can read it or its directory), so the server keeps no tool key and no MCP server credential: make the file 0600 and its directory 0700 (chmod 700 $keys; chmod 600 $keys/seal.key), or remove it to have a new one made at the next start" >&2
77
- fi
78
- fi
51
+ # Every other process this launcher starts, it starts here, before it writes a secret.
79
52
  dir=$(mktemp -d "${TMPDIR:-/tmp}/agentrun-serve.XXXXXX")
80
53
  mkfifo -m 600 "$dir/secrets"
81
54
  exec 3<>"$dir/secrets"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-serve",
3
- "version": "0.1.0-beta.32",
4
- "description": "The Agentrun v2 API on your own machine: an agent store's agents, revisions and runs, served on loopback.",
3
+ "version": "0.1.0-beta.33",
4
+ "description": "The AgentRun server: the /v2 API and console over one store, with runners that run your agents; the deployable process of the AgentRun platform.",
5
5
  "keywords": [
6
6
  "agentrun",
7
7
  "agent",
@@ -54,18 +54,18 @@
54
54
  "@earendil-works/pi-coding-agent": "1.5.0",
55
55
  "@modelcontextprotocol/client": "2.4.0",
56
56
  "@modelcontextprotocol/server": "2.4.0",
57
- "@parcha/agentrun-computer": "0.1.0-beta.32",
58
- "@parcha/agentrun-decisions": "0.1.0-beta.32",
59
- "@parcha/agentrun-dsl": "0.1.0-beta.32",
60
- "@parcha/agentrun-harness-claude": "0.1.0-beta.32",
61
- "@parcha/agentrun-harness-codex": "0.1.0-beta.32",
62
- "@parcha/agentrun-jev": "0.1.0-beta.32",
63
- "@parcha/agentrun-kernel": "0.1.0-beta.32",
64
- "@parcha/agentrun-pi": "0.1.0-beta.32",
65
- "@parcha/pi-browser": "0.1.0-beta.32",
66
- "@parcha/pi-durable-agent": "0.1.0-beta.32",
67
- "@parcha/pi-durable-disk": "0.1.0-beta.32",
68
- "@parcha/pi-transport": "0.1.0-beta.32",
57
+ "@parcha/agentrun-computer": "0.1.0-beta.33",
58
+ "@parcha/agentrun-decisions": "0.1.0-beta.33",
59
+ "@parcha/agentrun-dsl": "0.1.0-beta.33",
60
+ "@parcha/agentrun-harness-claude": "0.1.0-beta.33",
61
+ "@parcha/agentrun-harness-codex": "0.1.0-beta.33",
62
+ "@parcha/agentrun-jev": "0.1.0-beta.33",
63
+ "@parcha/agentrun-kernel": "0.1.0-beta.33",
64
+ "@parcha/agentrun-pi": "0.1.0-beta.33",
65
+ "@parcha/pi-browser": "0.1.0-beta.33",
66
+ "@parcha/pi-durable-agent": "0.1.0-beta.33",
67
+ "@parcha/pi-durable-disk": "0.1.0-beta.33",
68
+ "@parcha/pi-transport": "0.1.0-beta.33",
69
69
  "@secretlint/core": "13.1.0",
70
70
  "@secretlint/profiler": "13.1.0",
71
71
  "@secretlint/secretlint-rule-preset-recommend": "13.1.0",
@@ -21,7 +21,7 @@ mcp:
21
21
  pin: { slack_send_message: { channel_id: "${parameters.slack_channel}" } }
22
22
  parameters:
23
23
  icp: { type: string, required: true, description: "your ideal customer in your own words: industry, company size, region, buying signals, and what disqualifies a lead (e.g. 'B2B fintech, 50-2000 people, US or EU, has a compliance team; never gambling operators')" }
24
- post_to: { type: string, required: true, enum: [crm, slack, none], description: "where each brief goes: crm (a note and the score field on the HubSpot contact), slack (a message in one channel) or none (the run's answer only)" }
24
+ post_to: { type: string, required: false, default: none, enum: [crm, slack, none], description: "where each brief goes: crm (a note and the score field on the HubSpot contact), slack (a message in one channel) or none (the run's answer only)" }
25
25
  slack_channel: { type: string, pattern: "^[CG][A-Z0-9]{8,12}$", description: "a Slack channel ID like C0123ABCD (the channel's details in Slack show it), never its name: where the brief is posted when post_to is slack" }
26
26
  crm_score_property: { type: string, pattern: "^[a-z][a-z0-9_]{0,99}$", description: "a HubSpot contact number property's internal name, like lead_fit_score (lowercase letters, digits and underscores): the fit score is written there when post_to is crm; empty: the note only" }
27
27
  competitors: { type: string, description: "your competitors' names or domains, comma-separated; a lead from one is flagged, never scored as a customer" }
@@ -11,7 +11,7 @@ model: { tier: balanced }
11
11
  effort: medium
12
12
  tools: [read, web_search, web_fetch, ask_person]
13
13
  parameters:
14
- risk_appetite: { type: string, required: true, enum: [low, medium, high], description: "low, medium or high: how much risk you accept, which sets how each red flag is graded and which verdict it leads to. Use medium (the default) unless your policy says otherwise; low is for regulated onboarding, high for low-exposure vendors." }
14
+ risk_appetite: { type: string, required: false, default: medium, enum: [low, medium, high], description: "low, medium or high: how much risk you accept, which sets how each red flag is graded and which verdict it leads to. Use medium (the default) unless your policy says otherwise; low is for regulated onboarding, high for low-exposure vendors." }
15
15
  jurisdictions_of_interest: { type: string, required: false, pattern: "^$|^[A-Za-z]{2}(\\s*,\\s*[A-Za-z]{2})*$", description: "Optional. Countries that matter to you, as ISO 3166-1 alpha-2 codes separated by commas (e.g. US,GB,AE). Every tie the company has to one (incorporation, address, owner, officer, operations) is reported. Empty: none." }
16
16
  opensanctions: { type: boolean, required: false, default: false, description: "Optional. Also look each name up in OpenSanctions (opensanctions.org), one index of every sanctions list, beside the list owners' own sites. Licence: OpenSanctions data is CC BY-NC 4.0, free for non-commercial use only; commercial use needs a paid licence from OpenSanctions. Turn it on only if your use is non-commercial or you hold that licence. Off (the default): the list owners' own sites only." }
17
17
  budget: { per_run_usd: 5.00 }
package/dist/app.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { type AppContext, type AppOptions } from "@parcha/pi-durable-disk";
2
- import { promptOf } from "./skills.js";
3
- export { WORKFLOW_ADAPTERS } from "./runner/workflow-adapters.js";
4
- export { promptOf };
5
- export default function app(where: AppContext): Promise<AppOptions>;