eve-hub 0.14.9 → 0.14.11
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 +12 -0
- package/README.md +1 -1
- package/image-limits.d.mts +1 -0
- package/image-limits.mjs +35 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# eve-hub
|
|
2
2
|
|
|
3
|
+
## 0.14.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The README and pack script name the job that publishes the kit, `ci.yml`'s `deploy-hub` (the old `release.yml` is gone).
|
|
8
|
+
|
|
9
|
+
## 0.14.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Image sizes: `displaySize` gives an image's shown size, after a JPEG's EXIF orientation.
|
|
14
|
+
|
|
3
15
|
## 0.14.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ Add a changeset (`pnpm changeset`, pick `eve-hub`) when a tool's name, schema, o
|
|
|
59
59
|
|
|
60
60
|
A deployed workspace (lib/workspace-template.mjs, staged by hosted-hub/scripts/stage-workspace.mjs) has no hub checkout to link, so it installs the kit from npm, published as [`eve-hub`](https://www.npmjs.com/package/eve-hub): `"eve-hub": "<version>"`. `node packages/agent-kit/scripts/pack.mjs <outDir>` builds the package: every `.ts` module compiled to `.js` + `.d.ts` in place (node won't strip types under `node_modules`), the `exports` map pointed at them, and `templates/` included.
|
|
61
61
|
|
|
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,
|
|
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, `ci.yml`'s `deploy-hub` job 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
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
|
|
package/image-limits.d.mts
CHANGED
|
@@ -2,4 +2,5 @@ export const MAX_BYTES: number;
|
|
|
2
2
|
export const MODEL_MAX_EDGE: number;
|
|
3
3
|
export function sniffImage(bytes: Uint8Array): string | null;
|
|
4
4
|
export function imageSize(bytes: Uint8Array, mediaType: string): { width: number; height: number } | null;
|
|
5
|
+
export function displaySize(bytes: Uint8Array, mediaType: string): { width: number; height: number } | null;
|
|
5
6
|
export function modelUnsafe(bytes: Uint8Array): string | null;
|
package/image-limits.mjs
CHANGED
|
@@ -45,6 +45,41 @@ export function imageSize(bytes, mediaType) {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// The size the image is shown at: a JPEG whose EXIF orientation turns it a quarter (5 to 8) is drawn with its sides swapped, as
|
|
49
|
+
// AppKit and browsers draw it. imageSize is the stored frame, which is what a model provider's limits apply to.
|
|
50
|
+
export function displaySize(bytes, mediaType) {
|
|
51
|
+
const size = imageSize(bytes, mediaType);
|
|
52
|
+
if (!size || mediaType !== "image/jpeg") return size;
|
|
53
|
+
const o = jpegOrientation(bytes);
|
|
54
|
+
return o >= 5 && o <= 8 ? { width: size.height, height: size.width } : size;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// The EXIF orientation (1 to 8) in a JPEG's APP1 segment; 1 when it has none.
|
|
58
|
+
function jpegOrientation(bytes) {
|
|
59
|
+
const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
60
|
+
let i = 2;
|
|
61
|
+
while (i + 4 <= bytes.length && bytes[i] === 0xff) {
|
|
62
|
+
const marker = bytes[i + 1];
|
|
63
|
+
if (marker === 0xda || marker === 0xd9) return 1;
|
|
64
|
+
const len = v.getUint16(i + 2);
|
|
65
|
+
const start = i + 4, end = Math.min(i + 2 + len, bytes.length);
|
|
66
|
+
if (marker === 0xe1 && end - start >= 14 && String.fromCharCode(...bytes.subarray(start, start + 4)) === "Exif" && bytes[start + 4] === 0 && bytes[start + 5] === 0) {
|
|
67
|
+
const tiff = start + 6, little = bytes[tiff] === 0x49;
|
|
68
|
+
const u16 = (o) => v.getUint16(o, little), u32 = (o) => v.getUint32(o, little);
|
|
69
|
+
const ifd = tiff + u32(tiff + 4);
|
|
70
|
+
if (ifd + 2 > end) return 1;
|
|
71
|
+
const n = u16(ifd);
|
|
72
|
+
for (let e = 0; e < n && ifd + 2 + e * 12 + 12 <= end; e++) {
|
|
73
|
+
const at = ifd + 2 + e * 12;
|
|
74
|
+
if (u16(at) === 0x0112) return u16(at + 8);
|
|
75
|
+
}
|
|
76
|
+
return 1;
|
|
77
|
+
}
|
|
78
|
+
i += 2 + len;
|
|
79
|
+
}
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
48
83
|
// Why a model provider would reject these bytes as an image part, or null if
|
|
49
84
|
// it takes them: an unknown format, a size we can't read, a side over 8000px,
|
|
50
85
|
// or more than MAX_BYTES. Checked before any file part is emitted.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.11",
|
|
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",
|