@heyramzi/social 1.2.1 → 1.3.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/README.md CHANGED
@@ -10,11 +10,11 @@ changes in one place.
10
10
  | `./questions` | `storyQuestions({ field, piece, reader })`: the story questions a judge model answers, in the surface's own words | CutKit's check, Jev's `opening`, `linkedin`, `x` and `reddit` surfaces |
11
11
  | `./hooks` | One regex per hook-library shape, and the banned shape | `./shorts` |
12
12
  | `./shorts` | `matchHook` and `auditShorts`, the skeleton of a Short | `heyramzi-slop --register=shorts` in `@heyramzi/lint` |
13
- | `./jev` | The wire shape of a question (`questionBody`), the `Answer` type, and `askJev`: one call that takes the key, model, state and questions, and returns the answers | CutKit's check, UpSys's `tools/social` client |
13
+ | `./jev` | The wire shape of a question (`questionBody`), the `Answer` type, and `askJev`: one call that takes the endpoint URL, key, model, state and questions, and returns the answers | CutKit's check, UpSys's `tools/social` client |
14
14
  | `./grade` | A trained model plus Jev's answers to a grade: `gradeAnswers` (grade 0 to 10, confidence, the three weakest answers with their fixes, the nearest winners, the pass gate), `encode`, `predict`, `rankOn`, `letterGrade`, `PASS_GRADE` | UpSys's loop, training and draft grading, CutKit's letter |
15
15
 
16
- `./jev` reads no env and keeps no cache. The caller passes the key, the model and, if it wants
17
- one, `fetch` and `retries` (a dropped connection, a 429, a 529 or a 5xx waits 0.5s, 1s, 2s and
16
+ `./jev` reads no env and keeps no cache. The caller passes the URL (any TypeSafe-compatible
17
+ endpoint's `${JEV_BASE_URL}/v1/systemone`), the key, the model and, if it wants one, `fetch` and `retries` (a dropped connection, a 429, a 529 or a 5xx waits 0.5s, 1s, 2s and
18
18
  on). Every call gives up after 60 seconds. It throws when a question comes back unanswered, so
19
19
  nobody grades a partial set. A disk or database cache wraps it in the app, keyed on
20
20
  `questionBody`.
package/jev.d.ts CHANGED
@@ -15,7 +15,6 @@ export type JevQuestion =
15
15
  /** Option key to its meaning. */
16
16
  | { type: "choice"; instructions: string; criteria: Record<string, string> };
17
17
 
18
- export declare const JEV_URL: string;
19
18
  export declare function questionBody(q: JevQuestion): JevQuestion;
20
19
 
21
20
  export declare function askJev(request: {
@@ -23,7 +22,8 @@ export declare function askJev(request: {
23
22
  model: string;
24
23
  state: unknown;
25
24
  questions: Record<string, JevQuestion>;
26
- url?: string;
25
+ /** Any TypeSafe-compatible endpoint's systemone URL: `${JEV_BASE_URL}/v1/systemone`. */
26
+ url: string;
27
27
  fetch?: typeof fetch;
28
28
  retries?: number;
29
29
  }): Promise<{ answers: Record<string, Answer>; model: string }>;
package/jev.js CHANGED
@@ -1,11 +1,8 @@
1
1
  /**
2
2
  * The wire shape of a Jev question and the one call that answers it. No env reads and no
3
- * cache: the app passes its key and model and caches.
3
+ * cache: the app passes its endpoint, key and model, and caches.
4
4
  */
5
5
 
6
- /** TypeSafe's /v1/systemone behind the Vercel AI Gateway, which bills the gateway credits. */
7
- export const JEV_URL = "https://ai-gateway.vercel.sh/typesafe/v1/systemone";
8
-
9
6
  /** A dead socket hung a run for 15 hours on 14 Oct 2026, so every call gives up at this. */
10
7
  const TIMEOUT_MS = 60_000;
11
8
 
@@ -23,7 +20,7 @@ const retryable = (status) => status === 429 || status === 529 || status >= 500;
23
20
  const backoff = (attempt) => new Promise((done) => setTimeout(done, 500 * 2 ** attempt));
24
21
 
25
22
  async function post(request, attempt) {
26
- const { key, model, state, questions, url = JEV_URL, fetch: send = fetch, retries = 0 } = request;
23
+ const { key, model, state, questions, url, fetch: send = fetch, retries = 0 } = request;
27
24
  let res;
28
25
  try {
29
26
  res = await send(url, {
@@ -51,7 +48,7 @@ async function post(request, attempt) {
51
48
  * model: string,
52
49
  * state: unknown,
53
50
  * questions: Record<string, ReturnType<typeof questionBody>>,
54
- * url?: string,
51
+ * url: string,
55
52
  * fetch?: typeof fetch,
56
53
  * retries?: number,
57
54
  * }} JevCall
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@heyramzi/social",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Content evaluation CutKit and UpSys share: hook shapes, the Shorts audit, story checks with no model, the story question bank, and the Jev call and trained-model grade",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/heyramzi/vibe-kit.git",
9
- "directory": "packages/social"
8
+ "url": "https://github.com/heyramzi/upsys.git",
9
+ "directory": "kit/packages/social"
10
10
  },
11
11
  "files": [
12
12
  "grade.js",