@hasna/configs 0.1.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 +264 -0
- package/dashboard/dist/assets/index-DQ3P1g1z.css +1 -0
- package/dashboard/dist/assets/index-DbXmAL_d.js +11 -0
- package/dashboard/dist/index.html +14 -0
- package/dashboard/dist/vite.svg +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3087 -0
- package/dist/db/configs.d.ts +10 -0
- package/dist/db/configs.d.ts.map +1 -0
- package/dist/db/configs.test.d.ts +2 -0
- package/dist/db/configs.test.d.ts.map +1 -0
- package/dist/db/database.d.ts +7 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/machines.d.ts +8 -0
- package/dist/db/machines.d.ts.map +1 -0
- package/dist/db/machines.test.d.ts +2 -0
- package/dist/db/machines.test.d.ts.map +1 -0
- package/dist/db/profiles.d.ts +11 -0
- package/dist/db/profiles.d.ts.map +1 -0
- package/dist/db/profiles.test.d.ts +2 -0
- package/dist/db/profiles.test.d.ts.map +1 -0
- package/dist/db/snapshots.d.ts +8 -0
- package/dist/db/snapshots.d.ts.map +1 -0
- package/dist/db/snapshots.test.d.ts +2 -0
- package/dist/db/snapshots.test.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +896 -0
- package/dist/lib/apply.d.ts +11 -0
- package/dist/lib/apply.d.ts.map +1 -0
- package/dist/lib/apply.test.d.ts +2 -0
- package/dist/lib/apply.test.d.ts.map +1 -0
- package/dist/lib/export.d.ts +12 -0
- package/dist/lib/export.d.ts.map +1 -0
- package/dist/lib/import.d.ts +14 -0
- package/dist/lib/import.d.ts.map +1 -0
- package/dist/lib/sync.d.ts +19 -0
- package/dist/lib/sync.d.ts.map +1 -0
- package/dist/lib/sync.test.d.ts +2 -0
- package/dist/lib/sync.test.d.ts.map +1 -0
- package/dist/lib/template.d.ts +10 -0
- package/dist/lib/template.d.ts.map +1 -0
- package/dist/lib/template.test.d.ts +2 -0
- package/dist/lib/template.test.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +662 -0
- package/dist/mcp/mcp.test.d.ts +2 -0
- package/dist/mcp/mcp.test.d.ts.map +1 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +2390 -0
- package/dist/server/server.test.d.ts +2 -0
- package/dist/server/server.test.d.ts.map +1 -0
- package/dist/types/index.d.ts +152 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.d.ts","sourceRoot":"","sources":["../../src/server/server.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export declare const CONFIG_KINDS: readonly ["file", "reference"];
|
|
2
|
+
export type ConfigKind = (typeof CONFIG_KINDS)[number];
|
|
3
|
+
export declare const CONFIG_CATEGORIES: readonly ["agent", "rules", "mcp", "shell", "secrets_schema", "workspace", "git", "tools"];
|
|
4
|
+
export type ConfigCategory = (typeof CONFIG_CATEGORIES)[number];
|
|
5
|
+
export declare const CONFIG_AGENTS: readonly ["claude", "codex", "gemini", "zsh", "git", "npm", "global"];
|
|
6
|
+
export type ConfigAgent = (typeof CONFIG_AGENTS)[number];
|
|
7
|
+
export declare const CONFIG_FORMATS: readonly ["text", "json", "toml", "yaml", "markdown", "ini"];
|
|
8
|
+
export type ConfigFormat = (typeof CONFIG_FORMATS)[number];
|
|
9
|
+
export interface Config {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
kind: ConfigKind;
|
|
14
|
+
category: ConfigCategory;
|
|
15
|
+
agent: ConfigAgent;
|
|
16
|
+
target_path: string | null;
|
|
17
|
+
format: ConfigFormat;
|
|
18
|
+
content: string;
|
|
19
|
+
description: string | null;
|
|
20
|
+
tags: string[];
|
|
21
|
+
is_template: boolean;
|
|
22
|
+
version: number;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
synced_at: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface ConfigRow {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
kind: string;
|
|
32
|
+
category: string;
|
|
33
|
+
agent: string;
|
|
34
|
+
target_path: string | null;
|
|
35
|
+
format: string;
|
|
36
|
+
content: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
tags: string;
|
|
39
|
+
is_template: number;
|
|
40
|
+
version: number;
|
|
41
|
+
created_at: string;
|
|
42
|
+
updated_at: string;
|
|
43
|
+
synced_at: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface CreateConfigInput {
|
|
46
|
+
name: string;
|
|
47
|
+
kind?: ConfigKind;
|
|
48
|
+
category: ConfigCategory;
|
|
49
|
+
agent?: ConfigAgent;
|
|
50
|
+
target_path?: string | null;
|
|
51
|
+
format?: ConfigFormat;
|
|
52
|
+
content: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
tags?: string[];
|
|
55
|
+
is_template?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface UpdateConfigInput {
|
|
58
|
+
name?: string;
|
|
59
|
+
kind?: ConfigKind;
|
|
60
|
+
category?: ConfigCategory;
|
|
61
|
+
agent?: ConfigAgent;
|
|
62
|
+
target_path?: string | null;
|
|
63
|
+
format?: ConfigFormat;
|
|
64
|
+
content?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
tags?: string[];
|
|
67
|
+
is_template?: boolean;
|
|
68
|
+
synced_at?: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface ConfigFilter {
|
|
71
|
+
category?: ConfigCategory;
|
|
72
|
+
agent?: ConfigAgent;
|
|
73
|
+
kind?: ConfigKind;
|
|
74
|
+
tags?: string[];
|
|
75
|
+
search?: string;
|
|
76
|
+
is_template?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface ConfigSnapshot {
|
|
79
|
+
id: string;
|
|
80
|
+
config_id: string;
|
|
81
|
+
content: string;
|
|
82
|
+
version: number;
|
|
83
|
+
created_at: string;
|
|
84
|
+
}
|
|
85
|
+
export interface Profile {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
description: string | null;
|
|
90
|
+
created_at: string;
|
|
91
|
+
updated_at: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ProfileRow {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
description: string | null;
|
|
98
|
+
created_at: string;
|
|
99
|
+
updated_at: string;
|
|
100
|
+
}
|
|
101
|
+
export interface CreateProfileInput {
|
|
102
|
+
name: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface UpdateProfileInput {
|
|
106
|
+
name?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ProfileConfig {
|
|
110
|
+
profile_id: string;
|
|
111
|
+
config_id: string;
|
|
112
|
+
order: number;
|
|
113
|
+
}
|
|
114
|
+
export interface Machine {
|
|
115
|
+
id: string;
|
|
116
|
+
hostname: string;
|
|
117
|
+
os: string | null;
|
|
118
|
+
last_applied_at: string | null;
|
|
119
|
+
created_at: string;
|
|
120
|
+
}
|
|
121
|
+
export interface ApplyResult {
|
|
122
|
+
config_id: string;
|
|
123
|
+
path: string;
|
|
124
|
+
previous_content: string | null;
|
|
125
|
+
new_content: string;
|
|
126
|
+
dry_run: boolean;
|
|
127
|
+
changed: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface SyncResult {
|
|
130
|
+
added: number;
|
|
131
|
+
updated: number;
|
|
132
|
+
unchanged: number;
|
|
133
|
+
skipped: string[];
|
|
134
|
+
}
|
|
135
|
+
export interface ExportManifest {
|
|
136
|
+
version: string;
|
|
137
|
+
exported_at: string;
|
|
138
|
+
configs: Array<Omit<Config, "content">>;
|
|
139
|
+
}
|
|
140
|
+
export declare class ConfigNotFoundError extends Error {
|
|
141
|
+
constructor(id: string);
|
|
142
|
+
}
|
|
143
|
+
export declare class ProfileNotFoundError extends Error {
|
|
144
|
+
constructor(id: string);
|
|
145
|
+
}
|
|
146
|
+
export declare class ConfigApplyError extends Error {
|
|
147
|
+
constructor(message: string);
|
|
148
|
+
}
|
|
149
|
+
export declare class TemplateRenderError extends Error {
|
|
150
|
+
constructor(message: string);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,gCAAiC,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAGvD,eAAO,MAAM,iBAAiB,4FASpB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAGhE,eAAO,MAAM,aAAa,uEAQhB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAGzD,eAAO,MAAM,cAAc,8DAOjB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAG3D,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CA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gBAChC,EAAE,EAAE,MAAM;CAIvB;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,EAAE,EAAE,MAAM;CAIvB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hasna/configs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI coding agent configuration manager — store, version, apply, and share all your AI coding configs. CLI + MCP + REST API + Dashboard.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"configs": "dist/cli/index.js",
|
|
10
|
+
"configs-mcp": "dist/mcp/index.js",
|
|
11
|
+
"configs-serve": "dist/server/index.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"dashboard/dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "bun build src/cli/index.tsx --outdir dist/cli --target bun --external ink --external react --external chalk --external @modelcontextprotocol/sdk && bun build src/mcp/index.ts --outdir dist/mcp --target bun --external @modelcontextprotocol/sdk && bun build src/server/index.ts --outdir dist/server --target bun && bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --outDir dist",
|
|
27
|
+
"build:dashboard": "cd dashboard && bun run build",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "bun test",
|
|
30
|
+
"dev:cli": "bun run src/cli/index.tsx",
|
|
31
|
+
"dev:mcp": "bun run src/mcp/index.ts",
|
|
32
|
+
"dev:serve": "bun run src/server/index.ts",
|
|
33
|
+
"seed": "bun run scripts/seed.ts"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"configs",
|
|
37
|
+
"dotfiles",
|
|
38
|
+
"agent-config",
|
|
39
|
+
"claude",
|
|
40
|
+
"codex",
|
|
41
|
+
"gemini",
|
|
42
|
+
"mcp",
|
|
43
|
+
"ai",
|
|
44
|
+
"coding-agent",
|
|
45
|
+
"cli",
|
|
46
|
+
"dashboard"
|
|
47
|
+
],
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/hasna/open-configs.git"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/hasna/open-configs",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/hasna/open-configs/issues"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"bun": ">=1.0.0"
|
|
61
|
+
},
|
|
62
|
+
"author": "Andrei Hasna <andrei@hasna.com>",
|
|
63
|
+
"license": "Apache-2.0",
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
66
|
+
"chalk": "^5.4.1",
|
|
67
|
+
"commander": "^13.1.0",
|
|
68
|
+
"hono": "^4.7.4",
|
|
69
|
+
"ink": "^5.2.0",
|
|
70
|
+
"react": "^18.3.1",
|
|
71
|
+
"zod": "^3.24.2"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/bun": "^1.2.4",
|
|
75
|
+
"@types/react": "^18.3.18",
|
|
76
|
+
"typescript": "^5.7.3"
|
|
77
|
+
}
|
|
78
|
+
}
|