@mindstudio-ai/agent 0.1.170 → 0.1.172
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 +22 -0
- package/dist/cli.js +587 -21
- package/dist/index.d.ts +398 -14
- package/dist/index.js +580 -13
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +587 -21
- package/llms.txt +24 -0
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -412,6 +412,7 @@ Ask structured questions about text, JSON, or images and get calibrated answers
|
|
|
412
412
|
- jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.
|
|
413
413
|
- clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.
|
|
414
414
|
- mercury-decide runs Inception's Mercury Decide, which reads up to 64k tokens and up to 16 PNG, JPEG, WebP, or GIF images, each at most 10 MiB and 14 MiB together.
|
|
415
|
+
- drex-max, drex-v2.0 and drex-v1.5 run Nace.AI's Drex, served by DeepInfra, and take at most 16 questions. drex-max reads up to 262k tokens and up to 4 PNG, JPEG, WebP, or GIF images, 9 MiB together. drex-v2.0 and drex-v1.5 read text only, up to 128k tokens. nace-ai/drex-max, nace-ai/drex-v2.0 and nace-ai/drex-v1.5 name the same three.
|
|
415
416
|
- gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.
|
|
416
417
|
- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.
|
|
417
418
|
- The response model field is the version that answered.
|
|
@@ -2019,3 +2020,26 @@ The frontend consumes with `events.connect({ getToken, onEvent, onConnect })` fr
|
|
|
2019
2020
|
**A channel is an audience, and a method decides who is in it.** Never put two users' data on one channel. Default to per-user channels with publish-time fan-out (as above) for membership-gated audiences — removing someone stops their events immediately; reserve a shared channel for genuinely broadcast content (a ticker, a live blog), where revocation waits out the grant TTL. For anonymous visitors `auth.userId` is null — key their channels on `session.visitorId` instead, or `user:null` becomes one channel shared by every anonymous user.
|
|
2020
2021
|
|
|
2021
2022
|
**Events are at-most-once nudges.** Nothing is buffered while a client is disconnected and nothing replays on connect — clients refetch state in `onConnect` (subscribe for speed, reconcile for truth). `delivered: 0` means nobody is listening right now: normal, never an error. Every delivered frame carries the platform-stamped publish `id` (consumer dedupe key: `id` + `channel`); `publish` returns the same id. Payloads cap at 256k serialized chars, checked in the SDK before the network so oversize throws locally — when a publish carries data, publish before committing the write it announces; high-rate paths publish ids (`{ type, id }`) and let the client fetch. Channels are exact strings (letters, digits, `: _ - .` — no wildcards), ≤500 per publish, ≤100 per grant. Publishes and grants are scoped to the execution's environment (live/preview/dev) automatically, so a dev-session publish can never reach live users. Debug with `remy-admin events tail | publish | channels list`.
|
|
2023
|
+
|
|
2024
|
+
#### `browser` — a real Chrome the backend drives
|
|
2025
|
+
|
|
2026
|
+
Sign in to a site, work through its screens, read what it shows, keep screenshots. `browser.open()` starts a session: one browser with one page, open across calls until `close()`, its idle timeout (`idleTimeoutSeconds`, five minutes by default, up to 30) or 55 minutes. Backend only (hook token).
|
|
2027
|
+
|
|
2028
|
+
```typescript
|
|
2029
|
+
import { browser } from '@mindstudio-ai/agent';
|
|
2030
|
+
|
|
2031
|
+
const session = await browser.open({ url: 'https://app.example.com/login', viewport: 'mobile' }); // or 'desktop' (default), { width, height }
|
|
2032
|
+
await session.type({ label: 'Email' }, process.env.DEMO_EMAIL!);
|
|
2033
|
+
await session.type({ label: 'Password' }, process.env.DEMO_PASSWORD!, { submit: true });
|
|
2034
|
+
await session.waitFor('Dashboard');
|
|
2035
|
+
const clicked = await session.click({ role: 'link', text: 'Settings' }); // { url, title, snapshot, matched, box }
|
|
2036
|
+
const shot = await session.screenshot({ store: Shots }); // StoredFile & { width, height, deviceScaleFactor }; no store → { data: Buffer, ... }
|
|
2037
|
+
const later = await browser.session(session.id); // pick it up from another call (a cron resuming a run)
|
|
2038
|
+
await session.close();
|
|
2039
|
+
```
|
|
2040
|
+
|
|
2041
|
+
Every action returns the page afterward, `{ url, title, snapshot }`: `snapshot` is an outline with a ref on everything actionable (`button "Save" [ref=e12]`). Targets: a ref from the latest snapshot (`'e12'`), or `{ text }`, `{ role, text }`, `{ label }`, `{ selector }`. Element actions add `matched` and `box` (viewport CSS pixels, for a highlight). Pages render at 2x, so a screenshot is twice the viewport's size (its `deviceScaleFactor`). The rest: `goto(url)`, `snapshot()`, `select(target, option)`, `press(key)`, `scroll({ to?, by? })`, `screenshot({ fullPage?, cursor? })` (`cursor` keeps the session's cursor in the shot, where it last acted), `evaluate(fn, arg?)` (sent as source: no closures, pass what it needs as `arg`). Input is the browser's own; password values never appear in a snapshot. Pages go out through the deployment's exit proxy, on Remy's cloud a US residential address held for the session (the platform's own hosts, the app's included, direct), and the user agent is Chrome's with `RemyBrowser/1.0`, where to report a session and an opaque reference after it; each session's open and close, with its sites, are in the workspace's audit log. Billed for browser time per hour, from ready to its end, and that traffic per MB, so close a session when its work is done; a workspace has 10 open at once unless its limit is raised. Actions on one session run one at a time, in call order.
|
|
2042
|
+
|
|
2043
|
+
**A model drives it** through `runTask({ tools: [...session.tools({ secrets: { password: process.env.X! } })] })`: one tool, `browser`, taking a list of steps (`snapshot`, `navigate`, `click`, `type`, `select`, `press`, `scroll`, `wait`) run in order, stopping at the first that fails, answering with each step's outcome and the page after the last. A `type` step can name a secret in place of its text, which the model never sees, and only the latest page stays in full in the task's transcript (`supersedes`). With `session.tools({ screenshots: Store })` the model also gets `browser_screenshot({ question?, fullPage?, cursor? })`, which saves a screenshot to that store and answers with its `key` and a written description (an `analyzeImage` call), for what the outline can't say; those answers all stay in the transcript. **A person watches it** when a method returns `session.grantView()` (after its own access checks) and the frontend calls `browser.view(element, { getToken, onEnd? })` from `@mindstudio-ai/interface`, which draws the page into a `<canvas>`; its `state` is `connecting`, `live`, then `ended` (with `onEnd(reason)`).
|
|
2044
|
+
|
|
2045
|
+
Errors are `MindStudioError` codes: `browser_action_failed` (the page's reason; take a fresh snapshot when a ref is gone), `browser_timeout`, `browser_session_closed` / `browser_session_not_found` (open a new one), `browser_unavailable` (try again shortly), `browser_at_capacity` (the workspace's limit: close finished sessions). A session drives its one page: new tabs and iframe content aren't reachable.
|