@codetelemetry/mcp 0.4.0 → 0.4.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
@@ -31,7 +31,7 @@ deterministic (see [Releases & discovery](#releases--discovery)):
31
31
  ```json
32
32
  {
33
33
  "mcpServers": {
34
- "codetelemetry": { "command": "npx", "args": ["-y", "--package=@codetelemetry/mcp@0.4.0", "codetelemetry-mcp"] }
34
+ "codetelemetry": { "command": "npx", "args": ["-y", "--package=@codetelemetry/mcp@0.4.1", "codetelemetry-mcp"] }
35
35
  }
36
36
  }
37
37
  ```
@@ -60,6 +60,16 @@ npx -y @codetelemetry/connect bootstrap acme
60
60
  npx -y @codetelemetry/connect workspace list
61
61
  ```
62
62
 
63
+ New workspace setups capture prompts and tool content by default so session titles,
64
+ replay and command evidence work immediately. Pass `enrich: false` to
65
+ `bootstrap_workspace`, or `--no-enrich` to Connect bootstrap, to opt out. The choice
66
+ is saved in the setup plan; resuming preserves explicit opt-outs, existing saved
67
+ client choices and legacy checkpoints. A new named Codex profile also defaults to
68
+ capture when no earlier capture choice exists. This does not change personal
69
+ onboarding defaults or another workspace's configuration. Captured team-scoped
70
+ content follows the organization's visibility policy; new organizations disclose
71
+ member visibility during creation, and administrators can change it in settings.
72
+
63
73
  `--plan file.json` supplies the same bootstrap fields as the MCP tool, including
64
74
  selected Grader checks. CLI exit 2 means setup is waiting for the returned action;
65
75
  exit 0 means the requested checks completed. Funding is checked before client
@@ -3,7 +3,7 @@ import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import { randomUUID } from "node:crypto";
6
- import { bindWorkspace, bindingOf, codexWorkspaceProfilePath, writeCodexWorkspaceProfile, WORKSPACE_MCP_PACKAGE, contextPath, workspaceLock, loadWorkspace, readWorkspaceFile, saveWorkspace, workspaceHome, workspaceName, workspaceOrigin, writeWorkspaceFile, } from "./workspaces.js";
6
+ import { bindWorkspace, bindingOf, codexWorkspaceProfilePath, writeCodexWorkspaceProfile, workspaceCaptureDefault, WORKSPACE_MCP_PACKAGE, contextPath, workspaceLock, loadWorkspace, readWorkspaceFile, saveWorkspace, workspaceHome, workspaceName, workspaceOrigin, writeWorkspaceFile, } from "./workspaces.js";
7
7
  import { resolveEndpoints } from "./config.js";
8
8
  import { verifyScope, confirmLanded } from "./connectivity.js";
9
9
  import { pollOnce } from "./deviceClient.js";
@@ -55,7 +55,7 @@ async function request(base, route, body, fetchImpl, deadline, key, scope) {
55
55
  throw new Error(`Bootstrap request failed (HTTP ${response.status}${typeof result.error === "string" && /^[a-z_]{1,64}$/.test(result.error) ? `, ${result.error}` : ""}); resume after resolving it.`);
56
56
  return result;
57
57
  }
58
- function validatePlan(options) {
58
+ function validatePlan(options, enrichDefault) {
59
59
  workspaceName(options.name);
60
60
  const allowed = new Set([
61
61
  "name",
@@ -136,7 +136,11 @@ function validatePlan(options) {
136
136
  : path.join(repositoryPath, ".claude", "settings.local.json");
137
137
  if (configPath !== allowedConfig)
138
138
  throw new Error("Bootstrap writes only this workspace's named Codex profile or repository-local Claude settings.");
139
- return { ...options, repositoryPath, client, configPath };
139
+ return {
140
+ ...options,
141
+ ...(options.enrich === undefined && enrichDefault !== undefined ? { enrich: enrichDefault } : {}),
142
+ repositoryPath, client, configPath,
143
+ };
140
144
  }
141
145
  export async function bootstrapWorkspace(options, environment = {}) {
142
146
  if (options.reauthorize !== undefined &&
@@ -183,7 +187,8 @@ export async function bootstrapWorkspace(options, environment = {}) {
183
187
  else {
184
188
  if (options.organizationName && fs.existsSync(contextPath(name)))
185
189
  throw new Error("This context already exists. Omit organizationName to configure it, or choose a new context name to create another organization.");
186
- const plan = validatePlan(options);
190
+ const existing = fs.existsSync(contextPath(name)) ? loadWorkspace(name) : null;
191
+ const plan = validatePlan(options, existing ? workspaceCaptureDefault(existing) : true);
187
192
  state = {
188
193
  version: 1,
189
194
  name,
@@ -51,6 +51,7 @@ Usage:
51
51
  codetelemetry-connect bootstrap <name> [--organization-name NAME | --organization-id ID]
52
52
  [--client codex|claude] [--project PATH] [--plan FILE]
53
53
  Resume with just bootstrap <name>. --plan supplies Grader checks/features.
54
+ New setups capture prompts/tool content; --no-enrich opts out.
54
55
  codetelemetry-connect login [options] Authenticate via device code, then do the above
55
56
  codetelemetry-connect doctor [options] Re-test the already-configured key
56
57
  codetelemetry-connect print-config Print the config block (no key)
@@ -442,6 +443,11 @@ export async function run(argv) {
442
443
  options.organizationId = flags["organization-id"];
443
444
  if (typeof flags.client === "string")
444
445
  options.client = flags.client;
446
+ if (flags.enrich !== undefined) {
447
+ if (typeof flags.enrich !== "boolean")
448
+ throw new Error("--enrich/--no-enrich must be a boolean flag.");
449
+ options.enrich = flags.enrich;
450
+ }
445
451
  const result = await bootstrapWorkspace(options, { apiBase: typeof flags["api-base"] === "string" ? flags["api-base"] : undefined });
446
452
  out(JSON.stringify(result, null, 2));
447
453
  if (result.status === "authorization_required" && flags.open !== false && !flags.json)
@@ -1,5 +1,5 @@
1
1
  import type { KeyScope } from "./connectivity.ts";
2
- export declare const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.4.0";
2
+ export declare const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.4.1";
3
3
  export declare const MAX_WORKSPACE_BYTES: number;
4
4
  export declare const MAX_WORKSPACES = 64;
5
5
  export type WorkspaceBinding = {
@@ -28,6 +28,7 @@ export declare function readWorkspaceFile(file: string, privateFile?: boolean):
28
28
  export declare function writeWorkspaceText(file: string, data: string): void;
29
29
  export declare function writeWorkspaceFile(file: string, value: unknown): void;
30
30
  export declare function codexWorkspaceProfilePath(name: string): string;
31
+ export declare function workspaceCaptureDefault(context: WorkspaceContext): boolean;
31
32
  export declare function writeCodexWorkspaceProfile(context: WorkspaceContext, options?: {
32
33
  enrich?: boolean;
33
34
  repositoryObservation?: boolean;
@@ -5,7 +5,7 @@ import { createHash, randomBytes } from "node:crypto";
5
5
  import { buildOtelSection } from "./codexConfig.js";
6
6
  import { repositoryHookSource, quotedCommand, REPOSITORY_HOOK_FILE } from "./repositoryHook.js";
7
7
  import { looksLikeKey } from "./keys.js";
8
- export const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.4.0";
8
+ export const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.4.1";
9
9
  export const MAX_WORKSPACE_BYTES = 64 * 1024;
10
10
  export const MAX_WORKSPACES = 64;
11
11
  export function workspaceName(value) {
@@ -145,7 +145,25 @@ export function writeWorkspaceFile(file, value) {
145
145
  export function codexWorkspaceProfilePath(name) {
146
146
  return path.join(process.env.CODEX_HOME || path.join(os.homedir(), ".codex"), `codetelemetry-${workspaceName(name)}.config.toml`);
147
147
  }
148
+ export function workspaceCaptureDefault(context) {
149
+ if (context.clientConfig)
150
+ return context.clientConfig.enrich;
151
+ const file = codexWorkspaceProfilePath(context.name);
152
+ if (!fs.existsSync(file))
153
+ return true;
154
+ noLinks(file);
155
+ const stat = fs.lstatSync(file);
156
+ if (!stat.isFile() || stat.size > MAX_WORKSPACE_BYTES)
157
+ throw new Error("Invalid workspace profile.");
158
+ const text = fs.readFileSync(file, "utf8");
159
+ if (!text.startsWith(`# CodeTelemetry workspace ${context.name}\n`)) {
160
+ throw new Error("The Codex workspace profile is not managed by CodeTelemetry; choose a different context name.");
161
+ }
162
+ const section = text.match(/^\[otel\]\r?\n([\s\S]*?)(?=^\[|(?![\s\S]))/m)?.[1] ?? "";
163
+ return /^\s*log_user_prompt\s*=\s*true\s*(?:#.*)?$/m.test(section);
164
+ }
148
165
  export function writeCodexWorkspaceProfile(context, options = {}) {
166
+ const enrich = options.enrich ?? workspaceCaptureDefault(context);
149
167
  const profilePath = codexWorkspaceProfilePath(context.name), marker = `# CodeTelemetry workspace ${context.name}\n`;
150
168
  upgradeLegacyCodexObserver(path.dirname(profilePath));
151
169
  if (fs.existsSync(profilePath)) {
@@ -157,9 +175,9 @@ export function writeCodexWorkspaceProfile(context, options = {}) {
157
175
  throw new Error("The Codex workspace profile is not managed by CodeTelemetry; choose a different context name.");
158
176
  }
159
177
  let text = marker +
160
- buildOtelSection(context.ingestKey, context.ingestEndpoint, options.enrich === true) +
178
+ buildOtelSection(context.ingestKey, context.ingestEndpoint, enrich) +
161
179
  "\n";
162
- if (!options.enrich)
180
+ if (!enrich)
163
181
  text = text.replace("[otel]\n", "[otel]\nlog_user_prompt = false\n");
164
182
  if (options.repositoryObservation) {
165
183
  const hookPath = path.join(workspaceHome(), `${context.name}.hook.cjs`);
@@ -1,2 +1,2 @@
1
1
  export declare const MCP_SERVER_NAME = "codetelemetry";
2
- export declare const MCP_SERVER_VERSION = "0.4.0";
2
+ export declare const MCP_SERVER_VERSION = "0.4.1";
@@ -1,2 +1,2 @@
1
1
  export const MCP_SERVER_NAME = "codetelemetry";
2
- export const MCP_SERVER_VERSION = "0.4.0";
2
+ export const MCP_SERVER_VERSION = "0.4.1";
@@ -53,7 +53,7 @@ export const workspaceTools = [
53
53
  {
54
54
  name: "bootstrap_workspace",
55
55
  title: "Create or resume a workspace setup",
56
- description: "Create/select an organization and finish repository-scoped setup using a persistent named context. The first call returns one browser approval URL; later calls with the same name resume the saved plan, verify funding and ingestion, optionally save/publish selected Grader checks and write Terraform. No credits or seats are purchased. Pass organizationName to create or organizationId to select. Existing contexts need neither. Each call is bounded; pending steps are explicit. Secrets stay local; unrelated global configurations are unchanged.",
56
+ description: "Create/select an organization and finish repository-scoped setup using a persistent named context. New workspace setups enable prompt and tool-content capture by default; pass enrich:false to opt out. Saved capture choices are preserved on resume. The first call returns one browser approval URL; later calls with the same name resume the saved plan, verify funding and ingestion, optionally save/publish selected Grader checks and write Terraform. No credits or seats are purchased. Pass organizationName to create or organizationId to select. Existing contexts need neither. Each call is bounded; pending steps are explicit. Secrets stay local; unrelated global configurations are unchanged.",
57
57
  inputSchema: {
58
58
  type: "object",
59
59
  additionalProperties: false,
@@ -76,7 +76,7 @@ export const workspaceTools = [
76
76
  type: "boolean",
77
77
  description: "Replace an expired or revoked credential after fresh approval, preserving this exact account and organization.",
78
78
  },
79
- enrich: { type: "boolean" },
79
+ enrich: { type: "boolean", default: true, description: "Capture prompts and tool content for new workspace setups (default true). Set false to opt out. Existing saved choices are preserved." },
80
80
  repositoryObservation: { type: "boolean" },
81
81
  },
82
82
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codetelemetry/mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "CodeTelemetry MCP server \u2014 lets a coding agent onboard a user end to end: authenticate (device code), obtain an ingest key, write the Claude Code OTEL config, send a test event, and confirm telemetry landed \u2014 then search, read, interpret and compare the user's own coding sessions, plan the next one, and size tasks, plans and Linear issues from that history. The plaintext key never enters the model's context.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "serverName": "codetelemetry",
3
- "serverVersion": "0.4.0",
4
- "registryHash": "6bfd22de2c81f7a7ef817af42b2c9f741dcbb085de4d79fc661d291b065dd3a0",
3
+ "serverVersion": "0.4.1",
4
+ "registryHash": "217ada41e87180ec24e8e8d96108a2e52dfc5eae0c4007aa313eac6a11b7ece8",
5
5
  "toolCount": 30,
6
6
  "tools": [
7
7
  {
8
8
  "name": "bootstrap_workspace",
9
9
  "title": "Create or resume a workspace setup",
10
- "description": "Create/select an organization and finish repository-scoped setup using a persistent named context. The first call returns one browser approval URL; later calls with the same name resume the saved plan, verify funding and ingestion, optionally save/publish selected Grader checks and write Terraform. No credits or seats are purchased. Pass organizationName to create or organizationId to select. Existing contexts need neither. Each call is bounded; pending steps are explicit. Secrets stay local; unrelated global configurations are unchanged.",
10
+ "description": "Create/select an organization and finish repository-scoped setup using a persistent named context. New workspace setups enable prompt and tool-content capture by default; pass enrich:false to opt out. Saved capture choices are preserved on resume. The first call returns one browser approval URL; later calls with the same name resume the saved plan, verify funding and ingestion, optionally save/publish selected Grader checks and write Terraform. No credits or seats are purchased. Pass organizationName to create or organizationId to select. Existing contexts need neither. Each call is bounded; pending steps are explicit. Secrets stay local; unrelated global configurations are unchanged.",
11
11
  "inputSchema": {
12
12
  "type": "object",
13
13
  "additionalProperties": false,
@@ -79,7 +79,9 @@
79
79
  "description": "Replace an expired or revoked credential after fresh approval, preserving this exact account and organization."
80
80
  },
81
81
  "enrich": {
82
- "type": "boolean"
82
+ "type": "boolean",
83
+ "default": true,
84
+ "description": "Capture prompts and tool content for new workspace setups (default true). Set false to opt out. Existing saved choices are preserved."
83
85
  },
84
86
  "repositoryObservation": {
85
87
  "type": "boolean"