@concord-ai/concord-mcp 0.13.0 → 0.14.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 +20 -0
- package/dist/cli/commands/cloud-inbox.d.ts +1 -1
- package/dist/cli/commands/cloud-inbox.js +3 -3
- package/dist/cli/commands/cloud-inbox.js.map +1 -1
- package/dist/cli/commands/cloud.d.ts +4 -0
- package/dist/cli/commands/cloud.js +62 -16
- package/dist/cli/commands/cloud.js.map +1 -1
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/inbox.d.ts +12 -0
- package/dist/cli/commands/inbox.js +32 -5
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +25 -0
- package/dist/cli/commands/setup.js +74 -7
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/context.d.ts +7 -1
- package/dist/cli/context.js +7 -4
- package/dist/cli/context.js.map +1 -1
- package/dist/cloud/proxy.d.ts +2 -2
- package/dist/cloud/proxy.js +5 -4
- package/dist/cloud/proxy.js.map +1 -1
- package/dist/cloud/settings.d.ts +8 -3
- package/dist/cloud/settings.js +14 -3
- package/dist/cloud/settings.js.map +1 -1
- package/dist/cloud/target.d.ts +24 -0
- package/dist/cloud/target.js +33 -0
- package/dist/cloud/target.js.map +1 -0
- package/dist/config/user-config.d.ts +17 -0
- package/dist/config/user-config.js +65 -0
- package/dist/config/user-config.js.map +1 -0
- package/dist/db/connection.js +17 -3
- package/dist/db/connection.js.map +1 -1
- package/dist/db/index.d.ts +8 -4
- package/dist/db/index.js +16 -12
- package/dist/db/index.js.map +1 -1
- package/dist/db/project-scope-migration.d.ts +14 -0
- package/dist/db/project-scope-migration.js +168 -0
- package/dist/db/project-scope-migration.js.map +1 -0
- package/dist/db/repositories/agent-messages.d.ts +4 -1
- package/dist/db/repositories/agent-messages.js +9 -5
- package/dist/db/repositories/agent-messages.js.map +1 -1
- package/dist/db/repositories/events.d.ts +1 -1
- package/dist/db/repositories/events.js +9 -7
- package/dist/db/repositories/events.js.map +1 -1
- package/dist/db/repositories/handoffs.d.ts +1 -1
- package/dist/db/repositories/handoffs.js +17 -13
- package/dist/db/repositories/handoffs.js.map +1 -1
- package/dist/db/repositories/ownership-events.d.ts +1 -1
- package/dist/db/repositories/ownership-events.js +7 -5
- package/dist/db/repositories/ownership-events.js.map +1 -1
- package/dist/db/repositories/reviews.d.ts +1 -1
- package/dist/db/repositories/reviews.js +12 -9
- package/dist/db/repositories/reviews.js.map +1 -1
- package/dist/db/repositories/task-updates.d.ts +1 -1
- package/dist/db/repositories/task-updates.js +7 -5
- package/dist/db/repositories/task-updates.js.map +1 -1
- package/dist/db/repositories/tasks.d.ts +2 -1
- package/dist/db/repositories/tasks.js +26 -15
- package/dist/db/repositories/tasks.js.map +1 -1
- package/dist/db/rows.d.ts +2 -0
- package/dist/db/rows.js +2 -0
- package/dist/db/rows.js.map +1 -1
- package/dist/db/schema.js +3 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/install/adapters/index.d.ts +5 -0
- package/dist/install/adapters/index.js +2 -2
- package/dist/install/adapters/index.js.map +1 -1
- package/dist/install/block.d.ts +2 -0
- package/dist/install/block.js +11 -0
- package/dist/install/block.js.map +1 -1
- package/dist/install/claude-plugin.d.ts +2 -0
- package/dist/install/claude-plugin.js +5 -2
- package/dist/install/claude-plugin.js.map +1 -1
- package/dist/install/codex-config.d.ts +2 -0
- package/dist/install/codex-config.js +5 -2
- package/dist/install/codex-config.js.map +1 -1
- package/dist/install/global-mode.d.ts +15 -0
- package/dist/install/global-mode.js +139 -0
- package/dist/install/global-mode.js.map +1 -0
- package/dist/install/instructions.d.ts +4 -0
- package/dist/install/instructions.js +21 -0
- package/dist/install/instructions.js.map +1 -1
- package/dist/install/mcp-config.d.ts +13 -4
- package/dist/install/mcp-config.js +56 -16
- package/dist/install/mcp-config.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/tools/agent-messages.d.ts +1 -1
- package/dist/tools/agent-messages.js +8 -3
- package/dist/tools/agent-messages.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspaces/client-roots.d.ts +32 -0
- package/dist/workspaces/client-roots.js +39 -0
- package/dist/workspaces/client-roots.js.map +1 -0
- package/dist/workspaces/manager.d.ts +13 -1
- package/dist/workspaces/manager.js +35 -4
- package/dist/workspaces/manager.js.map +1 -1
- package/dist/workspaces/store.d.ts +44 -0
- package/dist/workspaces/store.js +84 -0
- package/dist/workspaces/store.js.map +1 -0
- package/package.json +1 -1
- package/plugin/cursor/concord-relay/cursor-hook.mjs +30 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { WorkspaceManager, WorkspaceSelection } from './manager.js';
|
|
2
|
+
/** The part of an MCP server connection that can ask the client for its roots. */
|
|
3
|
+
export interface RootsClient {
|
|
4
|
+
getClientCapabilities(): {
|
|
5
|
+
roots?: object | undefined;
|
|
6
|
+
} | undefined;
|
|
7
|
+
listRoots(): Promise<{
|
|
8
|
+
roots: readonly {
|
|
9
|
+
uri: string;
|
|
10
|
+
}[];
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether the environment already names the repository. A client that does
|
|
15
|
+
* (Claude Code's `CLAUDE_PROJECT_DIR`, or a project registration's pinned
|
|
16
|
+
* `CONCORD_REPO_ROOT`) is not second-guessed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasExplicitRepoRoot(env: NodeJS.ProcessEnv): boolean;
|
|
19
|
+
export interface ClientRootOptions {
|
|
20
|
+
/** Whether a repository works through Concord Cloud (linked, or by default), which a local server cannot serve. */
|
|
21
|
+
readonly isCloudLinked?: (repoRoot: string) => boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Join the folder the client has open. A server registered at user scope runs
|
|
25
|
+
* wherever the client launched it (Cursor's global servers, notably), which
|
|
26
|
+
* says nothing about the project in the window; a client that supports MCP
|
|
27
|
+
* roots names that folder. Returns undefined when nothing was joined: the
|
|
28
|
+
* client names no folder, or a tool call chose a workspace while the answer
|
|
29
|
+
* was on its way, which stands. A folder linked to Concord Cloud is refused
|
|
30
|
+
* rather than served from a local store its cloud peers would never see.
|
|
31
|
+
*/
|
|
32
|
+
export declare function joinClientRoot(client: RootsClient, manager: WorkspaceManager, options?: ClientRootOptions): Promise<WorkspaceSelection | undefined>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { resolveExplicitRepoRoot } from '../config/paths.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the environment already names the repository. A client that does
|
|
5
|
+
* (Claude Code's `CLAUDE_PROJECT_DIR`, or a project registration's pinned
|
|
6
|
+
* `CONCORD_REPO_ROOT`) is not second-guessed.
|
|
7
|
+
*/
|
|
8
|
+
export function hasExplicitRepoRoot(env) {
|
|
9
|
+
return ['CONCORD_REPO_ROOT', 'CLAUDE_PROJECT_DIR'].some((name) => (env[name]?.trim() ?? '') !== '');
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Join the folder the client has open. A server registered at user scope runs
|
|
13
|
+
* wherever the client launched it (Cursor's global servers, notably), which
|
|
14
|
+
* says nothing about the project in the window; a client that supports MCP
|
|
15
|
+
* roots names that folder. Returns undefined when nothing was joined: the
|
|
16
|
+
* client names no folder, or a tool call chose a workspace while the answer
|
|
17
|
+
* was on its way, which stands. A folder linked to Concord Cloud is refused
|
|
18
|
+
* rather than served from a local store its cloud peers would never see.
|
|
19
|
+
*/
|
|
20
|
+
export async function joinClientRoot(client, manager, options = {}) {
|
|
21
|
+
if (client.getClientCapabilities()?.roots === undefined)
|
|
22
|
+
return undefined;
|
|
23
|
+
const before = manager.selections;
|
|
24
|
+
const { roots } = await client.listRoots();
|
|
25
|
+
if (manager.selections !== before)
|
|
26
|
+
return undefined;
|
|
27
|
+
const folder = roots.find((root) => root.uri.startsWith('file://'));
|
|
28
|
+
if (folder === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
const root = resolveExplicitRepoRoot(fileURLToPath(folder.uri));
|
|
31
|
+
if (options.isCloudLinked?.(root) === true) {
|
|
32
|
+
manager.refuse(`${root} works through Concord Cloud, which this user-level Concord server does not ` +
|
|
33
|
+
"serve. Use the project's own Concord server, which `concord setup` registers, or " +
|
|
34
|
+
'`concord cloud unlink` there to keep it local.');
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return manager.join(root);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=client-roots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-roots.js","sourceRoot":"","sources":["../../src/workspaces/client-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAS7D;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAsB;IACxD,OAAO,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC,IAAI,CACrD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,CAC3C,CAAC;AACJ,CAAC;AAOD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAmB,EACnB,OAAyB,EACzB,UAA6B,EAAE;IAE/B,IAAI,MAAM,CAAC,qBAAqB,EAAE,EAAE,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;IAC3C,IAAI,OAAO,CAAC,UAAU,KAAK,MAAM;QAAE,OAAO,SAAS,CAAC;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,IAAI,GAAG,uBAAuB,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC3C,OAAO,CAAC,MAAM,CACZ,GAAG,IAAI,8EAA8E;YACnF,mFAAmF;YACnF,gDAAgD,CACnD,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Repositories } from '../db/index.js';
|
|
2
|
+
import { type StoreLocation } from './store.js';
|
|
2
3
|
export interface WorkspaceIdentity {
|
|
3
4
|
workspaceId: string;
|
|
4
5
|
repoRoot: string;
|
|
@@ -12,7 +13,9 @@ export interface WorkspaceSelection extends WorkspaceIdentity {
|
|
|
12
13
|
}
|
|
13
14
|
export interface WorkspaceManagerOptions {
|
|
14
15
|
allowedRoots?: readonly string[];
|
|
15
|
-
open?: (databaseFilename: string) => Repositories;
|
|
16
|
+
open?: (databaseFilename: string, project: string) => Repositories;
|
|
17
|
+
/** Where a root's state lives; the repository's own store unless global mode applies. */
|
|
18
|
+
resolveStore?: (repoRoot: string) => StoreLocation;
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
21
|
* Open and route Concord workspaces within one MCP server process.
|
|
@@ -25,6 +28,15 @@ export declare class WorkspaceManager {
|
|
|
25
28
|
constructor(initialRoot: string, options?: WorkspaceManagerOptions);
|
|
26
29
|
/** Build a manager using the optional path-delimited environment allowlist. */
|
|
27
30
|
static fromEnvironment(initialRoot: string, env: NodeJS.ProcessEnv, options?: Omit<WorkspaceManagerOptions, 'allowedRoots'>): WorkspaceManager;
|
|
31
|
+
/** How many times a workspace has been chosen, by a tool call or a join. */
|
|
32
|
+
get selections(): number;
|
|
33
|
+
/**
|
|
34
|
+
* The active workspace's root without throwing: undefined once refused.
|
|
35
|
+
* For diagnostics such as telemetry, which must never block a reply.
|
|
36
|
+
*/
|
|
37
|
+
get activeRoot(): string | undefined;
|
|
38
|
+
/** Refuse every operation from now on, with `reason` as the error. */
|
|
39
|
+
refuse(reason: string): void;
|
|
28
40
|
/** The active/default context used when an operation omits `workspace_id`. */
|
|
29
41
|
current(): WorkspaceContext;
|
|
30
42
|
/** Validate, open (once), and make a repository root active. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { delimiter } from 'node:path';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveExplicitRepoRoot, workspaceIdForRoot, workspaceRootFromId, } from '../config/paths.js';
|
|
3
3
|
import { openRepositories } from '../db/index.js';
|
|
4
|
+
import { resolveStore } from './store.js';
|
|
4
5
|
/**
|
|
5
6
|
* Open and route Concord workspaces within one MCP server process.
|
|
6
7
|
*
|
|
@@ -11,9 +12,13 @@ export class WorkspaceManager {
|
|
|
11
12
|
#contexts = new Map();
|
|
12
13
|
#allowedRoots;
|
|
13
14
|
#open;
|
|
15
|
+
#resolveStore;
|
|
14
16
|
#activeWorkspaceId;
|
|
17
|
+
#selections = 0;
|
|
18
|
+
#refusal;
|
|
15
19
|
constructor(initialRoot, options = {}) {
|
|
16
20
|
this.#open = options.open ?? openRepositories;
|
|
21
|
+
this.#resolveStore = options.resolveStore ?? ((root) => resolveStore(root, process.env));
|
|
17
22
|
this.#allowedRoots =
|
|
18
23
|
options.allowedRoots === undefined
|
|
19
24
|
? undefined
|
|
@@ -30,10 +35,30 @@ export class WorkspaceManager {
|
|
|
30
35
|
.split(delimiter)
|
|
31
36
|
.map((root) => root.trim())
|
|
32
37
|
.filter((root) => root !== '');
|
|
33
|
-
|
|
38
|
+
const withStore = { resolveStore: (root) => resolveStore(root, env), ...options };
|
|
39
|
+
return new WorkspaceManager(initialRoot, allowedRoots === undefined ? withStore : { ...withStore, allowedRoots });
|
|
40
|
+
}
|
|
41
|
+
/** How many times a workspace has been chosen, by a tool call or a join. */
|
|
42
|
+
get selections() {
|
|
43
|
+
return this.#selections;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The active workspace's root without throwing: undefined once refused.
|
|
47
|
+
* For diagnostics such as telemetry, which must never block a reply.
|
|
48
|
+
*/
|
|
49
|
+
get activeRoot() {
|
|
50
|
+
if (this.#refusal !== undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
return this.#contexts.get(this.#activeWorkspaceId)?.repoRoot;
|
|
53
|
+
}
|
|
54
|
+
/** Refuse every operation from now on, with `reason` as the error. */
|
|
55
|
+
refuse(reason) {
|
|
56
|
+
this.#refusal = reason;
|
|
34
57
|
}
|
|
35
58
|
/** The active/default context used when an operation omits `workspace_id`. */
|
|
36
59
|
current() {
|
|
60
|
+
if (this.#refusal !== undefined)
|
|
61
|
+
throw new Error(this.#refusal);
|
|
37
62
|
const context = this.#contexts.get(this.#activeWorkspaceId);
|
|
38
63
|
if (context === undefined) {
|
|
39
64
|
throw new Error('Concord has no active workspace.');
|
|
@@ -42,17 +67,19 @@ export class WorkspaceManager {
|
|
|
42
67
|
}
|
|
43
68
|
/** Validate, open (once), and make a repository root active. */
|
|
44
69
|
join(root) {
|
|
70
|
+
this.#selections += 1;
|
|
45
71
|
const repoRoot = resolveExplicitRepoRoot(root);
|
|
46
72
|
this.#assertAllowed(repoRoot);
|
|
47
73
|
const workspaceId = workspaceIdForRoot(repoRoot);
|
|
48
74
|
let context = this.#contexts.get(workspaceId);
|
|
49
75
|
const firstOpen = context === undefined;
|
|
50
76
|
if (context === undefined) {
|
|
77
|
+
const store = this.#resolveStore(repoRoot);
|
|
51
78
|
context = {
|
|
52
79
|
workspaceId,
|
|
53
80
|
repoRoot,
|
|
54
|
-
concordPath:
|
|
55
|
-
repos: this.#open(databasePath
|
|
81
|
+
concordPath: store.concordPath,
|
|
82
|
+
repos: this.#open(store.databasePath, store.project),
|
|
56
83
|
};
|
|
57
84
|
this.#contexts.set(workspaceId, context);
|
|
58
85
|
}
|
|
@@ -64,6 +91,7 @@ export class WorkspaceManager {
|
|
|
64
91
|
* the current selection for backward-compatible clients.
|
|
65
92
|
*/
|
|
66
93
|
select(workspaceId) {
|
|
94
|
+
this.#selections += 1;
|
|
67
95
|
if (workspaceId === undefined) {
|
|
68
96
|
return this.current();
|
|
69
97
|
}
|
|
@@ -92,6 +120,9 @@ export function routedRepositories(manager) {
|
|
|
92
120
|
get db() {
|
|
93
121
|
return manager.current().repos.db;
|
|
94
122
|
},
|
|
123
|
+
get project() {
|
|
124
|
+
return manager.current().repos.project;
|
|
125
|
+
},
|
|
95
126
|
get tasks() {
|
|
96
127
|
return manager.current().repos.tasks;
|
|
97
128
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/workspaces/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/workspaces/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AAuB9D;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAClB,SAAS,GAAG,IAAI,GAAG,EAA4B,CAAC;IAChD,a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aAAa;YACf,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project for work outside any repository, named as Concord Cloud names
|
|
3
|
+
* it (`GENERAL_WORKSPACE`), so instructions mean the same thing against both.
|
|
4
|
+
*/
|
|
5
|
+
export declare const GENERAL_PROJECT = "general";
|
|
6
|
+
/** Where a workspace's state lives. */
|
|
7
|
+
export interface StoreLocation {
|
|
8
|
+
/** `local`: the repository's own `.concord/`; `global`: the machine-wide store. */
|
|
9
|
+
readonly kind: 'local' | 'global';
|
|
10
|
+
readonly databasePath: string;
|
|
11
|
+
/** Where its human-readable artifacts are written. */
|
|
12
|
+
readonly concordPath: string;
|
|
13
|
+
/** The workspace's project inside the database. */
|
|
14
|
+
readonly project: string;
|
|
15
|
+
}
|
|
16
|
+
export type OriginRemote = (repoRoot: string) => string | undefined;
|
|
17
|
+
/** The repository's `origin` URL as git reports it, if it has one. */
|
|
18
|
+
export declare function gitOriginRemote(repoRoot: string): string | undefined;
|
|
19
|
+
/** The repository's own `.concord/` store, created on first use. */
|
|
20
|
+
export declare function localStore(repoRoot: string): StoreLocation;
|
|
21
|
+
/**
|
|
22
|
+
* A workspace's project in the machine-wide store. A repository is named by
|
|
23
|
+
* its git remote, as Concord Cloud names it, so every clone shares one project;
|
|
24
|
+
* one with no remote by its path. Anything outside a repository is `general`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function globalProjectKey(repoRoot: string, originRemote: OriginRemote): string;
|
|
27
|
+
/** Whether a workspace root is a git repository (or a linked worktree of one). */
|
|
28
|
+
export declare function isRepository(root: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A repository's project as Concord Cloud names it — its normalised `origin`,
|
|
31
|
+
* which every clone shares — or undefined when it has none. Shared by the
|
|
32
|
+
* machine-wide store and the cloud default, so the two never name it apart.
|
|
33
|
+
*/
|
|
34
|
+
export declare function repositoryProjectKey(repoRoot: string, originRemote: OriginRemote): string | undefined;
|
|
35
|
+
/** A readable directory name for a project's artifacts, unique by its hash. */
|
|
36
|
+
export declare function artifactDirName(project: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Choose the store for a workspace root. A repository that was set up keeps
|
|
39
|
+
* everything in its own `.concord/`, messages and roster included. Otherwise,
|
|
40
|
+
* when the user turned on global mode, the workspace is a project in the
|
|
41
|
+
* machine-wide store, so nothing is written into the repository. Without global
|
|
42
|
+
* mode the repository's own store is created, as it always has been.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveStore(repoRoot: string, env: NodeJS.ProcessEnv, originRemote?: OriginRemote): StoreLocation;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { concordDir, databasePath } from '../config/paths.js';
|
|
6
|
+
import { globalDatabasePath, readUserConfig, userConcordDir } from '../config/user-config.js';
|
|
7
|
+
import { LOCAL_PROJECT } from '../db/index.js';
|
|
8
|
+
import { normalizeProjectKey } from '../domain/project-key.js';
|
|
9
|
+
/**
|
|
10
|
+
* The project for work outside any repository, named as Concord Cloud names
|
|
11
|
+
* it (`GENERAL_WORKSPACE`), so instructions mean the same thing against both.
|
|
12
|
+
*/
|
|
13
|
+
export const GENERAL_PROJECT = 'general';
|
|
14
|
+
/** The repository's `origin` URL as git reports it, if it has one. */
|
|
15
|
+
export function gitOriginRemote(repoRoot) {
|
|
16
|
+
const result = spawnSync('git', ['-C', repoRoot, 'remote', 'get-url', 'origin'], {
|
|
17
|
+
encoding: 'utf8',
|
|
18
|
+
});
|
|
19
|
+
const url = result.status === 0 ? result.stdout.trim() : '';
|
|
20
|
+
return url === '' ? undefined : url;
|
|
21
|
+
}
|
|
22
|
+
/** The repository's own `.concord/` store, created on first use. */
|
|
23
|
+
export function localStore(repoRoot) {
|
|
24
|
+
return {
|
|
25
|
+
kind: 'local',
|
|
26
|
+
databasePath: databasePath(repoRoot),
|
|
27
|
+
concordPath: concordDir(repoRoot),
|
|
28
|
+
project: LOCAL_PROJECT,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A workspace's project in the machine-wide store. A repository is named by
|
|
33
|
+
* its git remote, as Concord Cloud names it, so every clone shares one project;
|
|
34
|
+
* one with no remote by its path. Anything outside a repository is `general`.
|
|
35
|
+
*/
|
|
36
|
+
export function globalProjectKey(repoRoot, originRemote) {
|
|
37
|
+
if (!isRepository(repoRoot))
|
|
38
|
+
return GENERAL_PROJECT;
|
|
39
|
+
return repositoryProjectKey(repoRoot, originRemote) ?? repoRoot;
|
|
40
|
+
}
|
|
41
|
+
/** Whether a workspace root is a git repository (or a linked worktree of one). */
|
|
42
|
+
export function isRepository(root) {
|
|
43
|
+
return existsSync(join(root, '.git'));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A repository's project as Concord Cloud names it — its normalised `origin`,
|
|
47
|
+
* which every clone shares — or undefined when it has none. Shared by the
|
|
48
|
+
* machine-wide store and the cloud default, so the two never name it apart.
|
|
49
|
+
*/
|
|
50
|
+
export function repositoryProjectKey(repoRoot, originRemote) {
|
|
51
|
+
const remote = originRemote(repoRoot);
|
|
52
|
+
return (remote === undefined ? null : normalizeProjectKey(remote)) ?? undefined;
|
|
53
|
+
}
|
|
54
|
+
/** Characters of the project key kept in its directory name, well under any name limit. */
|
|
55
|
+
const READABLE_NAME_LENGTH = 64;
|
|
56
|
+
/** A readable directory name for a project's artifacts, unique by its hash. */
|
|
57
|
+
export function artifactDirName(project) {
|
|
58
|
+
const readable = project
|
|
59
|
+
.replace(/[^a-z0-9._-]+/giu, '-')
|
|
60
|
+
.slice(-READABLE_NAME_LENGTH)
|
|
61
|
+
.replace(/^-+|-+$/gu, '');
|
|
62
|
+
const hash = createHash('sha256').update(project).digest('hex').slice(0, 8);
|
|
63
|
+
return `${readable === '' ? 'project' : readable}-${hash}`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Choose the store for a workspace root. A repository that was set up keeps
|
|
67
|
+
* everything in its own `.concord/`, messages and roster included. Otherwise,
|
|
68
|
+
* when the user turned on global mode, the workspace is a project in the
|
|
69
|
+
* machine-wide store, so nothing is written into the repository. Without global
|
|
70
|
+
* mode the repository's own store is created, as it always has been.
|
|
71
|
+
*/
|
|
72
|
+
export function resolveStore(repoRoot, env, originRemote = gitOriginRemote) {
|
|
73
|
+
if (existsSync(databasePath(repoRoot)) || readUserConfig(env).globalMode !== true) {
|
|
74
|
+
return localStore(repoRoot);
|
|
75
|
+
}
|
|
76
|
+
const project = globalProjectKey(repoRoot, originRemote);
|
|
77
|
+
return {
|
|
78
|
+
kind: 'global',
|
|
79
|
+
databasePath: globalDatabasePath(env),
|
|
80
|
+
concordPath: join(userConcordDir(env), 'projects', artifactDirName(project)),
|
|
81
|
+
project,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/workspaces/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAA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AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -63,6 +63,35 @@ function inboxStatus(root) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The workspace id and, for a repository in the machine-wide store, the
|
|
68
|
+
* instructions it has no rule file for. Undefined from a CLI too old to say.
|
|
69
|
+
*/
|
|
70
|
+
function workspaceStatus(root) {
|
|
71
|
+
try {
|
|
72
|
+
return JSON.parse(runConcord(root, ['inbox', 'status', '--json'], true));
|
|
73
|
+
} catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function sessionContext(agentId, status) {
|
|
79
|
+
// A user-level Cursor server may run far from this folder; the id routes it.
|
|
80
|
+
const workspace =
|
|
81
|
+
typeof status?.workspace_id === 'string'
|
|
82
|
+
? ` Pass workspace_id "${status.workspace_id}" to Concord tools so they act on this ` +
|
|
83
|
+
`folder.`
|
|
84
|
+
: '';
|
|
85
|
+
const instructions = typeof status?.instructions === 'string' ? `\n\n${status.instructions}` : '';
|
|
86
|
+
return (
|
|
87
|
+
`Concord: this Cursor session is agent ${agentId}.${workspace} To receive peer messages ` +
|
|
88
|
+
`while idle, start exactly one Cursor background Shell task with: ` +
|
|
89
|
+
`concord inbox watch --provider cursor --once. Leave it active when the turn ends so ` +
|
|
90
|
+
`Cursor's background-task completion resumes you. When it completes, answer the emitted ` +
|
|
91
|
+
`peer message, then immediately start a fresh monitor.${instructions}`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
66
95
|
function register(root, agentId) {
|
|
67
96
|
runConcord(root, ['inbox', 'register', '--agent', agentId, '--provider', 'cursor']);
|
|
68
97
|
}
|
|
@@ -100,12 +129,7 @@ async function main() {
|
|
|
100
129
|
register(root, agentId);
|
|
101
130
|
writeResult({
|
|
102
131
|
env: { CONCORD_AGENT_ID: agentId },
|
|
103
|
-
additional_context:
|
|
104
|
-
`Concord: this Cursor session is agent ${agentId}. To receive peer messages while ` +
|
|
105
|
-
`idle, start exactly one Cursor background Shell task with: ` +
|
|
106
|
-
`concord inbox watch --provider cursor --once. Leave it active when the turn ends so ` +
|
|
107
|
-
`Cursor's background-task completion resumes you. When it completes, answer the emitted ` +
|
|
108
|
-
`peer message, then immediately start a fresh monitor.`,
|
|
132
|
+
additional_context: sessionContext(agentId, workspaceStatus(root)),
|
|
109
133
|
});
|
|
110
134
|
return;
|
|
111
135
|
}
|