@weaccelerateinc/agent-sdk 0.12.0 → 0.13.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/README.md CHANGED
@@ -1,13 +1,15 @@
1
- # @weaccelerateinc/agent-sdk 0.12.0
1
+ # @weaccelerateinc/agent-sdk 0.13.0
2
2
 
3
- SDK 0.12.0 adds opt-in Browser Use run-created fill-only checkout, exact additional-extension policies, and private WhatsApp adapters with durable sent-receipt reconciliation. The platform must implement durable owner/session/viewer fences and qualify its provider. Existing connector defaults and the 0.11.0 customer-final-click purchase contract remain. The approved extension ZIP is unchanged; its compatibility metadata includes 0.12.0.
3
+ SDK 0.13.0 lets authenticated integrations attach their customer-owned Browser Use browser without a separate merchant opt-in or an inventory of other installed extensions. Accelerate verifies its own extension, ownership and run binding. The run-created flow remains fill-only with private verification, durable scheduling/viewer fences, replay protection and cleanup. The approved extension ZIP is unchanged; its compatibility metadata includes 0.13.0.
4
+
5
+ Apply required migration 004 and deploy the matching wallet/gateway and reaper before the managed service, then install this SDK. SDK 0.12.0 retains its original opt-in and inventory checks. The customer controls its browser and other extensions; Accelerate does not claim isolation from them.
4
6
 
5
7
  Version 0.11.0 is a breaking release: **Accelerate never sends the final payment click.** A purchase arms one short click, the customer's agent performs it once through its own browser connection (`BrowserConnectorHost.performFinalClick`) in the customer's existing browser, then Accelerate observes the outcome. Purchase requires `final_click_actor:'customer'` and that host; the managed Kernel browser is fill-only. `client.checkouts.submit` rejects locally with `customer_click_required`. See [customer-owned final click](../../docs/customer-final-click.md). Release 0.10.3 keeps its existing behavior. Merchant layouts remain limited to the qualified sandbox page; this SDK release does not by itself qualify any merchant layout, a service deployment or production payments.
6
8
 
7
- Server-only ESM SDK with TypeScript declarations, Node 22+, zero runtime dependencies. New partners use their existing browser and explicitly select `managed_review_v2`, which continues an armed fill immediately after private CVV verification. Existing callers keep `managed_review_v1` unless they opt in. Public npm releases use `@weaccelerateinc/agent-sdk`; install an exact available version with `npm install @weaccelerateinc/agent-sdk@0.12.0`. Check `npm view @weaccelerateinc/agent-sdk@0.12.0 version` to confirm registry availability. The package remains `UNLICENSED`.
9
+ Server-only ESM SDK with TypeScript declarations, Node 22+, zero runtime dependencies. New partners use their existing browser and explicitly select `managed_review_v2`, which continues an armed fill immediately after private CVV verification. Existing callers keep `managed_review_v1` unless they opt in. Public npm releases use `@weaccelerateinc/agent-sdk`; install an exact available version with `npm install @weaccelerateinc/agent-sdk@0.13.0`. Check `npm view @weaccelerateinc/agent-sdk@0.13.0 version` to confirm registry availability. The package remains `UNLICENSED`.
8
10
 
9
11
  ```sh
10
- npm install --ignore-scripts @weaccelerateinc/agent-sdk@0.12.0
12
+ npm install --ignore-scripts @weaccelerateinc/agent-sdk@0.13.0
11
13
  npx --no-install accelerate-agent init ./partner-demo --browser existing
12
14
  ```
13
15
 
@@ -28,7 +28,8 @@
28
28
  "0.10.3",
29
29
  "0.10.4",
30
30
  "0.11.0",
31
- "0.12.0"
31
+ "0.12.0",
32
+ "0.13.0"
32
33
  ],
33
34
  "executor_contract": "accelerate_manual_checkout_v1"
34
35
  },
@@ -27,7 +27,8 @@
27
27
  "0.10.3",
28
28
  "0.10.4",
29
29
  "0.11.0",
30
- "0.12.0"
30
+ "0.12.0",
31
+ "0.13.0"
31
32
  ],
32
33
  "executor_contract": "accelerate_manual_checkout_v1"
33
34
  },
@@ -1,6 +1,6 @@
1
1
  import { createHash } from 'node:crypto';
2
2
 
3
- const SDK_VERSION = '0.12.0';
3
+ const SDK_VERSION = '0.13.0';
4
4
  const EXECUTOR_CONTRACT = 'accelerate_manual_checkout_v1';
5
5
  const BRIDGE_PROTOCOL = 'accelerate_extension_bridge_v1';
6
6
  const LEGACY_SHA256 = '65574cbb27ab344687963f72a136f2653551b57458b284e486946b27699099c8';
@@ -42,14 +42,14 @@ export function createBrowserUseHost(options: {
42
42
  merchantId: string;
43
43
  extensionId: string;
44
44
  /** Primary runtime ID pinned in durable operator installation configuration.
45
- * Required for run-created or multi-extension mode; stable across host restarts. */
45
+ * Required when the resolved browser has run provenance; stable across host restarts. */
46
46
  extensionRuntimeId?: string;
47
47
  extensionRelease: ApprovedExtensionRelease;
48
48
  host: BrowserUsePlatformHost;
49
- /** Requires a durable owned run reservation and a fence covering all session runs and queued work.
50
- * The executor must separately enable this merchant. Default false. */
49
+ /** @deprecated Ignored. Run-created browsers require a durable owned reservation,
50
+ * a pinned extensionRuntimeId and a fence covering all session runs and queued work. */
51
51
  allowRunCreatedBrowsers?: boolean;
52
- /** Complete additional extension set approved for this merchant/provider. This is not qualification evidence. */
52
+ /** @deprecated Ignored. The customer manages its other browser extensions. */
53
53
  additionalExtensions?: ReadonlyArray<Readonly<{ id: string; runtimeId: string; version: string }>>;
54
54
  fetchImpl?: typeof fetch;
55
55
  /** Test clock only. */
@@ -45,23 +45,14 @@ const freeze = value => {
45
45
  };
46
46
 
47
47
  export function createBrowserUseHost(configuration = {}) {
48
+ // Legacy opt-in and extension-inventory options remain accepted but have no effect.
48
49
  exact(configuration, ['apiKey', 'merchantId', 'extensionId', 'extensionRelease', 'host'], ['fetchImpl', 'now', 'allowRunCreatedBrowsers', 'additionalExtensions', 'extensionRuntimeId']);
49
- const { apiKey, merchantId, extensionId, host, fetchImpl = fetch, now = Date.now,
50
- allowRunCreatedBrowsers = false, additionalExtensions = [], extensionRuntimeId } = configuration;
50
+ const { apiKey, merchantId, extensionId, host, fetchImpl = fetch, now = Date.now, extensionRuntimeId } = configuration;
51
51
  check(typeof apiKey === 'string' && apiKey.length >= 16 && apiKey.length <= 500 && !/[\u0000-\u0020\u007f]/u.test(apiKey) &&
52
52
  UUID.test(merchantId) && UUID.test(extensionId) && typeof fetchImpl === 'function' && typeof now === 'function' && host &&
53
53
  ['resolveOwnedBrowser', 'drainAndFence', 'bindCheckout', 'resolveCheckoutBrowser', 'inspectDocument', 'confirmLocalCleanup']
54
54
  .every(key => typeof host[key] === 'function'), 'configuration_invalid');
55
- check(typeof allowRunCreatedBrowsers === 'boolean' && Array.isArray(additionalExtensions) && additionalExtensions.length <= 2, 'configuration_invalid');
56
55
  check(extensionRuntimeId === undefined || RUNTIME.test(extensionRuntimeId), 'configuration_invalid');
57
- check(!(allowRunCreatedBrowsers || additionalExtensions.length) || RUNTIME.test(extensionRuntimeId ?? ''), 'configuration_invalid');
58
- const extensionIds = new Set([extensionId]), runtimes = new Set();
59
- const extras = additionalExtensions.map(value => {
60
- exact(value, ['id', 'runtimeId', 'version']);
61
- check(UUID.test(value.id) && RUNTIME.test(value.runtimeId) && typeof value.version === 'string' &&
62
- /^\d+(?:\.\d+){0,3}$/u.test(value.version) && !extensionIds.has(value.id) && !runtimes.has(value.runtimeId), 'configuration_invalid');
63
- extensionIds.add(value.id); runtimes.add(value.runtimeId); return Object.freeze({ ...value });
64
- });
65
56
  let release;
66
57
  try { release = validateApprovedExtensionRelease(configuration.extensionRelease); }
67
58
  catch { throw new AccelerateError('configuration_invalid'); }
@@ -81,7 +72,8 @@ export function createBrowserUseHost(configuration = {}) {
81
72
  catch { throw new AccelerateError('permission_denied'); }
82
73
  let provenance;
83
74
  if (Object.hasOwn(document.browser, 'provenance')) {
84
- check(allowRunCreatedBrowsers || cleanup && typeof document.fence_id === 'string' && document.fence_id.length > 0, 'permission_denied');
75
+ check(RUNTIME.test(extensionRuntimeId ?? ''), 'configuration_invalid');
76
+ check(!cleanup || typeof document.fence_id === 'string' && document.fence_id.length > 0, 'permission_denied');
85
77
  try { provenance = browserUseRunProvenance(document.browser.provenance); }
86
78
  catch { throw new AccelerateError('permission_denied'); }
87
79
  }
@@ -139,23 +131,23 @@ export function createBrowserUseHost(configuration = {}) {
139
131
  metadata.accelerate_extension_sha256 === release.artifact.sha256 && metadata.accelerate_extension_version === release.extension_version) &&
140
132
  typeof value.timeoutAt === 'string' && Number.isFinite(Date.parse(value.timeoutAt)) &&
141
133
  (requiredStatus === 'stopped' || Date.parse(value.timeoutAt) > now()) &&
142
- Array.isArray(value.extensions) && value.extensions.length === extras.length + 1 &&
143
- new Set(value.extensions.map(item => item?.id)).size === value.extensions.length &&
144
- new Set(value.extensions.map(item => item?.runtimeId)).size === value.extensions.length);
145
- const primary = value.extensions.find(item => item?.id === extensionId);
146
- check(primary?.version === release.extension_version && RUNTIME.test(primary?.runtimeId ?? '') &&
147
- extras.every(expected => value.extensions.some(item => ['id', 'version', 'runtimeId'].every(key => item?.[key] === expected[key]))));
134
+ Array.isArray(value.extensions));
135
+ const primaries = value.extensions.filter(item => item?.id === extensionId);
136
+ check(primaries.length === 1);
137
+ const primary = primaries[0];
138
+ check(primary.version === release.extension_version && RUNTIME.test(primary.runtimeId ?? '') &&
139
+ !value.extensions.some(item => item !== primary && item?.runtimeId === primary.runtimeId));
148
140
  check(extensionRuntimeId === undefined || primary.runtimeId === extensionRuntimeId);
149
141
  // Deliberately project away provider CDP/viewer URLs and unknown response fields.
150
142
  const read = freeze({ expires_at: value.timeoutAt, runtime_id: primary.runtimeId });
151
143
  if (!options.withConnection) return read;
152
144
  check(typeof value.cdpUrl === 'string' && value.cdpUrl.length <= 2048 && typeof value.startedAt === 'string');
153
145
  return freeze({ ...read, connection: freeze({ id: value.id, status: value.status, cdpUrl: value.cdpUrl, startedAt: value.startedAt,
154
- timeoutAt: value.timeoutAt, recordingAvailable: false,
146
+ timeoutAt: value.timeoutAt, recordingAvailable: false, accelerate_extension_id: extensionId,
155
147
  metadata: binding.provenance ? {} : Object.fromEntries(['accelerate_merchant_id', 'accelerate_owner_user_id',
156
148
  'accelerate_workspace_id', 'accelerate_custody_mode', 'accelerate_agent_extension_id',
157
149
  'accelerate_extension_sha256', 'accelerate_extension_version'].map(key => [key, metadata[key]])),
158
- extensions: value.extensions.map(item => ({ id: item.id, runtimeId: item.runtimeId, version: item.version })),
150
+ extensions: [{ id: extensionId, runtimeId: primary.runtimeId, version: primary.version }],
159
151
  ...runEvidence }) });
160
152
  } catch {
161
153
  throw new AccelerateError(options.signal?.aborted ? 'request_cancelled' : 'integration_unavailable');
package/index.d.ts CHANGED
@@ -166,9 +166,13 @@ export interface CreateCheckout {
166
166
  * Send it on every create. It is held in memory for this checkout and never stored. */
167
167
  browser_resource?: ClientBrowserResource;
168
168
  }
169
- /** The fields of Browser Use `GET /api/v4/browsers/{id}` that Accelerate needs. */
169
+ /** Private projection of Browser Use `GET /api/v4/browsers/{id}`, with the
170
+ * Accelerate extension selected by the authenticated backend. */
170
171
  export interface ClientBrowserResource {
171
172
  id: string;
173
+ /** Accelerate extension selected from the backend's durable installation configuration.
174
+ * Other extensions in the customer-owned browser are outside this projection. */
175
+ accelerate_extension_id?: string;
172
176
  status: 'active';
173
177
  cdpUrl: string;
174
178
  startedAt: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weaccelerateinc/agent-sdk",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Server-only payment SDK, existing-browser connectors and private host adapters for agent platforms",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -1,15 +1,15 @@
1
1
  # Existing-browser payment starter
2
2
 
3
- SDK 0.12.0, explicit `managed_review_v2`, `customer_backend_trusted`. Newly generated existing-browser apps default to `purpose:'purchase'` with the submit tool enabled. The matching service must support this profile; publishing the SDK does not deploy the service or qualify a merchant layout. Your platform creates its browser and installs the approved extension. This starter attaches that same browser at payment; it never creates a replacement. The older `accelerate-agent init <dir>` starter still selects Accelerate-managed Kernel custody and its fill-only default.
3
+ SDK 0.13.0, explicit `managed_review_v2`, `customer_backend_trusted`. Newly generated existing-browser apps default to `purpose:'purchase'` with the submit tool enabled. The matching service must support this profile; publishing the SDK does not deploy the service or qualify a merchant layout. Your platform creates its browser and installs the approved extension. This starter attaches that same browser at payment; it never creates a replacement. The older `accelerate-agent init <dir>` starter still selects Accelerate-managed Kernel custody and its fill-only default.
4
4
 
5
5
  ## Run without credentials
6
6
 
7
- Once Accelerate supplies the matching verified 0.12.0 archive, install it, then:
7
+ Once Accelerate supplies the matching verified 0.13.0 archive, install it, then:
8
8
 
9
9
  ```sh
10
10
  npx --no-install accelerate-agent init ./partner-demo --browser existing
11
11
  cd partner-demo
12
- npm install /secure/downloads/weaccelerateinc-agent-sdk-0.12.0.tgz
12
+ npm install /secure/downloads/weaccelerateinc-agent-sdk-0.13.0.tgz
13
13
  npm test
14
14
  npm run smoke
15
15
  ```
@@ -12,7 +12,7 @@
12
12
  "test": "node --test tests/*.test.mjs"
13
13
  },
14
14
  "dependencies": {
15
- "@weaccelerateinc/agent-sdk": "0.12.0",
15
+ "@weaccelerateinc/agent-sdk": "0.13.0",
16
16
  "@modelcontextprotocol/server": "2.3.1"
17
17
  },
18
18
  "devDependencies": {
@@ -225,7 +225,7 @@ export function createSyntheticDependencies({ purpose = 'sandbox_fill_only', pro
225
225
  artifact: { format: 'zip', sha256: 'a'.repeat(64), bytes: 1234 },
226
226
  bridge: { protocol: 'accelerate_extension_bridge_v1', sha256: 'b'.repeat(64) },
227
227
  capabilities: { manual_card_fill: true, document_bound_single_use: true, autosave_disabled: true, automatic_submit: false, maximum_retention_ms: 480000 },
228
- compatibility: { sdk_versions: ['0.10.1', '0.10.2', '0.10.3', '0.10.4', '0.11.0', '0.12.0'], executor_contract: 'accelerate_manual_checkout_v1' },
228
+ compatibility: { sdk_versions: ['0.10.1', '0.10.2', '0.10.3', '0.10.4', '0.11.0', '0.12.0', '0.13.0'], executor_contract: 'accelerate_manual_checkout_v1' },
229
229
  qualifications: [{ provider: 'connector', scope: 'synthetic_only', evidence: 'docs/evidence/synthetic-starter.json' }],
230
230
  }; // Fake metadata for this in-process fixture only; never load it in live mode.
231
231
  const browser = { owner: context, browser: { provider: 'connector', connector_id: 'synthetic_cdp', browser_id: 'existing:browser:1', custody_mode: 'customer_backend_trusted' },
package/starter/README.md CHANGED
@@ -6,12 +6,12 @@ The default runnable mode is **synthetic**. It uses the real SDK, managed MCP ad
6
6
 
7
7
  ## Install and run
8
8
 
9
- Requires Node.js 22 or newer. Install the exact SDK 0.9.0 archive and checksum supplied by Accelerate; [release distribution](https://github.com/weaccelerateinc/accelerate-agent-sdk/blob/main/docs/releases.md) records verified availability. Do not assume npm publication.
9
+ Requires Node.js 22 or newer. Install the exact SDK 0.13.0 archive and checksum supplied by Accelerate; [release distribution](https://github.com/weaccelerateinc/accelerate/blob/main/products/agent-sdk/docs/releases.md) records verified availability. Do not assume npm publication.
10
10
 
11
11
  ```sh
12
12
  npx --no-install accelerate-agent init ./accelerate-demo
13
13
  cd accelerate-demo
14
- npm install /absolute/path/to/accelerate-agent-sdk-0.9.0.tgz
14
+ npm install /absolute/path/to/weaccelerateinc-agent-sdk-0.13.0.tgz
15
15
  npm test
16
16
  npm run smoke
17
17
  ```
@@ -12,7 +12,7 @@
12
12
  "test": "node --test tests/*.test.mjs"
13
13
  },
14
14
  "dependencies": {
15
- "@weaccelerateinc/agent-sdk": "0.12.0",
15
+ "@weaccelerateinc/agent-sdk": "0.13.0",
16
16
  "@modelcontextprotocol/server": "2.3.1"
17
17
  },
18
18
  "devDependencies": {