@atrib/summarize 0.4.16 → 0.4.17

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP server exposing the `summarize` tool, synthesizes a narrative across N records using an OpenAI-compatible LLM.
4
4
 
5
- Closes the consumer-side cognitive-loop primitive companion to `atrib-trace`: trace returns the causal chain (structural); summarize returns the synthesized meaning across the chain (semantic). Both read the same local mirror including the optional `_local` sidecar.
5
+ Closes the consumer-side cognitive-loop primitive companion to `atrib-trace`: trace returns the declared-relationship path; summarize returns the synthesized meaning across the selected records. Both read the same local mirror including the optional `_local` sidecar.
6
6
 
7
7
  ## Tool
8
8
 
package/dist/index.d.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  * an OpenAI-compatible LLM to synthesize a narrative across them.
5
5
  *
6
6
  * Closes the consumer-side cognitive-loop primitive companion to trace:
7
- * trace returns the causal chain (structural); summarize returns the
8
- * synthesized meaning across that chain (semantic). Both read the same
7
+ * trace returns the declared-relationship path; summarize returns the
8
+ * synthesized meaning across the selected records. Both read the same
9
9
  * local mirror including the optional _local sidecar.
10
10
  *
11
11
  * LLM access via OpenAI-compatible HTTP. Defaults to NVIDIA NIM with the
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@
5
5
  * an OpenAI-compatible LLM to synthesize a narrative across them.
6
6
  *
7
7
  * Closes the consumer-side cognitive-loop primitive companion to trace:
8
- * trace returns the causal chain (structural); summarize returns the
9
- * synthesized meaning across that chain (semantic). Both read the same
8
+ * trace returns the declared-relationship path; summarize returns the
9
+ * synthesized meaning across the selected records. Both read the same
10
10
  * local mirror including the optional _local sidecar.
11
11
  *
12
12
  * LLM access via OpenAI-compatible HTTP. Defaults to NVIDIA NIM with the
@@ -23,18 +23,41 @@ import { buildSystemPrompt, buildUserMessage } from './prompt.js';
23
23
  const SHA256_REF_PATTERN = /^sha256:[0-9a-f]{64}$/;
24
24
  const HEX_32_PATTERN = /^[0-9a-f]{32}$/;
25
25
  const SummarizeInput = z.object({
26
- context_id: z.string().regex(HEX_32_PATTERN).optional().describe("When supplied, summarize every record sharing this 32-hex trace identifier. " +
27
- "Mutually composable with record_hashes: if both, the union of records is used."),
28
- record_hashes: z.array(z.string().regex(SHA256_REF_PATTERN)).optional().describe("Explicit list of 'sha256:<64-hex>' record hashes to summarize. Records not " +
29
- "in the local mirror are silently skipped (use trace to inspect dangling)."),
30
- focus: z.string().min(1).max(2000).optional().describe('Optional steering for the synthesis (e.g. "what decisions did I make", ' +
26
+ context_id: z
27
+ .string()
28
+ .regex(HEX_32_PATTERN)
29
+ .optional()
30
+ .describe('When supplied, summarize every record sharing this 32-hex trace identifier. ' +
31
+ 'Mutually composable with record_hashes: if both, the union of records is used.'),
32
+ record_hashes: z
33
+ .array(z.string().regex(SHA256_REF_PATTERN))
34
+ .optional()
35
+ .describe("Explicit list of 'sha256:<64-hex>' record hashes to summarize. Records not " +
36
+ 'in the local mirror are silently skipped (use trace to inspect dangling).'),
37
+ focus: z
38
+ .string()
39
+ .min(1)
40
+ .max(2000)
41
+ .optional()
42
+ .describe('Optional steering for the synthesis (e.g. "what decisions did I make", ' +
31
43
  '"why did I revise X", "which claims shaped the outcome"). Defaults to a ' +
32
44
  'general "summarize what the agent did and why" focus.'),
33
- max_records: z.number().int().min(1).max(200).optional().describe('Cap on records fed to the LLM, default 50. Records beyond the cap (after ' +
45
+ max_records: z
46
+ .number()
47
+ .int()
48
+ .min(1)
49
+ .max(200)
50
+ .optional()
51
+ .describe('Cap on records fed to the LLM, default 50. Records beyond the cap (after ' +
34
52
  'sorting by timestamp ascending) are skipped and counted in records_skipped. ' +
35
53
  'Increase carefully, large prompts run slower + cost more + risk model ' +
36
54
  'context limits.'),
37
- model: z.string().min(1).max(200).optional().describe('Override the configured model for this call. Format depends on provider ' +
55
+ model: z
56
+ .string()
57
+ .min(1)
58
+ .max(200)
59
+ .optional()
60
+ .describe('Override the configured model for this call. Format depends on provider ' +
38
61
  '(NVIDIA NIM uses e.g. "qwen/qwen3.5-397b-a17b"). Defaults to env ' +
39
62
  'ATRIB_SUMMARIZE_MODEL or the package default.'),
40
63
  });
package/dist/prompt.js CHANGED
@@ -3,12 +3,12 @@ const SYSTEM_PROMPT = `You synthesize narratives across signed agent activity re
3
3
 
4
4
  Each record has:
5
5
  - A cryptographic identity (signature, hash, creator_key)
6
- - A causal position (chain_root, informed_by)
6
+ - A graph position (chain_root, informed_by)
7
7
  - A semantic payload, EITHER carried in a local sidecar (rich) OR absent (impoverished, only event_type and metadata)
8
8
 
9
9
  Your job: produce a coherent narrative across the records that surfaces:
10
10
  - What the agent was doing (decisions, observations, revisions)
11
- - What informed what (causal chains via informed_by)
11
+ - What the signer claimed informed what (via informed_by)
12
12
  - What shaped the outcome vs what was incidental
13
13
  - Honest gaps (when records are impoverished, say so; do not invent semantics)
14
14
 
@@ -38,7 +38,7 @@ export function buildUserMessage(records, focus) {
38
38
  }
39
39
  else {
40
40
  lines.push(`# Default focus`);
41
- lines.push('Summarize what the agent did and why, surfacing the decisions that shaped the work and the causal chain.');
41
+ lines.push('Summarize what the agent did and why, surfacing the decisions and signed relationship path that shaped the work.');
42
42
  }
43
43
  return lines.join('\n');
44
44
  }
@@ -80,6 +80,10 @@ function renderRecord(r) {
80
80
  out.push(`what: ${c['what']}`);
81
81
  if (typeof c['why_noted'] === 'string')
82
82
  out.push(`why_noted: ${c['why_noted']}`);
83
+ if (typeof c['intent'] === 'string')
84
+ out.push(`intent: ${c['intent']}`);
85
+ if (typeof c['rationale'] === 'string')
86
+ out.push(`rationale: ${c['rationale']}`);
83
87
  if (typeof c['summary'] === 'string')
84
88
  out.push(`summary: ${c['summary']}`);
85
89
  if (typeof c['importance'] === 'string')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/summarize",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "MCP server for atrib. Synthesizes a narrative across N records via an OpenAI-compatible LLM so agents read context, not raw record bytes.",
5
5
  "author": "atrib <hello@atrib.dev>",
6
6
  "keywords": [
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@modelcontextprotocol/sdk": "^1.29.0",
27
27
  "zod": "^3.25.76",
28
- "@atrib/mcp": "0.17.5"
28
+ "@atrib/mcp": "0.17.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^25.9.2",