eve-hub 0.13.2 → 0.13.3
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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/execution-context.mjs +4 -1
- package/package.json +1 -1
- package/prepare.mjs +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# eve-hub
|
|
2
2
|
|
|
3
|
+
## 0.13.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A hosted bot's GitHub guidance follows one fact, the build's `GITHUB_TOKEN`. With it, the build mounts eve's git extension (its `# GitHub` section) and the execution context says `git` and `gh` are signed in. Without it, no bot mounts the git extension (a stub the workspace repo carries is removed), and the execution context's new GitHub line says the shell has no credential and points to the `vercel-kit` connection when one is listed.
|
|
8
|
+
|
|
3
9
|
## 0.13.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ A deployed workspace (lib/workspace-template.mjs, staged by hosted-hub/scripts/s
|
|
|
61
61
|
|
|
62
62
|
Releases go through Changesets, as in eve. A PR that changes the kit adds a changeset (`pnpm changeset`) and applies it (`pnpm changeset version`); when it merges, `.github/workflows/release.yml` runs `changeset publish` (no bot commits to main: its ruleset allows only PR merges): the kit's `prepack` stages the package into `dist/npm` (its `publishConfig.directory`), npm gets it, and the `eve-hub@<version>` GitHub release is created. npm auth is the repo's `NPM_TOKEN` secret (an npm automation token). The template pins the version this checkout carries.
|
|
63
63
|
|
|
64
|
-
The template's main gets a Vercel Sandbox and only the kit stubs that run without the hub's machine (lib/workspace-template.mjs `DEPLOYED_KIT_FILES`; eve's own bash replaces the kit's). The template's builder also mounts eve-code (`eve/extensions/code`: `apply_patch`, `grep`, the review skills, a read-only worker) and `eve/extensions/git` (`git({})`), both with no `github` option. The bot uses `gh` and `git` from bash, whose GitHub token is the sandbox firewall's (the Vercel sandbox `create_agent` writes, lib/agent-template.mjs `sandboxFile`), and no `gh` tool is contributed. A deployed workspace's eve is the one pin in `hosted-hub/bots/package.json`, which staging copies over the template's (an eve snapshot with `eve/extensions/git`; `hosted-hub/test/stage-workspace.test.mjs` checks the staged imports resolve against it). The hub and local bots stay on the hub's eve. The published tarball (`scripts/pack.mjs`) leaves out the kit__worker extension, which mounts only on the hub's machine. The hub reaches each bot's eve channel with `Authorization: Bearer $BOT_TOKEN` (`bot-token.mjs`); the kit's calls to the hub (`registry-fetch.mjs`, at `ROSTER_REGISTRY_URL`) carry `Authorization: Bearer $HUB_TOKEN` when set. The hosted hub keeps Vercel Authentication on: a deployed bot sends its project's OIDC token in `x-vercel-trusted-oidc-idp-token` too (the hub project lists each bots project in its Trusted Sources, `hosted-hub/src/onboard/trust.ts` `trustBots`, and never the bypass secret, even while its deployment still holds the env), and a bot on a Mac sends `x-vercel-protection-bypass: $HUB_PROTECTION_BYPASS` (the hub project's automation bypass secret) when it has one.
|
|
64
|
+
The template's main gets a Vercel Sandbox and only the kit stubs that run without the hub's machine (lib/workspace-template.mjs `DEPLOYED_KIT_FILES`; eve's own bash replaces the kit's). The template's builder also mounts eve-code (`eve/extensions/code`: `apply_patch`, `grep`, the review skills, a read-only worker) and `eve/extensions/git` (`git({})`), both with no `github` option. Every bot of a build with the project's `GITHUB_TOKEN` mounts `eve/extensions/git`; a build without one mounts it nowhere, and the execution context points the bot to the `vercel-kit` connection instead (packages/agent-kit/prepare.mjs, execution-context.mjs; the rendered prompts are snapshotted in hosted-hub/test/prompts). The bot uses `gh` and `git` from bash, whose GitHub token is the sandbox firewall's (the Vercel sandbox `create_agent` writes, lib/agent-template.mjs `sandboxFile`), and no `gh` tool is contributed. A deployed workspace's eve is the one pin in `hosted-hub/bots/package.json`, which staging copies over the template's (an eve snapshot with `eve/extensions/git`; `hosted-hub/test/stage-workspace.test.mjs` checks the staged imports resolve against it). The hub and local bots stay on the hub's eve. The published tarball (`scripts/pack.mjs`) leaves out the kit__worker extension, which mounts only on the hub's machine. The hub reaches each bot's eve channel with `Authorization: Bearer $BOT_TOKEN` (`bot-token.mjs`); the kit's calls to the hub (`registry-fetch.mjs`, at `ROSTER_REGISTRY_URL`) carry `Authorization: Bearer $HUB_TOKEN` when set. The hosted hub keeps Vercel Authentication on: a deployed bot sends its project's OIDC token in `x-vercel-trusted-oidc-idp-token` too (the hub project lists each bots project in its Trusted Sources, `hosted-hub/src/onboard/trust.ts` `trustBots`, and never the bypass secret, even while its deployment still holds the env), and a bot on a Mac sends `x-vercel-protection-bypass: $HUB_PROTECTION_BYPASS` (the hub project's automation bypass secret) when it has one.
|
|
65
65
|
|
|
66
66
|
## Vercel Kit connection
|
|
67
67
|
|
package/execution-context.mjs
CHANGED
|
@@ -55,8 +55,11 @@ export function hostedContext({ bot, kit, removed, deployment: d }, options) {
|
|
|
55
55
|
].filter(Boolean).join(", ") || "no Vercel facts were available to this build"}. Each bot is its own service at \`/eve/<name>\` in that one project.`,
|
|
56
56
|
`- **Source:** ${d.repo ? `built from \`${d.repo}\`${d.branch ? ` on \`${d.branch}\`` : ""}${d.sha ? ` at commit \`${d.sha}\`` : ""}` : "no git repository: the hub uploaded these files"}. You are made of files in it: \`agents/${bot}/\`, \`memory/\` and \`hub.workspace.json\`.`,
|
|
57
57
|
d.repo
|
|
58
|
-
?
|
|
58
|
+
? "- **Changing it:** commit to that repository; Vercel builds and deploys the commit."
|
|
59
59
|
: "- **Changing it:** there is no repository to commit to. The hub replaces these files on its next deploy, so an edit made only in this deployment does not last.",
|
|
60
|
+
d.githubToken
|
|
61
|
+
? "- **GitHub:** `git` and `gh` in your shell are already signed in and set to sign commits as the owner; do not set your own author or identity, or GitHub rejects the push."
|
|
62
|
+
: "- **GitHub:** your shell has no GitHub credential: `git` cannot authenticate, so a private repository won't clone and nothing can be pushed. When a `vercel-kit` connection is listed, reach GitHub through it (connection_search, then connection_execute); otherwise tell the human this deployment has no GitHub access.",
|
|
60
63
|
"- **Memory:** the standing decisions you recall are the `memory/` and `agents/<bot>/memory/` files, built into each deployment. An entry takes effect when the deployment that contains it is live, not on your next turn; with no repository it cannot last.",
|
|
61
64
|
"- **Limits:** there is no `hub` CLI, you cannot restart yourself or any bot, and there are no host paths: your shell is a Vercel Sandbox with its own filesystem, not the owner's machine.",
|
|
62
65
|
`- **Kit tools this build removed:** ${removed.length ? list(removed) : "none"}. They need the hub's machine, or change the roster, which a deployment does by commit.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
|
|
6
6
|
"type": "module",
|
package/prepare.mjs
CHANGED
|
@@ -27,10 +27,12 @@ import { botDomains, domainFolders, readBotMemory, readMemory, validateMemory }
|
|
|
27
27
|
import { agentRunsOn, readWorkspaceFile, removeWorkspaceAgent } from "./workspace.mjs";
|
|
28
28
|
import { architectureText } from "./team.mjs";
|
|
29
29
|
|
|
30
|
-
// eve's git extension, for every bot
|
|
31
|
-
// bash, whose GitHub credential is the sandbox
|
|
32
|
-
//
|
|
33
|
-
//
|
|
30
|
+
// eve's git extension, for every bot of a build with a GITHUB_TOKEN: it points
|
|
31
|
+
// the bot at `gh` and `git` in bash, whose GitHub credential is the sandbox
|
|
32
|
+
// firewall's (the Vercel sandbox lib/agent-template.mjs writes). With no
|
|
33
|
+
// `github` option it brokers no credential and says the shell has one, so a
|
|
34
|
+
// build without the token mounts none. It only guides: its `pr` skill (commit,
|
|
35
|
+
// push, draft PR) loads when a bot publishes.
|
|
34
36
|
export const gitExtensionFiles = () => ({ "extensions/git/extension.ts": `import git from "eve/extensions/git";\n\nexport default git({});\n` });
|
|
35
37
|
|
|
36
38
|
// Bots that edit code: eve-code (apply_patch, grep, the review skills and its
|
|
@@ -134,17 +136,19 @@ export function prepareDeployment(dir) {
|
|
|
134
136
|
mkdirSync(join(dir, "agents", "main", "agent", "channels"), { recursive: true });
|
|
135
137
|
writeFileSync(join(dir, "agents", "main", "agent", "channels", "manifest.ts"), MANIFEST_CHANNEL);
|
|
136
138
|
applyKit(change, dirOf);
|
|
139
|
+
const deployment = deploymentFacts();
|
|
137
140
|
for (const file of readdirSync(join(dir, "agents"), { recursive: true })) {
|
|
138
141
|
if (!file.endsWith("/agent.ts")) continue;
|
|
139
142
|
const bot = dirname(join(dir, "agents", file));
|
|
140
143
|
const name = basename(dirname(bot));
|
|
141
144
|
const code = CODE_BOTS.includes(name);
|
|
142
|
-
for (const [stub, content] of Object.entries({ ...gitExtensionFiles(), ...(code ? codeExtensionFiles(name) : {}) })) {
|
|
145
|
+
for (const [stub, content] of Object.entries({ ...(deployment.githubToken ? gitExtensionFiles() : {}), ...(code ? codeExtensionFiles(name) : {}) })) {
|
|
143
146
|
mkdirSync(dirname(join(bot, stub)), { recursive: true });
|
|
144
147
|
writeFileSync(join(bot, stub), content);
|
|
145
148
|
}
|
|
149
|
+
// A workspace repo may carry the stub from an earlier build.
|
|
150
|
+
if (!deployment.githubToken) for (const stub of Object.keys(gitExtensionFiles())) if (existsSync(join(bot, stub))) removeStub(bot, stub);
|
|
146
151
|
}
|
|
147
|
-
const deployment = deploymentFacts();
|
|
148
152
|
for (const name of readdirSync(join(dir, "agents"))) {
|
|
149
153
|
const bot = join(dir, "agents", name, "agent");
|
|
150
154
|
writeExecutionContext(bot, { bot: name, deployment });
|