@concord-ai/concord-mcp 0.4.1 → 0.6.0
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 +139 -39
- package/dist/artifacts/handoff-md.js +5 -1
- package/dist/artifacts/handoff-md.js.map +1 -1
- package/dist/artifacts/work-state-json.js +4 -0
- package/dist/artifacts/work-state-json.js.map +1 -1
- package/dist/artifacts/work-state-view.d.ts +4 -0
- package/dist/artifacts/work-state-view.js +7 -2
- package/dist/artifacts/work-state-view.js.map +1 -1
- package/dist/cli/commands/check.js +2 -1
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/doctor.js +35 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/hook.d.ts +3 -3
- package/dist/cli/commands/hook.js +4 -4
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.js +25 -5
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/status.js +5 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +8 -4
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/who.js +7 -2
- package/dist/cli/commands/who.js.map +1 -1
- package/dist/cli/context.d.ts +3 -2
- package/dist/cli/context.js +5 -4
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/dashboard/app.js +2 -2
- package/dist/cli/dashboard/app.js.map +1 -1
- package/dist/cli/index.js +44 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspace-options.d.ts +21 -0
- package/dist/cli/workspace-options.js +36 -0
- package/dist/cli/workspace-options.js.map +1 -0
- package/dist/config/paths.d.ts +17 -3
- package/dist/config/paths.js +80 -10
- package/dist/config/paths.js.map +1 -1
- package/dist/db/index.d.ts +4 -1
- package/dist/db/index.js +2 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/repositories/handoffs.d.ts +9 -1
- package/dist/db/repositories/handoffs.js +38 -3
- package/dist/db/repositories/handoffs.js.map +1 -1
- package/dist/db/repositories/ownership-events.d.ts +19 -0
- package/dist/db/repositories/ownership-events.js +43 -0
- package/dist/db/repositories/ownership-events.js.map +1 -0
- package/dist/db/repositories/tasks.d.ts +12 -0
- package/dist/db/repositories/tasks.js +33 -5
- package/dist/db/repositories/tasks.js.map +1 -1
- package/dist/db/rows.d.ts +33 -3
- package/dist/db/rows.js +87 -2
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +36 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/domain/adoption.d.ts +3 -3
- package/dist/domain/adoption.js +2 -2
- package/dist/domain/adoption.js.map +1 -1
- package/dist/domain/operations.d.ts +42 -0
- package/dist/domain/operations.js +2 -0
- package/dist/domain/operations.js.map +1 -0
- package/dist/domain/presence.js +1 -1
- package/dist/domain/presence.js.map +1 -1
- package/dist/domain/schemas.d.ts +34 -250
- package/dist/domain/schemas.js +108 -97
- package/dist/domain/schemas.js.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/install/codex-config.d.ts +21 -0
- package/dist/install/codex-config.js +68 -0
- package/dist/install/codex-config.js.map +1 -0
- package/dist/install/instructions.d.ts +6 -2
- package/dist/install/instructions.js +27 -34
- package/dist/install/instructions.js.map +1 -1
- package/dist/install/mcp-config.d.ts +24 -0
- package/dist/install/mcp-config.js +60 -0
- package/dist/install/mcp-config.js.map +1 -0
- package/dist/server.d.ts +6 -3
- package/dist/server.js +12 -15
- package/dist/server.js.map +1 -1
- package/dist/telemetry/client.d.ts +22 -0
- package/dist/telemetry/client.js +161 -0
- package/dist/telemetry/client.js.map +1 -0
- package/dist/telemetry/identity.d.ts +11 -0
- package/dist/telemetry/identity.js +59 -0
- package/dist/telemetry/identity.js.map +1 -0
- package/dist/telemetry/transport.d.ts +15 -0
- package/dist/telemetry/transport.js +83 -0
- package/dist/telemetry/transport.js.map +1 -0
- package/dist/tools/claim-work.d.ts +1 -19
- package/dist/tools/claim-work.js +8 -63
- package/dist/tools/claim-work.js.map +1 -1
- package/dist/tools/get-task-context.d.ts +4 -4
- package/dist/tools/get-task-context.js +3 -51
- package/dist/tools/get-task-context.js.map +1 -1
- package/dist/tools/get-work-state.d.ts +5 -6
- package/dist/tools/get-work-state.js +18 -36
- package/dist/tools/get-work-state.js.map +1 -1
- package/dist/tools/handoff-lifecycle.d.ts +10 -0
- package/dist/tools/handoff-lifecycle.js +151 -0
- package/dist/tools/handoff-lifecycle.js.map +1 -0
- package/dist/tools/handoff.d.ts +5 -9
- package/dist/tools/handoff.js +56 -93
- package/dist/tools/handoff.js.map +1 -1
- package/dist/tools/register-agent.d.ts +1 -4
- package/dist/tools/register-agent.js +0 -52
- package/dist/tools/register-agent.js.map +1 -1
- package/dist/tools/review-ready.d.ts +2 -4
- package/dist/tools/review-ready.js +36 -45
- package/dist/tools/review-ready.js.map +1 -1
- package/dist/tools/task-lifecycle.d.ts +12 -0
- package/dist/tools/task-lifecycle.js +200 -0
- package/dist/tools/task-lifecycle.js.map +1 -0
- package/dist/tools/update-task.d.ts +1 -4
- package/dist/tools/update-task.js +14 -29
- package/dist/tools/update-task.js.map +1 -1
- package/dist/tools/workflow.d.ts +38 -0
- package/dist/tools/workflow.js +444 -0
- package/dist/tools/workflow.js.map +1 -0
- package/dist/tools/workspace-routing.d.ts +8 -0
- package/dist/tools/workspace-routing.js +15 -0
- package/dist/tools/workspace-routing.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspaces/manager.d.ts +43 -0
- package/dist/workspaces/manager.js +118 -0
- package/dist/workspaces/manager.js.map +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { writeArtifacts } from './artifacts/index.js';
|
|
4
|
-
import {
|
|
5
|
-
import { openRepositories } from './db/index.js';
|
|
4
|
+
import { resolveRepoRoot } from './config/paths.js';
|
|
6
5
|
import { createServer } from './server.js';
|
|
6
|
+
import { createTelemetryClient } from './telemetry/client.js';
|
|
7
|
+
import { TelemetryTransport } from './telemetry/transport.js';
|
|
8
|
+
import { WorkspaceManager } from './workspaces/manager.js';
|
|
7
9
|
async function main() {
|
|
8
10
|
const repoRoot = resolveRepoRoot(process.cwd(), process.env);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
onToolWrite: () => {
|
|
13
|
-
|
|
11
|
+
const workspaceManager = WorkspaceManager.fromEnvironment(repoRoot, process.env);
|
|
12
|
+
const server = createServer(workspaceManager.current().repos, {
|
|
13
|
+
workspaceManager,
|
|
14
|
+
onToolWrite: (workspace) => {
|
|
15
|
+
if (workspace !== undefined) {
|
|
16
|
+
writeArtifacts(workspace.concordPath, workspace.repos);
|
|
17
|
+
}
|
|
14
18
|
},
|
|
15
19
|
});
|
|
16
|
-
const
|
|
20
|
+
const telemetry = createTelemetryClient({
|
|
21
|
+
surface: 'mcp',
|
|
22
|
+
workspaceRoot: () => workspaceManager.current().repoRoot,
|
|
23
|
+
});
|
|
24
|
+
const stdio = new StdioServerTransport();
|
|
25
|
+
const transport = telemetry === undefined ? stdio : new TelemetryTransport(stdio, telemetry);
|
|
26
|
+
process.once('beforeExit', () => {
|
|
27
|
+
void telemetry?.close();
|
|
28
|
+
});
|
|
17
29
|
await server.connect(transport);
|
|
18
30
|
}
|
|
19
31
|
main().catch((error) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,O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AAI,CAAC,YAAY,EAAE,GAAG,EAAE;QAC9B,KAAK,SAAS,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** The TOML table Codex reads Concord's server definition from. */
|
|
2
|
+
export declare const CODEX_SECTION_HEADER = "[mcp_servers.concord]";
|
|
3
|
+
/**
|
|
4
|
+
* Absolute path to Codex's user-global config. Unlike everything else `install`
|
|
5
|
+
* writes this lives outside the repo, so `CODEX_HOME` is honored — both because
|
|
6
|
+
* Codex itself respects it and because it lets tests target a temp directory.
|
|
7
|
+
*/
|
|
8
|
+
export declare function codexConfigFile(env?: NodeJS.ProcessEnv): string;
|
|
9
|
+
/**
|
|
10
|
+
* Idempotently add Concord's `[mcp_servers.concord]` table to a Codex TOML
|
|
11
|
+
* config. This splices the table by line range rather than parsing and
|
|
12
|
+
* re-serializing, so unrelated tables — and the comments and formatting around
|
|
13
|
+
* them, which a round-trip through a parser would discard — survive verbatim.
|
|
14
|
+
*/
|
|
15
|
+
export declare function upsertCodexMcpServer(existing: string | undefined): string;
|
|
16
|
+
/**
|
|
17
|
+
* Register Concord in Codex's user-global `config.toml` (created if absent),
|
|
18
|
+
* preserving the rest of the file. Returns the absolute path written, since it
|
|
19
|
+
* lies outside the repo and callers surface that to the user.
|
|
20
|
+
*/
|
|
21
|
+
export declare function installCodexMcpConfig(env?: NodeJS.ProcessEnv): string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { CONCORD_SERVER_COMMAND } from './mcp-config.js';
|
|
5
|
+
/** The TOML table Codex reads Concord's server definition from. */
|
|
6
|
+
export const CODEX_SECTION_HEADER = '[mcp_servers.concord]';
|
|
7
|
+
/** Matches any TOML table header, which terminates the preceding table. */
|
|
8
|
+
const TABLE_HEADER = /^\s*\[/u;
|
|
9
|
+
/**
|
|
10
|
+
* Absolute path to Codex's user-global config. Unlike everything else `install`
|
|
11
|
+
* writes this lives outside the repo, so `CODEX_HOME` is honored — both because
|
|
12
|
+
* Codex itself respects it and because it lets tests target a temp directory.
|
|
13
|
+
*/
|
|
14
|
+
export function codexConfigFile(env = process.env) {
|
|
15
|
+
const home = env['CODEX_HOME'];
|
|
16
|
+
const base = home !== undefined && home.trim() !== '' ? home : join(homedir(), '.codex');
|
|
17
|
+
return join(base, 'config.toml');
|
|
18
|
+
}
|
|
19
|
+
/** Normalize preceding content so exactly one blank line precedes our table. */
|
|
20
|
+
function withTrailingBlankLine(lines) {
|
|
21
|
+
if (lines.length === 0) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
return `${lines.join('\n').replace(/\n*$/u, '')}\n\n`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Idempotently add Concord's `[mcp_servers.concord]` table to a Codex TOML
|
|
28
|
+
* config. This splices the table by line range rather than parsing and
|
|
29
|
+
* re-serializing, so unrelated tables — and the comments and formatting around
|
|
30
|
+
* them, which a round-trip through a parser would discard — survive verbatim.
|
|
31
|
+
*/
|
|
32
|
+
export function upsertCodexMcpServer(existing) {
|
|
33
|
+
const section = `${CODEX_SECTION_HEADER}\ncommand = "${CONCORD_SERVER_COMMAND}"\n`;
|
|
34
|
+
const source = existing ?? '';
|
|
35
|
+
if (source.trim() === '') {
|
|
36
|
+
return section;
|
|
37
|
+
}
|
|
38
|
+
const lines = source.split('\n');
|
|
39
|
+
const found = lines.findIndex((line) => line.trim() === CODEX_SECTION_HEADER);
|
|
40
|
+
const start = found === -1 ? lines.length : found;
|
|
41
|
+
// Our table runs until the next table header; a nested `[mcp_servers.concord.env]`
|
|
42
|
+
// is such a header, so any subtable the user added is preserved as trailing content.
|
|
43
|
+
let end = lines.length;
|
|
44
|
+
if (found !== -1) {
|
|
45
|
+
for (let index = found + 1; index < lines.length; index += 1) {
|
|
46
|
+
if (TABLE_HEADER.test(lines[index] ?? '')) {
|
|
47
|
+
end = index;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const head = withTrailingBlankLine(lines.slice(0, start));
|
|
53
|
+
const tail = lines.slice(end).join('\n');
|
|
54
|
+
return tail === '' ? `${head}${section}` : `${head}${section}\n${tail}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Register Concord in Codex's user-global `config.toml` (created if absent),
|
|
58
|
+
* preserving the rest of the file. Returns the absolute path written, since it
|
|
59
|
+
* lies outside the repo and callers surface that to the user.
|
|
60
|
+
*/
|
|
61
|
+
export function installCodexMcpConfig(env = process.env) {
|
|
62
|
+
const fullPath = codexConfigFile(env);
|
|
63
|
+
const existing = existsSync(fullPath) ? readFileSync(fullPath, 'utf8') : undefined;
|
|
64
|
+
mkdirSync(dirname(fullPath), { recursive: true });
|
|
65
|
+
writeFileSync(fullPath, upsertCodexMcpServer(existing));
|
|
66
|
+
return fullPath;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=codex-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-config.js","sourceRoot":"","sources":["../../src/install/codex-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC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IACnF,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export declare const
|
|
1
|
+
/** Version of the generated agent workflow contract. */
|
|
2
|
+
export declare const CONCORD_INSTRUCTION_VERSION = "1";
|
|
3
|
+
/** Concise MCP-native guidance, versioned with the running server. */
|
|
4
|
+
export declare const CONCORD_SERVER_INSTRUCTIONS = "Concord coordinates coding agents through five workflow tools.\n- Call start_work before editing. It registers your agent, claims or accepts the task, and reports overlaps.\n- Use inspect_work to read workspace or task context and update_work for durable progress, decisions, questions, blockers, and findings.\n- Use transfer_work for assignment, acceptance, decline, release, reassignment, evidence-bearing handoff offers, and reopening.\n- Call finish_work before finishing, review, or closure with changed files, tests, assumptions, decisions, risks, and provenance.\nKeep claims small and resolve reported overlaps before editing.";
|
|
5
|
+
/** Canonical fallback block written into supported client instruction files. */
|
|
6
|
+
export declare const CONCORD_INSTRUCTIONS = "## Concord \u2014 shared work-state for coding agents\n\n<!-- concord:workflow-version=1 -->\n\nThis project uses Concord MCP. Keep coordination to the five workflow tools:\n\n- **Before editing**, call `start_work` with the task, your agent kind/id, and\n expected files or modules. It registers presence, accepts assigned work when\n appropriate, claims the scope, and returns overlap warnings.\n- Use `inspect_work` to read the workspace or one task. Use `update_work` for\n durable progress, decisions, assumptions, questions, blockers, and findings.\n- Use `transfer_work` for assignment, acceptance, decline, release,\n reassignment, evidence-bearing handoff offers, and reopening.\n- **Before finishing**, call `finish_work` once with the outcome, changed\n files, tests, assumptions, decisions, risks, guardrails, and provenance. It\n records evidence and can mark work review-ready or terminal.\n\nKeep each claim small and resolve reported overlaps before editing. Concord\nregenerates human-readable review artifacts in `.concord/`.\n\nEnforcement remains client-dependent. `concord doctor` reports setup and\nworkflow adoption; optional hooks can block exact-file collisions.";
|
|
3
7
|
/** MDC frontmatter used when creating a fresh Cursor rules file. */
|
|
4
8
|
export declare const CURSOR_MDC_HEADER = "---\ndescription: Concord shared work-state tools for coding agents\nalwaysApply: true\n---\n";
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Version of the generated agent workflow contract. */
|
|
2
|
+
export const CONCORD_INSTRUCTION_VERSION = '1';
|
|
3
|
+
/** Concise MCP-native guidance, versioned with the running server. */
|
|
4
|
+
export const CONCORD_SERVER_INSTRUCTIONS = `Concord coordinates coding agents through five workflow tools.
|
|
5
|
+
- Call start_work before editing. It registers your agent, claims or accepts the task, and reports overlaps.
|
|
6
|
+
- Use inspect_work to read workspace or task context and update_work for durable progress, decisions, questions, blockers, and findings.
|
|
7
|
+
- Use transfer_work for assignment, acceptance, decline, release, reassignment, evidence-bearing handoff offers, and reopening.
|
|
8
|
+
- Call finish_work before finishing, review, or closure with changed files, tests, assumptions, decisions, risks, and provenance.
|
|
9
|
+
Keep claims small and resolve reported overlaps before editing.`;
|
|
10
|
+
/** Canonical fallback block written into supported client instruction files. */
|
|
2
11
|
export const CONCORD_INSTRUCTIONS = `## Concord — shared work-state for coding agents
|
|
3
12
|
|
|
4
|
-
|
|
13
|
+
<!-- concord:workflow-version=${CONCORD_INSTRUCTION_VERSION} -->
|
|
5
14
|
|
|
6
|
-
|
|
7
|
-
a one-line summary of what you are working on, and your status. Reuse the
|
|
8
|
-
returned \`agent_id\` on every later Concord call so your presence stays
|
|
9
|
-
attributed to one instance, and call \`register_agent\` again when your focus
|
|
10
|
-
changes. Then call \`get_work_state\` to see who else is active before you
|
|
11
|
-
start — it shows the agent roster, active claims, overlaps, and stale claims.
|
|
12
|
-
- **Keep each claim small.** Break work into the smallest independently
|
|
13
|
-
handoff-able unit and \`claim_work\` each piece separately, rather than
|
|
14
|
-
claiming one broad task. Concord flags claims that look too broad.
|
|
15
|
-
- **Before editing code**, call \`claim_work\` with the task id, title, your
|
|
16
|
-
\`agent_id\`, and the files/modules you expect to touch. Concord warns about
|
|
17
|
-
overlaps with other active work.
|
|
18
|
-
- **While working**, call \`update_task\` (with your \`agent_id\`) for durable
|
|
19
|
-
intent, progress, assumptions, decisions, questions, answers, blockers, and
|
|
20
|
-
findings. When resuming or coordinating on a task, call \`get_task_context\`
|
|
21
|
-
first.
|
|
22
|
-
- **Before finishing or when blocked**, call \`handoff\` with what changed, tests
|
|
23
|
-
run, assumptions, decisions, and guardrails you checked. **Before a PR**, set
|
|
24
|
-
\`ready_for_review\` (with open questions and provenance) to also produce a
|
|
25
|
-
review packet.
|
|
15
|
+
This project uses Concord MCP. Keep coordination to the five workflow tools:
|
|
26
16
|
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
- **Before editing**, call \`start_work\` with the task, your agent kind/id, and
|
|
18
|
+
expected files or modules. It registers presence, accepts assigned work when
|
|
19
|
+
appropriate, claims the scope, and returns overlap warnings.
|
|
20
|
+
- Use \`inspect_work\` to read the workspace or one task. Use \`update_work\` for
|
|
21
|
+
durable progress, decisions, assumptions, questions, blockers, and findings.
|
|
22
|
+
- Use \`transfer_work\` for assignment, acceptance, decline, release,
|
|
23
|
+
reassignment, evidence-bearing handoff offers, and reopening.
|
|
24
|
+
- **Before finishing**, call \`finish_work\` once with the outcome, changed
|
|
25
|
+
files, tests, assumptions, decisions, risks, guardrails, and provenance. It
|
|
26
|
+
records evidence and can mark work review-ready or terminal.
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Claude Code, \`concord install --claude-hooks\` installs this automatically — set
|
|
36
|
-
\`CONCORD_TASK=<your task id>\` so the hook excludes your own claim. It also
|
|
37
|
-
installs a SessionStart hook that auto-registers your presence and tells you the
|
|
38
|
-
\`agent_id\` to reuse, so you are visible in the roster even before your first
|
|
39
|
-
tool call.`;
|
|
28
|
+
Keep each claim small and resolve reported overlaps before editing. Concord
|
|
29
|
+
regenerates human-readable review artifacts in \`.concord/\`.
|
|
30
|
+
|
|
31
|
+
Enforcement remains client-dependent. \`concord doctor\` reports setup and
|
|
32
|
+
workflow adoption; optional hooks can block exact-file collisions.`;
|
|
40
33
|
/** MDC frontmatter used when creating a fresh Cursor rules file. */
|
|
41
34
|
export const CURSOR_MDC_HEADER = `---
|
|
42
35
|
description: Concord shared work-state tools for coding agents
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/install/instructions.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/install/instructions.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,sEAAsE;AACtE,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;gEAKqB,CAAC;AAEjE,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;gCAEJ,2BAA2B;;;;;;;;;;;;;;;;;;;mEAmBQ,CAAC;AAEpE,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;CAIhC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The key Concord registers itself under in an `mcpServers` map. */
|
|
2
|
+
export declare const CONCORD_SERVER_KEY = "concord";
|
|
3
|
+
/** The binary clients spawn to run the stdio MCP server. */
|
|
4
|
+
export declare const CONCORD_SERVER_COMMAND = "concord-mcp";
|
|
5
|
+
/**
|
|
6
|
+
* Thrown when an existing config file cannot be parsed. The caller reports this
|
|
7
|
+
* and leaves the file untouched rather than overwriting hand-written config.
|
|
8
|
+
*/
|
|
9
|
+
export declare class McpConfigParseError extends Error {
|
|
10
|
+
readonly relPath: string;
|
|
11
|
+
constructor(relPath: string);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Idempotently add Concord's server entry to an `mcpServers` config string.
|
|
15
|
+
* Every other server and every unrelated top-level key is preserved, and
|
|
16
|
+
* passing the previous output back in is a no-op.
|
|
17
|
+
*/
|
|
18
|
+
export declare function upsertMcpServer(existing: string | undefined): string;
|
|
19
|
+
/**
|
|
20
|
+
* Register Concord in every JSON-shaped client config under `repoRoot`
|
|
21
|
+
* (Claude Code's `.mcp.json` and Cursor's `.cursor/mcp.json`), creating each
|
|
22
|
+
* file if absent. Returns the relative paths written.
|
|
23
|
+
*/
|
|
24
|
+
export declare function installMcpConfigs(repoRoot: string): string[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/** The key Concord registers itself under in an `mcpServers` map. */
|
|
5
|
+
export const CONCORD_SERVER_KEY = 'concord';
|
|
6
|
+
/** The binary clients spawn to run the stdio MCP server. */
|
|
7
|
+
export const CONCORD_SERVER_COMMAND = 'concord-mcp';
|
|
8
|
+
/** Repo-relative config paths that share the `mcpServers` JSON shape. */
|
|
9
|
+
const JSON_TARGETS = ['.mcp.json', join('.cursor', 'mcp.json')];
|
|
10
|
+
const mcpConfigSchema = z.object({ mcpServers: z.record(z.unknown()).optional() }).passthrough();
|
|
11
|
+
/**
|
|
12
|
+
* Thrown when an existing config file cannot be parsed. The caller reports this
|
|
13
|
+
* and leaves the file untouched rather than overwriting hand-written config.
|
|
14
|
+
*/
|
|
15
|
+
export class McpConfigParseError extends Error {
|
|
16
|
+
relPath;
|
|
17
|
+
constructor(relPath) {
|
|
18
|
+
super(`${relPath} is not valid JSON — fix or remove it, then re-run.`);
|
|
19
|
+
this.relPath = relPath;
|
|
20
|
+
this.name = 'McpConfigParseError';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Idempotently add Concord's server entry to an `mcpServers` config string.
|
|
25
|
+
* Every other server and every unrelated top-level key is preserved, and
|
|
26
|
+
* passing the previous output back in is a no-op.
|
|
27
|
+
*/
|
|
28
|
+
export function upsertMcpServer(existing) {
|
|
29
|
+
const source = existing === undefined || existing.trim() === '' ? {} : JSON.parse(existing);
|
|
30
|
+
const config = mcpConfigSchema.parse(source);
|
|
31
|
+
const servers = config.mcpServers ?? {};
|
|
32
|
+
const next = {
|
|
33
|
+
...config,
|
|
34
|
+
mcpServers: { ...servers, [CONCORD_SERVER_KEY]: { command: CONCORD_SERVER_COMMAND } },
|
|
35
|
+
};
|
|
36
|
+
return `${JSON.stringify(next, null, 2)}\n`;
|
|
37
|
+
}
|
|
38
|
+
function writeMcpConfig(repoRoot, relPath) {
|
|
39
|
+
const fullPath = join(repoRoot, relPath);
|
|
40
|
+
const existing = existsSync(fullPath) ? readFileSync(fullPath, 'utf8') : undefined;
|
|
41
|
+
let updated;
|
|
42
|
+
try {
|
|
43
|
+
updated = upsertMcpServer(existing);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
throw new McpConfigParseError(relPath);
|
|
47
|
+
}
|
|
48
|
+
mkdirSync(dirname(fullPath), { recursive: true });
|
|
49
|
+
writeFileSync(fullPath, updated);
|
|
50
|
+
return relPath;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Register Concord in every JSON-shaped client config under `repoRoot`
|
|
54
|
+
* (Claude Code's `.mcp.json` and Cursor's `.cursor/mcp.json`), creating each
|
|
55
|
+
* file if absent. Returns the relative paths written.
|
|
56
|
+
*/
|
|
57
|
+
export function installMcpConfigs(repoRoot) {
|
|
58
|
+
return JSON_TARGETS.map((relPath) => writeMcpConfig(repoRoot, relPath));
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=mcp-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/install/mcp-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE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EAAE,CAAC,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE;KACtF,CAAC;IACF,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB,EAAE,OAAe;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnF,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { Repositories } from './db/index.js';
|
|
3
|
+
import { type WorkspaceContext, type WorkspaceManager } from './workspaces/manager.js';
|
|
3
4
|
/** Concord's advertised MCP server version. */
|
|
4
|
-
export declare const SERVER_VERSION = "0.
|
|
5
|
+
export declare const SERVER_VERSION = "0.6.0";
|
|
5
6
|
export interface ServerOptions {
|
|
6
7
|
/** Called after any tool writes to the database (used to regenerate artifacts). */
|
|
7
|
-
onToolWrite?: () => void;
|
|
8
|
+
onToolWrite?: (workspace: WorkspaceContext | undefined) => void;
|
|
9
|
+
/** Enables automatic root resolution and optional per-operation workspace selection. */
|
|
10
|
+
workspaceManager?: WorkspaceManager;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
|
-
* Build the Concord MCP server and register the
|
|
13
|
+
* Build the Concord MCP server and register the workflow tools against the given
|
|
11
14
|
* repositories. Transport wiring lives in the entry points.
|
|
12
15
|
*/
|
|
13
16
|
export declare function createServer(repos: Repositories, options?: ServerOptions): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { registerHandoff } from './tools/handoff.js';
|
|
6
|
-
import { registerRegisterAgent } from './tools/register-agent.js';
|
|
7
|
-
import { registerUpdateTask } from './tools/update-task.js';
|
|
2
|
+
import { CONCORD_SERVER_INSTRUCTIONS } from './install/instructions.js';
|
|
3
|
+
import { registerWorkStateResource } from './tools/get-work-state.js';
|
|
4
|
+
import { registerWorkflowTools } from './tools/workflow.js';
|
|
8
5
|
import { VERSION } from './version.js';
|
|
6
|
+
import { routedRepositories, } from './workspaces/manager.js';
|
|
9
7
|
/** Concord's advertised MCP server version. */
|
|
10
8
|
export const SERVER_VERSION = VERSION;
|
|
11
9
|
/**
|
|
12
|
-
* Build the Concord MCP server and register the
|
|
10
|
+
* Build the Concord MCP server and register the workflow tools against the given
|
|
13
11
|
* repositories. Transport wiring lives in the entry points.
|
|
14
12
|
*/
|
|
15
13
|
export function createServer(repos, options = {}) {
|
|
16
|
-
const server = new McpServer({ name: 'concord-mcp', version: SERVER_VERSION });
|
|
14
|
+
const server = new McpServer({ name: 'concord-mcp', version: SERVER_VERSION }, { instructions: CONCORD_SERVER_INSTRUCTIONS });
|
|
15
|
+
const manager = options.workspaceManager;
|
|
16
|
+
const selectedRepos = manager === undefined ? repos : routedRepositories(manager);
|
|
17
|
+
const selectWorkspace = manager === undefined ? undefined : (workspaceId) => manager.select(workspaceId);
|
|
17
18
|
// Register the read surface first so we get the change-notifier, then run it
|
|
18
19
|
// (plus the caller's hook) after every write.
|
|
19
|
-
const notifyWorkStateChanged =
|
|
20
|
+
const notifyWorkStateChanged = registerWorkStateResource(server, selectedRepos, selectWorkspace);
|
|
20
21
|
const onWrite = () => {
|
|
21
|
-
options.onToolWrite?.();
|
|
22
|
+
options.onToolWrite?.(manager?.current());
|
|
22
23
|
notifyWorkStateChanged();
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
-
registerRegisterAgent(server, repos, onWrite);
|
|
26
|
-
registerClaimWork(server, repos, onWrite);
|
|
27
|
-
registerUpdateTask(server, repos, onWrite);
|
|
28
|
-
registerHandoff(server, repos, onWrite);
|
|
25
|
+
registerWorkflowTools(server, selectedRepos, onWrite, selectWorkspace);
|
|
29
26
|
return server;
|
|
30
27
|
}
|
|
31
28
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D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export type TelemetryOutcome = 'success' | 'error';
|
|
4
|
+
interface TelemetryClientOptions {
|
|
5
|
+
surface: TelemetrySurface;
|
|
6
|
+
workspaceRoot: () => string | undefined;
|
|
7
|
+
env?: NodeJS.ProcessEnv;
|
|
8
|
+
fetcher?: typeof fetch;
|
|
9
|
+
stderr?: {
|
|
10
|
+
write(message: string): unknown;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare class TelemetryClient {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(installationId: string, workspaceKey: string, options: TelemetryClientOptions);
|
|
16
|
+
setClientInfo(name: string, version: string): void;
|
|
17
|
+
recordOperation(operation: string, outcome: TelemetryOutcome, durationMs: number): void;
|
|
18
|
+
flush(): Promise<void>;
|
|
19
|
+
close(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createTelemetryClient(options: TelemetryClientOptions): TelemetryClient | undefined;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { arch, platform, release } from 'node:os';
|
|
3
|
+
import { VERSION } from '../version.js';
|
|
4
|
+
import { loadTelemetryIdentity, markTelemetryNoticeShown, telemetryConfigFile, workspacePseudonym, } from './identity.js';
|
|
5
|
+
export const DEFAULT_TELEMETRY_URL = 'https://getconcord.ai/api/telemetry/v1';
|
|
6
|
+
const FLUSH_DELAY_MS = 5_000;
|
|
7
|
+
const FETCH_TIMEOUT_MS = 1_500;
|
|
8
|
+
const MAX_BATCH_SIZE = 50;
|
|
9
|
+
const MAX_QUEUE_SIZE = 200;
|
|
10
|
+
export class TelemetryClient {
|
|
11
|
+
#installationId;
|
|
12
|
+
#sessionId = randomUUID();
|
|
13
|
+
#workspaceKey;
|
|
14
|
+
#surface;
|
|
15
|
+
#workspaceRoot;
|
|
16
|
+
#endpoint;
|
|
17
|
+
#fetcher;
|
|
18
|
+
#ci;
|
|
19
|
+
#events = [];
|
|
20
|
+
#clientInfo;
|
|
21
|
+
#sequence = 0;
|
|
22
|
+
#timer;
|
|
23
|
+
#flushing = false;
|
|
24
|
+
constructor(installationId, workspaceKey, options) {
|
|
25
|
+
this.#installationId = installationId;
|
|
26
|
+
this.#workspaceKey = workspaceKey;
|
|
27
|
+
this.#surface = options.surface;
|
|
28
|
+
this.#workspaceRoot = options.workspaceRoot;
|
|
29
|
+
this.#endpoint = options.env?.['CONCORD_TELEMETRY_URL'] ?? DEFAULT_TELEMETRY_URL;
|
|
30
|
+
this.#fetcher = options.fetcher ?? fetch;
|
|
31
|
+
this.#ci = (options.env ?? process.env)['CI'] !== undefined;
|
|
32
|
+
this.#record('session_started', null, null, null);
|
|
33
|
+
}
|
|
34
|
+
setClientInfo(name, version) {
|
|
35
|
+
const normalizedName = /codex/iu.test(name)
|
|
36
|
+
? 'codex'
|
|
37
|
+
: /claude/iu.test(name)
|
|
38
|
+
? 'claude'
|
|
39
|
+
: /cursor/iu.test(name)
|
|
40
|
+
? 'cursor'
|
|
41
|
+
: /gemini|google/iu.test(name)
|
|
42
|
+
? 'gemini'
|
|
43
|
+
: /visual studio|vscode/iu.test(name)
|
|
44
|
+
? 'vscode'
|
|
45
|
+
: 'other';
|
|
46
|
+
this.#clientInfo = {
|
|
47
|
+
name: normalizedName,
|
|
48
|
+
version: /^[0-9A-Za-z.+_-]{1,40}$/u.test(version) ? version : null,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
recordOperation(operation, outcome, durationMs) {
|
|
52
|
+
this.#record('operation_completed', operation.slice(0, 80), outcome, durationMs);
|
|
53
|
+
}
|
|
54
|
+
async flush() {
|
|
55
|
+
if (this.#flushing || this.#events.length === 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.#flushing = true;
|
|
59
|
+
if (this.#timer !== undefined) {
|
|
60
|
+
clearTimeout(this.#timer);
|
|
61
|
+
this.#timer = undefined;
|
|
62
|
+
}
|
|
63
|
+
const events = this.#events.splice(0, MAX_BATCH_SIZE);
|
|
64
|
+
try {
|
|
65
|
+
await this.#fetcher(this.#endpoint, {
|
|
66
|
+
method: 'POST',
|
|
67
|
+
headers: { 'content-type': 'application/json' },
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
schema_version: 1,
|
|
70
|
+
installation_id: this.#installationId,
|
|
71
|
+
session_id: this.#sessionId,
|
|
72
|
+
sent_at: new Date().toISOString(),
|
|
73
|
+
source: {
|
|
74
|
+
surface: this.#surface,
|
|
75
|
+
concord_version: VERSION,
|
|
76
|
+
node_version: process.versions.node,
|
|
77
|
+
platform: platform(),
|
|
78
|
+
platform_release: release(),
|
|
79
|
+
arch: arch(),
|
|
80
|
+
ci: this.#ci,
|
|
81
|
+
client_name: this.#clientInfo?.name ?? null,
|
|
82
|
+
client_version: this.#clientInfo?.version ?? null,
|
|
83
|
+
},
|
|
84
|
+
events,
|
|
85
|
+
}),
|
|
86
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Usage data is best effort and must never affect the product.
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
this.#flushing = false;
|
|
94
|
+
if (this.#events.length > 0) {
|
|
95
|
+
this.#scheduleFlush();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
close() {
|
|
100
|
+
return this.flush();
|
|
101
|
+
}
|
|
102
|
+
#record(eventType, operation, outcome, durationMs) {
|
|
103
|
+
if (this.#events.length >= MAX_QUEUE_SIZE) {
|
|
104
|
+
this.#events.shift();
|
|
105
|
+
}
|
|
106
|
+
const root = this.#workspaceRoot();
|
|
107
|
+
this.#events.push({
|
|
108
|
+
event_id: randomUUID(),
|
|
109
|
+
sequence: this.#sequence,
|
|
110
|
+
occurred_at: new Date().toISOString(),
|
|
111
|
+
event_type: eventType,
|
|
112
|
+
operation,
|
|
113
|
+
outcome,
|
|
114
|
+
duration_ms: durationMs === null ? null : Math.min(86_400_000, Math.max(0, Math.round(durationMs))),
|
|
115
|
+
workspace_id: root === undefined
|
|
116
|
+
? null
|
|
117
|
+
: workspacePseudonym({
|
|
118
|
+
installationId: this.#installationId,
|
|
119
|
+
workspaceKey: this.#workspaceKey,
|
|
120
|
+
noticeShown: true,
|
|
121
|
+
}, root),
|
|
122
|
+
});
|
|
123
|
+
this.#sequence += 1;
|
|
124
|
+
if (this.#events.length >= MAX_BATCH_SIZE) {
|
|
125
|
+
void this.flush();
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.#scheduleFlush();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
#scheduleFlush() {
|
|
132
|
+
if (this.#timer !== undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.#timer = setTimeout(() => {
|
|
136
|
+
this.#timer = undefined;
|
|
137
|
+
void this.flush();
|
|
138
|
+
}, FLUSH_DELAY_MS);
|
|
139
|
+
this.#timer.unref();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export function createTelemetryClient(options) {
|
|
143
|
+
const env = options.env ?? process.env;
|
|
144
|
+
if (env['CONCORD_TELEMETRY_DISABLED'] === '1' ||
|
|
145
|
+
env['DO_NOT_TRACK'] === '1' ||
|
|
146
|
+
(env['NODE_ENV'] === 'test' && options.fetcher === undefined)) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
const configFile = telemetryConfigFile(env);
|
|
150
|
+
const identity = loadTelemetryIdentity(configFile);
|
|
151
|
+
if (identity === undefined) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
if (!identity.noticeShown) {
|
|
155
|
+
(options.stderr ?? process.stderr).write('Concord sends anonymous usage telemetry (no code, paths, or task content). ' +
|
|
156
|
+
'Disable with CONCORD_TELEMETRY_DISABLED=1.\n');
|
|
157
|
+
markTelemetryNoticeShown(configFile, identity);
|
|
158
|
+
}
|
|
159
|
+
return new TelemetryClient(identity.installationId, identity.workspaceKey, options);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/telemetry/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,qBAAqB,GAAG,wCAAwC,CAAC;AAC9E,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,cAAc,GAAG,GAAG,CAAC;AA6B3B,MAAM,OAAO,eAAe;IACjB,eAAe,CAAS;IACxB,UAAU,GAAG,UAAU,EAAE,CAAC;IAC1B,aAAa,CAAS;IACtB,QAAQ,CAAmB;IAC3B,cAAc,CAA2B;IACzC,SAAS,CAAS;IAClB,QAAQ,CAAe;IACvB,GAAG,CAAU;IACb,OAAO,GAAkB,EAAE,CAAC;IACrC,WAAW,CAAyB;IACpC,SAAS,GAAG,CAAC,CAAC;IACd,MAAM,CAA6B;IACnC,SAAS,GAAG,KAAK,CAAC;IAElB,YAAY,cAAsB,EAAE,YAAoB,EAAE,OAA+B;QACvF,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GA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F,wBAAwB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TelemetryIdentity {
|
|
2
|
+
installationId: string;
|
|
3
|
+
workspaceKey: string;
|
|
4
|
+
noticeShown: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function telemetryConfigFile(env?: NodeJS.ProcessEnv): string;
|
|
7
|
+
/** Load or create the anonymous identity. Failure disables telemetry. */
|
|
8
|
+
export declare function loadTelemetryIdentity(path: string): TelemetryIdentity | undefined;
|
|
9
|
+
export declare function markTelemetryNoticeShown(path: string, identity: TelemetryIdentity): void;
|
|
10
|
+
/** Stable only for this installation; the canonical path and key never leave the machine. */
|
|
11
|
+
export declare function workspacePseudonym(identity: TelemetryIdentity, repoRoot: string): string;
|