glooit 0.5.0 → 0.5.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.
@@ -1,138 +1,62 @@
1
- import { z } from 'zod';
2
- export declare const AgentSchema: z.ZodEnum<{
3
- claude: "claude";
4
- cursor: "cursor";
5
- codex: "codex";
6
- roocode: "roocode";
7
- }>;
8
- export type Agent = z.infer<typeof AgentSchema>;
9
- export declare const HookFunctionSchema: z.ZodAny;
10
- export declare const RuleSchema: z.ZodObject<{
11
- file: z.ZodString;
12
- to: z.ZodString;
13
- globs: z.ZodOptional<z.ZodString>;
14
- targets: z.ZodArray<z.ZodEnum<{
15
- claude: "claude";
16
- cursor: "cursor";
17
- codex: "codex";
18
- roocode: "roocode";
19
- }>>;
20
- hooks: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
- }, z.core.$strip>;
22
- export declare const CommandSchema: z.ZodObject<{
23
- command: z.ZodString;
24
- file: z.ZodString;
25
- targets: z.ZodArray<z.ZodEnum<{
26
- claude: "claude";
27
- cursor: "cursor";
28
- codex: "codex";
29
- roocode: "roocode";
30
- }>>;
31
- }, z.core.$strip>;
32
- export declare const McpConfigSchema: z.ZodObject<{
33
- command: z.ZodOptional<z.ZodString>;
34
- args: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
36
- type: z.ZodOptional<z.ZodString>;
37
- url: z.ZodOptional<z.ZodString>;
38
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
39
- alwaysAllow: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
- disabled: z.ZodOptional<z.ZodBoolean>;
41
- }, z.core.$strip>;
42
- export declare const McpSchema: z.ZodObject<{
43
- name: z.ZodString;
44
- config: z.ZodObject<{
45
- command: z.ZodOptional<z.ZodString>;
46
- args: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
48
- type: z.ZodOptional<z.ZodString>;
49
- url: z.ZodOptional<z.ZodString>;
50
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
- alwaysAllow: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
- disabled: z.ZodOptional<z.ZodBoolean>;
53
- }, z.core.$strip>;
54
- targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
55
- claude: "claude";
56
- cursor: "cursor";
57
- codex: "codex";
58
- roocode: "roocode";
59
- }>>>;
60
- outputPath: z.ZodOptional<z.ZodString>;
61
- }, z.core.$strip>;
62
- export declare const BackupConfigSchema: z.ZodObject<{
63
- enabled: z.ZodDefault<z.ZodBoolean>;
64
- retention: z.ZodDefault<z.ZodNumber>;
65
- }, z.core.$strip>;
66
- export declare const HooksSchema: z.ZodObject<{
67
- before: z.ZodOptional<z.ZodArray<z.ZodAny>>;
68
- after: z.ZodOptional<z.ZodArray<z.ZodAny>>;
69
- error: z.ZodOptional<z.ZodArray<z.ZodAny>>;
70
- }, z.core.$strip>;
71
- export declare const ConfigSchema: z.ZodObject<{
72
- configDir: z.ZodDefault<z.ZodString>;
73
- rules: z.ZodArray<z.ZodObject<{
74
- file: z.ZodString;
75
- to: z.ZodString;
76
- globs: z.ZodOptional<z.ZodString>;
77
- targets: z.ZodArray<z.ZodEnum<{
78
- claude: "claude";
79
- cursor: "cursor";
80
- codex: "codex";
81
- roocode: "roocode";
82
- }>>;
83
- hooks: z.ZodOptional<z.ZodArray<z.ZodString>>;
84
- }, z.core.$strip>>;
85
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
- command: z.ZodString;
87
- file: z.ZodString;
88
- targets: z.ZodArray<z.ZodEnum<{
89
- claude: "claude";
90
- cursor: "cursor";
91
- codex: "codex";
92
- roocode: "roocode";
93
- }>>;
94
- }, z.core.$strip>>>;
95
- mcps: z.ZodOptional<z.ZodArray<z.ZodObject<{
96
- name: z.ZodString;
97
- config: z.ZodObject<{
98
- command: z.ZodOptional<z.ZodString>;
99
- args: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
101
- type: z.ZodOptional<z.ZodString>;
102
- url: z.ZodOptional<z.ZodString>;
103
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
104
- alwaysAllow: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
- disabled: z.ZodOptional<z.ZodBoolean>;
106
- }, z.core.$strip>;
107
- targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
108
- claude: "claude";
109
- cursor: "cursor";
110
- codex: "codex";
111
- roocode: "roocode";
112
- }>>>;
113
- outputPath: z.ZodOptional<z.ZodString>;
114
- }, z.core.$strip>>>;
115
- mergeMcps: z.ZodDefault<z.ZodBoolean>;
116
- hooks: z.ZodOptional<z.ZodObject<{
117
- before: z.ZodOptional<z.ZodArray<z.ZodAny>>;
118
- after: z.ZodOptional<z.ZodArray<z.ZodAny>>;
119
- error: z.ZodOptional<z.ZodArray<z.ZodAny>>;
120
- }, z.core.$strip>>;
121
- backup: z.ZodOptional<z.ZodObject<{
122
- enabled: z.ZodDefault<z.ZodBoolean>;
123
- retention: z.ZodDefault<z.ZodNumber>;
124
- }, z.core.$strip>>;
125
- }, z.core.$strip>;
126
- export type Rule = z.infer<typeof RuleSchema>;
127
- export type Command = z.infer<typeof CommandSchema>;
128
- export type McpConfig = z.infer<typeof McpConfigSchema>;
129
- export type Mcp = z.infer<typeof McpSchema>;
1
+ export type AgentName = 'claude' | 'cursor' | 'codex' | 'roocode' | 'generic';
2
+ export interface AgentTarget {
3
+ name: AgentName;
4
+ to?: string;
5
+ }
6
+ export type Agent = AgentName | AgentTarget;
7
+ export interface Rule {
8
+ name?: string;
9
+ file: string;
10
+ to: string;
11
+ globs?: string;
12
+ targets: Agent[];
13
+ hooks?: string[];
14
+ }
15
+ export interface Command {
16
+ command: string;
17
+ file: string;
18
+ targets: Agent[];
19
+ }
20
+ export interface McpConfig {
21
+ command?: string;
22
+ args?: string[];
23
+ env?: Record<string, string>;
24
+ type?: string;
25
+ url?: string;
26
+ headers?: Record<string, string>;
27
+ alwaysAllow?: string[];
28
+ disabled?: boolean;
29
+ }
30
+ export interface Mcp {
31
+ name: string;
32
+ config: McpConfig;
33
+ targets?: AgentName[];
34
+ outputPath?: string;
35
+ }
130
36
  export interface ResolvedMcp extends Omit<Mcp, 'outputPath'> {
131
37
  outputPath: string;
132
38
  }
133
- export type BackupConfig = z.infer<typeof BackupConfigSchema>;
134
- export type Hooks = z.infer<typeof HooksSchema>;
135
- export type Config = z.infer<typeof ConfigSchema>;
39
+ export interface BackupConfig {
40
+ enabled?: boolean;
41
+ retention?: number;
42
+ }
43
+ export interface Hooks {
44
+ before?: ((context: {
45
+ config: Config;
46
+ }) => Promise<void> | void)[];
47
+ after?: ((context: SyncContext) => Promise<string | void> | string | void)[];
48
+ error?: ((error: unknown) => Promise<void> | void)[];
49
+ }
50
+ export interface Config {
51
+ configDir?: string;
52
+ targets?: Agent[];
53
+ rules: Rule[];
54
+ commands?: Command[];
55
+ mcps?: Mcp[];
56
+ mergeMcps?: boolean;
57
+ hooks?: Hooks;
58
+ backup?: BackupConfig;
59
+ }
136
60
  export interface AgentMapping {
137
61
  path: string;
138
62
  format: 'markdown' | 'frontmatter';
@@ -144,7 +68,7 @@ export interface SyncContext {
144
68
  rule: Rule;
145
69
  content: string;
146
70
  targetPath: string;
147
- agent: Agent;
71
+ agent: AgentName;
148
72
  }
149
73
  export interface BackupEntry {
150
74
  timestamp: string;
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "glooit",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "🧴 Sync your AI agent configurations and rules across platforms with ease",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
7
  "type": "module",
9
8
  "bin": {
10
9
  "glooit": "dist/cli/index.js"
@@ -17,14 +16,13 @@
17
16
  "build:binary:macos": "bun build src/cli/index.ts --compile --target=bun-darwin-arm64 --outfile bin/glooit-macos",
18
17
  "build:binary:windows": "bun build src/cli/index.ts --compile --target=bun-windows-x64 --outfile bin/glooit-windows.exe",
19
18
  "dev": "bun run src/cli/index.ts",
20
- "test": "vitest",
21
- "test:run": "vitest run",
19
+ "test": "vitest --run",
22
20
  "test:coverage": "vitest run --coverage",
23
21
  "typecheck": "tsc --noEmit",
24
22
  "lint": "oxlint src tests",
25
23
  "lint:fix": "oxlint src tests --fix",
26
24
  "format": "oxlint src tests --fix",
27
- "check": "bun run typecheck && bun run lint && bun run test:run",
25
+ "check": "bun run typecheck && bun run lint && bun run test",
28
26
  "taze": "bunx taze",
29
27
  "prepublishOnly": "bun run check && bun run build && bun run build:cli",
30
28
  "install:local": "bun run build:binary && sudo mv bin/glooit /usr/local/bin/"
@@ -71,7 +69,6 @@
71
69
  },
72
70
  "dependencies": {
73
71
  "commander": "^14.0.1",
74
- "package-manager-detector": "^1.3.0",
75
- "zod": "^4.1.11"
72
+ "package-manager-detector": "^1.3.0"
76
73
  }
77
74
  }