eric-sdk 0.0.5 → 0.1.1
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/CHANGELOG.md +42 -0
- package/README.md +55 -231
- package/dist/index.cjs +3 -24
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +3 -24
- package/package.json +5 -10
- package/src/client.ts +13 -35
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Eric SDK are documented here.
|
|
4
|
+
|
|
5
|
+
This project follows semantic versioning.
|
|
6
|
+
Pre-1.0 releases may introduce intentional breaking changes as the API surface hardens.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.1.1] – 2026-01-30
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Removed explicit `flow: "decisionRouter"` from SDK requests.
|
|
14
|
+
|
|
15
|
+
### Rationale
|
|
16
|
+
The Eric API no longer accepts direct flow invocation.
|
|
17
|
+
All requests are treated as intent submissions and are routed through
|
|
18
|
+
the internal decision router by default.
|
|
19
|
+
|
|
20
|
+
This change simplifies the SDK payload and prevents accidental coupling
|
|
21
|
+
to internal execution details.
|
|
22
|
+
|
|
23
|
+
## [0.1.0] – 2026-01-27
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Removed `client.call()` to prevent direct flow invocation.
|
|
27
|
+
- All executions must now be routed through `decide()`.
|
|
28
|
+
|
|
29
|
+
### Rationale
|
|
30
|
+
Direct flow execution allowed applications to bypass policy enforcement.
|
|
31
|
+
Eric is designed as a governance and control layer; all execution must pass through
|
|
32
|
+
policy evaluation to ensure deterministic, auditable outcomes.
|
|
33
|
+
|
|
34
|
+
This release intentionally narrows the public API to reflect Eric’s execution model.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [0.0.5] – 2025-12-14
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- Initial public SDK release.
|
|
42
|
+
- `decide()` with policy-based routing and optional execution bounds.
|
package/README.md
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Eric SDK (JavaScript / TypeScript)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official SDK for interacting with **Eric AI**, a policy-governed execution layer for AI systems.
|
|
4
4
|
|
|
5
|
-
Eric
|
|
6
|
-
|
|
5
|
+
Eric is designed for environments where AI behavior must be **controlled, deterministic, and auditable**.
|
|
6
|
+
All requests are evaluated against configured policy before any capability is executed.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## 🚀 Features
|
|
11
|
-
|
|
12
|
-
* 🔁 **Governed routing** via `eric.decide()`
|
|
13
|
-
* 🧭 Deterministic flow selection using the **decisionRouter**
|
|
14
|
-
* 🎯 Restricted auto-routing with `allowedFlows`
|
|
15
|
-
* 🔧 Direct flow execution with `eric.call()`
|
|
16
|
-
* 🔒 Public vs Private API key security model
|
|
17
|
-
* 🧠 Domain-aware tone and behavior (events, wellness, business)
|
|
18
|
-
* 🛡️ Domain whitelisting + rate limiting (public keys)
|
|
19
|
-
* 🧱 Strong TypeScript typing
|
|
20
|
-
* 🧰 Production-ready SDK backed by Firebase Cloud Functions
|
|
8
|
+
This SDK exposes a single, safe interaction model that enforces those guarantees by default.
|
|
21
9
|
|
|
22
10
|
---
|
|
23
11
|
|
|
24
|
-
##
|
|
12
|
+
## Installation
|
|
25
13
|
|
|
26
14
|
```bash
|
|
27
15
|
npm install eric-sdk
|
|
@@ -29,273 +17,109 @@ npm install eric-sdk
|
|
|
29
17
|
|
|
30
18
|
---
|
|
31
19
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
Eric supports **two types of API keys**, similar to Stripe or OpenAI.
|
|
35
|
-
|
|
36
|
-
### 🔓 Public Key (`pub_xxx`)
|
|
20
|
+
## Authentication
|
|
37
21
|
|
|
38
|
-
|
|
22
|
+
You will need an Eric-issued API key.
|
|
39
23
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* Restricted to **safe flows only**
|
|
43
|
-
|
|
44
|
-
Allowed flows with a public key:
|
|
24
|
+
```ts
|
|
25
|
+
import { EricSDK } from "eric-sdk";
|
|
45
26
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
const eric = new EricSDK({
|
|
28
|
+
apiKey: process.env.ERIC_API_KEY!,
|
|
29
|
+
client: "your-app-id",
|
|
30
|
+
});
|
|
31
|
+
```
|
|
49
32
|
|
|
50
|
-
|
|
33
|
+
API keys are scoped and governed server-side.
|
|
34
|
+
Keys should be treated as secrets and stored securely.
|
|
51
35
|
|
|
52
36
|
---
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Server-to-server only.
|
|
38
|
+
## Security Notice
|
|
57
39
|
|
|
58
|
-
|
|
59
|
-
* No domain restriction
|
|
60
|
-
* Higher rate limits
|
|
61
|
-
* Intended for trusted backend workloads
|
|
40
|
+
This SDK enforces server-side policy and execution controls.
|
|
62
41
|
|
|
63
|
-
|
|
64
|
-
This is the same model used by Stripe, OpenAI, Twilio, and AWS.
|
|
42
|
+
API keys must be stored securely and never embedded in public repositories.
|
|
65
43
|
|
|
66
44
|
---
|
|
67
45
|
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
import { EricSDK } from "eric-sdk";
|
|
46
|
+
## Usage
|
|
72
47
|
|
|
73
|
-
|
|
74
|
-
apiKey: process.env.ERIC_API_KEY!, // pub_ or priv_
|
|
75
|
-
client: "eventinterface",
|
|
76
|
-
});
|
|
48
|
+
### Policy-Governed Execution
|
|
77
49
|
|
|
78
|
-
|
|
79
|
-
text: "I'm overwhelmed today.",
|
|
80
|
-
});
|
|
81
|
-
```
|
|
50
|
+
All interactions with Eric are routed through `decide()`.
|
|
82
51
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
{
|
|
87
|
-
"flow": "dailyNudgeGenerator",
|
|
88
|
-
"type": "structured",
|
|
89
|
-
"data": {
|
|
90
|
-
"nudge": "You're building momentum — take a breath and trust your progress."
|
|
91
|
-
},
|
|
92
|
-
"meta": {
|
|
93
|
-
"routingMode": "llm",
|
|
94
|
-
"reason": "Detected emotional distress language"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The `meta` field explains **why** a particular flow was chosen.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 🎯 Auto-Routing with Restrictions
|
|
52
|
+
Eric evaluates each request against policy, routing constraints, and execution bounds before selecting and invoking an approved capability.
|
|
104
53
|
|
|
105
54
|
```ts
|
|
106
55
|
const result = await eric.decide({
|
|
107
|
-
text:
|
|
108
|
-
|
|
109
|
-
userState: {
|
|
110
|
-
tone: "energetic",
|
|
111
|
-
length: 150,
|
|
112
|
-
},
|
|
56
|
+
text: "summarize the provided content",
|
|
57
|
+
requestType: "summary",
|
|
113
58
|
});
|
|
114
59
|
```
|
|
115
60
|
|
|
116
|
-
### Guarantees
|
|
117
|
-
|
|
118
|
-
* Eric **must** choose `announcementRewriter`
|
|
119
|
-
* No unrelated flows can be selected
|
|
120
|
-
* Predictable, safe behavior for admin tools
|
|
121
|
-
|
|
122
61
|
---
|
|
123
62
|
|
|
124
|
-
|
|
63
|
+
### Optional Execution Bounds
|
|
64
|
+
|
|
65
|
+
You may optionally restrict which capabilities are eligible for execution.
|
|
125
66
|
|
|
126
67
|
```ts
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
68
|
+
await eric.decide({
|
|
69
|
+
text: "Generate a structured daily summary for the provided input",
|
|
70
|
+
allowedFlows: ["dailySummary"],
|
|
130
71
|
});
|
|
131
72
|
```
|
|
132
73
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* You already know the exact flow
|
|
136
|
-
* Running batch jobs or scheduled tasks
|
|
137
|
-
* Executing admin or restricted operations
|
|
138
|
-
* Using private server keys
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## 🧠 When to Use `decide()` vs `call()`
|
|
74
|
+
When bounds are provided:
|
|
143
75
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
| `eric.decide({ allowedFlows })` | Auto-routing restricted to a safe list |
|
|
148
|
-
| `eric.call()` | Direct execution when flow is already known |
|
|
76
|
+
* Only approved capabilities may execute
|
|
77
|
+
* No out-of-scope behavior is permitted
|
|
78
|
+
* Results remain deterministic and auditable
|
|
149
79
|
|
|
150
80
|
---
|
|
151
81
|
|
|
152
|
-
##
|
|
153
|
-
|
|
154
|
-
### `eric.decide(options)`
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
{
|
|
158
|
-
text?: string;
|
|
159
|
-
userState?: Record<string, any>;
|
|
160
|
-
topic?: string;
|
|
161
|
-
allowedFlows?: string[];
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Returns:
|
|
82
|
+
## Response Shape
|
|
166
83
|
|
|
167
84
|
```ts
|
|
168
85
|
{
|
|
169
86
|
flow: string;
|
|
170
|
-
type:
|
|
171
|
-
data:
|
|
172
|
-
meta?: {
|
|
173
|
-
routingMode: "direct" | "requestType" | "signature" | "llm" | "forced";
|
|
174
|
-
reason: string;
|
|
175
|
-
};
|
|
87
|
+
type: string;
|
|
88
|
+
data: unknown;
|
|
176
89
|
}
|
|
177
90
|
```
|
|
178
91
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
### `eric.call(flow, data)`
|
|
92
|
+
All responses conform to pre-approved output contracts.
|
|
182
93
|
|
|
183
|
-
|
|
94
|
+
All fields are guaranteed to be present according to the executed capability’s contract.
|
|
184
95
|
|
|
185
96
|
---
|
|
186
97
|
|
|
187
|
-
##
|
|
188
|
-
|
|
189
|
-
### Common
|
|
190
|
-
|
|
191
|
-
* `decisionRouter`
|
|
192
|
-
* `shortTextSummary`
|
|
193
|
-
* `questionAnswerHelper`
|
|
194
|
-
* `dailyNudgeGenerator`
|
|
195
|
-
|
|
196
|
-
### Wellness
|
|
197
|
-
|
|
198
|
-
* `aiCoachFeedback`
|
|
199
|
-
* `personalizedSessionRecommender`
|
|
200
|
-
* `wellnessProgressReporter`
|
|
201
|
-
* `trendInsightReporter`
|
|
202
|
-
|
|
203
|
-
### Events
|
|
98
|
+
## Design Principles
|
|
204
99
|
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* `sessionRecapGenerator`
|
|
211
|
-
* `sponsorValueSummary`
|
|
212
|
-
* `announcementRewriter`
|
|
213
|
-
|
|
214
|
-
### Business
|
|
215
|
-
|
|
216
|
-
* `leadershipInsight`
|
|
217
|
-
* `feedbackInsightAnalyzer`
|
|
218
|
-
* `performanceReviewAssistant`
|
|
219
|
-
* `teamDynamicsAnalyzer`
|
|
220
|
-
* `productivityCoach`
|
|
100
|
+
* **Policy-first execution** — no direct or bypassed calls
|
|
101
|
+
* **Deterministic behavior** — predictable outputs by design
|
|
102
|
+
* **Auditability** — every decision and execution is logged
|
|
103
|
+
* **Infrastructure-grade** — built for production systems, not chatbots
|
|
104
|
+
* **Intend-base API** — clients describe what they want, not what to run
|
|
221
105
|
|
|
222
106
|
---
|
|
223
107
|
|
|
224
|
-
##
|
|
225
|
-
|
|
226
|
-
Eric’s backend enforces:
|
|
227
|
-
|
|
228
|
-
### ✔ Allowed Flows
|
|
229
|
-
|
|
230
|
-
Public keys may only call:
|
|
108
|
+
## Versioning
|
|
231
109
|
|
|
232
|
-
|
|
233
|
-
* `shortTextSummary`
|
|
234
|
-
* `announcementRewriter`
|
|
110
|
+
The Eric SDK follows semantic versioning.
|
|
235
111
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
### ✔ Domain Whitelisting
|
|
112
|
+
Breaking changes reflect deliberate enforcement of governance and safety guarantees.
|
|
239
113
|
|
|
240
|
-
|
|
114
|
+
Pre-1.0 versions were experimental and are not supported.
|
|
241
115
|
|
|
242
|
-
|
|
243
|
-
[
|
|
244
|
-
"http://localhost:5173",
|
|
245
|
-
"https://eventinterface.com",
|
|
246
|
-
"https://www.eventinterface.com",
|
|
247
|
-
"https://ingomu.com",
|
|
248
|
-
"https://www.ingomu.com"
|
|
249
|
-
]
|
|
250
|
-
```
|
|
116
|
+
See `CHANGELOG.md` for details.
|
|
251
117
|
|
|
252
118
|
---
|
|
253
119
|
|
|
254
|
-
|
|
120
|
+
## Support
|
|
255
121
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
* Enforced automatically by the backend
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## 🛡️ Private Key Rules
|
|
263
|
-
|
|
264
|
-
Private keys:
|
|
265
|
-
|
|
266
|
-
* Must be used server-side only
|
|
267
|
-
* Are not domain-restricted
|
|
268
|
-
* Can execute all flows
|
|
269
|
-
* Should be stored in environment variables
|
|
270
|
-
* Are billed per usage
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
## ⚙️ Configuration
|
|
275
|
-
|
|
276
|
-
```ts
|
|
277
|
-
new EricSDK({
|
|
278
|
-
apiKey: "pub_xxx" | "priv_xxx",
|
|
279
|
-
client: "eventinterface",
|
|
280
|
-
baseUrl: "https://us-central1-eric-ai-prod.cloudfunctions.net/runFlow",
|
|
281
|
-
});
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
> **Note:**
|
|
285
|
-
> Domain context (events, wellness, business) is derived server-side from the client identity and is not required in the SDK configuration.
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## 🧪 Local Development
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
npm link
|
|
293
|
-
# then in consuming project:
|
|
294
|
-
npm link eric-sdk
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
---
|
|
122
|
+
For access, onboarding, or documentation:
|
|
123
|
+
[https://ericaicontrol.dev](https://ericaicontrol.dev)
|
|
298
124
|
|
|
299
|
-
## 📄 License
|
|
300
125
|
|
|
301
|
-
MIT © 2025
|
package/dist/index.cjs
CHANGED
|
@@ -63,32 +63,11 @@ var EricSDK = class {
|
|
|
63
63
|
this.baseUrl = options.baseUrl ?? "https://us-central1-eric-ai-prod.cloudfunctions.net/runFlow";
|
|
64
64
|
}
|
|
65
65
|
/* -------------------------------------------------------------
|
|
66
|
-
*
|
|
66
|
+
* DECIDE — policy-governed execution
|
|
67
67
|
* ------------------------------------------------------------- */
|
|
68
|
-
async
|
|
68
|
+
async decide(input) {
|
|
69
|
+
const { allowedFlows, requestType, ...rest } = input;
|
|
69
70
|
const payload = {
|
|
70
|
-
flow: flowName,
|
|
71
|
-
data: {
|
|
72
|
-
...data,
|
|
73
|
-
client: this.client
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const res = await import_axios.default.post(this.baseUrl, payload, {
|
|
77
|
-
headers: {
|
|
78
|
-
"x-api-key": this.apiKey,
|
|
79
|
-
"x-api-client": this.client,
|
|
80
|
-
"Content-Type": "application/json"
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return res.data.output;
|
|
84
|
-
}
|
|
85
|
-
/* -------------------------------------------------------------
|
|
86
|
-
* 2) DECIDE — agentic routing with optional allowedFlows
|
|
87
|
-
* ------------------------------------------------------------- */
|
|
88
|
-
async decide(data) {
|
|
89
|
-
const { allowedFlows, requestType, ...rest } = data;
|
|
90
|
-
const payload = {
|
|
91
|
-
flow: "decisionRouter",
|
|
92
71
|
data: {
|
|
93
72
|
...rest,
|
|
94
73
|
client: this.client,
|
package/dist/index.d.cts
CHANGED
|
@@ -8,19 +8,19 @@ interface EricResponse {
|
|
|
8
8
|
type: string;
|
|
9
9
|
data: any;
|
|
10
10
|
}
|
|
11
|
+
interface DecideInput {
|
|
12
|
+
text?: string;
|
|
13
|
+
topic?: string;
|
|
14
|
+
requestType?: string;
|
|
15
|
+
userState?: any;
|
|
16
|
+
allowedFlows?: string[];
|
|
17
|
+
}
|
|
11
18
|
declare class EricSDK {
|
|
12
19
|
private apiKey;
|
|
13
20
|
private client;
|
|
14
21
|
private baseUrl;
|
|
15
22
|
constructor(options: EricClientOptions);
|
|
16
|
-
|
|
17
|
-
decide(data: {
|
|
18
|
-
text?: string;
|
|
19
|
-
topic?: string;
|
|
20
|
-
requestType?: string;
|
|
21
|
-
userState?: any;
|
|
22
|
-
allowedFlows?: string[];
|
|
23
|
-
}): Promise<EricResponse>;
|
|
23
|
+
decide(input: DecideInput): Promise<EricResponse>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
interface ShortTextSummary {
|
|
@@ -195,4 +195,4 @@ declare function isPerformanceReview(result: any): result is {
|
|
|
195
195
|
data: PerformanceReview;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
-
export { type AICoachFeedback, type AnnouncementRewrite, type AttendeeEngagement, type DailyNudge, type EricClientOptions, type EricResponse, EricSDK, type EventPulse, type EventSummaryDigest, type FeedbackInsight, type LeadershipInsight, type NetworkingMatches, type PerformanceReview, type ProductivityInsight, type QAItem, type QuestionAnswerSummary, type RecommendationItem, type SessionRecap, type SessionRecommendation, type ShortTextSummary, type SpeakerPerformance, type SponsorValueSummary, type TeamDynamics, type TrendInsight, type WellnessProgress, isAICoachFeedback, isAnnouncementRewrite, isAttendeeEngagement, isEventPulse, isEventSummary, isFeedbackInsight, isLeadershipInsight, isNetworkingMatches, isNudge, isPerformanceReview, isProductivityInsight, isQA, isRecommendation, isSessionRecap, isSpeakerPerformance, isSponsorSummary, isSummary, isTeamDynamics, isTrendInsight, isWellnessProgress };
|
|
198
|
+
export { type AICoachFeedback, type AnnouncementRewrite, type AttendeeEngagement, type DailyNudge, type DecideInput, type EricClientOptions, type EricResponse, EricSDK, type EventPulse, type EventSummaryDigest, type FeedbackInsight, type LeadershipInsight, type NetworkingMatches, type PerformanceReview, type ProductivityInsight, type QAItem, type QuestionAnswerSummary, type RecommendationItem, type SessionRecap, type SessionRecommendation, type ShortTextSummary, type SpeakerPerformance, type SponsorValueSummary, type TeamDynamics, type TrendInsight, type WellnessProgress, isAICoachFeedback, isAnnouncementRewrite, isAttendeeEngagement, isEventPulse, isEventSummary, isFeedbackInsight, isLeadershipInsight, isNetworkingMatches, isNudge, isPerformanceReview, isProductivityInsight, isQA, isRecommendation, isSessionRecap, isSpeakerPerformance, isSponsorSummary, isSummary, isTeamDynamics, isTrendInsight, isWellnessProgress };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,19 +8,19 @@ interface EricResponse {
|
|
|
8
8
|
type: string;
|
|
9
9
|
data: any;
|
|
10
10
|
}
|
|
11
|
+
interface DecideInput {
|
|
12
|
+
text?: string;
|
|
13
|
+
topic?: string;
|
|
14
|
+
requestType?: string;
|
|
15
|
+
userState?: any;
|
|
16
|
+
allowedFlows?: string[];
|
|
17
|
+
}
|
|
11
18
|
declare class EricSDK {
|
|
12
19
|
private apiKey;
|
|
13
20
|
private client;
|
|
14
21
|
private baseUrl;
|
|
15
22
|
constructor(options: EricClientOptions);
|
|
16
|
-
|
|
17
|
-
decide(data: {
|
|
18
|
-
text?: string;
|
|
19
|
-
topic?: string;
|
|
20
|
-
requestType?: string;
|
|
21
|
-
userState?: any;
|
|
22
|
-
allowedFlows?: string[];
|
|
23
|
-
}): Promise<EricResponse>;
|
|
23
|
+
decide(input: DecideInput): Promise<EricResponse>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
interface ShortTextSummary {
|
|
@@ -195,4 +195,4 @@ declare function isPerformanceReview(result: any): result is {
|
|
|
195
195
|
data: PerformanceReview;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
-
export { type AICoachFeedback, type AnnouncementRewrite, type AttendeeEngagement, type DailyNudge, type EricClientOptions, type EricResponse, EricSDK, type EventPulse, type EventSummaryDigest, type FeedbackInsight, type LeadershipInsight, type NetworkingMatches, type PerformanceReview, type ProductivityInsight, type QAItem, type QuestionAnswerSummary, type RecommendationItem, type SessionRecap, type SessionRecommendation, type ShortTextSummary, type SpeakerPerformance, type SponsorValueSummary, type TeamDynamics, type TrendInsight, type WellnessProgress, isAICoachFeedback, isAnnouncementRewrite, isAttendeeEngagement, isEventPulse, isEventSummary, isFeedbackInsight, isLeadershipInsight, isNetworkingMatches, isNudge, isPerformanceReview, isProductivityInsight, isQA, isRecommendation, isSessionRecap, isSpeakerPerformance, isSponsorSummary, isSummary, isTeamDynamics, isTrendInsight, isWellnessProgress };
|
|
198
|
+
export { type AICoachFeedback, type AnnouncementRewrite, type AttendeeEngagement, type DailyNudge, type DecideInput, type EricClientOptions, type EricResponse, EricSDK, type EventPulse, type EventSummaryDigest, type FeedbackInsight, type LeadershipInsight, type NetworkingMatches, type PerformanceReview, type ProductivityInsight, type QAItem, type QuestionAnswerSummary, type RecommendationItem, type SessionRecap, type SessionRecommendation, type ShortTextSummary, type SpeakerPerformance, type SponsorValueSummary, type TeamDynamics, type TrendInsight, type WellnessProgress, isAICoachFeedback, isAnnouncementRewrite, isAttendeeEngagement, isEventPulse, isEventSummary, isFeedbackInsight, isLeadershipInsight, isNetworkingMatches, isNudge, isPerformanceReview, isProductivityInsight, isQA, isRecommendation, isSessionRecap, isSpeakerPerformance, isSponsorSummary, isSummary, isTeamDynamics, isTrendInsight, isWellnessProgress };
|
package/dist/index.js
CHANGED
|
@@ -7,32 +7,11 @@ var EricSDK = class {
|
|
|
7
7
|
this.baseUrl = options.baseUrl ?? "https://us-central1-eric-ai-prod.cloudfunctions.net/runFlow";
|
|
8
8
|
}
|
|
9
9
|
/* -------------------------------------------------------------
|
|
10
|
-
*
|
|
10
|
+
* DECIDE — policy-governed execution
|
|
11
11
|
* ------------------------------------------------------------- */
|
|
12
|
-
async
|
|
12
|
+
async decide(input) {
|
|
13
|
+
const { allowedFlows, requestType, ...rest } = input;
|
|
13
14
|
const payload = {
|
|
14
|
-
flow: flowName,
|
|
15
|
-
data: {
|
|
16
|
-
...data,
|
|
17
|
-
client: this.client
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const res = await axios.post(this.baseUrl, payload, {
|
|
21
|
-
headers: {
|
|
22
|
-
"x-api-key": this.apiKey,
|
|
23
|
-
"x-api-client": this.client,
|
|
24
|
-
"Content-Type": "application/json"
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return res.data.output;
|
|
28
|
-
}
|
|
29
|
-
/* -------------------------------------------------------------
|
|
30
|
-
* 2) DECIDE — agentic routing with optional allowedFlows
|
|
31
|
-
* ------------------------------------------------------------- */
|
|
32
|
-
async decide(data) {
|
|
33
|
-
const { allowedFlows, requestType, ...rest } = data;
|
|
34
|
-
const payload = {
|
|
35
|
-
flow: "decisionRouter",
|
|
36
15
|
data: {
|
|
37
16
|
...rest,
|
|
38
17
|
client: this.client,
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eric-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Official SDK for
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Official SDK for enforcing policy-governed AI execution using the Eric AI governance layer",
|
|
5
5
|
"author": "Rod Bridges",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
|
|
8
7
|
"type": "module",
|
|
9
|
-
|
|
10
8
|
"main": "./dist/index.cjs",
|
|
11
9
|
"module": "./dist/index.js",
|
|
12
10
|
"types": "./dist/index.d.ts",
|
|
13
|
-
|
|
14
11
|
"exports": {
|
|
15
12
|
".": {
|
|
16
13
|
"require": "./dist/index.cjs",
|
|
@@ -18,20 +15,18 @@
|
|
|
18
15
|
"types": "./dist/index.d.ts"
|
|
19
16
|
}
|
|
20
17
|
},
|
|
21
|
-
|
|
22
18
|
"scripts": {
|
|
23
19
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
24
20
|
"prepare": "npm run build",
|
|
25
21
|
"test": "echo \"No tests yet\""
|
|
26
22
|
},
|
|
27
|
-
|
|
28
23
|
"dependencies": {
|
|
29
24
|
"axios": "^1.13.2",
|
|
30
25
|
"zod": "^4.1.13"
|
|
31
26
|
},
|
|
32
|
-
|
|
33
27
|
"devDependencies": {
|
|
34
28
|
"tsup": "^8.5.1",
|
|
35
29
|
"typescript": "^5.9.3"
|
|
36
|
-
}
|
|
37
|
-
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://ericaicontrol.dev"
|
|
32
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -12,6 +12,14 @@ export interface EricResponse {
|
|
|
12
12
|
data: any;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export interface DecideInput {
|
|
16
|
+
text?: string;
|
|
17
|
+
topic?: string;
|
|
18
|
+
requestType?: string;
|
|
19
|
+
userState?: any;
|
|
20
|
+
allowedFlows?: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
export class EricSDK {
|
|
16
24
|
private apiKey: string;
|
|
17
25
|
private client: string;
|
|
@@ -26,47 +34,17 @@ export class EricSDK {
|
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
/* -------------------------------------------------------------
|
|
29
|
-
*
|
|
30
|
-
* ------------------------------------------------------------- */
|
|
31
|
-
async call(flowName: string, data: any): Promise<EricResponse> {
|
|
32
|
-
const payload = {
|
|
33
|
-
flow: flowName,
|
|
34
|
-
data: {
|
|
35
|
-
...data,
|
|
36
|
-
client: this.client,
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const res = await axios.post(this.baseUrl, payload, {
|
|
41
|
-
headers: {
|
|
42
|
-
"x-api-key": this.apiKey,
|
|
43
|
-
"x-api-client": this.client,
|
|
44
|
-
"Content-Type": "application/json",
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
return res.data.output;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* -------------------------------------------------------------
|
|
52
|
-
* 2) DECIDE — agentic routing with optional allowedFlows
|
|
37
|
+
* DECIDE — policy-governed execution
|
|
53
38
|
* ------------------------------------------------------------- */
|
|
54
|
-
async decide(
|
|
55
|
-
|
|
56
|
-
topic?: string;
|
|
57
|
-
requestType?: string;
|
|
58
|
-
userState?: any;
|
|
59
|
-
allowedFlows?: string[];
|
|
60
|
-
}): Promise<EricResponse> {
|
|
61
|
-
const { allowedFlows, requestType, ...rest } = data;
|
|
39
|
+
async decide(input: DecideInput): Promise<EricResponse> {
|
|
40
|
+
const { allowedFlows, requestType, ...rest } = input;
|
|
62
41
|
|
|
63
42
|
const payload: any = {
|
|
64
|
-
flow: "decisionRouter",
|
|
65
43
|
data: {
|
|
66
44
|
...rest,
|
|
67
45
|
client: this.client,
|
|
68
46
|
text: rest.text ?? "implicit_intent",
|
|
69
|
-
}
|
|
47
|
+
},
|
|
70
48
|
};
|
|
71
49
|
|
|
72
50
|
if (requestType) {
|
|
@@ -82,7 +60,7 @@ export class EricSDK {
|
|
|
82
60
|
"x-api-key": this.apiKey,
|
|
83
61
|
"x-api-client": this.client,
|
|
84
62
|
"Content-Type": "application/json",
|
|
85
|
-
}
|
|
63
|
+
},
|
|
86
64
|
});
|
|
87
65
|
|
|
88
66
|
return res.data.output;
|