@atrib/summarize 0.3.1 → 0.3.2

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
18
18
  import { z } from 'zod';
19
+ import { resolveEnvContextId } from '@atrib/mcp';
19
20
  import { loadAllRecords } from './storage.js';
20
21
  import { callLlm, resolveLlmConfig } from './llm.js';
21
22
  import { buildSystemPrompt, buildUserMessage } from './prompt.js';
@@ -59,14 +60,11 @@ export async function createAtribSummarizeServer() {
59
60
  async function handleSummarize(input) {
60
61
  const warnings = [];
61
62
  const maxRecords = input.max_records ?? 50;
62
- // ATRIB_CONTEXT_ID env-var default: when the caller omitted context_id
63
- // AND did not supply record_hashes, fall back to the env var if it
64
- // carries a valid 32-hex value. Lets Inspect-style harnesses scope
65
- // summarize to a per-arm context_id via the MCP env block (per D072's
66
- // per-arm isolation contract). Explicit input.context_id always wins.
67
- const envContextId = process.env['ATRIB_CONTEXT_ID'];
68
- const effectiveContextId = input.context_id ??
69
- (envContextId && HEX_32_PATTERN.test(envContextId) ? envContextId : undefined);
63
+ // Env-var context_id default: when the caller omitted context_id AND did
64
+ // not supply record_hashes, fall back to @atrib/mcp's resolveEnvContextId
65
+ // (D078 + D083 precedence: ATRIB_CONTEXT_ID, then a registered harness
66
+ // env var like CLAUDE_CODE_SESSION_ID). Explicit input.context_id wins.
67
+ const effectiveContextId = input.context_id ?? resolveEnvContextId();
70
68
  const effective = {
71
69
  ...input,
72
70
  ...(effectiveContextId ? { context_id: effectiveContextId } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/summarize",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
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
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "^1.29.0",
13
13
  "zod": "^3.25.76",
14
- "@atrib/mcp": "0.7.0"
14
+ "@atrib/mcp": "0.8.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^25.8.0",