@native-engagement/sdk 0.10.0 → 0.11.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 ADDED
@@ -0,0 +1,54 @@
1
+ # Native Engagement SDK
2
+
3
+ JavaScript and TypeScript access to Native Engagement. Requires Node.js 24.22.1 or later in the Node.js 24 line.
4
+
5
+ ```sh
6
+ npm install @native-engagement/sdk@0.11.0
7
+ ```
8
+
9
+ ## Connect and sign in
10
+
11
+ Use the trusted service URL supplied by your administrator. Browser sign-in handles account credentials and any MFA challenge.
12
+
13
+ ```js
14
+ import {
15
+ createNativePublicLogin, openNativeLoginPage, RemoteNativeEngagementSdk
16
+ } from '@native-engagement/sdk';
17
+
18
+ const origin = 'https://engagement.example';
19
+ const login = await createNativePublicLogin(origin);
20
+ const grant = await login.authorize(AbortSignal.timeout(180_000), openNativeLoginPage);
21
+ const sdk = new RemoteNativeEngagementSdk({
22
+ baseUrl: origin,
23
+ accessToken: () => grant.accessToken
24
+ });
25
+
26
+ const discovery = await sdk.discoverContracts({ query: 'execution.device', limit: 10 });
27
+ console.log(discovery);
28
+ // At the end of the session:
29
+ await login.revoke(grant);
30
+ ```
31
+
32
+ Your administrator provisions account and tenant permissions. Each operation checks current authorization. Keep grants in memory or an approved protected credential store. For an existing automation identity, supply its authorized token provider through `accessToken`; never put credentials in command arguments or source code.
33
+
34
+ ## Discover and call capabilities
35
+
36
+ Use `sdk.discoverContracts({query, kind, limit, cursor})` to find relevant capabilities and `sdk.schema(name, 'input')` for their current input constraints. Call `sdk.query({name, payload})` or `sdk.command({name, payload})` with those inputs. Commands require a stable `idempotencyKey`.
37
+
38
+ The SDK also exports typed helpers for supported business operations and `NativeMcpToolCatalog` for a host that already owns an authenticated MCP client. Capability discovery grants no additional permissions.
39
+
40
+ Keep original request keys and receipts. After a lost response or an unknown external result, inspect the original operation before retrying. Request acceptance, operation completion and external delivery are separate outcomes.
41
+
42
+ ## Prepare an execution environment
43
+
44
+ This package is a remote client. It does not contain another Agent Runtime, an execution node, channel applications or models. Your Agent Runtime remains managed by its existing host.
45
+
46
+ `installationRuntimeSkill()` returns offline execution prerequisites and dependency reuse guidance. Discover `execution.device.list` and `execution.device.inspect` to reuse an existing authorized environment. When another environment is needed, follow `execution.environment.request` and its original authenticated installation handoff.
47
+
48
+ The host Agent can prepare selected authorized dependencies and install a trusted execution artifact. Reuse compatible installed programs and caches. An execution artifact supplies the local Node/Worker programs; an existing installation can continue to use its original programs. A Desktop application is optional.
49
+
50
+ Installation, account pairing, channel authorization and updates retain their own checks. Preserve installation identity, credentials, task journals and recovery state across upgrades. Missing trusted artifacts or unsupported platforms must remain explicit.
51
+
52
+ ## License
53
+
54
+ Apache-2.0. Bundled third-party notices are included in `THIRD_PARTY_LICENSES.txt`.