@hasna/project 0.1.2

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 (57) hide show
  1. package/README.md +172 -0
  2. package/dist/cli/commands/completion.d.ts +3 -0
  3. package/dist/cli/commands/completion.d.ts.map +1 -0
  4. package/dist/cli/commands/projects.d.ts +3 -0
  5. package/dist/cli/commands/projects.d.ts.map +1 -0
  6. package/dist/cli/index.d.ts +3 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +47129 -0
  9. package/dist/db/database.d.ts +7 -0
  10. package/dist/db/database.d.ts.map +1 -0
  11. package/dist/db/pg-migrations.d.ts +7 -0
  12. package/dist/db/pg-migrations.d.ts.map +1 -0
  13. package/dist/db/projects.d.ts +22 -0
  14. package/dist/db/projects.d.ts.map +1 -0
  15. package/dist/db/projects.test.d.ts +2 -0
  16. package/dist/db/projects.test.d.ts.map +1 -0
  17. package/dist/db/schema.d.ts +4 -0
  18. package/dist/db/schema.d.ts.map +1 -0
  19. package/dist/db/workdirs.d.ts +10 -0
  20. package/dist/db/workdirs.d.ts.map +1 -0
  21. package/dist/index.d.ts +8 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +32158 -0
  24. package/dist/lib/detect.d.ts +3 -0
  25. package/dist/lib/detect.d.ts.map +1 -0
  26. package/dist/lib/doctor.d.ts +16 -0
  27. package/dist/lib/doctor.d.ts.map +1 -0
  28. package/dist/lib/env.d.ts +5 -0
  29. package/dist/lib/env.d.ts.map +1 -0
  30. package/dist/lib/generate.d.ts +16 -0
  31. package/dist/lib/generate.d.ts.map +1 -0
  32. package/dist/lib/git.d.ts +5 -0
  33. package/dist/lib/git.d.ts.map +1 -0
  34. package/dist/lib/github.d.ts +14 -0
  35. package/dist/lib/github.d.ts.map +1 -0
  36. package/dist/lib/import.d.ts +26 -0
  37. package/dist/lib/import.d.ts.map +1 -0
  38. package/dist/lib/import.test.d.ts +2 -0
  39. package/dist/lib/import.test.d.ts.map +1 -0
  40. package/dist/lib/scheduler.d.ts +21 -0
  41. package/dist/lib/scheduler.d.ts.map +1 -0
  42. package/dist/lib/stats.d.ts +23 -0
  43. package/dist/lib/stats.d.ts.map +1 -0
  44. package/dist/lib/status.d.ts +14 -0
  45. package/dist/lib/status.d.ts.map +1 -0
  46. package/dist/lib/sync.d.ts +20 -0
  47. package/dist/lib/sync.d.ts.map +1 -0
  48. package/dist/lib/watch.d.ts +6 -0
  49. package/dist/lib/watch.d.ts.map +1 -0
  50. package/dist/mcp/index.d.ts +3 -0
  51. package/dist/mcp/index.d.ts.map +1 -0
  52. package/dist/mcp/index.js +47904 -0
  53. package/dist/mcp/tools/cloud.d.ts +3 -0
  54. package/dist/mcp/tools/cloud.d.ts.map +1 -0
  55. package/dist/types/index.d.ts +149 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/package.json +72 -0
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerCloudSyncTools(server: McpServer): void;
3
+ //# sourceMappingURL=cloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cloud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6E9D"}
@@ -0,0 +1,149 @@
1
+ export interface ProjectIntegrations {
2
+ todos_project_id?: string;
3
+ mementos_project_id?: string;
4
+ conversations_space?: string;
5
+ files_index_id?: string;
6
+ [key: string]: string | undefined;
7
+ }
8
+ export declare const PROJECT_STATUSES: readonly ["active", "archived"];
9
+ export type ProjectStatus = (typeof PROJECT_STATUSES)[number];
10
+ export declare const SYNC_DIRECTIONS: readonly ["push", "pull", "both"];
11
+ export type SyncDirection = (typeof SYNC_DIRECTIONS)[number];
12
+ export declare const SYNC_LOG_STATUSES: readonly ["running", "completed", "failed"];
13
+ export type SyncLogStatus = (typeof SYNC_LOG_STATUSES)[number];
14
+ export interface Project {
15
+ id: string;
16
+ slug: string;
17
+ name: string;
18
+ description: string | null;
19
+ status: ProjectStatus;
20
+ path: string;
21
+ s3_bucket: string | null;
22
+ s3_prefix: string | null;
23
+ git_remote: string | null;
24
+ tags: string[];
25
+ integrations: ProjectIntegrations;
26
+ created_at: string;
27
+ updated_at: string;
28
+ synced_at: string | null;
29
+ }
30
+ export interface ProjectRow {
31
+ id: string;
32
+ slug: string;
33
+ name: string;
34
+ description: string | null;
35
+ status: string;
36
+ path: string;
37
+ s3_bucket: string | null;
38
+ s3_prefix: string | null;
39
+ git_remote: string | null;
40
+ tags: string | null;
41
+ integrations: string | null;
42
+ created_at: string;
43
+ updated_at: string;
44
+ synced_at: string | null;
45
+ }
46
+ export interface CreateProjectInput {
47
+ name: string;
48
+ path: string;
49
+ description?: string;
50
+ slug?: string;
51
+ tags?: string[];
52
+ s3_bucket?: string;
53
+ s3_prefix?: string;
54
+ git_remote?: string;
55
+ git_init?: boolean;
56
+ }
57
+ export interface UpdateProjectInput {
58
+ name?: string;
59
+ description?: string;
60
+ path?: string;
61
+ tags?: string[];
62
+ s3_bucket?: string | null;
63
+ s3_prefix?: string | null;
64
+ git_remote?: string | null;
65
+ integrations?: ProjectIntegrations;
66
+ }
67
+ export interface ProjectFilter {
68
+ status?: ProjectStatus;
69
+ tags?: string[];
70
+ limit?: number;
71
+ offset?: number;
72
+ }
73
+ export interface ProjectFile {
74
+ id: string;
75
+ project_id: string;
76
+ relative_path: string;
77
+ size: number;
78
+ hash: string | null;
79
+ synced_at: string | null;
80
+ }
81
+ export interface SyncLog {
82
+ id: string;
83
+ project_id: string;
84
+ direction: SyncDirection;
85
+ status: SyncLogStatus;
86
+ files_synced: number;
87
+ bytes: number;
88
+ error: string | null;
89
+ started_at: string;
90
+ completed_at: string | null;
91
+ }
92
+ export interface SyncLogRow {
93
+ id: string;
94
+ project_id: string;
95
+ direction: string;
96
+ status: string;
97
+ files_synced: number;
98
+ bytes: number;
99
+ error: string | null;
100
+ started_at: string;
101
+ completed_at: string | null;
102
+ }
103
+ export interface ProjectWorkdir {
104
+ id: string;
105
+ project_id: string;
106
+ path: string;
107
+ machine_id: string;
108
+ label: string;
109
+ is_primary: boolean;
110
+ claude_md_generated: boolean;
111
+ agents_md_generated: boolean;
112
+ created_at: string;
113
+ }
114
+ export interface ProjectWorkdirRow {
115
+ id: string;
116
+ project_id: string;
117
+ path: string;
118
+ machine_id: string;
119
+ label: string;
120
+ is_primary: number;
121
+ claude_md_generated: number;
122
+ agents_md_generated: number;
123
+ created_at: string;
124
+ }
125
+ export interface AddWorkdirInput {
126
+ project_id: string;
127
+ path: string;
128
+ label?: string;
129
+ is_primary?: boolean;
130
+ }
131
+ export declare class ProjectNotFoundError extends Error {
132
+ projectId: string;
133
+ static readonly code = "PROJECT_NOT_FOUND";
134
+ static readonly suggestion = "Use `projects list` to see available projects.";
135
+ constructor(projectId: string);
136
+ }
137
+ export declare class ProjectSlugConflictError extends Error {
138
+ slug: string;
139
+ static readonly code = "SLUG_CONFLICT";
140
+ static readonly suggestion = "Choose a different name or provide an explicit --slug.";
141
+ constructor(slug: string);
142
+ }
143
+ export declare class ProjectPathConflictError extends Error {
144
+ path: string;
145
+ static readonly code = "PATH_CONFLICT";
146
+ static readonly suggestion = "Use `projects get` to find the existing project at this path.";
147
+ constructor(path: string);
148
+ }
149
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,GAAG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,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,qBAAa,oBAAqB,SAAQ,KAAK;IAG1B,SAAS,EAAE,MAAM;IAFpC,MAAM,CAAC,QAAQ,CAAC,IAAI,uBAAuB;IAC3C,MAAM,CAAC,QAAQ,CAAC,UAAU,oDAAoD;gBAC3D,SAAS,EAAE,MAAM;CAIrC;AAED,qBAAa,wBAAyB,SAAQ,KAAK;IAG9B,IAAI,EAAE,MAAM;IAF/B,MAAM,CAAC,QAAQ,CAAC,IAAI,mBAAmB;IACvC,MAAM,CAAC,QAAQ,CAAC,UAAU,4DAA4D;gBACnE,IAAI,EAAE,MAAM;CAIhC;AAED,qBAAa,wBAAyB,SAAQ,KAAK;IAG9B,IAAI,EAAE,MAAM;IAF/B,MAAM,CAAC,QAAQ,CAAC,IAAI,mBAAmB;IACvC,MAAM,CAAC,QAAQ,CAAC,UAAU,mEAAmE;gBAC1E,IAAI,EAAE,MAAM;CAIhC"}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@hasna/project",
3
+ "version": "0.1.2",
4
+ "description": "Project management CLI + MCP server for AI agents — register, sync, and open projects across machines",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "project": "dist/cli/index.js",
10
+ "project-mcp": "dist/mcp/index.js"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "LICENSE",
21
+ "README.md"
22
+ ],
23
+ "scripts": {
24
+ "build": "bun build src/cli/index.ts --outdir dist/cli --target bun && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk && bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --outDir dist",
25
+ "typecheck": "tsc --noEmit",
26
+ "test": "bun test",
27
+ "dev:cli": "bun run src/cli/index.ts",
28
+ "dev:mcp": "bun run src/mcp/index.ts",
29
+ "prepublishOnly": "bun run build",
30
+ "postinstall": "mkdir -p $HOME/.hasna/projects 2>/dev/null || true"
31
+ },
32
+ "keywords": [
33
+ "projects",
34
+ "mcp",
35
+ "ai",
36
+ "coding-agent",
37
+ "claude",
38
+ "cli",
39
+ "sync",
40
+ "s3"
41
+ ],
42
+ "publishConfig": {
43
+ "registry": "https://registry.npmjs.org",
44
+ "access": "public"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/hasna/open-projects.git"
49
+ },
50
+ "homepage": "https://github.com/hasna/open-projects",
51
+ "bugs": {
52
+ "url": "https://github.com/hasna/open-projects/issues"
53
+ },
54
+ "engines": {
55
+ "bun": ">=1.0.0"
56
+ },
57
+ "author": "Andrei Hasna <andrei@hasna.com>",
58
+ "license": "Apache-2.0",
59
+ "dependencies": {
60
+ "@aws-sdk/client-s3": "^3.1018.0",
61
+ "@hasna/cloud": "^0.1.28",
62
+ "@modelcontextprotocol/sdk": "^1.12.1",
63
+ "chalk": "^5.4.1",
64
+ "commander": "^13.1.0",
65
+ "nanoid": "^5.0.9",
66
+ "zod": "^3.24.2"
67
+ },
68
+ "devDependencies": {
69
+ "@types/bun": "^1.2.4",
70
+ "typescript": "^5.7.3"
71
+ }
72
+ }