@qoniai/qoni 0.4.4 → 0.5.0
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 +14 -0
- package/README.md +10 -0
- package/README.zh-CN.md +9 -0
- package/dist/index.cjs +35 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -739,6 +739,15 @@ interface SnapshotAction {
|
|
|
739
739
|
interface RunLimits {
|
|
740
740
|
maxDurationMinutes?: number;
|
|
741
741
|
}
|
|
742
|
+
type BrowserbaseRegion = "us-west-2" | "us-east-1" | "eu-central-1" | "ap-southeast-1";
|
|
743
|
+
interface BrowserProxyOptions {
|
|
744
|
+
/** Server-side proxy registry id. Credentials never enter the SDK call. */
|
|
745
|
+
proxyId?: string;
|
|
746
|
+
/** `off` uses datacenter egress; `all` proxies all requests; `scoped` uses admin patterns. */
|
|
747
|
+
mode?: "off" | "all" | "scoped";
|
|
748
|
+
/** Browserbase compute region. This is separate from the proxy's IP geography. */
|
|
749
|
+
region?: BrowserbaseRegion;
|
|
750
|
+
}
|
|
742
751
|
interface DoAnythingRunOptions {
|
|
743
752
|
/** Delegation token — passed once here; the returned handle holds it. */
|
|
744
753
|
token: string;
|
|
@@ -752,6 +761,8 @@ interface DoAnythingRunOptions {
|
|
|
752
761
|
*/
|
|
753
762
|
session?: SessionRef;
|
|
754
763
|
profileId?: string;
|
|
764
|
+
/** Applies when this run creates a new Browserbase session. */
|
|
765
|
+
browserProxy?: BrowserProxyOptions;
|
|
755
766
|
keepAlive?: boolean;
|
|
756
767
|
allowedActions?: string[];
|
|
757
768
|
skills?: string[];
|
|
@@ -1384,4 +1395,4 @@ declare const QoniScopeBundles: {
|
|
|
1384
1395
|
readonly TRACK: readonly ["webagent.track:read", "webagent.track:manage"];
|
|
1385
1396
|
};
|
|
1386
1397
|
|
|
1387
|
-
export { type Action, type ActionKind, ActionKinds, type Artifact, type CaptureOptions, type ClarificationPayload, type CompleteDelegateAgentInput, type CompleteDelegateTokenInput, type ConfirmationPayload, type CoreRunEvent, type DeepResearchAttachOptions, type DeepResearchEvent, type DeepResearchRunOptions, type DelegateAgentInput, type DelegateAgentResponse, type DelegateAgentTokenResponse, type DelegateTokenInput, type DelegateTokenInteractiveInput, type DelegateTokenResponse, type DelegateTokenResult, type DelegateTokenSilentInput, type DelegateTokenSilentResponse, type DelegationMode, type DelegationTokenResponse, type DoAnythingAttachOptions, type DoAnythingEvent, type DoAnythingRunOptions, type DoAnythingSnapshot, type GenAuthAccessTokenInput, type GenAuthAdminToken, type GenAuthAdminTokenOverrideInput, type GenAuthDelegationIntrospectionInput, type GenAuthUserCreateBatchInput, type GenAuthUserCreateInput, type GenAuthUserDeleteBatchInput, type GenAuthUserGetBatchInput, type GenAuthUserGetInput, type GenAuthUserListInput, type GenAuthUserUpdateInput, type Interaction, type InteractionEvidence, InteractionHandle, type InteractionPayloadByType, type InteractionSite, type InteractionStatus, InteractionStatuses, type InteractionType, InteractionTypes, type InteractiveDelegationResponse, type JsonObject, type MonitorEvent, type MonitorEventsOptions, MonitorHandle, type MonitorRunsOptions, Qoni, QoniAuthError, QoniDelegationRequiredError, QoniError, type QoniErrorCode, type QoniErrorOptions, type QoniEvent, type QoniEventType, QoniEventTypes, type QoniMeta, type QoniOptions, QoniPermissionDeniedError, type QoniProduct, type QoniProductName, QoniProductScopes, QoniRateLimitError, type QoniResponse, type QoniRuntimeConfig, type QoniSSEEvent, QoniScopeBundles, QoniScopes, QoniTimeoutError, QoniTokenExpiredError, QoniUpstreamError, QoniValidationError, type RawRequestInput, type RunDoneData, type RunEvent, type RunEventsOptions, RunHandle, type RunImage, type RunLimits, type RunMessageData, type RunReconnectInfo, type RunResult, type RunScreenshotData, type RunStatus, type RunWaitOptions, type RuntimeTokenInput, type SessionRef, type SiteLoginPayload, type SnapshotAction, type SnapshotImage, type TakeControlPayload, type TokenInput, type TrackAttachOptions, type TrackCreateOptions, type WaitKind, type WaitPayload, type WebSearchAttachOptions, type WebSearchEvent, type WebSearchRunOptions, buildAuthorization, buildSignature, buildStringToSign };
|
|
1398
|
+
export { type Action, type ActionKind, ActionKinds, type Artifact, type BrowserProxyOptions, type BrowserbaseRegion, type CaptureOptions, type ClarificationPayload, type CompleteDelegateAgentInput, type CompleteDelegateTokenInput, type ConfirmationPayload, type CoreRunEvent, type DeepResearchAttachOptions, type DeepResearchEvent, type DeepResearchRunOptions, type DelegateAgentInput, type DelegateAgentResponse, type DelegateAgentTokenResponse, type DelegateTokenInput, type DelegateTokenInteractiveInput, type DelegateTokenResponse, type DelegateTokenResult, type DelegateTokenSilentInput, type DelegateTokenSilentResponse, type DelegationMode, type DelegationTokenResponse, type DoAnythingAttachOptions, type DoAnythingEvent, type DoAnythingRunOptions, type DoAnythingSnapshot, type GenAuthAccessTokenInput, type GenAuthAdminToken, type GenAuthAdminTokenOverrideInput, type GenAuthDelegationIntrospectionInput, type GenAuthUserCreateBatchInput, type GenAuthUserCreateInput, type GenAuthUserDeleteBatchInput, type GenAuthUserGetBatchInput, type GenAuthUserGetInput, type GenAuthUserListInput, type GenAuthUserUpdateInput, type Interaction, type InteractionEvidence, InteractionHandle, type InteractionPayloadByType, type InteractionSite, type InteractionStatus, InteractionStatuses, type InteractionType, InteractionTypes, type InteractiveDelegationResponse, type JsonObject, type MonitorEvent, type MonitorEventsOptions, MonitorHandle, type MonitorRunsOptions, Qoni, QoniAuthError, QoniDelegationRequiredError, QoniError, type QoniErrorCode, type QoniErrorOptions, type QoniEvent, type QoniEventType, QoniEventTypes, type QoniMeta, type QoniOptions, QoniPermissionDeniedError, type QoniProduct, type QoniProductName, QoniProductScopes, QoniRateLimitError, type QoniResponse, type QoniRuntimeConfig, type QoniSSEEvent, QoniScopeBundles, QoniScopes, QoniTimeoutError, QoniTokenExpiredError, QoniUpstreamError, QoniValidationError, type RawRequestInput, type RunDoneData, type RunEvent, type RunEventsOptions, RunHandle, type RunImage, type RunLimits, type RunMessageData, type RunReconnectInfo, type RunResult, type RunScreenshotData, type RunStatus, type RunWaitOptions, type RuntimeTokenInput, type SessionRef, type SiteLoginPayload, type SnapshotAction, type SnapshotImage, type TakeControlPayload, type TokenInput, type TrackAttachOptions, type TrackCreateOptions, type WaitKind, type WaitPayload, type WebSearchAttachOptions, type WebSearchEvent, type WebSearchRunOptions, buildAuthorization, buildSignature, buildStringToSign };
|
package/dist/index.d.ts
CHANGED
|
@@ -739,6 +739,15 @@ interface SnapshotAction {
|
|
|
739
739
|
interface RunLimits {
|
|
740
740
|
maxDurationMinutes?: number;
|
|
741
741
|
}
|
|
742
|
+
type BrowserbaseRegion = "us-west-2" | "us-east-1" | "eu-central-1" | "ap-southeast-1";
|
|
743
|
+
interface BrowserProxyOptions {
|
|
744
|
+
/** Server-side proxy registry id. Credentials never enter the SDK call. */
|
|
745
|
+
proxyId?: string;
|
|
746
|
+
/** `off` uses datacenter egress; `all` proxies all requests; `scoped` uses admin patterns. */
|
|
747
|
+
mode?: "off" | "all" | "scoped";
|
|
748
|
+
/** Browserbase compute region. This is separate from the proxy's IP geography. */
|
|
749
|
+
region?: BrowserbaseRegion;
|
|
750
|
+
}
|
|
742
751
|
interface DoAnythingRunOptions {
|
|
743
752
|
/** Delegation token — passed once here; the returned handle holds it. */
|
|
744
753
|
token: string;
|
|
@@ -752,6 +761,8 @@ interface DoAnythingRunOptions {
|
|
|
752
761
|
*/
|
|
753
762
|
session?: SessionRef;
|
|
754
763
|
profileId?: string;
|
|
764
|
+
/** Applies when this run creates a new Browserbase session. */
|
|
765
|
+
browserProxy?: BrowserProxyOptions;
|
|
755
766
|
keepAlive?: boolean;
|
|
756
767
|
allowedActions?: string[];
|
|
757
768
|
skills?: string[];
|
|
@@ -1384,4 +1395,4 @@ declare const QoniScopeBundles: {
|
|
|
1384
1395
|
readonly TRACK: readonly ["webagent.track:read", "webagent.track:manage"];
|
|
1385
1396
|
};
|
|
1386
1397
|
|
|
1387
|
-
export { type Action, type ActionKind, ActionKinds, type Artifact, type CaptureOptions, type ClarificationPayload, type CompleteDelegateAgentInput, type CompleteDelegateTokenInput, type ConfirmationPayload, type CoreRunEvent, type DeepResearchAttachOptions, type DeepResearchEvent, type DeepResearchRunOptions, type DelegateAgentInput, type DelegateAgentResponse, type DelegateAgentTokenResponse, type DelegateTokenInput, type DelegateTokenInteractiveInput, type DelegateTokenResponse, type DelegateTokenResult, type DelegateTokenSilentInput, type DelegateTokenSilentResponse, type DelegationMode, type DelegationTokenResponse, type DoAnythingAttachOptions, type DoAnythingEvent, type DoAnythingRunOptions, type DoAnythingSnapshot, type GenAuthAccessTokenInput, type GenAuthAdminToken, type GenAuthAdminTokenOverrideInput, type GenAuthDelegationIntrospectionInput, type GenAuthUserCreateBatchInput, type GenAuthUserCreateInput, type GenAuthUserDeleteBatchInput, type GenAuthUserGetBatchInput, type GenAuthUserGetInput, type GenAuthUserListInput, type GenAuthUserUpdateInput, type Interaction, type InteractionEvidence, InteractionHandle, type InteractionPayloadByType, type InteractionSite, type InteractionStatus, InteractionStatuses, type InteractionType, InteractionTypes, type InteractiveDelegationResponse, type JsonObject, type MonitorEvent, type MonitorEventsOptions, MonitorHandle, type MonitorRunsOptions, Qoni, QoniAuthError, QoniDelegationRequiredError, QoniError, type QoniErrorCode, type QoniErrorOptions, type QoniEvent, type QoniEventType, QoniEventTypes, type QoniMeta, type QoniOptions, QoniPermissionDeniedError, type QoniProduct, type QoniProductName, QoniProductScopes, QoniRateLimitError, type QoniResponse, type QoniRuntimeConfig, type QoniSSEEvent, QoniScopeBundles, QoniScopes, QoniTimeoutError, QoniTokenExpiredError, QoniUpstreamError, QoniValidationError, type RawRequestInput, type RunDoneData, type RunEvent, type RunEventsOptions, RunHandle, type RunImage, type RunLimits, type RunMessageData, type RunReconnectInfo, type RunResult, type RunScreenshotData, type RunStatus, type RunWaitOptions, type RuntimeTokenInput, type SessionRef, type SiteLoginPayload, type SnapshotAction, type SnapshotImage, type TakeControlPayload, type TokenInput, type TrackAttachOptions, type TrackCreateOptions, type WaitKind, type WaitPayload, type WebSearchAttachOptions, type WebSearchEvent, type WebSearchRunOptions, buildAuthorization, buildSignature, buildStringToSign };
|
|
1398
|
+
export { type Action, type ActionKind, ActionKinds, type Artifact, type BrowserProxyOptions, type BrowserbaseRegion, type CaptureOptions, type ClarificationPayload, type CompleteDelegateAgentInput, type CompleteDelegateTokenInput, type ConfirmationPayload, type CoreRunEvent, type DeepResearchAttachOptions, type DeepResearchEvent, type DeepResearchRunOptions, type DelegateAgentInput, type DelegateAgentResponse, type DelegateAgentTokenResponse, type DelegateTokenInput, type DelegateTokenInteractiveInput, type DelegateTokenResponse, type DelegateTokenResult, type DelegateTokenSilentInput, type DelegateTokenSilentResponse, type DelegationMode, type DelegationTokenResponse, type DoAnythingAttachOptions, type DoAnythingEvent, type DoAnythingRunOptions, type DoAnythingSnapshot, type GenAuthAccessTokenInput, type GenAuthAdminToken, type GenAuthAdminTokenOverrideInput, type GenAuthDelegationIntrospectionInput, type GenAuthUserCreateBatchInput, type GenAuthUserCreateInput, type GenAuthUserDeleteBatchInput, type GenAuthUserGetBatchInput, type GenAuthUserGetInput, type GenAuthUserListInput, type GenAuthUserUpdateInput, type Interaction, type InteractionEvidence, InteractionHandle, type InteractionPayloadByType, type InteractionSite, type InteractionStatus, InteractionStatuses, type InteractionType, InteractionTypes, type InteractiveDelegationResponse, type JsonObject, type MonitorEvent, type MonitorEventsOptions, MonitorHandle, type MonitorRunsOptions, Qoni, QoniAuthError, QoniDelegationRequiredError, QoniError, type QoniErrorCode, type QoniErrorOptions, type QoniEvent, type QoniEventType, QoniEventTypes, type QoniMeta, type QoniOptions, QoniPermissionDeniedError, type QoniProduct, type QoniProductName, QoniProductScopes, QoniRateLimitError, type QoniResponse, type QoniRuntimeConfig, type QoniSSEEvent, QoniScopeBundles, QoniScopes, QoniTimeoutError, QoniTokenExpiredError, QoniUpstreamError, QoniValidationError, type RawRequestInput, type RunDoneData, type RunEvent, type RunEventsOptions, RunHandle, type RunImage, type RunLimits, type RunMessageData, type RunReconnectInfo, type RunResult, type RunScreenshotData, type RunStatus, type RunWaitOptions, type RuntimeTokenInput, type SessionRef, type SiteLoginPayload, type SnapshotAction, type SnapshotImage, type TakeControlPayload, type TokenInput, type TrackAttachOptions, type TrackCreateOptions, type WaitKind, type WaitPayload, type WebSearchAttachOptions, type WebSearchEvent, type WebSearchRunOptions, buildAuthorization, buildSignature, buildStringToSign };
|
package/dist/index.js
CHANGED
|
@@ -1146,6 +1146,34 @@ var PLATFORM_DECIDED_RUN_OPTIONS = [
|
|
|
1146
1146
|
"outputSchema",
|
|
1147
1147
|
"cacheScript"
|
|
1148
1148
|
];
|
|
1149
|
+
var BROWSERBASE_REGIONS = /* @__PURE__ */ new Set([
|
|
1150
|
+
"us-west-2",
|
|
1151
|
+
"us-east-1",
|
|
1152
|
+
"eu-central-1",
|
|
1153
|
+
"ap-southeast-1"
|
|
1154
|
+
]);
|
|
1155
|
+
function validateBrowserProxyOptions(value) {
|
|
1156
|
+
if (value === void 0) return;
|
|
1157
|
+
if (!isJsonObject(value)) {
|
|
1158
|
+
throw new QoniValidationError("browserProxy must be an object");
|
|
1159
|
+
}
|
|
1160
|
+
const allowed = /* @__PURE__ */ new Set(["proxyId", "mode", "region"]);
|
|
1161
|
+
const extras = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1162
|
+
if (extras.length > 0) {
|
|
1163
|
+
throw new QoniValidationError(
|
|
1164
|
+
`browserProxy does not accept ${extras.join(", ")} \u2014 credentials stay server-side`
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
if (value.proxyId !== void 0 && (typeof value.proxyId !== "string" || !/^[a-z0-9][a-z0-9._-]{0,63}$/.test(value.proxyId))) {
|
|
1168
|
+
throw new QoniValidationError("browserProxy.proxyId is invalid");
|
|
1169
|
+
}
|
|
1170
|
+
if (value.mode !== void 0 && !["off", "all", "scoped"].includes(String(value.mode))) {
|
|
1171
|
+
throw new QoniValidationError("browserProxy.mode must be off, all, or scoped");
|
|
1172
|
+
}
|
|
1173
|
+
if (value.region !== void 0 && (typeof value.region !== "string" || !BROWSERBASE_REGIONS.has(value.region))) {
|
|
1174
|
+
throw new QoniValidationError("browserProxy.region is not supported");
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1149
1177
|
function createDoAnythingNamespace(transport) {
|
|
1150
1178
|
const api = {
|
|
1151
1179
|
createSession: (input) => transport.webAgentJson("POST", "/do_anything/sessions", input.token, {
|
|
@@ -1308,6 +1336,7 @@ function createDoAnythingNamespace(transport) {
|
|
|
1308
1336
|
if (!prompt || typeof prompt !== "string") {
|
|
1309
1337
|
throw new QoniValidationError("doAnything.run requires a prompt string");
|
|
1310
1338
|
}
|
|
1339
|
+
validateBrowserProxyOptions(rest.browserProxy);
|
|
1311
1340
|
const unsupported = PLATFORM_DECIDED_RUN_OPTIONS.filter(
|
|
1312
1341
|
(key) => rest[key] !== void 0
|
|
1313
1342
|
);
|
|
@@ -1359,8 +1388,13 @@ function normalizeDoAnythingRunInput(input) {
|
|
|
1359
1388
|
profileId: "profile_id",
|
|
1360
1389
|
keepAlive: "keep_alive",
|
|
1361
1390
|
allowedActions: "allowed_actions",
|
|
1362
|
-
maxDurationMinutes: "max_duration_minutes"
|
|
1391
|
+
maxDurationMinutes: "max_duration_minutes",
|
|
1392
|
+
browserProxy: "browser_proxy"
|
|
1363
1393
|
});
|
|
1394
|
+
const browserProxy = body.browser_proxy;
|
|
1395
|
+
if (isJsonObject(browserProxy)) {
|
|
1396
|
+
body.browser_proxy = renameKeys2(browserProxy, { proxyId: "proxy_id" });
|
|
1397
|
+
}
|
|
1364
1398
|
return body;
|
|
1365
1399
|
}
|
|
1366
1400
|
function normalizeDoAnythingInterveneInput(input) {
|