@alveus-ai/std 0.1.53 → 0.1.55

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.
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Usage:
11
11
  * alveus deploy
12
- * alveus run @yourscope/goal-agent --input '{"objective": "extract the cert as JSON"}'
12
+ * alveus run @yourscope/goal-agent --input '{"objective": "extract the contact as JSON"}'
13
13
  * alveus receipt <execution-id>
14
14
  */
15
15
 
@@ -30,7 +30,7 @@ interface AttemptInput {
30
30
  const attempt = agent$(async (_state, input: AttemptInput, _ctx: ExecutionContext) => {
31
31
  const improved = (input.feedback?.length ?? 0) > 0;
32
32
  return improved
33
- ? JSON.stringify({ certification: 'SOC 2 Type II', evidence: ['soc2_report.pdf'] })
33
+ ? JSON.stringify({ name: 'Ada Lovelace', emails: ['ada@example.com'] })
34
34
  : JSON.stringify({ note: 'still gathering details' });
35
35
  });
36
36
 
@@ -38,7 +38,7 @@ const attempt = agent$(async (_state, input: AttemptInput, _ctx: ExecutionContex
38
38
  * Scorer: a deterministic check over the candidate. It only measures — it
39
39
  * returns a verdict per criterion and never decides completion.
40
40
  */
41
- const certScorer = agent$(async (_state, input: ScorerInput, _ctx: ExecutionContext) => {
41
+ const contactScorer = agent$(async (_state, input: ScorerInput, _ctx: ExecutionContext) => {
42
42
  let parsed: Record<string, unknown> | null = null;
43
43
  try {
44
44
  parsed = JSON.parse(String(input.subject));
@@ -48,8 +48,8 @@ const certScorer = agent$(async (_state, input: ScorerInput, _ctx: ExecutionCont
48
48
 
49
49
  const check = (id: string): boolean => {
50
50
  if (id === 'valid_json') return parsed !== null;
51
- if (id === 'cert_named') return typeof parsed?.certification === 'string';
52
- if (id === 'has_evidence') return Array.isArray(parsed?.evidence) && parsed.evidence.length > 0;
51
+ if (id === 'has_name') return typeof parsed?.name === 'string';
52
+ if (id === 'has_emails') return Array.isArray(parsed?.emails) && parsed.emails.length > 0;
53
53
  return false;
54
54
  };
55
55
 
@@ -64,8 +64,8 @@ const certScorer = agent$(async (_state, input: ScorerInput, _ctx: ExecutionCont
64
64
  });
65
65
 
66
66
  const goal = createGoalAgent({
67
- criteria: [{ id: 'valid_json' }, { id: 'cert_named' }, { id: 'has_evidence' }],
68
- scorer: certScorer,
67
+ criteria: [{ id: 'valid_json' }, { id: 'has_name' }, { id: 'has_emails' }],
68
+ scorer: contactScorer,
69
69
  attempt,
70
70
  maxCycles: 3,
71
71
  });
@@ -76,6 +76,6 @@ const goal = createGoalAgent({
76
76
  */
77
77
  export const goalAgent = agent$((_state, input: { objective: string }, ctx: ExecutionContext) =>
78
78
  // Label this run by its objective, so the graph's node reads what it is for
79
- // ("extract the cert as JSON") instead of an anonymous agent hash.
79
+ // ("extract the contact as JSON") instead of an anonymous agent hash.
80
80
  ctx.call(goal, input, { label: input.objective }),
81
- );
81
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveus-ai/std",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "Standard library of reusable agents and utilities for Alveus",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",