eric-sdk 0.1.4 → 0.1.6

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 CHANGED
@@ -1,83 +1,109 @@
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.4] – 2026-02-13
11
-
12
- ### Changed
13
-
14
- - Added `engines` field specifying Node.js >=20.
15
-
16
- ---
17
-
18
- ## [0.1.3] 2026-02-06
19
-
20
- ### Changed:
21
-
22
- * **Removed `client` from request payload**: The SDK no longer includes `client` in the request body when calling `decide()`.
23
-
24
- ### Rationale:
25
-
26
- `client` is infrastructure identity and is now treated as authoritative header-only metadata (`x-api-client`).
27
- This change removes ambiguity, prevents spoofing, and aligns the SDK with Eric’s control-plane model, where execution authority lives outside user-provided input.
28
-
29
- ### Notes:
30
-
31
- * Applications must continue to provide `x-api-client` and `x-api-key` headers.
32
- * Requests that previously included `client` in the body may be rejected by strict API validation.
33
-
34
- ---
35
-
36
- ## [0.1.2] – 2026-02-03
37
-
38
- ### What's New:
39
-
40
- * **Updated API Endpoint**: The SDK now calls the API endpoint at `https://us-central1-eric-ai-prod.cloudfunctions.net/decide` for decision-making flows.
41
-
42
- ### Breaking Changes:
43
-
44
- * **Endpoint Change**: If you were using the previous `decide` endpoint, please update the SDK configuration to use the new endpoint.
45
-
46
- ---
47
-
48
- ## [0.1.1] 2026-01-30
49
-
50
- ### Changed:
51
-
52
- * Removed explicit `flow: "decisionRouter"` from SDK requests.
53
-
54
- ### Rationale:
55
-
56
- The Eric API no longer accepts direct flow invocations.
57
- 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.
58
-
59
- ---
60
-
61
- ## [0.1.0] – 2026-01-27
62
-
63
- ### Changed:
64
-
65
- * Removed `client.call()` to prevent direct flow invocation.
66
- * All executions must now be routed through `decide()`.
67
-
68
- ### Rationale:
69
-
70
- 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.
71
-
72
- ---
73
-
74
- ## [0.0.5] – 2025-12-14
75
-
76
- ### Added:
77
-
78
- * Initial public SDK release.
79
- * `decide()` with policy-based routing and optional execution bounds.
80
-
81
- ---
82
-
83
- This version ensures clarity and consistency across all sections while providing users with the necessary context on each update.
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.6] – 2026-02-25
11
+
12
+ ## Changed
13
+
14
+ Added repository, homepage, and issues metadata to package.json.
15
+
16
+ Rationale
17
+
18
+ Improves npm package transparency and traceability by linking the SDK to its public GitHub source, issue tracking, and documentation.
19
+ No runtime behavior changes.
20
+
21
+ ---
22
+
23
+ ## [0.1.5] – 2026-02-24
24
+
25
+ ### Changed
26
+
27
+ * Narrowed `type` in response shape from `string` to `"structured" | "text"`.
28
+
29
+ ### Rationale
30
+
31
+ Response format classification is now explicitly constrained.
32
+ This prevents accidental drift in output types and strengthens the SDK’s deterministic contract.
33
+
34
+ ---
35
+
36
+ ## [0.1.4] – 2026-02-13
37
+
38
+ ### Changed
39
+
40
+ - Added `engines` field specifying Node.js >=20.
41
+
42
+ ---
43
+
44
+ ## [0.1.3] 2026-02-06
45
+
46
+ ### Changed:
47
+
48
+ * **Removed `client` from request payload**: The SDK no longer includes `client` in the request body when calling `decide()`.
49
+
50
+ ### Rationale:
51
+
52
+ `client` is infrastructure identity and is now treated as authoritative header-only metadata (`x-api-client`).
53
+ This change removes ambiguity, prevents spoofing, and aligns the SDK with Eric’s control-plane model, where execution authority lives outside user-provided input.
54
+
55
+ ### Notes:
56
+
57
+ * Applications must continue to provide `x-api-client` and `x-api-key` headers.
58
+ * Requests that previously included `client` in the body may be rejected by strict API validation.
59
+
60
+ ---
61
+
62
+ ## [0.1.2] – 2026-02-03
63
+
64
+ ### What's New:
65
+
66
+ * **Updated API Endpoint**: The SDK now calls the API endpoint at `https://us-central1-eric-ai-prod.cloudfunctions.net/decide` for decision-making flows.
67
+
68
+ ### Breaking Changes:
69
+
70
+ * **Endpoint Change**: If you were using the previous `decide` endpoint, please update the SDK configuration to use the new endpoint.
71
+
72
+ ---
73
+
74
+ ## [0.1.1] – 2026-01-30
75
+
76
+ ### Changed:
77
+
78
+ * Removed explicit `flow: "decisionRouter"` from SDK requests.
79
+
80
+ ### Rationale:
81
+
82
+ The Eric API no longer accepts direct flow invocations.
83
+ 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.
84
+
85
+ ---
86
+
87
+ ## [0.1.0] – 2026-01-27
88
+
89
+ ### Changed:
90
+
91
+ * Removed `client.call()` to prevent direct flow invocation.
92
+ * All executions must now be routed through `decide()`.
93
+
94
+ ### Rationale:
95
+
96
+ 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.
97
+
98
+ ---
99
+
100
+ ## [0.0.5] – 2025-12-14
101
+
102
+ ### Added:
103
+
104
+ * Initial public SDK release.
105
+ * `decide()` with policy-based routing and optional execution bounds.
106
+
107
+ ---
108
+
109
+ 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 bounds are provided:
75
-
76
- * Only approved capabilities may execute
77
- * No out-of-scope behavior is permitted
78
- * Results remain deterministic and auditable
79
-
80
- ---
81
-
82
- ## Response Shape
83
-
84
- ```ts
85
- {
86
- flow: string;
87
- type: string;
88
- data: unknown;
89
- }
90
- ```
91
-
92
- All responses conform to pre-approved output contracts.
93
-
94
- All fields are guaranteed to be present according to the executed capability’s contract.
95
-
96
- ---
97
-
98
- ## Design Principles
99
-
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
105
-
106
- ---
107
-
108
- ## Versioning
109
-
110
- The Eric SDK follows semantic versioning.
111
-
112
- Breaking changes reflect deliberate enforcement of governance and safety guarantees.
113
-
114
- Pre-1.0 versions were experimental and are not supported.
115
-
116
- See `CHANGELOG.md` for details.
117
-
118
- ---
119
-
120
- ## Support
121
-
122
- For access, onboarding, or documentation:
123
- [https://ericaicontrol.dev](https://ericaicontrol.dev)
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
  });