@ctrl-spc/cli 1.1.14 → 1.2.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.
Files changed (42) hide show
  1. package/dist/agents.js +54 -0
  2. package/dist/collision.js +44 -0
  3. package/dist/commands/fetch.js +213 -0
  4. package/dist/commands/init.js +457 -0
  5. package/dist/commands/link.js +152 -0
  6. package/dist/commands/login.js +332 -0
  7. package/dist/commands/logout.js +14 -0
  8. package/dist/commands/run.js +622 -0
  9. package/dist/config.js +68 -0
  10. package/dist/env.js +5 -0
  11. package/dist/git.js +70 -0
  12. package/dist/index.js +56 -72
  13. package/dist/mcp.js +1732 -0
  14. package/dist/presence.js +62 -0
  15. package/dist/prompt.js +47 -0
  16. package/dist/protocol.js +117 -0
  17. package/dist/skills.js +148 -0
  18. package/dist/supabase.js +40 -10
  19. package/dist/topology.js +602 -0
  20. package/package.json +25 -23
  21. package/bin/ctrl-spc.js +0 -6
  22. package/dist/auth.js +0 -172
  23. package/dist/controlRequests.js +0 -154
  24. package/dist/daemon.js +0 -152
  25. package/dist/devices.js +0 -64
  26. package/dist/flagAssembler.js +0 -29
  27. package/dist/init.js +0 -79
  28. package/dist/launchd.js +0 -154
  29. package/dist/lifecycle.js +0 -37
  30. package/dist/mcpConfig.js +0 -12
  31. package/dist/repo.js +0 -52
  32. package/dist/session.js +0 -58
  33. package/dist/setup.js +0 -60
  34. package/dist/spawner.js +0 -138
  35. package/dist/windows-service.js +0 -142
  36. package/node_modules/@ctrl-spc/mcp-server/dist/claimResolver.d.ts +0 -24
  37. package/node_modules/@ctrl-spc/mcp-server/dist/claimResolver.js +0 -32
  38. package/node_modules/@ctrl-spc/mcp-server/dist/fingerprint.d.ts +0 -2
  39. package/node_modules/@ctrl-spc/mcp-server/dist/fingerprint.js +0 -21
  40. package/node_modules/@ctrl-spc/mcp-server/dist/index.d.ts +0 -1
  41. package/node_modules/@ctrl-spc/mcp-server/dist/index.js +0 -22
  42. package/node_modules/@ctrl-spc/mcp-server/package.json +0 -38
@@ -1,32 +0,0 @@
1
- export function mapClaimError(message) {
2
- const claimed = message.match(/repo_claimed:([^"]+)$/);
3
- if (claimed) {
4
- return `This repository is managed by ${claimed[1]}. Ask an admin for access.`;
5
- }
6
- if (message.includes('manage_projects_required')) {
7
- return "You do not have permission to manage projects in this context.";
8
- }
9
- return 'Something went wrong. Please try again.';
10
- }
11
- export async function claimProject(client, input) {
12
- const { data, error } = await client.rpc('create_project_with_links', {
13
- p_name: input.name,
14
- p_remote_url: input.remoteUrl,
15
- p_local_path: input.localPath,
16
- p_fingerprint: input.fingerprint,
17
- p_org_id: input.orgId,
18
- p_is_monorepo_subproject: Boolean(input.isMonorepoSubproject),
19
- });
20
- if (error)
21
- return { ok: false, message: mapClaimError(error.message) };
22
- const row = Array.isArray(data) ? data[0] : data;
23
- if (!row)
24
- return { ok: false, message: 'Something went wrong. Please try again.' };
25
- return { ok: true, projectId: row.project_id, projectName: row.project_name, claimed: Boolean(row.claimed) };
26
- }
27
- export async function releaseProjectClaim(client, projectId) {
28
- const { error } = await client.rpc('release_project_claim', { p_project_id: projectId });
29
- if (error)
30
- return { ok: false, message: mapClaimError(error.message) };
31
- return { ok: true };
32
- }
@@ -1,2 +0,0 @@
1
- export declare function normalizeRemoteUrl(remote: string | null | undefined): string;
2
- export declare function fingerprintRepo(rootCommitSha: string, normalizedRemoteUrl: string): string;
@@ -1,21 +0,0 @@
1
- import { createHash } from 'node:crypto';
2
- export function normalizeRemoteUrl(remote) {
3
- if (!remote)
4
- return '';
5
- const trimmed = remote.trim().replace(/\/+$/, '').replace(/\.git$/i, '');
6
- const ssh = trimmed.match(/^git@([^:]+):(.+)$/);
7
- if (ssh) {
8
- return `https://${ssh[1].toLowerCase()}/${ssh[2].toLowerCase().replace(/\.git$/i, '')}`;
9
- }
10
- try {
11
- const url = new URL(trimmed);
12
- const path = url.pathname.replace(/^\/+/, '').replace(/\/+$/, '').replace(/\.git$/i, '');
13
- return `https://${url.host.toLowerCase()}/${path.toLowerCase()}`;
14
- }
15
- catch {
16
- return trimmed.toLowerCase();
17
- }
18
- }
19
- export function fingerprintRepo(rootCommitSha, normalizedRemoteUrl) {
20
- return createHash('sha256').update(`${rootCommitSha}\n${normalizedRemoteUrl}`).digest('hex');
21
- }
@@ -1 +0,0 @@
1
- export declare function startMcpServer(): Promise<void>;
@@ -1,22 +0,0 @@
1
- import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
4
- const json = (body) => ({ content: [{ type: 'text', text: JSON.stringify(body) }] });
5
- export async function startMcpServer() {
6
- const server = new Server({ name: 'ctrl-spc', version: '0.1.0' }, { capabilities: { tools: {} } });
7
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
8
- tools: [
9
- {
10
- name: 'get_status',
11
- description: 'Returns a small health response from the Control Space MCP server.',
12
- inputSchema: { type: 'object', properties: {} },
13
- },
14
- ],
15
- }));
16
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
17
- if (request.params.name === 'get_status')
18
- return json({ ok: true, server: 'ctrl-spc' });
19
- throw new Error(`Unknown tool: ${request.params.name}`);
20
- });
21
- await server.connect(new StdioServerTransport());
22
- }
@@ -1,38 +0,0 @@
1
- {
2
- "name": "@ctrl-spc/mcp-server",
3
- "version": "0.1.0",
4
- "description": "Control Space MCP server and governance chokepoint",
5
- "type": "module",
6
- "types": "dist/index.d.ts",
7
- "files": ["dist/"],
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./fingerprint": {
14
- "types": "./dist/fingerprint.d.ts",
15
- "import": "./dist/fingerprint.js"
16
- },
17
- "./claimResolver": {
18
- "types": "./dist/claimResolver.d.ts",
19
- "import": "./dist/claimResolver.js"
20
- }
21
- },
22
- "scripts": {
23
- "build": "tsc",
24
- "test": "vitest run"
25
- },
26
- "dependencies": {
27
- "@modelcontextprotocol/sdk": "^1.11.0",
28
- "@supabase/supabase-js": "^2.108.2"
29
- },
30
- "devDependencies": {
31
- "@types/node": "^24.13.2",
32
- "typescript": "~6.0.2",
33
- "vitest": "^4.1.9"
34
- },
35
- "engines": {
36
- "node": ">=20"
37
- }
38
- }