- browser.screenshot returns the page as an image content block (≤1280px wide, JPEG quality configurable) for vision-capable upstreams; non-vision upstreams get a redacted text snapshot. Login pages / password fields are marked sensitive and withheld unless a browser.sensitive_screenshot grant exists and allowSensitive is passed. - browser.click_at / type_at / scroll / wait act in screenshot pixels; the server converts via viewport/DPR, requires automation control and an allowlisted host, and writes a thumbnail evidence file (DATA_DIR/tmp/evidence) referenced from agent_run_event. - browser.solve_challenge runs a bounded child agent_run (vision caps only, maxSteps ≤ 12, budget), judges success from page facts, stops immediately on 2FA / SMS / device confirmation, and otherwise moves the session to waiting with evidence and a takeover link. - PiAgentRuntime passes modelImage outputs as pi-ai image content when model.input has image; the ledger never stores image data; coordinate actions use per-invocation idempotency keys. - Tests: image codec, runtime image content, E14 e2e (login solved, 2FA stop, step limit, sensitive withheld). Real camofox 1.17.0 check on example.com recorded in the runbook. Co-Authored-By: Claude Opus 5.5 <[email protected]>
66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
// @umt/agent 公开入口。Pi SDK 类型只出现在 src/pi/*,这里只导出本包自有接口。
|
|
export const PACKAGE_NAME = "@umt/agent";
|
|
|
|
export { CapabilityError, type CapabilityErrorCode, isCapabilityError } from "./capability/errors.ts";
|
|
export {
|
|
CapabilityRegistry,
|
|
type CapabilityRegistryOptions,
|
|
defaultIdempotencyKey,
|
|
type RegisteredCapability,
|
|
stableStringify,
|
|
} from "./capability/registry.ts";
|
|
export { capabilityIdToToolName, isCapabilityId, toolNameToCapabilityId } from "./capability/tool-name.ts";
|
|
export * from "./capability/types.ts";
|
|
export {
|
|
ENV_FIELDS,
|
|
OAUTH_CALLBACK_PORTS,
|
|
OAUTH_MODES,
|
|
PI_AI_VERSION,
|
|
providerCatalog,
|
|
providerInfo,
|
|
} from "./pi/catalog.ts";
|
|
export {
|
|
type CreateFakeRuntimeOptions,
|
|
createFakeRuntime,
|
|
FAKE_AGENT_SETTINGS,
|
|
FakeModelProvider,
|
|
type FakeModelProviderOptions,
|
|
type FakeScript,
|
|
type FakeStep,
|
|
type FakeToolCall,
|
|
type FakeToolResult,
|
|
} from "./pi/fake.ts";
|
|
export { DEFAULT_FAKE_OAUTH, FakeOAuthControl } from "./pi/fake-upstream.ts";
|
|
export {
|
|
checkToolCall,
|
|
DEFAULT_COMPACTION_INSTRUCTIONS,
|
|
PiAgentRuntime,
|
|
type PiAgentRuntimeOptions,
|
|
toolContent,
|
|
} from "./pi/runtime.ts";
|
|
export { sessionPathFor } from "./pi/session.ts";
|
|
export {
|
|
classifyUpstreamError,
|
|
PiUpstreamClient,
|
|
type UpstreamAuthEvent,
|
|
type UpstreamAuthPrompt,
|
|
type UpstreamClientOptions,
|
|
type UpstreamCredential,
|
|
type UpstreamCredentialStore,
|
|
UpstreamError,
|
|
type UpstreamLoginInteraction,
|
|
type UpstreamSpec,
|
|
} from "./pi/upstream.ts";
|
|
export { isSensitiveKey, REDACTED, redactForModel, redactString, summarizeForLog } from "./redact.ts";
|
|
export * from "./runtime/port.ts";
|
|
export {
|
|
type AgentSettings,
|
|
AgentSettingsSchema,
|
|
type AgentThinkingLevel,
|
|
describeSettings,
|
|
type ResolvedAgentSettings,
|
|
resolveAgentSettings,
|
|
THINKING_LEVELS,
|
|
} from "./settings.ts";
|
|
export { buildSystemPrompt, type SystemPromptInput } from "./system-prompt.ts";
|