eric-sdk 0.0.3 → 0.0.5

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 CHANGED
@@ -86,14 +86,18 @@ var EricSDK = class {
86
86
  * 2) DECIDE — agentic routing with optional allowedFlows
87
87
  * ------------------------------------------------------------- */
88
88
  async decide(data) {
89
- const { allowedFlows, ...rest } = data;
89
+ const { allowedFlows, requestType, ...rest } = data;
90
90
  const payload = {
91
91
  flow: "decisionRouter",
92
92
  data: {
93
93
  ...rest,
94
- client: this.client
94
+ client: this.client,
95
+ text: rest.text ?? "implicit_intent"
95
96
  }
96
97
  };
98
+ if (requestType) {
99
+ payload.data.requestType = requestType;
100
+ }
97
101
  if (allowedFlows) {
98
102
  payload.data.allowedFlows = allowedFlows;
99
103
  }
package/dist/index.d.cts CHANGED
@@ -15,8 +15,9 @@ declare class EricSDK {
15
15
  constructor(options: EricClientOptions);
16
16
  call(flowName: string, data: any): Promise<EricResponse>;
17
17
  decide(data: {
18
- text: string;
18
+ text?: string;
19
19
  topic?: string;
20
+ requestType?: string;
20
21
  userState?: any;
21
22
  allowedFlows?: string[];
22
23
  }): Promise<EricResponse>;
package/dist/index.d.ts CHANGED
@@ -15,8 +15,9 @@ declare class EricSDK {
15
15
  constructor(options: EricClientOptions);
16
16
  call(flowName: string, data: any): Promise<EricResponse>;
17
17
  decide(data: {
18
- text: string;
18
+ text?: string;
19
19
  topic?: string;
20
+ requestType?: string;
20
21
  userState?: any;
21
22
  allowedFlows?: string[];
22
23
  }): Promise<EricResponse>;
package/dist/index.js CHANGED
@@ -30,14 +30,18 @@ var EricSDK = class {
30
30
  * 2) DECIDE — agentic routing with optional allowedFlows
31
31
  * ------------------------------------------------------------- */
32
32
  async decide(data) {
33
- const { allowedFlows, ...rest } = data;
33
+ const { allowedFlows, requestType, ...rest } = data;
34
34
  const payload = {
35
35
  flow: "decisionRouter",
36
36
  data: {
37
37
  ...rest,
38
- client: this.client
38
+ client: this.client,
39
+ text: rest.text ?? "implicit_intent"
39
40
  }
40
41
  };
42
+ if (requestType) {
43
+ payload.data.requestType = requestType;
44
+ }
41
45
  if (allowedFlows) {
42
46
  payload.data.allowedFlows = allowedFlows;
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eric-sdk",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Official SDK for interacting with the Eric AI Policy Engine",
5
5
  "author": "Rod Bridges",
6
6
  "license": "MIT",
package/src/client.ts CHANGED
@@ -52,21 +52,27 @@ export class EricSDK {
52
52
  * 2) DECIDE — agentic routing with optional allowedFlows
53
53
  * ------------------------------------------------------------- */
54
54
  async decide(data: {
55
- text: string;
55
+ text?: string;
56
56
  topic?: string;
57
+ requestType?: string;
57
58
  userState?: any;
58
59
  allowedFlows?: string[];
59
60
  }): Promise<EricResponse> {
60
- const { allowedFlows, ...rest } = data;
61
+ const { allowedFlows, requestType, ...rest } = data;
61
62
 
62
63
  const payload: any = {
63
64
  flow: "decisionRouter",
64
65
  data: {
65
66
  ...rest,
66
67
  client: this.client,
68
+ text: rest.text ?? "implicit_intent",
67
69
  }
68
70
  };
69
71
 
72
+ if (requestType) {
73
+ payload.data.requestType = requestType;
74
+ }
75
+
70
76
  if (allowedFlows) {
71
77
  payload.data.allowedFlows = allowedFlows;
72
78
  }