eric-sdk 0.1.3 → 0.1.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/CHANGELOG.md +96 -75
- package/README.md +126 -125
- package/dist/index.cjs +2 -104
- package/dist/index.d.cts +1 -173
- package/dist/index.d.ts +1 -173
- package/dist/index.js +1 -83
- package/package.json +4 -1
- package/src/client.ts +67 -67
- package/src/index.ts +1 -3
- package/tsconfig.json +13 -13
- package/src/flows/helper.ts +0 -110
- package/src/types/flow.ts +0 -139
package/CHANGELOG.md
CHANGED
|
@@ -1,75 +1,96 @@
|
|
|
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 evolves.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## [0.1.
|
|
11
|
-
|
|
12
|
-
### Changed
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
### Rationale
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
This
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
###
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
###
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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 evolves.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.1.5] – 2026-02-24
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
* Narrowed `type` in response shape from `string` to `"structured" | "text"`.
|
|
15
|
+
|
|
16
|
+
### Rationale
|
|
17
|
+
|
|
18
|
+
Response format classification is now explicitly constrained.
|
|
19
|
+
This prevents accidental drift in output types and strengthens the SDK’s deterministic contract.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## [0.1.4] – 2026-02-13
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Added `engines` field specifying Node.js >=20.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## [0.1.3] – 2026-02-06
|
|
32
|
+
|
|
33
|
+
### Changed:
|
|
34
|
+
|
|
35
|
+
* **Removed `client` from request payload**: The SDK no longer includes `client` in the request body when calling `decide()`.
|
|
36
|
+
|
|
37
|
+
### Rationale:
|
|
38
|
+
|
|
39
|
+
`client` is infrastructure identity and is now treated as authoritative header-only metadata (`x-api-client`).
|
|
40
|
+
This change removes ambiguity, prevents spoofing, and aligns the SDK with Eric’s control-plane model, where execution authority lives outside user-provided input.
|
|
41
|
+
|
|
42
|
+
### Notes:
|
|
43
|
+
|
|
44
|
+
* Applications must continue to provide `x-api-client` and `x-api-key` headers.
|
|
45
|
+
* Requests that previously included `client` in the body may be rejected by strict API validation.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## [0.1.2] – 2026-02-03
|
|
50
|
+
|
|
51
|
+
### What's New:
|
|
52
|
+
|
|
53
|
+
* **Updated API Endpoint**: The SDK now calls the API endpoint at `https://us-central1-eric-ai-prod.cloudfunctions.net/decide` for decision-making flows.
|
|
54
|
+
|
|
55
|
+
### Breaking Changes:
|
|
56
|
+
|
|
57
|
+
* **Endpoint Change**: If you were using the previous `decide` endpoint, please update the SDK configuration to use the new endpoint.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## [0.1.1] – 2026-01-30
|
|
62
|
+
|
|
63
|
+
### Changed:
|
|
64
|
+
|
|
65
|
+
* Removed explicit `flow: "decisionRouter"` from SDK requests.
|
|
66
|
+
|
|
67
|
+
### Rationale:
|
|
68
|
+
|
|
69
|
+
The Eric API no longer accepts direct flow invocations.
|
|
70
|
+
All requests are now treated as intent submissions and are routed through the internal decision router by default. This change simplifies the SDK payload and prevents accidental coupling to internal execution details.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## [0.1.0] – 2026-01-27
|
|
75
|
+
|
|
76
|
+
### Changed:
|
|
77
|
+
|
|
78
|
+
* Removed `client.call()` to prevent direct flow invocation.
|
|
79
|
+
* All executions must now be routed through `decide()`.
|
|
80
|
+
|
|
81
|
+
### Rationale:
|
|
82
|
+
|
|
83
|
+
Direct flow execution allowed applications to bypass policy enforcement. Eric is designed as a governance and control layer, and all execution must pass through policy evaluation to ensure deterministic, auditable outcomes. This release intentionally narrows the public API to reflect Eric’s execution model.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## [0.0.5] – 2025-12-14
|
|
88
|
+
|
|
89
|
+
### Added:
|
|
90
|
+
|
|
91
|
+
* Initial public SDK release.
|
|
92
|
+
* `decide()` with policy-based routing and optional execution bounds.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
This version ensures clarity and consistency across all sections while providing users with the necessary context on each update.
|
package/README.md
CHANGED
|
@@ -1,125 +1,126 @@
|
|
|
1
|
-
# Eric SDK (JavaScript / TypeScript)
|
|
2
|
-
|
|
3
|
-
Official SDK for interacting with **Eric AI**, a policy-governed execution layer for AI systems.
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
This SDK exposes a single, safe interaction model that enforces those guarantees by default.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install eric-sdk
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Authentication
|
|
21
|
-
|
|
22
|
-
You will need an Eric-issued API key.
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { EricSDK } from "eric-sdk";
|
|
26
|
-
|
|
27
|
-
const eric = new EricSDK({
|
|
28
|
-
apiKey: process.env.ERIC_API_KEY!,
|
|
29
|
-
client: "your-app-id",
|
|
30
|
-
});
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
API keys are scoped and governed server-side.
|
|
34
|
-
Keys should be treated as secrets and stored securely.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Security Notice
|
|
39
|
-
|
|
40
|
-
This SDK enforces server-side policy and execution controls.
|
|
41
|
-
|
|
42
|
-
API keys must be stored securely and never embedded in public repositories.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Usage
|
|
47
|
-
|
|
48
|
-
### Policy-Governed Execution
|
|
49
|
-
|
|
50
|
-
All interactions with Eric are routed through `decide()`.
|
|
51
|
-
|
|
52
|
-
Eric evaluates each request against policy, routing constraints, and execution bounds before selecting and invoking an approved capability.
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
const result = await eric.decide({
|
|
56
|
-
text: "summarize the provided content",
|
|
57
|
-
requestType: "summary",
|
|
58
|
-
});
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
### Optional Execution Bounds
|
|
64
|
-
|
|
65
|
-
You may optionally restrict which capabilities are eligible for execution.
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
await eric.decide({
|
|
69
|
-
text: "Generate a structured daily summary for the provided input",
|
|
70
|
-
allowedFlows: ["dailySummary"],
|
|
71
|
-
});
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
When
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Response Shape
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
{
|
|
86
|
-
flow: string;
|
|
87
|
-
type:
|
|
88
|
-
data: unknown;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
* **
|
|
102
|
-
* **
|
|
103
|
-
* **
|
|
104
|
-
* **
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
# Eric SDK (JavaScript / TypeScript)
|
|
2
|
+
|
|
3
|
+
Official SDK for interacting with **Eric AI**, a policy-governed execution layer for AI systems.
|
|
4
|
+
|
|
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
|
+
|
|
8
|
+
This SDK exposes a single, safe interaction model that enforces those guarantees by default.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install eric-sdk
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Authentication
|
|
21
|
+
|
|
22
|
+
You will need an Eric-issued API key.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { EricSDK } from "eric-sdk";
|
|
26
|
+
|
|
27
|
+
const eric = new EricSDK({
|
|
28
|
+
apiKey: process.env.ERIC_API_KEY!,
|
|
29
|
+
client: "your-app-id",
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
API keys are scoped and governed server-side.
|
|
34
|
+
Keys should be treated as secrets and stored securely.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Security Notice
|
|
39
|
+
|
|
40
|
+
This SDK enforces server-side policy and execution controls.
|
|
41
|
+
|
|
42
|
+
API keys must be stored securely and never embedded in public repositories.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
### Policy-Governed Execution
|
|
49
|
+
|
|
50
|
+
All interactions with Eric are routed through `decide()`.
|
|
51
|
+
|
|
52
|
+
Eric evaluates each request against policy, routing constraints, and execution bounds before selecting and invoking an approved capability.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const result = await eric.decide({
|
|
56
|
+
text: "summarize the provided content",
|
|
57
|
+
requestType: "summary",
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Optional Execution Bounds
|
|
64
|
+
|
|
65
|
+
You may optionally restrict which capabilities are eligible for execution.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
await eric.decide({
|
|
69
|
+
text: "Generate a structured daily summary for the provided input",
|
|
70
|
+
allowedFlows: ["dailySummary"],
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
When `allowedFlows` is provided:
|
|
75
|
+
|
|
76
|
+
- Only capabilities in the allowed set are eligible for execution.
|
|
77
|
+
- If resolution falls outside the allowed set, execution is denied.
|
|
78
|
+
- No fallback or automatic substitution occurs.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Response Shape
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
{
|
|
86
|
+
flow: string; // resolved capability
|
|
87
|
+
type: "structured" | "text"; // output format classification
|
|
88
|
+
data: unknown; // structured object or text result
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
All responses conform to pre-approved output contracts.
|
|
94
|
+
|
|
95
|
+
All fields are guaranteed to be present according to the executed capability’s contract.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Design Principles
|
|
100
|
+
|
|
101
|
+
* **Policy-first execution** — no direct or bypassed calls
|
|
102
|
+
* **Deterministic behavior** — predictable outputs by design
|
|
103
|
+
* **Auditability** — every decision and execution is logged
|
|
104
|
+
* **Infrastructure-grade** — built for production systems, not chatbots
|
|
105
|
+
* **Intent-based API** — clients describe what they want, not what to run
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Versioning
|
|
110
|
+
|
|
111
|
+
The Eric SDK follows semantic versioning.
|
|
112
|
+
|
|
113
|
+
Breaking changes reflect deliberate enforcement of governance and safety guarantees.
|
|
114
|
+
|
|
115
|
+
Pre-1.0 versions were experimental and are not supported.
|
|
116
|
+
|
|
117
|
+
See `CHANGELOG.md` for details.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Support
|
|
122
|
+
|
|
123
|
+
For access, onboarding, or documentation:
|
|
124
|
+
[https://ericaicontrol.dev](https://ericaicontrol.dev)
|
|
125
|
+
|
|
126
|
+
|
package/dist/index.cjs
CHANGED
|
@@ -30,27 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
EricSDK: () => EricSDK
|
|
34
|
-
isAICoachFeedback: () => isAICoachFeedback,
|
|
35
|
-
isAnnouncementRewrite: () => isAnnouncementRewrite,
|
|
36
|
-
isAttendeeEngagement: () => isAttendeeEngagement,
|
|
37
|
-
isEventPulse: () => isEventPulse,
|
|
38
|
-
isEventSummary: () => isEventSummary,
|
|
39
|
-
isFeedbackInsight: () => isFeedbackInsight,
|
|
40
|
-
isLeadershipInsight: () => isLeadershipInsight,
|
|
41
|
-
isNetworkingMatches: () => isNetworkingMatches,
|
|
42
|
-
isNudge: () => isNudge,
|
|
43
|
-
isPerformanceReview: () => isPerformanceReview,
|
|
44
|
-
isProductivityInsight: () => isProductivityInsight,
|
|
45
|
-
isQA: () => isQA,
|
|
46
|
-
isRecommendation: () => isRecommendation,
|
|
47
|
-
isSessionRecap: () => isSessionRecap,
|
|
48
|
-
isSpeakerPerformance: () => isSpeakerPerformance,
|
|
49
|
-
isSponsorSummary: () => isSponsorSummary,
|
|
50
|
-
isSummary: () => isSummary,
|
|
51
|
-
isTeamDynamics: () => isTeamDynamics,
|
|
52
|
-
isTrendInsight: () => isTrendInsight,
|
|
53
|
-
isWellnessProgress: () => isWellnessProgress
|
|
33
|
+
EricSDK: () => EricSDK
|
|
54
34
|
});
|
|
55
35
|
module.exports = __toCommonJS(index_exports);
|
|
56
36
|
|
|
@@ -89,89 +69,7 @@ var EricSDK = class {
|
|
|
89
69
|
return res.data.output;
|
|
90
70
|
}
|
|
91
71
|
};
|
|
92
|
-
|
|
93
|
-
// src/flows/helper.ts
|
|
94
|
-
function isSummary(result) {
|
|
95
|
-
return result.flow === "shortTextSummary";
|
|
96
|
-
}
|
|
97
|
-
function isQA(result) {
|
|
98
|
-
return result.flow === "questionAnswerHelper";
|
|
99
|
-
}
|
|
100
|
-
function isNudge(result) {
|
|
101
|
-
return result.flow === "dailyNudgeGenerator";
|
|
102
|
-
}
|
|
103
|
-
function isRecommendation(result) {
|
|
104
|
-
return result.flow === "personalizedSessionRecommender";
|
|
105
|
-
}
|
|
106
|
-
function isAICoachFeedback(result) {
|
|
107
|
-
return result.flow === "aiCoachFeedback";
|
|
108
|
-
}
|
|
109
|
-
function isWellnessProgress(result) {
|
|
110
|
-
return result.flow === "wellnessProgressReporter";
|
|
111
|
-
}
|
|
112
|
-
function isTrendInsight(result) {
|
|
113
|
-
return result.flow === "trendInsightReporter";
|
|
114
|
-
}
|
|
115
|
-
function isEventSummary(result) {
|
|
116
|
-
return result.flow === "eventSummaryDigest";
|
|
117
|
-
}
|
|
118
|
-
function isSpeakerPerformance(result) {
|
|
119
|
-
return result.flow === "speakerPerformanceAnalyzer";
|
|
120
|
-
}
|
|
121
|
-
function isNetworkingMatches(result) {
|
|
122
|
-
return result.flow === "networkingMatchmaker";
|
|
123
|
-
}
|
|
124
|
-
function isAttendeeEngagement(result) {
|
|
125
|
-
return result.flow === "attendeeEngagementReporter";
|
|
126
|
-
}
|
|
127
|
-
function isEventPulse(result) {
|
|
128
|
-
return result.flow === "eventPulseReport";
|
|
129
|
-
}
|
|
130
|
-
function isSessionRecap(result) {
|
|
131
|
-
return result.flow === "sessionRecapGenerator";
|
|
132
|
-
}
|
|
133
|
-
function isSponsorSummary(result) {
|
|
134
|
-
return result.flow === "sponsorValueSummary";
|
|
135
|
-
}
|
|
136
|
-
function isAnnouncementRewrite(result) {
|
|
137
|
-
return result.flow === "announcementRewriter";
|
|
138
|
-
}
|
|
139
|
-
function isLeadershipInsight(result) {
|
|
140
|
-
return result.flow === "leadershipInsight";
|
|
141
|
-
}
|
|
142
|
-
function isFeedbackInsight(result) {
|
|
143
|
-
return result.flow === "feedbackInsightAnalyzer";
|
|
144
|
-
}
|
|
145
|
-
function isProductivityInsight(result) {
|
|
146
|
-
return result.flow === "productivityCoach";
|
|
147
|
-
}
|
|
148
|
-
function isTeamDynamics(result) {
|
|
149
|
-
return result.flow === "teamDynamicsAnalyzer";
|
|
150
|
-
}
|
|
151
|
-
function isPerformanceReview(result) {
|
|
152
|
-
return result.flow === "performanceReviewAssistant";
|
|
153
|
-
}
|
|
154
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
155
73
|
0 && (module.exports = {
|
|
156
|
-
EricSDK
|
|
157
|
-
isAICoachFeedback,
|
|
158
|
-
isAnnouncementRewrite,
|
|
159
|
-
isAttendeeEngagement,
|
|
160
|
-
isEventPulse,
|
|
161
|
-
isEventSummary,
|
|
162
|
-
isFeedbackInsight,
|
|
163
|
-
isLeadershipInsight,
|
|
164
|
-
isNetworkingMatches,
|
|
165
|
-
isNudge,
|
|
166
|
-
isPerformanceReview,
|
|
167
|
-
isProductivityInsight,
|
|
168
|
-
isQA,
|
|
169
|
-
isRecommendation,
|
|
170
|
-
isSessionRecap,
|
|
171
|
-
isSpeakerPerformance,
|
|
172
|
-
isSponsorSummary,
|
|
173
|
-
isSummary,
|
|
174
|
-
isTeamDynamics,
|
|
175
|
-
isTrendInsight,
|
|
176
|
-
isWellnessProgress
|
|
74
|
+
EricSDK
|
|
177
75
|
});
|