ctxpipe 0.1.0-alpha.0 → 0.1.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/LICENSE +21 -0
- package/README.md +39 -0
- package/bin/ctxpipe.js +6 -42
- package/dist/auth.d.ts +34 -0
- package/dist/auth.js +324 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +39 -0
- package/dist/commands.js +252 -0
- package/dist/commands.js.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +19 -0
- package/dist/constants.js.map +1 -0
- package/dist/fs-operations.d.ts +16 -0
- package/dist/fs-operations.js +42 -0
- package/dist/fs-operations.js.map +1 -0
- package/dist/mcp/json.d.ts +3 -0
- package/dist/mcp/json.js +15 -0
- package/dist/mcp/json.js.map +1 -0
- package/dist/mcp/mcp-operations.d.ts +63 -0
- package/dist/mcp/mcp-operations.js +195 -0
- package/dist/mcp/mcp-operations.js.map +1 -0
- package/dist/mcp/paths.d.ts +7 -0
- package/dist/mcp/paths.js +17 -0
- package/dist/mcp/paths.js.map +1 -0
- package/dist/program.d.ts +1 -0
- package/dist/program.js +125 -0
- package/dist/program.js.map +1 -0
- package/dist/prompts.d.ts +27 -0
- package/dist/prompts.js +200 -0
- package/dist/prompts.js.map +1 -0
- package/dist/system.d.ts +3 -0
- package/dist/system.js +27 -0
- package/dist/system.js.map +1 -0
- package/dist/ui.d.ts +20 -0
- package/dist/ui.js +108 -0
- package/dist/ui.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/package.json +24 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function relativePath(path: string, cwd: string): string;
|
|
2
|
+
export declare function normalizeBaseUrl(value: string): string;
|
|
3
|
+
export declare function mcpUrl({ baseUrl, org }: {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
org: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function scopesFor(scope: "repo" | "user" | "both"): Array<"repo" | "user">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function relativePath(path, cwd) {
|
|
2
|
+
return path.startsWith(cwd) ? path.slice(cwd.length + 1) : path;
|
|
3
|
+
}
|
|
4
|
+
export function normalizeBaseUrl(value) {
|
|
5
|
+
return value.replace(/\/+$/, "");
|
|
6
|
+
}
|
|
7
|
+
export function mcpUrl({ baseUrl, org }) {
|
|
8
|
+
const url = new URL("/mcp", normalizeBaseUrl(baseUrl));
|
|
9
|
+
url.searchParams.set("orgSlug", org);
|
|
10
|
+
return url.toString();
|
|
11
|
+
}
|
|
12
|
+
export function scopesFor(scope) {
|
|
13
|
+
if (scope === "both")
|
|
14
|
+
return ["repo", "user"];
|
|
15
|
+
return [scope];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/mcp/paths.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,EAAoC;IACvE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAA;IACtD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;IACpC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAA;AACvB,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAA+B;IACvD,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,OAAO,CAAC,KAAK,CAAC,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runProgram(argv: string[]): Promise<void>;
|
package/dist/program.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { DEFAULT_BASE_URL } from "./constants.js";
|
|
3
|
+
import { packageVersion } from "./version.js";
|
|
4
|
+
import { runAuthLogin, runAuthLogout, runAuthWhoami, runDoctor, runInit, runMcpAdd, } from "./commands.js";
|
|
5
|
+
function collectList(value, previous) {
|
|
6
|
+
return [
|
|
7
|
+
...previous,
|
|
8
|
+
...value
|
|
9
|
+
.split(",")
|
|
10
|
+
.map((part) => part.trim())
|
|
11
|
+
.filter(Boolean),
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
export async function runProgram(argv) {
|
|
15
|
+
const program = new Command()
|
|
16
|
+
.name("ctxpipe")
|
|
17
|
+
.description("Initialize repos and connect ctx| MCP to your agents.")
|
|
18
|
+
.version(packageVersion, "-V, --version", "output the version number")
|
|
19
|
+
.addHelpText("after", `
|
|
20
|
+
Human setup:
|
|
21
|
+
npx ctxpipe init
|
|
22
|
+
|
|
23
|
+
Examples (non-interactive):
|
|
24
|
+
npx ctxpipe init --org acme --agents codex,claude --scope repo --yes
|
|
25
|
+
npx ctxpipe mcp add --org acme --client cursor --scope repo --yes
|
|
26
|
+
npx ctxpipe doctor --json
|
|
27
|
+
`);
|
|
28
|
+
program
|
|
29
|
+
.command("init")
|
|
30
|
+
.description("Initialize the current repo (or user scope) for ctx|. Writes .ctxpipe/config.json and optional MCP client configs.")
|
|
31
|
+
.option("--org <slug>", "ctx| organization slug (required when not interactive)")
|
|
32
|
+
.option("--base-url <url>", `ctx| app origin for auth and MCP (default: ${DEFAULT_BASE_URL})`, DEFAULT_BASE_URL)
|
|
33
|
+
.option("--scope <repo|user|both>", "Where to apply setup: this repo, your user account, or both (required when not interactive)")
|
|
34
|
+
.option("--agents <names>", "Comma-separated client ids (cursor, claude, codex, opencode, vscode). Repeatable; merged with --agent and --client.", collectList, [])
|
|
35
|
+
.option("--agent <names>", "Alias for --agents (same comma-separated / repeatable rules).", collectList, [])
|
|
36
|
+
.option("--client <names>", "Alias for --agents (same comma-separated / repeatable rules).", collectList, [])
|
|
37
|
+
.option("--dry-run", "Print planned changes without writing files", false)
|
|
38
|
+
.option("--json", "Print machine-readable JSON (use with --yes to apply; init only for apply summary)", false)
|
|
39
|
+
.option("-y, --yes", "Do not prompt; required for non-interactive apply", false)
|
|
40
|
+
.option("--no-mcp", "Skip MCP client configuration (still writes .ctxpipe/config.json with org and MCP URL)")
|
|
41
|
+
.action(async (rawOpts) => {
|
|
42
|
+
const opts = rawOpts;
|
|
43
|
+
const agents = [
|
|
44
|
+
...(opts.agents ?? []),
|
|
45
|
+
...(opts.agent ?? []),
|
|
46
|
+
...(opts.client ?? []),
|
|
47
|
+
];
|
|
48
|
+
await runInit({
|
|
49
|
+
baseUrl: opts.baseUrl,
|
|
50
|
+
org: opts.org,
|
|
51
|
+
scope: opts.scope,
|
|
52
|
+
agents,
|
|
53
|
+
dryRun: opts.dryRun,
|
|
54
|
+
json: opts.json,
|
|
55
|
+
yes: opts.yes,
|
|
56
|
+
mcp: opts.mcp,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
program
|
|
60
|
+
.command("doctor")
|
|
61
|
+
.description("Print environment diagnostics (Node version, cwd, detected client CLIs).")
|
|
62
|
+
.option("--json", "Print diagnostics as JSON", false)
|
|
63
|
+
.action((rawOpts) => {
|
|
64
|
+
const opts = rawOpts;
|
|
65
|
+
runDoctor({ json: opts.json });
|
|
66
|
+
});
|
|
67
|
+
const mcp = program.command("mcp").description("MCP-only commands for ctx|.");
|
|
68
|
+
mcp
|
|
69
|
+
.command("add")
|
|
70
|
+
.description("Configure ctx| MCP for one or more clients without re-running full init.")
|
|
71
|
+
.option("--org <slug>", "ctx| organization slug (required when not interactive)")
|
|
72
|
+
.option("--base-url <url>", `ctx| app origin for MCP URL (default: ${DEFAULT_BASE_URL})`, DEFAULT_BASE_URL)
|
|
73
|
+
.option("--scope <repo|user|both>", "Where to write MCP config: repo, user, or both (required when not interactive)")
|
|
74
|
+
.option("--client <names>", "Comma-separated client ids. Repeatable; merged with --clients.", collectList, [])
|
|
75
|
+
.option("--clients <names>", "Alias for --client (same comma-separated / repeatable rules).", collectList, [])
|
|
76
|
+
.option("--dry-run", "Print planned changes without writing files", false)
|
|
77
|
+
.option("--json", "Print machine-readable JSON (use with --yes to apply)", false)
|
|
78
|
+
.option("-y, --yes", "Do not prompt; required for non-interactive apply", false)
|
|
79
|
+
.action(async (rawOpts) => {
|
|
80
|
+
const opts = rawOpts;
|
|
81
|
+
const clients = [...(opts.client ?? []), ...(opts.clients ?? [])];
|
|
82
|
+
await runMcpAdd({
|
|
83
|
+
baseUrl: opts.baseUrl,
|
|
84
|
+
org: opts.org,
|
|
85
|
+
scope: opts.scope,
|
|
86
|
+
clients,
|
|
87
|
+
dryRun: opts.dryRun,
|
|
88
|
+
json: opts.json,
|
|
89
|
+
yes: opts.yes,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
const auth = program.command("auth").description("Setup sign-in for listing organizations (separate from MCP OAuth).");
|
|
93
|
+
auth
|
|
94
|
+
.command("login")
|
|
95
|
+
.description("Sign in with a browser/device code and store credentials for setup commands.")
|
|
96
|
+
.option("--base-url <url>", `ctx| app origin for auth (default: ${DEFAULT_BASE_URL})`, DEFAULT_BASE_URL)
|
|
97
|
+
.action(async (rawOpts) => {
|
|
98
|
+
const opts = rawOpts;
|
|
99
|
+
await runAuthLogin({ baseUrl: opts.baseUrl });
|
|
100
|
+
});
|
|
101
|
+
auth
|
|
102
|
+
.command("whoami")
|
|
103
|
+
.description("Show whether you are signed in for setup and which user the server reports.")
|
|
104
|
+
.option("--base-url <url>", `ctx| app origin (default: ${DEFAULT_BASE_URL})`, DEFAULT_BASE_URL)
|
|
105
|
+
.option("--json", "Print status as JSON", false)
|
|
106
|
+
.action(async (rawOpts) => {
|
|
107
|
+
const opts = rawOpts;
|
|
108
|
+
await runAuthWhoami({ baseUrl: opts.baseUrl, json: opts.json });
|
|
109
|
+
});
|
|
110
|
+
auth
|
|
111
|
+
.command("logout")
|
|
112
|
+
.description("Remove locally stored setup credentials for this base URL.")
|
|
113
|
+
.option("--base-url <url>", `ctx| app origin (default: ${DEFAULT_BASE_URL})`, DEFAULT_BASE_URL)
|
|
114
|
+
.option("--json", "Print status as JSON", false)
|
|
115
|
+
.action(async (rawOpts) => {
|
|
116
|
+
const opts = rawOpts;
|
|
117
|
+
await runAuthLogout({ baseUrl: opts.baseUrl, json: opts.json });
|
|
118
|
+
});
|
|
119
|
+
if (argv.length === 0) {
|
|
120
|
+
program.outputHelp();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
await program.parseAsync(argv, { from: "user" });
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,SAAS,WAAW,CAAC,KAAa,EAAE,QAAkB;IACpD,OAAO;QACL,GAAG,QAAQ;QACX,GAAG,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,6BAA6B,gBAAgB,GAAG,EAChD,gBAAgB,CACjB;SACA,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,KAAK,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,OAAgC,EAAE,EAAE;QACjD,MAAM,IAAI,GAAG,OAA6C,CAAA;QAC1D,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IAEJ,IAAI;SACD,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CACL,kBAAkB,EAClB,6BAA6B,gBAAgB,GAAG,EAChD,gBAAgB,CACjB;SACA,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,KAAK,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,OAAgC,EAAE,EAAE;QACjD,MAAM,IAAI,GAAG,OAA6C,CAAA;QAC1D,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IAEJ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,UAAU,EAAE,CAAA;QACpB,OAAM;IACR,CAAC;IAED,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Client } from "./constants.js";
|
|
2
|
+
export type InitPromptState = {
|
|
3
|
+
org: string | null;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
agents: string[];
|
|
6
|
+
scope: string | null;
|
|
7
|
+
mcp: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type InitPromptAnswers = {
|
|
10
|
+
org?: string;
|
|
11
|
+
scope?: "repo" | "user" | "both";
|
|
12
|
+
agents?: Client[];
|
|
13
|
+
};
|
|
14
|
+
export type McpPromptState = {
|
|
15
|
+
org: string | null;
|
|
16
|
+
clients: string[];
|
|
17
|
+
scope: string | null;
|
|
18
|
+
};
|
|
19
|
+
export type McpPromptAnswers = {
|
|
20
|
+
org?: string;
|
|
21
|
+
scope?: "repo" | "user" | "both";
|
|
22
|
+
clients?: Client[];
|
|
23
|
+
};
|
|
24
|
+
export declare function promptInitWizard(current: InitPromptState): Promise<InitPromptAnswers>;
|
|
25
|
+
export declare function promptMcpWizard(current: McpPromptState): Promise<McpPromptAnswers>;
|
|
26
|
+
export declare function detectDefaultOrgSlug(): string | undefined;
|
|
27
|
+
export declare function promptConfirm(message: string, initial: boolean): Promise<boolean>;
|
package/dist/prompts.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { confirm as confirmPrompt, isCancel, log, multiselect, select, spinner, text, } from "@clack/prompts";
|
|
3
|
+
import { CLIENT_COMMANDS, CLIENT_LABELS, CLIENTS } from "./constants.js";
|
|
4
|
+
import { fetchOrganizations, fetchSession, loginWithDeviceFlow, orgLabel, readStoredAuth, userLabel, } from "./auth.js";
|
|
5
|
+
import { readJsonObject } from "./fs-operations.js";
|
|
6
|
+
import { commandExists } from "./system.js";
|
|
7
|
+
import { muted, printWizardHeader } from "./ui.js";
|
|
8
|
+
export async function promptInitWizard(current) {
|
|
9
|
+
printWizardHeader();
|
|
10
|
+
const answers = {};
|
|
11
|
+
if (!current.org) {
|
|
12
|
+
answers.org = await promptSetupOrg(current.baseUrl);
|
|
13
|
+
}
|
|
14
|
+
if (!current.scope) {
|
|
15
|
+
answers.scope = await promptSelect({
|
|
16
|
+
message: "Where should ctxpipe apply setup?",
|
|
17
|
+
initial: "repo",
|
|
18
|
+
choices: [
|
|
19
|
+
{
|
|
20
|
+
title: "This repo",
|
|
21
|
+
value: "repo",
|
|
22
|
+
description: "Write project files such as .ctxpipe/config.json and MCP config.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "Globally",
|
|
26
|
+
value: "user",
|
|
27
|
+
description: "Configure supported clients for your whole machine when possible.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: "Both",
|
|
31
|
+
value: "both",
|
|
32
|
+
description: "Set up this repo and your user-level client config.",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (current.mcp && current.agents.length === 0) {
|
|
38
|
+
answers.agents = await promptAgents();
|
|
39
|
+
}
|
|
40
|
+
return answers;
|
|
41
|
+
}
|
|
42
|
+
async function promptSetupOrg(baseUrl) {
|
|
43
|
+
const fallbackOrg = detectDefaultOrgSlug();
|
|
44
|
+
let auth = await readStoredAuth(baseUrl);
|
|
45
|
+
let orgs = [];
|
|
46
|
+
let session = null;
|
|
47
|
+
if (auth) {
|
|
48
|
+
const sessionSpinner = spinner();
|
|
49
|
+
sessionSpinner.start("Checking existing ctx| session");
|
|
50
|
+
try {
|
|
51
|
+
;
|
|
52
|
+
[orgs, session] = await Promise.all([
|
|
53
|
+
fetchOrganizations({ baseUrl, accessToken: auth.accessToken }).catch(() => []),
|
|
54
|
+
fetchSession({ baseUrl, accessToken: auth.accessToken }).catch(() => null),
|
|
55
|
+
]);
|
|
56
|
+
sessionSpinner.stop(orgs.length > 0 ? "Loaded ctx| organizations" : "Sign-in required");
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
sessionSpinner.stop("Could not check saved sign-in");
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (orgs.length === 0) {
|
|
64
|
+
log.step("Sign in");
|
|
65
|
+
log.message(muted("Sign in to ctx| so we can load your organizations."));
|
|
66
|
+
auth = await loginWithDeviceFlow({ baseUrl });
|
|
67
|
+
const orgSpinner = spinner();
|
|
68
|
+
orgSpinner.start("Loading ctx| organizations");
|
|
69
|
+
try {
|
|
70
|
+
;
|
|
71
|
+
[orgs, session] = await Promise.all([
|
|
72
|
+
fetchOrganizations({ baseUrl, accessToken: auth.accessToken }),
|
|
73
|
+
fetchSession({ baseUrl, accessToken: auth.accessToken }).catch(() => null),
|
|
74
|
+
]);
|
|
75
|
+
orgSpinner.stop("Loaded ctx| organizations");
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
orgSpinner.stop("Could not load ctx| organizations");
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const label = userLabel(session);
|
|
83
|
+
if (label) {
|
|
84
|
+
log.success(`Signed in as ${label}.`);
|
|
85
|
+
}
|
|
86
|
+
if (orgs.length === 1) {
|
|
87
|
+
const org = orgs[0];
|
|
88
|
+
if (!org)
|
|
89
|
+
throw new Error("Could not load ctx| organization");
|
|
90
|
+
log.step("Organization");
|
|
91
|
+
log.message(orgLabel(org));
|
|
92
|
+
return org.slug;
|
|
93
|
+
}
|
|
94
|
+
if (orgs.length > 1) {
|
|
95
|
+
return promptSelect({
|
|
96
|
+
message: "Which ctx| organization should this repo use?",
|
|
97
|
+
initial: fallbackOrg ?? orgs[0]?.slug,
|
|
98
|
+
choices: orgs.map((org) => ({
|
|
99
|
+
title: orgLabel(org),
|
|
100
|
+
value: org.slug,
|
|
101
|
+
description: org.slug,
|
|
102
|
+
})),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return promptText({
|
|
106
|
+
message: "Which ctx| organization should this repo use?",
|
|
107
|
+
initial: fallbackOrg,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
export async function promptMcpWizard(current) {
|
|
111
|
+
printWizardHeader();
|
|
112
|
+
log.step("MCP");
|
|
113
|
+
log.message(muted("Choose the clients ctxpipe should configure for this machine or repo."));
|
|
114
|
+
const answers = {};
|
|
115
|
+
if (!current.org) {
|
|
116
|
+
answers.org = await promptText({
|
|
117
|
+
message: "Which ctx| organization should this MCP server use?",
|
|
118
|
+
initial: detectDefaultOrgSlug(),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (!current.scope) {
|
|
122
|
+
answers.scope = await promptSelect({
|
|
123
|
+
message: "Where should ctxpipe configure MCP?",
|
|
124
|
+
initial: "repo",
|
|
125
|
+
choices: [
|
|
126
|
+
{ title: "This repo", value: "repo" },
|
|
127
|
+
{ title: "Globally", value: "user" },
|
|
128
|
+
{ title: "Both", value: "both" },
|
|
129
|
+
],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (current.clients.length === 0) {
|
|
133
|
+
answers.clients = await promptAgents();
|
|
134
|
+
}
|
|
135
|
+
return answers;
|
|
136
|
+
}
|
|
137
|
+
async function promptAgents() {
|
|
138
|
+
const detectSpinner = spinner();
|
|
139
|
+
detectSpinner.start("Detecting installed agents");
|
|
140
|
+
const detected = CLIENTS.filter((client) => commandExists(CLIENT_COMMANDS[client]));
|
|
141
|
+
detectSpinner.stop(detected.length > 0
|
|
142
|
+
? `Detected ${detected.length} agent${detected.length === 1 ? "" : "s"}`
|
|
143
|
+
: "No supported agents detected");
|
|
144
|
+
const agents = await multiselect({
|
|
145
|
+
message: "Which agents should use ctx|?",
|
|
146
|
+
required: true,
|
|
147
|
+
initialValues: detected,
|
|
148
|
+
options: CLIENTS.map((client) => ({
|
|
149
|
+
label: CLIENT_LABELS[client],
|
|
150
|
+
value: client,
|
|
151
|
+
hint: detected.includes(client)
|
|
152
|
+
? "Detected on this machine"
|
|
153
|
+
: "Not detected, but ctxpipe can still write project config",
|
|
154
|
+
})),
|
|
155
|
+
});
|
|
156
|
+
return promptValue(agents);
|
|
157
|
+
}
|
|
158
|
+
async function promptText({ message, initial, }) {
|
|
159
|
+
const answer = await text({
|
|
160
|
+
message,
|
|
161
|
+
initialValue: initial,
|
|
162
|
+
validate: (value) => (String(value).trim() ? undefined : "Required"),
|
|
163
|
+
});
|
|
164
|
+
return String(promptValue(answer)).trim();
|
|
165
|
+
}
|
|
166
|
+
export function detectDefaultOrgSlug() {
|
|
167
|
+
const existing = readJsonObject(resolve(process.cwd(), ".ctxpipe", "config.json"));
|
|
168
|
+
if (typeof existing.orgSlug === "string" && existing.orgSlug.trim()) {
|
|
169
|
+
return existing.orgSlug;
|
|
170
|
+
}
|
|
171
|
+
return process.env.CTXPIPE_ORG_SLUG || process.env.CTXPIPE_ORG || undefined;
|
|
172
|
+
}
|
|
173
|
+
async function promptSelect({ message, choices, initial, }) {
|
|
174
|
+
const answer = await select({
|
|
175
|
+
message,
|
|
176
|
+
initialValue: choices.some((choice) => choice.value === initial)
|
|
177
|
+
? initial
|
|
178
|
+
: choices[0]?.value,
|
|
179
|
+
options: choices.map((choice) => ({
|
|
180
|
+
label: choice.title,
|
|
181
|
+
value: choice.value,
|
|
182
|
+
hint: choice.description,
|
|
183
|
+
})),
|
|
184
|
+
});
|
|
185
|
+
return promptValue(answer);
|
|
186
|
+
}
|
|
187
|
+
export async function promptConfirm(message, initial) {
|
|
188
|
+
const answer = await confirmPrompt({
|
|
189
|
+
message,
|
|
190
|
+
initialValue: initial,
|
|
191
|
+
});
|
|
192
|
+
return promptValue(answer);
|
|
193
|
+
}
|
|
194
|
+
function promptValue(value) {
|
|
195
|
+
if (isCancel(value)) {
|
|
196
|
+
throw new Error("Setup cancelled");
|
|
197
|
+
}
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,QAAQ,EACR,GAAG,EACH,WAAW,EACX,MAAM,EACN,OAAO,EACP,IAAI,GACL,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAe,MAAM,gB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ACjC,OAAe,EACf,OAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;QACjC,OAAO;QACP,YAAY,EAAE,OAAO;KACtB,CAAC,CAAA;IACF,OAAO,WAAW,CAAC,MAAM,CAAY,CAAA;AACvC,CAAC;AAED,SAAS,WAAW,CAAI,KAAiB;IACvC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/dist/system.d.ts
ADDED
package/dist/system.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
export function commandExists(command) {
|
|
3
|
+
if (!command)
|
|
4
|
+
return false;
|
|
5
|
+
const result = spawnSync(command, ["--version"], {
|
|
6
|
+
encoding: "utf8",
|
|
7
|
+
stdio: "ignore",
|
|
8
|
+
});
|
|
9
|
+
if (result.error?.code === "ENOENT") {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return result.status === 0 || result.status === 1;
|
|
13
|
+
}
|
|
14
|
+
export function openBrowser(url) {
|
|
15
|
+
const platform = process.platform;
|
|
16
|
+
const command = platform === "darwin" ? "open" : platform === "win32" ? "cmd" : "xdg-open";
|
|
17
|
+
const args = platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
18
|
+
const result = spawnSync(command, args, {
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
stdio: "ignore",
|
|
21
|
+
});
|
|
22
|
+
return result.status === 0;
|
|
23
|
+
}
|
|
24
|
+
export function sleep(ms) {
|
|
25
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SA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ED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ApplyOperationResult } from "./fs-operations.js";
|
|
2
|
+
import type { Operation } from "./mcp/mcp-operations.js";
|
|
3
|
+
export declare function printWizardHeader(): void;
|
|
4
|
+
export declare function renderPixelLogo(): string;
|
|
5
|
+
export declare function brand(value: string): string;
|
|
6
|
+
export declare function brandName(): string;
|
|
7
|
+
export declare function muted(value: string): string;
|
|
8
|
+
export declare function stepLabel(value: string): string;
|
|
9
|
+
export declare function successText(value: string): string;
|
|
10
|
+
export declare function warnText(value: string): string;
|
|
11
|
+
export declare function pathText(value: string): string;
|
|
12
|
+
export declare function describeOperation(op: Operation): string;
|
|
13
|
+
export declare function describeAppliedItem(item: ApplyOperationResult): string;
|
|
14
|
+
export declare function writeResult(json: boolean, result: unknown): void;
|
|
15
|
+
export declare function printDoctorTable(data: {
|
|
16
|
+
version: string;
|
|
17
|
+
node: string;
|
|
18
|
+
cwd: string;
|
|
19
|
+
detectedClients: Record<string, boolean>;
|
|
20
|
+
}): void;
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { intro, log } from "@clack/prompts";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { CLIENT_LABELS, CLIENTS } from "./constants.js";
|
|
4
|
+
import { relativePath } from "./mcp/paths.js";
|
|
5
|
+
const teal = chalk.hex("#2dd4bf");
|
|
6
|
+
const PIXEL_MARK = `
|
|
7
|
+
░██
|
|
8
|
+
░██
|
|
9
|
+
░███████ ░████████ ░██ ░██
|
|
10
|
+
░██ ░██ ░██ ░██ ░██
|
|
11
|
+
░██ ░██ ░█████
|
|
12
|
+
░██ ░██ ░██ ░██ ░██
|
|
13
|
+
░███████ ░████ ░██ ░██
|
|
14
|
+
`;
|
|
15
|
+
const PIXEL_PIPE = `
|
|
16
|
+
░██
|
|
17
|
+
░██
|
|
18
|
+
░██
|
|
19
|
+
░██
|
|
20
|
+
░██
|
|
21
|
+
░██
|
|
22
|
+
░██
|
|
23
|
+
░██
|
|
24
|
+
░██
|
|
25
|
+
░██
|
|
26
|
+
`;
|
|
27
|
+
export function printWizardHeader() {
|
|
28
|
+
console.log("");
|
|
29
|
+
console.log(renderPixelLogo());
|
|
30
|
+
intro(`${brandName()} setup`);
|
|
31
|
+
log.message(`${muted("Connect your agents to")} ${brandName()}`);
|
|
32
|
+
}
|
|
33
|
+
export function renderPixelLogo() {
|
|
34
|
+
const markLines = PIXEL_MARK.split("\n").filter((line) => line.length > 0);
|
|
35
|
+
const pipeLines = PIXEL_PIPE.split("\n").filter((line) => line.length > 0);
|
|
36
|
+
const width = Math.max(...markLines.map((line) => line.length));
|
|
37
|
+
const height = Math.max(markLines.length, pipeLines.length);
|
|
38
|
+
return Array.from({ length: height }, (_, index) => {
|
|
39
|
+
const mark = markLines[index] ?? "";
|
|
40
|
+
const pipe = pipeLines[index] ?? "";
|
|
41
|
+
return `${brand(mark.padEnd(width))}${teal(pipe)}`;
|
|
42
|
+
}).join("\n");
|
|
43
|
+
}
|
|
44
|
+
export function brand(value) {
|
|
45
|
+
return chalk.bold.white(value);
|
|
46
|
+
}
|
|
47
|
+
export function brandName() {
|
|
48
|
+
return `${brand("ctx")}${teal("|")}`;
|
|
49
|
+
}
|
|
50
|
+
export function muted(value) {
|
|
51
|
+
return chalk.dim(value);
|
|
52
|
+
}
|
|
53
|
+
export function stepLabel(value) {
|
|
54
|
+
return `${teal("◆")} ${chalk.bold.white(value)}`;
|
|
55
|
+
}
|
|
56
|
+
export function successText(value) {
|
|
57
|
+
return chalk.green(value);
|
|
58
|
+
}
|
|
59
|
+
export function warnText(value) {
|
|
60
|
+
return chalk.yellow(value);
|
|
61
|
+
}
|
|
62
|
+
export function pathText(value) {
|
|
63
|
+
return chalk.cyan(value);
|
|
64
|
+
}
|
|
65
|
+
export function describeOperation(op) {
|
|
66
|
+
if (op.description)
|
|
67
|
+
return op.description;
|
|
68
|
+
if (op.type === "write-json")
|
|
69
|
+
return `write ${relativePath(op.path, process.cwd())}`;
|
|
70
|
+
if (op.type === "run")
|
|
71
|
+
return `run ${op.command.join(" ")}`;
|
|
72
|
+
return op.detail;
|
|
73
|
+
}
|
|
74
|
+
export function describeAppliedItem(item) {
|
|
75
|
+
if (item.status === "manual")
|
|
76
|
+
return `${warnText("!")} ${item.detail}`;
|
|
77
|
+
if (item.status === "ran")
|
|
78
|
+
return `${successText("✓")} ${item.detail}`;
|
|
79
|
+
if (item.status === "written") {
|
|
80
|
+
return `${successText("✓")} ${pathText(relativePath(item.path, process.cwd()))}`;
|
|
81
|
+
}
|
|
82
|
+
if (item.status === "unchanged") {
|
|
83
|
+
return `${muted("•")} ${pathText(relativePath(item.path, process.cwd()))} ${muted("already up to date")}`;
|
|
84
|
+
}
|
|
85
|
+
return item.status;
|
|
86
|
+
}
|
|
87
|
+
export function writeResult(json, result) {
|
|
88
|
+
if (json) {
|
|
89
|
+
console.log(JSON.stringify(result, null, 2));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (typeof result === "object" && result !== null && "status" in result) {
|
|
93
|
+
console.log(String(result.status));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
console.log(String(result));
|
|
97
|
+
}
|
|
98
|
+
export function printDoctorTable(data) {
|
|
99
|
+
log.info(`${brand("ctxpipe")} ${muted(data.version)}`);
|
|
100
|
+
log.message(`${muted("node")} ${data.node}`);
|
|
101
|
+
log.message(`${muted("cwd")} ${data.cwd}`);
|
|
102
|
+
log.step("Detected clients");
|
|
103
|
+
for (const client of CLIENTS) {
|
|
104
|
+
const found = data.detectedClients[client] ? successText("yes") : muted("no");
|
|
105
|
+
log.message(`${CLIENT_LABELS[client]} ${found}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO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version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctxpipe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Universal ctx| CLI for initializing repositories and agent integrations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ctxpipe": "./bin/ctxpipe.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"bin"
|
|
10
|
+
"bin",
|
|
11
|
+
"dist",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"README.md"
|
|
11
14
|
],
|
|
12
15
|
"repository": {
|
|
13
16
|
"type": "git",
|
|
@@ -18,8 +21,25 @@
|
|
|
18
21
|
"bugs": {
|
|
19
22
|
"url": "https://github.com/ctxpipe-ai/ctxpipe/issues"
|
|
20
23
|
},
|
|
21
|
-
"license": "
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@clack/prompts": "^1.0.1",
|
|
27
|
+
"@napi-rs/keyring": "^1.3.0",
|
|
28
|
+
"chalk": "^5.6.2",
|
|
29
|
+
"commander": "^14.0.3"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "25.3.0",
|
|
33
|
+
"typescript": "5.9.3",
|
|
34
|
+
"vitest": "4.0.18"
|
|
35
|
+
},
|
|
22
36
|
"publishConfig": {
|
|
23
37
|
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -p tsconfig.build.json",
|
|
41
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
42
|
+
"pretest": "pnpm run build",
|
|
43
|
+
"test": "vitest run"
|
|
24
44
|
}
|
|
25
|
-
}
|
|
45
|
+
}
|