@deepraxis/sdk 0.1.1-dev.3cf83f2 → 0.1.1-dev.3d9f1a2
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/METHODS.md +18 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +24 -6
- package/dist/generated/sdk.gen.js +47 -5
- package/dist/generated/types.gen.d.ts +345 -6
- package/dist/helpers/browser-connect.js +5 -4
- package/dist/helpers/browser-decisions.d.ts +13 -0
- package/dist/helpers/browser-decisions.js +11 -0
- package/dist/helpers/browser-documentation.d.ts +1 -1
- package/dist/helpers/browser-documentation.js +4 -2
- package/dist/operations.generated.js +139 -7
- package/dist/resources.generated.d.ts +32 -0
- package/dist/resources.generated.js +12 -0
- package/package.json +1 -1
|
@@ -357,6 +357,42 @@ export const getAgentAppearance = (options) => (options.client ?? client).get({
|
|
|
357
357
|
url: '/agent/v1/agents/{agent_id}/appearance',
|
|
358
358
|
...options
|
|
359
359
|
});
|
|
360
|
+
/**
|
|
361
|
+
* Retrieve agent phone
|
|
362
|
+
*
|
|
363
|
+
* Read the agent's cloud phone, or learn that it has none: use it before driving the phone or to show its state in a settings page. configured says whether a phone block is saved at all (false is not an error: the phone is off), and state is one of none, starting, booting, restoring, running, archiving or releasing — none means no instance exists (never built, already released, or gone), archiving means its app state is being packed, and releasing means a release was asked for and the cron has not finished. sku and name come from the configuration when one exists. When the phone is reachable, sandbox_id is the public sandbox id of its running instance: take the phone over with it through POST /sandbox/v1/sandboxes/{id}/act, or open the sandbox page's screen tab in the Console; lease_ends_at is when that instance's lease runs out and the sandbox kills it. archived_at and archive_error describe the last app-state archive, which a fresh instance restores on the next use. Reading never builds a phone. Only a general or assume agent may have one: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it; an agent drives its own phone only through its phone tool, which can act on the device but cannot read this state or release it.
|
|
364
|
+
*/
|
|
365
|
+
export const agentsPhoneRetrieve = (options) => (options.client ?? client).get({
|
|
366
|
+
security: [{
|
|
367
|
+
key: 'BearerAuth',
|
|
368
|
+
scheme: 'bearer',
|
|
369
|
+
type: 'http'
|
|
370
|
+
}, {
|
|
371
|
+
key: 'ApiKeyAuth',
|
|
372
|
+
name: 'X-API-Key',
|
|
373
|
+
type: 'apiKey'
|
|
374
|
+
}],
|
|
375
|
+
url: '/agent/v1/agents/{agent_id}/phone',
|
|
376
|
+
...options
|
|
377
|
+
});
|
|
378
|
+
/**
|
|
379
|
+
* Release agent phone
|
|
380
|
+
*
|
|
381
|
+
* Ask for the agent's cloud phone to go, and answer its state afterwards. The phone is not killed here: its app state is packed first (state archiving), then the instance is killed and the row cleared, so the state answers releasing until that sweep finishes and the next use builds a fresh instance and restores the archive. The configuration is never deleted — the phone block stays and turning the phone off is agents.update with phone null, a different door. With no phone configured, or one that was never built (state none), the call changes nothing and answers none, so it is safe to repeat; repeating it while a release is pending is idempotent. Only a general or assume agent may have a phone: a service agent, an agent of another organization and a missing agent all answer 404 AGENT_NOT_FOUND. This operation is for people and their tools — the model cannot call it.
|
|
382
|
+
*/
|
|
383
|
+
export const agentsPhoneRelease = (options) => (options.client ?? client).post({
|
|
384
|
+
security: [{
|
|
385
|
+
key: 'BearerAuth',
|
|
386
|
+
scheme: 'bearer',
|
|
387
|
+
type: 'http'
|
|
388
|
+
}, {
|
|
389
|
+
key: 'ApiKeyAuth',
|
|
390
|
+
name: 'X-API-Key',
|
|
391
|
+
type: 'apiKey'
|
|
392
|
+
}],
|
|
393
|
+
url: '/agent/v1/agents/{agent_id}/phone/release',
|
|
394
|
+
...options
|
|
395
|
+
});
|
|
360
396
|
/**
|
|
361
397
|
* Get agent embed policy
|
|
362
398
|
*
|
|
@@ -1054,6 +1090,12 @@ export const createAudioSpeech = (options) => (options.client ?? client).post({
|
|
|
1054
1090
|
...options.headers
|
|
1055
1091
|
}
|
|
1056
1092
|
});
|
|
1093
|
+
/**
|
|
1094
|
+
* List current prices
|
|
1095
|
+
*
|
|
1096
|
+
* Read every open price item with the amount in force now, in USD and CNY, for example to show a pricing page or check what a meter costs before using it. No credential: the response is the public price book, not an organization's prices, so customer-specific prices and cost floors are not part of it (the source does not carry them). Each entry names the item id, the product (the id's namespace such as router, sandbox or search), the meter's unit and how many units one amount covers (per is 1000000 for per-million-token meters). A model with one amount has one entry; a price that varies by tier or by dimensions has one entry per tier or cell, told apart by variant: tier carries up_to, cell carries when, and a matrix default is kind default. Only versions already in force are shown, so an announced price never appears before its effective_from. usd and cny are decimal strings of major units copied from the price book; a currency the item does not price is null and must be shown as "—", never as 0. pricing_version and effective_at identify the catalog this body came from, and the ETag is derived from both: send it as If-None-Match to get 304 until either changes. Cache-Control is public, max-age=60, so revalidate rather than keeping a copy longer. Reading is free.
|
|
1097
|
+
*/
|
|
1098
|
+
export const listPublicPrices = (options) => (options?.client ?? client).get({ url: '/billing/v1/prices', ...options });
|
|
1057
1099
|
/**
|
|
1058
1100
|
* 列出浏览器会话
|
|
1059
1101
|
*
|
|
@@ -9531,7 +9573,7 @@ export const devopsPromotionsCancel = (options) => (options.client ?? client).po
|
|
|
9531
9573
|
/**
|
|
9532
9574
|
* Retry a promotion
|
|
9533
9575
|
*
|
|
9534
|
-
* Continue a promotion that stopped part-way
|
|
9576
|
+
* Continue a promotion that stopped part-way: one in halted (some targets deployed, some failed, some never started) or one in failed. The answer is a NEW promotion whose plan names only the targets that did not reach the release, so a partially deployed environment is completed rather than redeployed from the start. A halted promotion is stopped first — its run is asked to cancel and the executor is read back until the run is no longer running — because a new plan that starts while the old run still deploys the same targets would deploy them twice; when the run will not stop, the call is refused with PROMOTION_RUN_STILL_RUNNING and creates nothing. Once that run is over the halt is closed as the partial deploy it is (the targets that really deployed move their checkpoints) and the new promotion is planned from those checkpoints. Any other state is refused with PROMOTION_NOT_RETRYABLE, whose message names the state and what to do instead: a promotion that is still deploying has nothing to continue (cancel it to stop it), and a succeeded, cancelled or superseded one has nothing left — promote the release again if this environment must take it. The retry is attributed to the credential that sends it and is recorded on the promotion.
|
|
9535
9577
|
*/
|
|
9536
9578
|
export const devopsPromotionsRetry = (options) => (options.client ?? client).post({
|
|
9537
9579
|
security: [{
|
|
@@ -11427,7 +11469,7 @@ export const mediaEditAsset = (options) => (options.client ?? client).post({
|
|
|
11427
11469
|
/**
|
|
11428
11470
|
* Create speech
|
|
11429
11471
|
*
|
|
11430
|
-
* Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, the sum over every segment) and the recording carries it in provenance.cost; a request refused before it starts costs nothing. When the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {"input":"A red kite above a calm sea at sunrise."}, or with {"input":"A red kite above a calm sea at sunrise.","voice":"zh_female_wenroumama_uranus_bigtts"} for a gentle female voice.
|
|
11472
|
+
* Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. tier chooses which speech model speaks, instead of naming one: economy is the cheapest and fastest, balanced the best value and quality the best result, and the tier picks among the models that carry the voice you name — a voice a model does not offer is never selected and then refused. model is the transition-window parameter and names the same choice, so send only one of the two; omitting both speaks with the library’s speech model, or by its default tier once the platform turns the media-tier-defaults switch on. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, the sum over every segment) and the recording carries it in provenance.cost; a request refused before it starts costs nothing. When the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {"input":"A red kite above a calm sea at sunrise."}, or with {"input":"A red kite above a calm sea at sunrise.","voice":"zh_female_wenroumama_uranus_bigtts"} for a gentle female voice.
|
|
11431
11473
|
*/
|
|
11432
11474
|
export const mediaCreateSpeech = (options) => (options.client ?? client).post({
|
|
11433
11475
|
security: [{
|
|
@@ -12265,7 +12307,7 @@ export const getSandboxV1Sandboxes = (options) => (options?.client ?? client).ge
|
|
|
12265
12307
|
/**
|
|
12266
12308
|
* Create sandbox (v2)
|
|
12267
12309
|
*
|
|
12268
|
-
* Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs. On the own face an android phone accepts waitForReady: true, an own-face-only option: the create then waits until the phone program has connected (state running) or
|
|
12310
|
+
* Create a sandbox from a template. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, cannot be snapshotted, deleted when it ends; for jobs such as transcodes, scripts and builds) or ephemeral: false for a persistent one (pauses and resumes, snapshots, mounts volumes, kept after it stops; for long-lived computers). Leaving ephemeral out returns INVALID_PARAMS. autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention and volumes belong to persistent sandboxes and need ephemeral: false. Choose persistent only for long-lived computers. On the E2B-compatible face autoPause is the declaration: true is persistent, false or absent is ephemeral and ends at its timeout. Responses carry ephemeral. When a sandbox's machine has ended (timeout, kill, retention, provider loss), reaching it returns SANDBOX_EXPIRED (410) with terminationReason in the message: its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths, a directory or a file): when the sandbox ends for any reason except provider loss or a failed start, each path is packed as .tar.gz and stored in File, and the killed event of GET /sandbox/v1/events/sandboxes/{sandboxID} lists each fileId or the reason it was not kept. Paths not declared are not kept. The E2B face refuses outputs. On the own face an android phone accepts waitForReady: true, an own-face-only option: the create then waits until the phone program has connected (state running) or 55 seconds have passed since the request arrived (the vendor create itself takes about 48 s, so this is often not enough), and answers with the state it reached — a timeout is not an error; omit it (the default) and the create answers at once, before the phone connects, with state starting or booting, which you follow with the detail read or the act socket.
|
|
12269
12311
|
*/
|
|
12270
12312
|
export const postSandboxV1Sandboxes = (options) => (options.client ?? client).post({
|
|
12271
12313
|
security: [
|
|
@@ -15011,7 +15053,7 @@ export const vaultListSecrets = (options) => (options.client ?? client).get({
|
|
|
15011
15053
|
/**
|
|
15012
15054
|
* Create secret
|
|
15013
15055
|
*
|
|
15014
|
-
* Store a manually supplied token in an active vault.
|
|
15056
|
+
* Store a manually supplied token in an active vault. Declare allowed_hosts (1–16 domains) to let the value be redeemed for those destinations; omit it to store an empty list, which name-based resolution still returns but no destination can redeem, and which a service agent's session environment never receives either way. MCP credential matching reads the same declarations, so a `*.` entry covers subdomains there too. Unlike Anthropic credentials, this native operation takes name and value directly and creates only static secrets; use praxis.vault.authorizations.create for OAuth. Its name must be unused by any non-archived secret in that vault; the response contains metadata but never the supplied value. Application praxis_vault_ref bindings declare vault_id and secret (the secret name), but currently return 501; do not copy the value into a plain-text binding or metadata as a substitute.
|
|
15015
15057
|
*/
|
|
15016
15058
|
export const vaultCreateSecret = (options) => (options.client ?? client).post({
|
|
15017
15059
|
security: [{
|
|
@@ -15029,7 +15071,7 @@ export const vaultCreateSecret = (options) => (options.client ?? client).post({
|
|
|
15029
15071
|
/**
|
|
15030
15072
|
* Import secrets
|
|
15031
15073
|
*
|
|
15032
|
-
* Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets
|
|
15074
|
+
* Import lines or dotenv text into an active vault, reporting success or failure for each entry. Existing names have their values replaced; their hosts change only when that line supplies allowed_hosts. Shared hosts apply only to newly created secrets; if neither shared nor per-line hosts are supplied, new secrets get an empty host list, which name-based resolution still returns but no destination can redeem. Imported entries carry the same host rules as Create secret, and a service agent's session environment never receives a credential that declares hosts.
|
|
15033
15075
|
*/
|
|
15034
15076
|
export const vaultImportSecrets = (options) => (options.client ?? client).post({
|
|
15035
15077
|
security: [{
|
|
@@ -2821,6 +2821,23 @@ export type AgentSseEvent = ({
|
|
|
2821
2821
|
event: 'system.message' | 'user.message' | 'user.interrupt' | 'agent.message' | 'agent.thinking' | 'session.status_running' | 'session.status_rescheduled' | 'session.status_idle' | 'session.status_terminated' | 'agent.thread_context_compacting' | 'agent.thread_context_compacted' | 'agent.thread_context_reset' | 'session.updated' | 'session.error' | 'session.usage' | 'span.model_request_start' | 'span.model_request_end' | 'agent.tool_use' | 'agent.tool_result' | 'agent.mcp_tool_use' | 'agent.mcp_tool_result' | 'user.tool_confirmation' | 'agent.custom_tool_use' | 'user.custom_tool_result' | 'session.thread_created' | 'session.thread_status_running' | 'session.thread_status_idle' | 'session.thread_status_rescheduled' | 'session.thread_status_terminated' | 'agent.thread_message_sent' | 'agent.thread_message_received' | 'user.withdraw' | 'user.steer' | 'system.notification' | 'system.notification_suppressed' | 'system.notification_recorded' | 'session.forked' | 'session.goal_changed' | 'session.goal_verification' | 'event_start' | 'event_delta' | 'ping' | 'error';
|
|
2822
2822
|
data: AgentSseData;
|
|
2823
2823
|
};
|
|
2824
|
+
/**
|
|
2825
|
+
* The price book in force at the moment of the read.
|
|
2826
|
+
*/
|
|
2827
|
+
export type BillingPriceList = {
|
|
2828
|
+
/**
|
|
2829
|
+
* The published catalog version this body was cut from; it changes on any price write.
|
|
2830
|
+
*/
|
|
2831
|
+
pricing_version: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* The latest effective_from among the listed entries; null when no item has a price in force yet.
|
|
2834
|
+
*/
|
|
2835
|
+
effective_at: string;
|
|
2836
|
+
/**
|
|
2837
|
+
* One entry per amount in force, ordered by item id and then by the model's own tier/cell order.
|
|
2838
|
+
*/
|
|
2839
|
+
items: Array<BillingPriceEntry>;
|
|
2840
|
+
};
|
|
2824
2841
|
export type BrowserSessionCreateParams = {
|
|
2825
2842
|
/**
|
|
2826
2843
|
* 可省略;账户使用 default 项目。
|
|
@@ -21513,6 +21530,47 @@ export type SandboxNewSandboxV2 = {
|
|
|
21513
21530
|
* Volumes to mount into the sandbox, each with the volume name and the path inside the sandbox.
|
|
21514
21531
|
*/
|
|
21515
21532
|
volumeMounts?: Array<SandboxSandboxVolumeMount>;
|
|
21533
|
+
/**
|
|
21534
|
+
* Own face, required: true for an ephemeral sandbox (ends at its timeout, never pauses, cannot be snapshotted), false for a persistent one (pauses, resumes, snapshots, mounts volumes). Leaving it out returns INVALID_PARAMS.
|
|
21535
|
+
*/
|
|
21536
|
+
ephemeral?: boolean;
|
|
21537
|
+
/**
|
|
21538
|
+
* Own face: the machine size, a SKU id such as base-2c4g or, for an android phone, android-2c4g. Omitted, the template's default size is used.
|
|
21539
|
+
*/
|
|
21540
|
+
size?: string;
|
|
21541
|
+
/**
|
|
21542
|
+
* Own face: a display name for the sandbox, 1 to 64 characters. Omitted, one is generated from the template.
|
|
21543
|
+
*/
|
|
21544
|
+
name?: string;
|
|
21545
|
+
/**
|
|
21546
|
+
* Own face, android phones only: keep the create open until the phone is running or 55 seconds have passed since the request arrived; running out is not an error and answers the state reached.
|
|
21547
|
+
*/
|
|
21548
|
+
waitForReady?: boolean;
|
|
21549
|
+
/**
|
|
21550
|
+
* Own face: what happens at the timeout. pause needs ephemeral: false; must agree with autoPause when both are sent.
|
|
21551
|
+
*/
|
|
21552
|
+
onExpire?: 'kill' | 'pause';
|
|
21553
|
+
/**
|
|
21554
|
+
* Own face, persistent sandboxes only: pause after this many milliseconds without activity; null turns the idle pause off.
|
|
21555
|
+
*/
|
|
21556
|
+
idleTimeout?: number;
|
|
21557
|
+
/**
|
|
21558
|
+
* Own face, persistent sandboxes only: whose activity resets idleTimeout. traffic (default) counts data-plane calls, preview traffic and live processes; caller counts only your own control-plane calls.
|
|
21559
|
+
*/
|
|
21560
|
+
idleActivity?: 'traffic' | 'caller';
|
|
21561
|
+
/**
|
|
21562
|
+
* Own face, persistent sandboxes only: what happens when the provider loses the machine. fail (default) ends the sandbox; rebuild starts a new machine under the same id with its state lost.
|
|
21563
|
+
*/
|
|
21564
|
+
onLoss?: 'fail' | 'rebuild';
|
|
21565
|
+
/**
|
|
21566
|
+
* Own face: up to eight absolute paths to keep when the sandbox ends; each is packed as .tar.gz into File and listed on the killed event.
|
|
21567
|
+
*/
|
|
21568
|
+
outputs?: Array<{
|
|
21569
|
+
/**
|
|
21570
|
+
* Absolute path of a directory or file inside the sandbox.
|
|
21571
|
+
*/
|
|
21572
|
+
path: string;
|
|
21573
|
+
}>;
|
|
21516
21574
|
};
|
|
21517
21575
|
/**
|
|
21518
21576
|
* Sandbox created from a template.
|
|
@@ -24290,7 +24348,7 @@ export type VaultCreateSecretInput = {
|
|
|
24290
24348
|
*/
|
|
24291
24349
|
value: string;
|
|
24292
24350
|
/**
|
|
24293
|
-
* Allowed destinations for the secret.
|
|
24351
|
+
* Allowed destinations for the secret; checked at write and enforced when a value is redeemed for a destination host, which an empty list never satisfies. Omit it on creation to store an empty list: the value stays readable by name-based resolution only. When supplied, list 1–16 bare domain names, dotted-decimal IPv4 addresses or leading *. domain wildcards. A wildcard matches subdomains, not the domain itself. URLs, ports, paths, IPv6, local/private and platform hosts are rejected. Entries are lowercased, one trailing dot is removed, internationalized domains use Punycode, and duplicates are removed. A service agent's session environment never receives a credential that declares hosts.
|
|
24294
24352
|
*/
|
|
24295
24353
|
allowed_hosts?: Array<string>;
|
|
24296
24354
|
/**
|
|
@@ -24334,7 +24392,7 @@ export type VaultSecret = {
|
|
|
24334
24392
|
*/
|
|
24335
24393
|
kind: 'static' | 'oauth';
|
|
24336
24394
|
/**
|
|
24337
|
-
* Allowed destinations for the secret.
|
|
24395
|
+
* Allowed destinations for the secret; checked at write and enforced when a value is redeemed for a destination host, which an empty list never satisfies. Omit it on creation to store an empty list: the value stays readable by name-based resolution only. When supplied, list 1–16 bare domain names, dotted-decimal IPv4 addresses or leading *. domain wildcards. A wildcard matches subdomains, not the domain itself. URLs, ports, paths, IPv6, local/private and platform hosts are rejected. Entries are lowercased, one trailing dot is removed, internationalized domains use Punycode, and duplicates are removed. A service agent's session environment never receives a credential that declares hosts.
|
|
24338
24396
|
*/
|
|
24339
24397
|
allowed_hosts: Array<string>;
|
|
24340
24398
|
/**
|
|
@@ -24427,7 +24485,7 @@ export type VaultUpdateSecretInput = {
|
|
|
24427
24485
|
*/
|
|
24428
24486
|
value?: string;
|
|
24429
24487
|
/**
|
|
24430
|
-
* Allowed destinations for the secret. Omit it to keep the current list; an empty list removes the declaration,
|
|
24488
|
+
* Allowed destinations for the secret; checked at write and enforced when a value is redeemed for a destination host. Omit it to keep the current list; an empty list removes the declaration, so every redemption is denied and only name-based resolution still returns the value. When supplied with entries, list 1–16 bare domain names, dotted-decimal IPv4 addresses or leading *. domain wildcards. A wildcard matches subdomains, not the domain itself. URLs, ports, paths, IPv6, local/private and platform hosts are rejected. Entries are lowercased, one trailing dot is removed, internationalized domains use Punycode, and duplicates are removed. A service agent's session environment never receives a credential that declares hosts.
|
|
24431
24489
|
*/
|
|
24432
24490
|
allowed_hosts?: Array<string>;
|
|
24433
24491
|
/**
|
|
@@ -26987,6 +27045,76 @@ export type AgentSseData = {
|
|
|
26987
27045
|
message: string;
|
|
26988
27046
|
};
|
|
26989
27047
|
};
|
|
27048
|
+
/**
|
|
27049
|
+
* One amount in force for one price item.
|
|
27050
|
+
*/
|
|
27051
|
+
export type BillingPriceEntry = {
|
|
27052
|
+
/**
|
|
27053
|
+
* The price item key, stable and never reused, for example router:default/deepseek-v4-pro:input or sandbox:cpu_second.
|
|
27054
|
+
*/
|
|
27055
|
+
id: string;
|
|
27056
|
+
/**
|
|
27057
|
+
* The item key's namespace — the product that owns the meter (router, sandbox, search, browser, media, knowledge, agent, …); group the table by this.
|
|
27058
|
+
*/
|
|
27059
|
+
product: string;
|
|
27060
|
+
/**
|
|
27061
|
+
* The item key's subject when it has one, such as default/deepseek-v4-pro; null for a two-segment key.
|
|
27062
|
+
*/
|
|
27063
|
+
subject: string;
|
|
27064
|
+
/**
|
|
27065
|
+
* The item's display name from the price book.
|
|
27066
|
+
*/
|
|
27067
|
+
name: string;
|
|
27068
|
+
/**
|
|
27069
|
+
* The meter's unit as billing records it, for example token, cpu_second or request.
|
|
27070
|
+
*/
|
|
27071
|
+
unit: string;
|
|
27072
|
+
/**
|
|
27073
|
+
* How many units one amount covers, as a decimal integer string; 1000000 for per-million-token meters, 1 for a per-request or per-second meter.
|
|
27074
|
+
*/
|
|
27075
|
+
per: string;
|
|
27076
|
+
/**
|
|
27077
|
+
* When this amount took effect. It is at or before now by construction.
|
|
27078
|
+
*/
|
|
27079
|
+
effective_from: string;
|
|
27080
|
+
/**
|
|
27081
|
+
* Which amount of a multi-amount model this entry is; null when the item has exactly one amount.
|
|
27082
|
+
*/
|
|
27083
|
+
variant: {
|
|
27084
|
+
/**
|
|
27085
|
+
* This entry is one tier of a tiered price, chosen by the meter's tier selector.
|
|
27086
|
+
*/
|
|
27087
|
+
kind: 'tier';
|
|
27088
|
+
/**
|
|
27089
|
+
* The tier's upper bound of the selector; the last tier is null (no upper bound).
|
|
27090
|
+
*/
|
|
27091
|
+
up_to: string;
|
|
27092
|
+
} | {
|
|
27093
|
+
/**
|
|
27094
|
+
* This entry is one cell of a matrix price, priced for the dimension values in when.
|
|
27095
|
+
*/
|
|
27096
|
+
kind: 'cell';
|
|
27097
|
+
/**
|
|
27098
|
+
* The dimension values this cell prices, for example resolution 1080p.
|
|
27099
|
+
*/
|
|
27100
|
+
when: {
|
|
27101
|
+
[key: string]: string;
|
|
27102
|
+
};
|
|
27103
|
+
} | {
|
|
27104
|
+
/**
|
|
27105
|
+
* This entry is the matrix's default amount, used when no cell matches.
|
|
27106
|
+
*/
|
|
27107
|
+
kind: 'default';
|
|
27108
|
+
};
|
|
27109
|
+
/**
|
|
27110
|
+
* The stored USD amount in major units as a decimal string, or null when the item does not price USD; never 0 as a stand-in.
|
|
27111
|
+
*/
|
|
27112
|
+
usd: string;
|
|
27113
|
+
/**
|
|
27114
|
+
* The stored CNY amount in major units as a decimal string, or null when the item does not price CNY; it is what a CNY account is charged, never 0 as a stand-in.
|
|
27115
|
+
*/
|
|
27116
|
+
cny: string;
|
|
27117
|
+
};
|
|
26990
27118
|
/**
|
|
26991
27119
|
* File expiration policy
|
|
26992
27120
|
*
|
|
@@ -37573,6 +37701,14 @@ export type MediaSpeechCreateInput = {
|
|
|
37573
37701
|
* Language of the text, when the voice supports several.
|
|
37574
37702
|
*/
|
|
37575
37703
|
language?: string;
|
|
37704
|
+
/**
|
|
37705
|
+
* Speech model that synthesises the recording; omit it to use the library’s speech model (models.speech). This is the transition-window parameter; prefer tier, and send only one of the two. A value that is exactly a tier name (economy, balanced or quality) is read as that tier; any other value is a real model id, which keeps working only during the transition and is refused once the platform retires the parameter.
|
|
37706
|
+
*/
|
|
37707
|
+
model?: string;
|
|
37708
|
+
/**
|
|
37709
|
+
* Performance tier to run this request in, an alternative to naming a model: economy is the cheapest and fastest, balanced the best value, quality puts the result first. A tier picks among the speech models that carry the voice this request names, so a voice the chosen model does not offer is never selected and then refused, and a platform-designed voice is bound to its own model. Send tier or model, never both. Omitted, the library’s speech model answers, or its default tier once the media-tier-defaults switch is on.
|
|
37710
|
+
*/
|
|
37711
|
+
tier?: MediaMediaTier;
|
|
37576
37712
|
};
|
|
37577
37713
|
/**
|
|
37578
37714
|
* Body of a character element.
|
|
@@ -52848,6 +52984,178 @@ export type GetAgentAppearanceResponses = {
|
|
|
52848
52984
|
};
|
|
52849
52985
|
};
|
|
52850
52986
|
export type GetAgentAppearanceResponse = GetAgentAppearanceResponses[keyof GetAgentAppearanceResponses];
|
|
52987
|
+
export type AgentsPhoneRetrieveData = {
|
|
52988
|
+
body?: never;
|
|
52989
|
+
path: {
|
|
52990
|
+
/**
|
|
52991
|
+
* Agent id from agent creation or listing, the eight character identity number or the handle. A service agent never has a phone and answers not found. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_….
|
|
52992
|
+
*/
|
|
52993
|
+
agent_id: string;
|
|
52994
|
+
};
|
|
52995
|
+
query?: never;
|
|
52996
|
+
url: '/agent/v1/agents/{agent_id}/phone';
|
|
52997
|
+
};
|
|
52998
|
+
export type AgentsPhoneRetrieveErrors = {
|
|
52999
|
+
/**
|
|
53000
|
+
* INVALID_PARAMS: the agent_id is missing or malformed.
|
|
53001
|
+
*/
|
|
53002
|
+
400: unknown;
|
|
53003
|
+
/**
|
|
53004
|
+
* UNAUTHENTICATED (or INVALID_API_KEY, API_KEY_DISABLED, API_KEY_EXPIRED, INVALID_API_TOKEN, API_TOKEN_EXPIRED, API_TOKEN_REVOKED): the API key is missing, invalid or revoked. Send a valid key as X-API-Key or as a Bearer token.
|
|
53005
|
+
*/
|
|
53006
|
+
401: AgentError;
|
|
53007
|
+
/**
|
|
53008
|
+
* permission_error: the credential's role or bound resources do not allow this operation. Use a key with access to the agent domain and its resources.
|
|
53009
|
+
*/
|
|
53010
|
+
403: AgentError;
|
|
53011
|
+
/**
|
|
53012
|
+
* AGENT_NOT_FOUND: no agent with this reference belongs to your organization, this credential cannot see it, or it is a service agent (which never has a phone).
|
|
53013
|
+
*/
|
|
53014
|
+
404: unknown;
|
|
53015
|
+
/**
|
|
53016
|
+
* Agent service failed
|
|
53017
|
+
*/
|
|
53018
|
+
502: unknown;
|
|
53019
|
+
/**
|
|
53020
|
+
* Agent service unavailable
|
|
53021
|
+
*/
|
|
53022
|
+
503: unknown;
|
|
53023
|
+
};
|
|
53024
|
+
export type AgentsPhoneRetrieveError = AgentsPhoneRetrieveErrors[keyof AgentsPhoneRetrieveErrors];
|
|
53025
|
+
export type AgentsPhoneRetrieveResponses = {
|
|
53026
|
+
/**
|
|
53027
|
+
* This agent's phone: whether one is configured, what it is doing, and the public sandbox id to take it over with.
|
|
53028
|
+
*/
|
|
53029
|
+
200: {
|
|
53030
|
+
/**
|
|
53031
|
+
* Object type, always agent_phone.
|
|
53032
|
+
*/
|
|
53033
|
+
object: 'agent_phone';
|
|
53034
|
+
/**
|
|
53035
|
+
* The agent's public id (agent_…), the agent this phone belongs to.
|
|
53036
|
+
*/
|
|
53037
|
+
agent_id: string;
|
|
53038
|
+
/**
|
|
53039
|
+
* Whether this agent has a phone configured at all. false means no phone block is saved (the phone is off); it is not an error.
|
|
53040
|
+
*/
|
|
53041
|
+
configured: boolean;
|
|
53042
|
+
/**
|
|
53043
|
+
* What the phone is doing now. none: no phone built (or its instance is gone), so a later use builds one. starting: the sandbox is still creating the instance. booting: the instance is up and the phone program has not said hello yet. restoring: last time's app state is being put back on the instance. running: usable now. archiving: the app state is being packed before it is killed (a release begins here). releasing: a release was asked for and the cron has not finished archiving and killing it.
|
|
53044
|
+
*/
|
|
53045
|
+
state: 'none' | 'starting' | 'booting' | 'restoring' | 'running' | 'archiving' | 'releasing';
|
|
53046
|
+
/**
|
|
53047
|
+
* The sandbox SKU the phone is built from (for example android-2c4g), or null when no phone is configured. A configuration change of the SKU releases the old device.
|
|
53048
|
+
*/
|
|
53049
|
+
sku: string | null;
|
|
53050
|
+
/**
|
|
53051
|
+
* What people and the model call this phone, or null when no phone is configured.
|
|
53052
|
+
*/
|
|
53053
|
+
name: string | null;
|
|
53054
|
+
/**
|
|
53055
|
+
* The public sandbox id of the running instance, or null when there is no instance. Take the phone over with it: POST /sandbox/v1/sandboxes/{id}/act, or the Console sandbox page's screen tab.
|
|
53056
|
+
*/
|
|
53057
|
+
sandbox_id: string | null;
|
|
53058
|
+
/**
|
|
53059
|
+
* When the current instance's lease runs out, in RFC 3339; the sandbox kills the phone then. Null when there is no instance; every use extends the lease.
|
|
53060
|
+
*/
|
|
53061
|
+
lease_ends_at: string | null;
|
|
53062
|
+
/**
|
|
53063
|
+
* When the app state was last packed for this phone, in RFC 3339; null when it never was. The archive is what a fresh instance restores on the next use.
|
|
53064
|
+
*/
|
|
53065
|
+
archived_at: string | null;
|
|
53066
|
+
/**
|
|
53067
|
+
* Why the last app-state archive failed, or null. A phone that could not be packed is still released, but the last state is not kept.
|
|
53068
|
+
*/
|
|
53069
|
+
archive_error: string | null;
|
|
53070
|
+
};
|
|
53071
|
+
};
|
|
53072
|
+
export type AgentsPhoneRetrieveResponse = AgentsPhoneRetrieveResponses[keyof AgentsPhoneRetrieveResponses];
|
|
53073
|
+
export type AgentsPhoneReleaseData = {
|
|
53074
|
+
body?: never;
|
|
53075
|
+
path: {
|
|
53076
|
+
/**
|
|
53077
|
+
* Agent id from agent creation or listing, the eight character identity number or the handle. A service agent never has a phone and answers not found. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_….
|
|
53078
|
+
*/
|
|
53079
|
+
agent_id: string;
|
|
53080
|
+
};
|
|
53081
|
+
query?: never;
|
|
53082
|
+
url: '/agent/v1/agents/{agent_id}/phone/release';
|
|
53083
|
+
};
|
|
53084
|
+
export type AgentsPhoneReleaseErrors = {
|
|
53085
|
+
/**
|
|
53086
|
+
* INVALID_PARAMS: the agent_id is missing or malformed.
|
|
53087
|
+
*/
|
|
53088
|
+
400: unknown;
|
|
53089
|
+
/**
|
|
53090
|
+
* UNAUTHENTICATED (or INVALID_API_KEY, API_KEY_DISABLED, API_KEY_EXPIRED, INVALID_API_TOKEN, API_TOKEN_EXPIRED, API_TOKEN_REVOKED): the API key is missing, invalid or revoked. Send a valid key as X-API-Key or as a Bearer token.
|
|
53091
|
+
*/
|
|
53092
|
+
401: AgentError;
|
|
53093
|
+
/**
|
|
53094
|
+
* permission_error: the credential's role or bound resources do not allow this operation. Use a key with access to the agent domain and its resources.
|
|
53095
|
+
*/
|
|
53096
|
+
403: AgentError;
|
|
53097
|
+
/**
|
|
53098
|
+
* AGENT_NOT_FOUND: no agent with this reference belongs to your organization, this credential cannot see it, or it is a service agent (which never has a phone).
|
|
53099
|
+
*/
|
|
53100
|
+
404: unknown;
|
|
53101
|
+
/**
|
|
53102
|
+
* Agent service failed
|
|
53103
|
+
*/
|
|
53104
|
+
502: unknown;
|
|
53105
|
+
/**
|
|
53106
|
+
* Agent service unavailable
|
|
53107
|
+
*/
|
|
53108
|
+
503: unknown;
|
|
53109
|
+
};
|
|
53110
|
+
export type AgentsPhoneReleaseError = AgentsPhoneReleaseErrors[keyof AgentsPhoneReleaseErrors];
|
|
53111
|
+
export type AgentsPhoneReleaseResponses = {
|
|
53112
|
+
/**
|
|
53113
|
+
* The phone with the release recorded: state releasing, or none when there was nothing to release.
|
|
53114
|
+
*/
|
|
53115
|
+
200: {
|
|
53116
|
+
/**
|
|
53117
|
+
* Object type, always agent_phone.
|
|
53118
|
+
*/
|
|
53119
|
+
object: 'agent_phone';
|
|
53120
|
+
/**
|
|
53121
|
+
* The agent's public id (agent_…), the agent this phone belongs to.
|
|
53122
|
+
*/
|
|
53123
|
+
agent_id: string;
|
|
53124
|
+
/**
|
|
53125
|
+
* Whether this agent has a phone configured at all. false means no phone block is saved (the phone is off); it is not an error.
|
|
53126
|
+
*/
|
|
53127
|
+
configured: boolean;
|
|
53128
|
+
/**
|
|
53129
|
+
* What the phone is doing now. none: no phone built (or its instance is gone), so a later use builds one. starting: the sandbox is still creating the instance. booting: the instance is up and the phone program has not said hello yet. restoring: last time's app state is being put back on the instance. running: usable now. archiving: the app state is being packed before it is killed (a release begins here). releasing: a release was asked for and the cron has not finished archiving and killing it.
|
|
53130
|
+
*/
|
|
53131
|
+
state: 'none' | 'starting' | 'booting' | 'restoring' | 'running' | 'archiving' | 'releasing';
|
|
53132
|
+
/**
|
|
53133
|
+
* The sandbox SKU the phone is built from (for example android-2c4g), or null when no phone is configured. A configuration change of the SKU releases the old device.
|
|
53134
|
+
*/
|
|
53135
|
+
sku: string | null;
|
|
53136
|
+
/**
|
|
53137
|
+
* What people and the model call this phone, or null when no phone is configured.
|
|
53138
|
+
*/
|
|
53139
|
+
name: string | null;
|
|
53140
|
+
/**
|
|
53141
|
+
* The public sandbox id of the running instance, or null when there is no instance. Take the phone over with it: POST /sandbox/v1/sandboxes/{id}/act, or the Console sandbox page's screen tab.
|
|
53142
|
+
*/
|
|
53143
|
+
sandbox_id: string | null;
|
|
53144
|
+
/**
|
|
53145
|
+
* When the current instance's lease runs out, in RFC 3339; the sandbox kills the phone then. Null when there is no instance; every use extends the lease.
|
|
53146
|
+
*/
|
|
53147
|
+
lease_ends_at: string | null;
|
|
53148
|
+
/**
|
|
53149
|
+
* When the app state was last packed for this phone, in RFC 3339; null when it never was. The archive is what a fresh instance restores on the next use.
|
|
53150
|
+
*/
|
|
53151
|
+
archived_at: string | null;
|
|
53152
|
+
/**
|
|
53153
|
+
* Why the last app-state archive failed, or null. A phone that could not be packed is still released, but the last state is not kept.
|
|
53154
|
+
*/
|
|
53155
|
+
archive_error: string | null;
|
|
53156
|
+
};
|
|
53157
|
+
};
|
|
53158
|
+
export type AgentsPhoneReleaseResponse = AgentsPhoneReleaseResponses[keyof AgentsPhoneReleaseResponses];
|
|
52851
53159
|
export type GetAgentEmbedPolicyData = {
|
|
52852
53160
|
body?: never;
|
|
52853
53161
|
path: {
|
|
@@ -63438,6 +63746,29 @@ export type CreateAudioSpeechResponses = {
|
|
|
63438
63746
|
200: Blob | File;
|
|
63439
63747
|
};
|
|
63440
63748
|
export type CreateAudioSpeechResponse = CreateAudioSpeechResponses[keyof CreateAudioSpeechResponses];
|
|
63749
|
+
export type ListPublicPricesData = {
|
|
63750
|
+
body?: never;
|
|
63751
|
+
path?: never;
|
|
63752
|
+
query?: never;
|
|
63753
|
+
url: '/billing/v1/prices';
|
|
63754
|
+
};
|
|
63755
|
+
export type ListPublicPricesErrors = {
|
|
63756
|
+
/**
|
|
63757
|
+
* The price book could not be read (PRICE_LIST_UNAVAILABLE). Retry after a minute; do not show a price you cannot confirm.
|
|
63758
|
+
*/
|
|
63759
|
+
502: unknown;
|
|
63760
|
+
/**
|
|
63761
|
+
* The price book has not been published yet (UNAVAILABLE). Retry after a minute; there is no price to show.
|
|
63762
|
+
*/
|
|
63763
|
+
503: unknown;
|
|
63764
|
+
};
|
|
63765
|
+
export type ListPublicPricesResponses = {
|
|
63766
|
+
/**
|
|
63767
|
+
* The catalog in force. price_list.items is grouped by nothing — order by product and name to render a table; a null amount means the currency is not priced, not that it is free.
|
|
63768
|
+
*/
|
|
63769
|
+
200: BillingPriceList;
|
|
63770
|
+
};
|
|
63771
|
+
export type ListPublicPricesResponse = ListPublicPricesResponses[keyof ListPublicPricesResponses];
|
|
63441
63772
|
export type BrowserListSessionsData = {
|
|
63442
63773
|
body?: never;
|
|
63443
63774
|
path?: never;
|
|
@@ -64090,7 +64421,7 @@ export type BrowserRunPageActionData = {
|
|
|
64090
64421
|
*/
|
|
64091
64422
|
name: string;
|
|
64092
64423
|
/**
|
|
64093
|
-
* cookie 值,最多 4096
|
|
64424
|
+
* cookie 值,最多 4096 个字符,可为空字符串但字段必须出现(省略或传 null 会被拒绝,错误会说明是哪个字段、违反了什么规则);它是凭据,不会出现在动作结果、事件或日志里。
|
|
64094
64425
|
*/
|
|
64095
64426
|
value: string;
|
|
64096
64427
|
/**
|
|
@@ -98532,7 +98863,7 @@ export type DevopsPromotionsRetryErrors = {
|
|
|
98532
98863
|
*/
|
|
98533
98864
|
404: DevopsDevOpsError;
|
|
98534
98865
|
/**
|
|
98535
|
-
*
|
|
98866
|
+
* PROMOTION_NOT_RETRYABLE means this promotion has nothing to continue (its message names the state and what to do instead: cancel a running one to stop it, or promote the release again). PROMOTION_RUN_STILL_RUNNING means the halted attempt's run has not stopped yet — it was asked to cancel and the retry created nothing, because planning its targets now would deploy them a second time; read the promotion again shortly, or wait for the queue's own deadline to end the halted run.
|
|
98536
98867
|
*/
|
|
98537
98868
|
409: DevopsDevOpsError;
|
|
98538
98869
|
/**
|
|
@@ -105835,6 +106166,14 @@ export type MediaCreateSpeechData = {
|
|
|
105835
106166
|
* Language of the text, when the voice supports several.
|
|
105836
106167
|
*/
|
|
105837
106168
|
language?: string;
|
|
106169
|
+
/**
|
|
106170
|
+
* Speech model that synthesises the recording; omit it to use the library’s speech model (models.speech). This is the transition-window parameter; prefer tier, and send only one of the two. A value that is exactly a tier name (economy, balanced or quality) is read as that tier; any other value is a real model id, which keeps working only during the transition and is refused once the platform retires the parameter.
|
|
106171
|
+
*/
|
|
106172
|
+
model?: string;
|
|
106173
|
+
/**
|
|
106174
|
+
* Performance tier to run this request in, an alternative to naming a model: economy is the cheapest and fastest, balanced the best value, quality puts the result first. A tier picks among the speech models that carry the voice this request names, so a voice the chosen model does not offer is never selected and then refused, and a platform-designed voice is bound to its own model. Send tier or model, never both. Omitted, the library’s speech model answers, or its default tier once the media-tier-defaults switch is on.
|
|
106175
|
+
*/
|
|
106176
|
+
tier?: MediaMediaTier;
|
|
105838
106177
|
};
|
|
105839
106178
|
headers?: {
|
|
105840
106179
|
/**
|
|
@@ -105869,7 +106208,7 @@ export type MediaCreateSpeechErrors = {
|
|
|
105869
106208
|
*/
|
|
105870
106209
|
404: MediaMediaError;
|
|
105871
106210
|
/**
|
|
105872
|
-
* MODEL_PENDING: neither the request nor the library settings name a speech model, so there is nothing to synthesise with; set models.speech on the library or name model on the request. JOB_INVALID_STATE: the job cannot start from its current state; start a new job rather than resuming this one.
|
|
106211
|
+
* MODEL_PENDING: neither the request nor the library settings name a speech model, so there is nothing to synthesise with; set models.speech on the library or name model or tier on the request. JOB_INVALID_STATE: the job cannot start from its current state; start a new job rather than resuming this one.
|
|
105873
106212
|
*/
|
|
105874
106213
|
409: MediaMediaError;
|
|
105875
106214
|
/**
|
|
@@ -10,7 +10,7 @@ import { PraxisError } from "../core/errors.js";
|
|
|
10
10
|
import { classifyConnectRefusal } from "./browser-connect-error.js";
|
|
11
11
|
import { BROWSER_DOCUMENTATION } from "./browser-documentation.js";
|
|
12
12
|
import { createBrowserActions } from "./browser-actions.js";
|
|
13
|
-
import { agentContextName, buildConnectUrl, decideBrowserDriver, decideTabReuse, isDuplicateNameError, matchTargetsToPages, pickAgentContext, pickContextByName } from "./browser-decisions.js";
|
|
13
|
+
import { agentContextName, browserSessionName, buildConnectUrl, decideBrowserDriver, decideTabReuse, isDuplicateNameError, matchTargetsToPages, pickAgentContext, pickContextByName } from "./browser-decisions.js";
|
|
14
14
|
/** Version of the Playwright client library: preinstalled in the base image, installed on demand elsewhere. */
|
|
15
15
|
export const PLAYWRIGHT_CORE_VERSION = '1.63.0';
|
|
16
16
|
const GLOBAL_PLAYWRIGHT = '/usr/local/lib/node_modules/playwright-core';
|
|
@@ -156,7 +156,7 @@ async function connectActions(deps, settings) {
|
|
|
156
156
|
throw unavailable('praxis.browser.connect() needs node:fs/promises on the session machine to save screenshots.');
|
|
157
157
|
const client = createBrowserActions({
|
|
158
158
|
api: settings.api, token: settings.token, name: settings.name,
|
|
159
|
-
labels: { agent_session: settings.
|
|
159
|
+
labels: { agent_session: settings.sessionId, agent: settings.agentId },
|
|
160
160
|
context: settings.context, home: settings.home, fs, now: settings.now,
|
|
161
161
|
// Bound: a Worker isolate (the light machine) throws "Illegal invocation" when fetch is called as a method of another object.
|
|
162
162
|
fetch: deps.fetch ?? globalThis.fetch.bind(globalThis),
|
|
@@ -238,11 +238,12 @@ export async function connectBrowser(deps, options = {}) {
|
|
|
238
238
|
const now = deps.now ?? Date.now;
|
|
239
239
|
const driver = decideBrowserDriver({ override: deps.env.PRAXIS_BROWSER_DRIVER, childProcessAvailable: hasChildProcess(deps) });
|
|
240
240
|
const context = options.context === false ? undefined : await ensureContext(deps, agentId);
|
|
241
|
+
const name = browserSessionName({ agentId, sessionId, withContext: context !== undefined });
|
|
241
242
|
// The light machine drives the browser the service already runs; it never asks to be upgraded.
|
|
242
243
|
if (driver === 'actions')
|
|
243
|
-
return await connectActions(deps, { api, token, name
|
|
244
|
+
return await connectActions(deps, { api, token, name, sessionId, agentId, home, context, now });
|
|
244
245
|
const playwright = await loadPlaywright(deps, home);
|
|
245
|
-
const url = buildConnectUrl({ api, name
|
|
246
|
+
const url = buildConnectUrl({ api, name, context, idleMs: IDLE_MS, labels: { agent_session: sessionId, agent: agentId } });
|
|
246
247
|
let browser;
|
|
247
248
|
try {
|
|
248
249
|
browser = await playwright.chromium.connectOverCDP(url, { headers: { Authorization: `Bearer ${token}` }, timeout: 60_000 });
|
|
@@ -40,6 +40,19 @@ export interface ContextLike {
|
|
|
40
40
|
export declare function pickAgentContext<T extends ContextLike>(contexts: readonly T[], agentId: string): T | undefined;
|
|
41
41
|
/** Context names accept ASCII letters, digits and . _ : - only. */
|
|
42
42
|
export declare const agentContextName: (agentId: string) => string;
|
|
43
|
+
/**
|
|
44
|
+
* #3325: the cloud browser belongs to the agent, not to one session. An agent has exactly one saved-sign-in
|
|
45
|
+
* Context and a Context has one writer, so naming the browser after the session made every new session of the
|
|
46
|
+
* same agent (each stateless assume-MCP call is one) open a second browser that superseded the first: the open
|
|
47
|
+
* tabs and a half-done sign-in were gone between two calls. Named after the agent, every session and every call
|
|
48
|
+
* attaches to the one live browser by name. A connect without the Context (`context: false`) keeps the session
|
|
49
|
+
* name: it shares nothing, so it must not attach to the agent's signed-in browser.
|
|
50
|
+
*/
|
|
51
|
+
export declare function browserSessionName(input: {
|
|
52
|
+
agentId: string;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
withContext: boolean;
|
|
55
|
+
}): string;
|
|
43
56
|
/** Start pages are expendable only on Console hosts, never arbitrary sites' /start pages. */
|
|
44
57
|
export declare function isBlankTab(value: string): boolean;
|
|
45
58
|
/** One entry of a browser-level `Target.getTargets` answer, kept structural. */
|
|
@@ -69,6 +69,17 @@ export function pickAgentContext(contexts, agentId) {
|
|
|
69
69
|
}
|
|
70
70
|
/** Context names accept ASCII letters, digits and . _ : - only. */
|
|
71
71
|
export const agentContextName = (agentId) => `agent-${agentId}`.replace(/[^A-Za-z0-9._:-]/g, '-').slice(0, 128);
|
|
72
|
+
/**
|
|
73
|
+
* #3325: the cloud browser belongs to the agent, not to one session. An agent has exactly one saved-sign-in
|
|
74
|
+
* Context and a Context has one writer, so naming the browser after the session made every new session of the
|
|
75
|
+
* same agent (each stateless assume-MCP call is one) open a second browser that superseded the first: the open
|
|
76
|
+
* tabs and a half-done sign-in were gone between two calls. Named after the agent, every session and every call
|
|
77
|
+
* attaches to the one live browser by name. A connect without the Context (`context: false`) keeps the session
|
|
78
|
+
* name: it shares nothing, so it must not attach to the agent's signed-in browser.
|
|
79
|
+
*/
|
|
80
|
+
export function browserSessionName(input) {
|
|
81
|
+
return input.withContext ? agentContextName(input.agentId) : input.sessionId;
|
|
82
|
+
}
|
|
72
83
|
/** Start pages are expendable only on Console hosts, never arbitrary sites' /start pages. */
|
|
73
84
|
export function isBlankTab(value) {
|
|
74
85
|
if (value === "" || value === "about:blank")
|