@oya-ai/browser 1.0.204 → 1.0.207
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/dist/index.cjs +27 -1
- package/dist/index.d.cts +46 -1
- package/dist/index.d.ts +46 -1
- package/dist/index.js +27 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -636,7 +636,9 @@ function shareLink(baseUrl, id, token) {
|
|
|
636
636
|
// src/api/browsers.ts
|
|
637
637
|
function startBody(options) {
|
|
638
638
|
const { profile, persona, provider, wsUrl, name, queueMs, priority, budgetUsd, governed, policy } = options;
|
|
639
|
-
|
|
639
|
+
const personaGroup = options.personaGroup || options.profileGroup;
|
|
640
|
+
const runs = { profile: profile || persona, personaGroup };
|
|
641
|
+
return { ...runs, provider, wsUrl, name, queueMs, priority, budgetUsd, governed, policy };
|
|
640
642
|
}
|
|
641
643
|
var idempotencyKeyOf = ({ idempotencyKey }) => idempotencyKey ? headerSafe(idempotencyKey, "idempotencyKey", 'Use letters, digits, "-" and "_".') : globalThis.crypto.randomUUID();
|
|
642
644
|
async function start(http, wait, options) {
|
|
@@ -867,6 +869,23 @@ var personaApi = (http) => ({
|
|
|
867
869
|
...cookieCalls(http)
|
|
868
870
|
});
|
|
869
871
|
|
|
872
|
+
// src/api/persona-groups.ts
|
|
873
|
+
var personaGroupApi = (http) => ({
|
|
874
|
+
/** Every group on this key. */
|
|
875
|
+
list: async () => (await http().request("GET", "/api/persona-groups")).groups,
|
|
876
|
+
/**
|
|
877
|
+
* A new group of this key's personas (not the default one). Its name is what a
|
|
878
|
+
* start passes, so it cannot change later; a name already used is a 409.
|
|
879
|
+
*/
|
|
880
|
+
create: (name, personaIds = []) => http().request("POST", "/api/persona-groups", { name, personaIds }),
|
|
881
|
+
/** Replaces the group's members. */
|
|
882
|
+
update: (name, personaIds) => http().request("PUT", `/api/persona-groups/${segment(name, "name")}`, { personaIds }),
|
|
883
|
+
/** Deletes the group; its personas and their browsers are not touched. */
|
|
884
|
+
remove: async (name) => {
|
|
885
|
+
await http().request("DELETE", `/api/persona-groups/${segment(name, "name")}`);
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
|
|
870
889
|
// src/api/config.ts
|
|
871
890
|
var configApi = (http) => ({
|
|
872
891
|
/** This key's settings. Secrets read back masked. */
|
|
@@ -1109,6 +1128,13 @@ var Oya = class {
|
|
|
1109
1128
|
config = configApi(() => this.http);
|
|
1110
1129
|
/** Saved profiles. `personas` is retained as an alias for existing clients. */
|
|
1111
1130
|
profiles = this.personas;
|
|
1131
|
+
/**
|
|
1132
|
+
* Persona groups: name a set of your personas, then start browsers with
|
|
1133
|
+
* `oya.browser.start({ personaGroup: name })` to spread them across the set.
|
|
1134
|
+
*/
|
|
1135
|
+
personaGroups = personaGroupApi(() => this.http);
|
|
1136
|
+
/** The same as `personaGroups`, matching the `profiles` alias. */
|
|
1137
|
+
profileGroups = this.personaGroups;
|
|
1112
1138
|
/** What this key has spent. */
|
|
1113
1139
|
usage() {
|
|
1114
1140
|
return this.http.request("GET", "/api/usage");
|
package/dist/index.d.cts
CHANGED
|
@@ -37,6 +37,19 @@ interface StartOptions {
|
|
|
37
37
|
* <id> , a specific persona
|
|
38
38
|
*/
|
|
39
39
|
persona?: 'default' | 'auto' | (string & {});
|
|
40
|
+
/**
|
|
41
|
+
* A persona group to run as instead of one persona: the start runs as one of
|
|
42
|
+
* the group's personas, the one with the fewest running browsers, then the one
|
|
43
|
+
* used longest ago, skipping those at their cap. Make groups with
|
|
44
|
+
* `oya.personaGroups.create`. Not with `persona` or `profile`. When every
|
|
45
|
+
* member is full, `queueMs` waits on the least busy one.
|
|
46
|
+
*
|
|
47
|
+
* Needs Oya server 1.0.205 or later: an older server ignores it and starts as
|
|
48
|
+
* the default persona.
|
|
49
|
+
*/
|
|
50
|
+
personaGroup?: string;
|
|
51
|
+
/** The same as `personaGroup`, matching the `profile` alias of `persona`. */
|
|
52
|
+
profileGroup?: string;
|
|
40
53
|
/** Solve CAPTCHAs as they appear rather than waiting to be asked. */
|
|
41
54
|
captcha?: 'auto' | 'off';
|
|
42
55
|
/** Override the key's configured provider for this browser only. */
|
|
@@ -705,6 +718,8 @@ interface PersonaInfo {
|
|
|
705
718
|
proxy: {
|
|
706
719
|
/** Two-letter country, optionally a region. */
|
|
707
720
|
geo: string | null;
|
|
721
|
+
/** Present and true when it runs with no proxy at all. */
|
|
722
|
+
direct?: boolean;
|
|
708
723
|
} | null;
|
|
709
724
|
/** The proxy it is actually on, once assigned or pinned. */
|
|
710
725
|
exit: {
|
|
@@ -845,6 +860,17 @@ interface Cookie {
|
|
|
845
860
|
}
|
|
846
861
|
/** The formats a jar is exported in: as stored, or ready for Playwright's `context.addCookies()`. */
|
|
847
862
|
type CookieFormat = 'json' | 'playwright';
|
|
863
|
+
/** A named set of personas a browser start can run as instead of one persona. */
|
|
864
|
+
interface PersonaGroup {
|
|
865
|
+
/** What `start({ personaGroup })` passes; unique per key, and cannot be renamed. */
|
|
866
|
+
name: string;
|
|
867
|
+
/** Its member personas that still exist. */
|
|
868
|
+
personaIds: string[];
|
|
869
|
+
/** When it was made (ISO). */
|
|
870
|
+
createdAt: string;
|
|
871
|
+
/** When its members last changed (ISO). */
|
|
872
|
+
updatedAt: string;
|
|
873
|
+
}
|
|
848
874
|
|
|
849
875
|
/**
|
|
850
876
|
* Types for the durable control plane: sessions and their lifecycle, human
|
|
@@ -1122,6 +1148,8 @@ interface ProxyCheck {
|
|
|
1122
1148
|
interface GeoHint {
|
|
1123
1149
|
/** Two-letter country, optionally a region. */
|
|
1124
1150
|
geo?: string;
|
|
1151
|
+
/** Connect with no proxy at all: not an assigned proxy, not Oya residential. Traffic leaves from the browser's own network. Overrides geo. */
|
|
1152
|
+
direct?: boolean;
|
|
1125
1153
|
}
|
|
1126
1154
|
/** A persona to create. */
|
|
1127
1155
|
interface PersonaCreate {
|
|
@@ -1605,6 +1633,23 @@ declare class Oya {
|
|
|
1605
1633
|
update: (id: string, changes: PersonaUpdate) => Promise<PersonaInfo>;
|
|
1606
1634
|
clone: (id: string, options?: CloneOptions) => Promise<PersonaInfo>;
|
|
1607
1635
|
};
|
|
1636
|
+
/**
|
|
1637
|
+
* Persona groups: name a set of your personas, then start browsers with
|
|
1638
|
+
* `oya.browser.start({ personaGroup: name })` to spread them across the set.
|
|
1639
|
+
*/
|
|
1640
|
+
readonly personaGroups: {
|
|
1641
|
+
list: () => Promise<PersonaGroup[]>;
|
|
1642
|
+
create: (name: string, personaIds?: string[]) => Promise<PersonaGroup>;
|
|
1643
|
+
update: (name: string, personaIds: string[]) => Promise<PersonaGroup>;
|
|
1644
|
+
remove: (name: string) => Promise<void>;
|
|
1645
|
+
};
|
|
1646
|
+
/** The same as `personaGroups`, matching the `profiles` alias. */
|
|
1647
|
+
readonly profileGroups: {
|
|
1648
|
+
list: () => Promise<PersonaGroup[]>;
|
|
1649
|
+
create: (name: string, personaIds?: string[]) => Promise<PersonaGroup>;
|
|
1650
|
+
update: (name: string, personaIds: string[]) => Promise<PersonaGroup>;
|
|
1651
|
+
remove: (name: string) => Promise<void>;
|
|
1652
|
+
};
|
|
1608
1653
|
/** What this key has spent. */
|
|
1609
1654
|
usage(): Promise<unknown>;
|
|
1610
1655
|
/** Waits for a starting browser to dial in, through this client's own list and session calls. */
|
|
@@ -1612,4 +1657,4 @@ declare class Oya {
|
|
|
1612
1657
|
}
|
|
1613
1658
|
|
|
1614
1659
|
export { Browser, MAX_FILE_BYTES, Oya, OyaError, Run, Oya as default, file };
|
|
1615
|
-
export type { Activity, Analysis, AnalyzeOptions, AttentionRequest, Block, BrowserDetail, BrowserInfo, CaptchaResult, CaptchaSolver, Config, ConfigUpdate, ControlCredential, ControlEvent, ControlOverview, ControlRole, ControlSession, Cookie, CookieFormat, DesktopOptions, EcsAuth, EcsConfig, Element, FileValue, Fingerprint, Health, HumanInputAction, ImportOptions, LlmCatalogEntry, LlmProvider, MfaConfig, MfaResult, OyaOptions, PageFormat, PersonaInfo, PersonaPrefs, PlayResult, Playbook, PlaybookAnswer, PlaybookExport, PlaybookSummary, ProjectSettings, Provider, ProxyCreate, ProxyInfo, RecoverOptions, RunData, RunInfo, RunResult, SandboxRuntime, Signup, SignupOptions, SiteCredentials, StartOptions, StartResult, StopResult, SubmitOptions };
|
|
1660
|
+
export type { Activity, Analysis, AnalyzeOptions, AttentionRequest, Block, BrowserDetail, BrowserInfo, CaptchaResult, CaptchaSolver, Config, ConfigUpdate, ControlCredential, ControlEvent, ControlOverview, ControlRole, ControlSession, Cookie, CookieFormat, DesktopOptions, EcsAuth, EcsConfig, Element, FileValue, Fingerprint, Health, HumanInputAction, ImportOptions, LlmCatalogEntry, LlmProvider, MfaConfig, MfaResult, OyaOptions, PageFormat, PersonaGroup, PersonaInfo, PersonaPrefs, PlayResult, Playbook, PlaybookAnswer, PlaybookExport, PlaybookSummary, ProjectSettings, Provider, ProxyCreate, ProxyInfo, RecoverOptions, RunData, RunInfo, RunResult, SandboxRuntime, Signup, SignupOptions, SiteCredentials, StartOptions, StartResult, StopResult, SubmitOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,19 @@ interface StartOptions {
|
|
|
37
37
|
* <id> , a specific persona
|
|
38
38
|
*/
|
|
39
39
|
persona?: 'default' | 'auto' | (string & {});
|
|
40
|
+
/**
|
|
41
|
+
* A persona group to run as instead of one persona: the start runs as one of
|
|
42
|
+
* the group's personas, the one with the fewest running browsers, then the one
|
|
43
|
+
* used longest ago, skipping those at their cap. Make groups with
|
|
44
|
+
* `oya.personaGroups.create`. Not with `persona` or `profile`. When every
|
|
45
|
+
* member is full, `queueMs` waits on the least busy one.
|
|
46
|
+
*
|
|
47
|
+
* Needs Oya server 1.0.205 or later: an older server ignores it and starts as
|
|
48
|
+
* the default persona.
|
|
49
|
+
*/
|
|
50
|
+
personaGroup?: string;
|
|
51
|
+
/** The same as `personaGroup`, matching the `profile` alias of `persona`. */
|
|
52
|
+
profileGroup?: string;
|
|
40
53
|
/** Solve CAPTCHAs as they appear rather than waiting to be asked. */
|
|
41
54
|
captcha?: 'auto' | 'off';
|
|
42
55
|
/** Override the key's configured provider for this browser only. */
|
|
@@ -705,6 +718,8 @@ interface PersonaInfo {
|
|
|
705
718
|
proxy: {
|
|
706
719
|
/** Two-letter country, optionally a region. */
|
|
707
720
|
geo: string | null;
|
|
721
|
+
/** Present and true when it runs with no proxy at all. */
|
|
722
|
+
direct?: boolean;
|
|
708
723
|
} | null;
|
|
709
724
|
/** The proxy it is actually on, once assigned or pinned. */
|
|
710
725
|
exit: {
|
|
@@ -845,6 +860,17 @@ interface Cookie {
|
|
|
845
860
|
}
|
|
846
861
|
/** The formats a jar is exported in: as stored, or ready for Playwright's `context.addCookies()`. */
|
|
847
862
|
type CookieFormat = 'json' | 'playwright';
|
|
863
|
+
/** A named set of personas a browser start can run as instead of one persona. */
|
|
864
|
+
interface PersonaGroup {
|
|
865
|
+
/** What `start({ personaGroup })` passes; unique per key, and cannot be renamed. */
|
|
866
|
+
name: string;
|
|
867
|
+
/** Its member personas that still exist. */
|
|
868
|
+
personaIds: string[];
|
|
869
|
+
/** When it was made (ISO). */
|
|
870
|
+
createdAt: string;
|
|
871
|
+
/** When its members last changed (ISO). */
|
|
872
|
+
updatedAt: string;
|
|
873
|
+
}
|
|
848
874
|
|
|
849
875
|
/**
|
|
850
876
|
* Types for the durable control plane: sessions and their lifecycle, human
|
|
@@ -1122,6 +1148,8 @@ interface ProxyCheck {
|
|
|
1122
1148
|
interface GeoHint {
|
|
1123
1149
|
/** Two-letter country, optionally a region. */
|
|
1124
1150
|
geo?: string;
|
|
1151
|
+
/** Connect with no proxy at all: not an assigned proxy, not Oya residential. Traffic leaves from the browser's own network. Overrides geo. */
|
|
1152
|
+
direct?: boolean;
|
|
1125
1153
|
}
|
|
1126
1154
|
/** A persona to create. */
|
|
1127
1155
|
interface PersonaCreate {
|
|
@@ -1605,6 +1633,23 @@ declare class Oya {
|
|
|
1605
1633
|
update: (id: string, changes: PersonaUpdate) => Promise<PersonaInfo>;
|
|
1606
1634
|
clone: (id: string, options?: CloneOptions) => Promise<PersonaInfo>;
|
|
1607
1635
|
};
|
|
1636
|
+
/**
|
|
1637
|
+
* Persona groups: name a set of your personas, then start browsers with
|
|
1638
|
+
* `oya.browser.start({ personaGroup: name })` to spread them across the set.
|
|
1639
|
+
*/
|
|
1640
|
+
readonly personaGroups: {
|
|
1641
|
+
list: () => Promise<PersonaGroup[]>;
|
|
1642
|
+
create: (name: string, personaIds?: string[]) => Promise<PersonaGroup>;
|
|
1643
|
+
update: (name: string, personaIds: string[]) => Promise<PersonaGroup>;
|
|
1644
|
+
remove: (name: string) => Promise<void>;
|
|
1645
|
+
};
|
|
1646
|
+
/** The same as `personaGroups`, matching the `profiles` alias. */
|
|
1647
|
+
readonly profileGroups: {
|
|
1648
|
+
list: () => Promise<PersonaGroup[]>;
|
|
1649
|
+
create: (name: string, personaIds?: string[]) => Promise<PersonaGroup>;
|
|
1650
|
+
update: (name: string, personaIds: string[]) => Promise<PersonaGroup>;
|
|
1651
|
+
remove: (name: string) => Promise<void>;
|
|
1652
|
+
};
|
|
1608
1653
|
/** What this key has spent. */
|
|
1609
1654
|
usage(): Promise<unknown>;
|
|
1610
1655
|
/** Waits for a starting browser to dial in, through this client's own list and session calls. */
|
|
@@ -1612,4 +1657,4 @@ declare class Oya {
|
|
|
1612
1657
|
}
|
|
1613
1658
|
|
|
1614
1659
|
export { Browser, MAX_FILE_BYTES, Oya, OyaError, Run, Oya as default, file };
|
|
1615
|
-
export type { Activity, Analysis, AnalyzeOptions, AttentionRequest, Block, BrowserDetail, BrowserInfo, CaptchaResult, CaptchaSolver, Config, ConfigUpdate, ControlCredential, ControlEvent, ControlOverview, ControlRole, ControlSession, Cookie, CookieFormat, DesktopOptions, EcsAuth, EcsConfig, Element, FileValue, Fingerprint, Health, HumanInputAction, ImportOptions, LlmCatalogEntry, LlmProvider, MfaConfig, MfaResult, OyaOptions, PageFormat, PersonaInfo, PersonaPrefs, PlayResult, Playbook, PlaybookAnswer, PlaybookExport, PlaybookSummary, ProjectSettings, Provider, ProxyCreate, ProxyInfo, RecoverOptions, RunData, RunInfo, RunResult, SandboxRuntime, Signup, SignupOptions, SiteCredentials, StartOptions, StartResult, StopResult, SubmitOptions };
|
|
1660
|
+
export type { Activity, Analysis, AnalyzeOptions, AttentionRequest, Block, BrowserDetail, BrowserInfo, CaptchaResult, CaptchaSolver, Config, ConfigUpdate, ControlCredential, ControlEvent, ControlOverview, ControlRole, ControlSession, Cookie, CookieFormat, DesktopOptions, EcsAuth, EcsConfig, Element, FileValue, Fingerprint, Health, HumanInputAction, ImportOptions, LlmCatalogEntry, LlmProvider, MfaConfig, MfaResult, OyaOptions, PageFormat, PersonaGroup, PersonaInfo, PersonaPrefs, PlayResult, Playbook, PlaybookAnswer, PlaybookExport, PlaybookSummary, ProjectSettings, Provider, ProxyCreate, ProxyInfo, RecoverOptions, RunData, RunInfo, RunResult, SandboxRuntime, Signup, SignupOptions, SiteCredentials, StartOptions, StartResult, StopResult, SubmitOptions };
|
package/dist/index.js
CHANGED
|
@@ -604,7 +604,9 @@ function shareLink(baseUrl, id, token) {
|
|
|
604
604
|
// src/api/browsers.ts
|
|
605
605
|
function startBody(options) {
|
|
606
606
|
const { profile, persona, provider, wsUrl, name, queueMs, priority, budgetUsd, governed, policy } = options;
|
|
607
|
-
|
|
607
|
+
const personaGroup = options.personaGroup || options.profileGroup;
|
|
608
|
+
const runs = { profile: profile || persona, personaGroup };
|
|
609
|
+
return { ...runs, provider, wsUrl, name, queueMs, priority, budgetUsd, governed, policy };
|
|
608
610
|
}
|
|
609
611
|
var idempotencyKeyOf = ({ idempotencyKey }) => idempotencyKey ? headerSafe(idempotencyKey, "idempotencyKey", 'Use letters, digits, "-" and "_".') : globalThis.crypto.randomUUID();
|
|
610
612
|
async function start(http, wait, options) {
|
|
@@ -835,6 +837,23 @@ var personaApi = (http) => ({
|
|
|
835
837
|
...cookieCalls(http)
|
|
836
838
|
});
|
|
837
839
|
|
|
840
|
+
// src/api/persona-groups.ts
|
|
841
|
+
var personaGroupApi = (http) => ({
|
|
842
|
+
/** Every group on this key. */
|
|
843
|
+
list: async () => (await http().request("GET", "/api/persona-groups")).groups,
|
|
844
|
+
/**
|
|
845
|
+
* A new group of this key's personas (not the default one). Its name is what a
|
|
846
|
+
* start passes, so it cannot change later; a name already used is a 409.
|
|
847
|
+
*/
|
|
848
|
+
create: (name, personaIds = []) => http().request("POST", "/api/persona-groups", { name, personaIds }),
|
|
849
|
+
/** Replaces the group's members. */
|
|
850
|
+
update: (name, personaIds) => http().request("PUT", `/api/persona-groups/${segment(name, "name")}`, { personaIds }),
|
|
851
|
+
/** Deletes the group; its personas and their browsers are not touched. */
|
|
852
|
+
remove: async (name) => {
|
|
853
|
+
await http().request("DELETE", `/api/persona-groups/${segment(name, "name")}`);
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
|
|
838
857
|
// src/api/config.ts
|
|
839
858
|
var configApi = (http) => ({
|
|
840
859
|
/** This key's settings. Secrets read back masked. */
|
|
@@ -1077,6 +1096,13 @@ var Oya = class {
|
|
|
1077
1096
|
config = configApi(() => this.http);
|
|
1078
1097
|
/** Saved profiles. `personas` is retained as an alias for existing clients. */
|
|
1079
1098
|
profiles = this.personas;
|
|
1099
|
+
/**
|
|
1100
|
+
* Persona groups: name a set of your personas, then start browsers with
|
|
1101
|
+
* `oya.browser.start({ personaGroup: name })` to spread them across the set.
|
|
1102
|
+
*/
|
|
1103
|
+
personaGroups = personaGroupApi(() => this.http);
|
|
1104
|
+
/** The same as `personaGroups`, matching the `profiles` alias. */
|
|
1105
|
+
profileGroups = this.personaGroups;
|
|
1080
1106
|
/** What this key has spent. */
|
|
1081
1107
|
usage() {
|
|
1082
1108
|
return this.http.request("GET", "/api/usage");
|
package/package.json
CHANGED