interai-risk-oracle 0.1.6-beta → 0.1.7-beta

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
@@ -2,15 +2,15 @@
2
2
 
3
3
  Typed hosted API client for InterAI Risk Oracle.
4
4
 
5
- Package version: `interai-risk-oracle@0.1.6-beta`.
5
+ Package version: `interai-risk-oracle@0.1.7-beta`.
6
6
 
7
7
  ```bash
8
- npm install interai-risk-oracle@0.1.6-beta
8
+ npm install interai-risk-oracle@0.1.7-beta
9
9
  ```
10
10
 
11
- ## Builder workflow
11
+ ## Zero-funding builder trial
12
12
 
13
- The client can onboard a builder, retain the returned API key, inspect the account, quote usage, and manage a prepaid top-up without hand-building HTTP requests:
13
+ A new builder can reach a first hosted verification without moving funds. The controlled demo trial is bounded by InterAI's trial TTL, per-client limits, shared budget, and maximum-verification count.
14
14
 
15
15
  ```ts
16
16
  import { InterAIRiskOracleClient } from "interai-risk-oracle"
@@ -20,7 +20,44 @@ const client = new InterAIRiskOracleClient({
20
20
  })
21
21
 
22
22
  const onboarding = await client.onboard({
23
- name: "my-agent"
23
+ name: "my-agent",
24
+ scope: "demo_trial"
25
+ })
26
+
27
+ const decision = await client.verify({
28
+ use_case: "agent-before-tool-execution",
29
+ action: {
30
+ type: "read_only_lookup",
31
+ name: "check_order_status",
32
+ description: "Read an order status in a sandbox",
33
+ external_side_effect: false,
34
+ irreversible: false
35
+ },
36
+ context: {
37
+ agent_id: "my-agent",
38
+ environment: "sandbox",
39
+ user_confirmation: true
40
+ },
41
+ policy: { require_trust_receipt: true }
42
+ })
43
+
44
+ const receipt = await client.getTrustReceipt(decision.trust_receipt_id!)
45
+ ```
46
+
47
+ `onboard()` stores the returned API key on the client when one is issued. The demo trial is for bounded integration evaluation; it is not a source of transferable funds and does not bypass normal production funding requirements.
48
+
49
+ ## Funded builder workflow
50
+
51
+ The same client can create a standard account, retain the returned API key, inspect the account, quote usage, and manage a prepaid top-up without hand-building HTTP requests:
52
+
53
+ ```ts
54
+ const client = new InterAIRiskOracleClient({
55
+ baseUrl: "https://api.interailabs.dev"
56
+ })
57
+
58
+ await client.onboard({
59
+ name: "my-funded-agent",
60
+ scope: "standard"
24
61
  })
25
62
 
26
63
  const account = await client.me()
@@ -28,7 +65,7 @@ const quote = await client.quote({ mode: "fast" })
28
65
  const topup = await client.createTopup("0.10")
29
66
  ```
30
67
 
31
- `onboard()` stores the returned API key on the client when one is issued. You can also set a key explicitly with `setApiKey()`.
68
+ You can also set a key explicitly with `setApiKey()`.
32
69
 
33
70
  Top-up helpers cover `createTopup()`, `topupStatus()`, and `confirmTopup()`. Account helpers include `me()`, `ledger()`, and `usage()`. HTTP failures raise `OracleHttpError` with `status`, structured API `code`, response headers, body, and parsed x402 payment requirements when present.
34
71
 
@@ -102,4 +139,4 @@ npm run build
102
139
  npm pack --dry-run
103
140
  ```
104
141
 
105
- See [the durable SQLite dispatch example](../../examples/execution-boundary/README.md) for restart-safe consumption and terminal executor binding. The low-level validator alone does not prevent replay.
142
+ See [the durable SQLite dispatch example](../../examples/execution-boundary/README.md) for restart-safe consumption and terminal executor binding. The low-level validator alone does not prevent replay.
@@ -0,0 +1,16 @@
1
+ import { InterAIRiskOracleClient as BaseInterAIRiskOracleClient, type InterAIClientOptions, type OnboardResponse } from "./index.js";
2
+ export * from "./index.js";
3
+ export declare const SDK_VERSION: "0.1.7-beta";
4
+ export type OnboardOptions = {
5
+ name?: string;
6
+ account_id?: string;
7
+ api_key_name?: string;
8
+ recommended_topup_usdc?: string;
9
+ scope?: "standard" | "demo_trial";
10
+ };
11
+ /** Package-facing client with the complete builder onboarding surface. */
12
+ export declare class InterAIRiskOracleClient extends BaseInterAIRiskOracleClient {
13
+ constructor(options: InterAIClientOptions);
14
+ onboard(input?: OnboardOptions): Promise<OnboardResponse>;
15
+ }
16
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,IAAI,2BAA2B,EACtD,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAA;AAEnB,cAAc,YAAY,CAAA;AAE1B,eAAO,MAAM,WAAW,EAAG,YAAqB,CAAA;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,KAAK,CAAC,EAAE,UAAU,GAAG,YAAY,CAAA;CAClC,CAAA;AAED,0EAA0E;AAC1E,qBAAa,uBAAwB,SAAQ,2BAA2B;gBAC1D,OAAO,EAAE,oBAAoB;IAO1B,OAAO,CAAC,KAAK,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;CAG7E"}
package/dist/public.js ADDED
@@ -0,0 +1,16 @@
1
+ import { InterAIRiskOracleClient as BaseInterAIRiskOracleClient } from "./index.js";
2
+ export * from "./index.js";
3
+ export const SDK_VERSION = "0.1.7-beta";
4
+ /** Package-facing client with the complete builder onboarding surface. */
5
+ export class InterAIRiskOracleClient extends BaseInterAIRiskOracleClient {
6
+ constructor(options) {
7
+ super({
8
+ ...options,
9
+ clientName: options.clientName || `typescript-sdk/${SDK_VERSION}`
10
+ });
11
+ }
12
+ async onboard(input = {}) {
13
+ return super.onboard(input);
14
+ }
15
+ }
16
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,IAAI,2BAA2B,EAGvD,MAAM,YAAY,CAAA;AAEnB,cAAc,YAAY,CAAA;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,YAAqB,CAAA;AAUhD,0EAA0E;AAC1E,MAAM,OAAO,uBAAwB,SAAQ,2BAA2B;IACtE,YAAY,OAA6B;QACvC,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,kBAAkB,WAAW,EAAE;SAClE,CAAC,CAAA;IACJ,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,QAAwB,EAAE;QAC/C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "interai-risk-oracle",
3
- "version": "0.1.6-beta",
3
+ "version": "0.1.7-beta",
4
4
  "description": "TypeScript client for InterAI's independent pre-execution decision layer for consequential agent actions.",
5
5
  "homepage": "https://api.interailabs.dev/",
6
6
  "repository": {
@@ -12,12 +12,12 @@
12
12
  "url": "https://github.com/InterAILabs/ai-risk-oracle/issues"
13
13
  },
14
14
  "type": "module",
15
- "main": "./dist/index.js",
16
- "types": "./dist/index.d.ts",
15
+ "main": "./dist/public.js",
16
+ "types": "./dist/public.d.ts",
17
17
  "exports": {
18
18
  ".": {
19
- "types": "./dist/index.d.ts",
20
- "import": "./dist/index.js"
19
+ "types": "./dist/public.d.ts",
20
+ "import": "./dist/public.js"
21
21
  }
22
22
  },
23
23
  "files": [
@@ -49,4 +49,4 @@
49
49
  "devDependencies": {
50
50
  "typescript": "^5.0.0"
51
51
  }
52
- }
52
+ }