@a1st/aix-schema 0.0.3
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/dist/aix.d.ts +51 -0
- package/dist/aix.d.ts.map +1 -0
- package/dist/aix.js +39 -0
- package/dist/aix.js.map +1 -0
- package/dist/config.d.ts +12130 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +36 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +17 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +34 -0
- package/dist/core.js.map +1 -0
- package/dist/editors.d.ts +3288 -0
- package/dist/editors.d.ts.map +1 -0
- package/dist/editors.js +52 -0
- package/dist/editors.js.map +1 -0
- package/dist/factory.d.ts +7 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +15 -0
- package/dist/factory.js.map +1 -0
- package/dist/hooks.d.ts +106 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +50 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonc.d.ts +10 -0
- package/dist/jsonc.d.ts.map +1 -0
- package/dist/jsonc.js +16 -0
- package/dist/jsonc.js.map +1 -0
- package/dist/mcp.d.ts +508 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +92 -0
- package/dist/mcp.js.map +1 -0
- package/dist/migrate.d.ts +11 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +24 -0
- package/dist/migrate.js.map +1 -0
- package/dist/normalize.d.ts +36 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +143 -0
- package/dist/normalize.js.map +1 -0
- package/dist/prompts.d.ts +297 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +50 -0
- package/dist/prompts.js.map +1 -0
- package/dist/references.d.ts +60 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +23 -0
- package/dist/references.js.map +1 -0
- package/dist/rules.d.ts +534 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +85 -0
- package/dist/rules.js.map +1 -0
- package/dist/skill.d.ts +38 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +18 -0
- package/dist/skill.js.map +1 -0
- package/dist/skills.d.ts +183 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +26 -0
- package/dist/skills.js.map +1 -0
- package/dist/validate.d.ts +17 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +34 -0
- package/dist/validate.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +42 -0
- package/schema.json +1408 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../src/editors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7B,CAAC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baseEditorConfigSchema = z.object({
|
|
4
|
+
enabled: z.boolean().default(true).describe('Whether to configure this editor'),
|
|
5
|
+
rules: rulesSchema.optional().describe('Editor-specific rules (in addition to global rules)'),
|
|
6
|
+
});
|
|
7
|
+
export const windsurfConfigSchema = baseEditorConfigSchema.extend({
|
|
8
|
+
cascadeSettings: z.record(z.unknown()).optional().describe('Windsurf Cascade settings'),
|
|
9
|
+
});
|
|
10
|
+
export const cursorConfigSchema = baseEditorConfigSchema.extend({
|
|
11
|
+
aiSettings: z.record(z.unknown()).optional().describe('Cursor AI settings'),
|
|
12
|
+
});
|
|
13
|
+
export const claudeCodeConfigSchema = baseEditorConfigSchema.extend({
|
|
14
|
+
permissions: z.record(z.unknown()).optional().describe('Claude Code permissions'),
|
|
15
|
+
});
|
|
16
|
+
export const editorEnum = z
|
|
17
|
+
.enum(['windsurf', 'cursor', 'claude-code', 'vscode', 'zed', 'neovim'])
|
|
18
|
+
.describe('Supported editor/agent');
|
|
19
|
+
/**
|
|
20
|
+
* Verbose object form for editors configuration.
|
|
21
|
+
* Each key is an editor name, value is its config.
|
|
22
|
+
*/
|
|
23
|
+
const editorsObjectSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
windsurf: windsurfConfigSchema.optional(),
|
|
26
|
+
cursor: cursorConfigSchema.optional(),
|
|
27
|
+
'claude-code': claudeCodeConfigSchema.optional(),
|
|
28
|
+
})
|
|
29
|
+
.catchall(baseEditorConfigSchema);
|
|
30
|
+
/**
|
|
31
|
+
* Array shorthand item: either an editor name string or { editorName: config } object.
|
|
32
|
+
* - String: "windsurf" → { windsurf: { enabled: true } }
|
|
33
|
+
* - Object: { "cursor": { "aiSettings": {...} } } → merged as-is
|
|
34
|
+
*/
|
|
35
|
+
const editorsArrayItemSchema = z.union([editorEnum, z.record(z.string(), baseEditorConfigSchema)]);
|
|
36
|
+
/**
|
|
37
|
+
* Array shorthand form for editors.
|
|
38
|
+
* Unlisted editors are implicitly disabled.
|
|
39
|
+
* Example: ["windsurf", { "cursor": { "aiSettings": {} } }]
|
|
40
|
+
*/
|
|
41
|
+
const editorsArraySchema = z
|
|
42
|
+
.array(editorsArrayItemSchema)
|
|
43
|
+
.describe('Shorthand: array of editor names or configs');
|
|
44
|
+
/**
|
|
45
|
+
* Editors configuration - accepts either:
|
|
46
|
+
* - Array shorthand: ["windsurf", "cursor"] or ["windsurf", { "cursor": {...} }]
|
|
47
|
+
* - Object form: { "windsurf": { "enabled": true }, "cursor": {...} }
|
|
48
|
+
*/
|
|
49
|
+
export const editorsSchema = z
|
|
50
|
+
.union([editorsArraySchema, editorsObjectSchema])
|
|
51
|
+
.describe('Editor-specific configurations');
|
|
52
|
+
//# sourceMappingURL=editors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editors.js","sourceRoot":"","sources":["../src/editors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/E,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,MAAM,CAAC;IAC/D,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACzF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAA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js';
|
|
2
|
+
/**
|
|
3
|
+
* Create an empty AiJsonConfig with all required fields initialized to their defaults.
|
|
4
|
+
* This is the single source of truth for creating new configs.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createEmptyConfig(): AiJsonConfig;
|
|
7
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,CAQhD"}
|
package/dist/factory.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SCHEMA_VERSION, SCHEMA_BASE_URL } from './version.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create an empty AiJsonConfig with all required fields initialized to their defaults.
|
|
4
|
+
* This is the single source of truth for creating new configs.
|
|
5
|
+
*/
|
|
6
|
+
export function createEmptyConfig() {
|
|
7
|
+
return {
|
|
8
|
+
$schema: `${SCHEMA_BASE_URL}/v${SCHEMA_VERSION}/ai.json`,
|
|
9
|
+
skills: {},
|
|
10
|
+
mcp: {},
|
|
11
|
+
rules: {},
|
|
12
|
+
prompts: {},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC9B,OAAO;QACJ,OAAO,EAAE,GAAG,eAAe,KAAK,cAAc,UAAU;QACxD,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;KACb,CAAC;AACL,CAAC"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Generic hook event types that map to editor-specific events.
|
|
4
|
+
* These are normalized event names that adapters translate to native formats.
|
|
5
|
+
*/
|
|
6
|
+
export declare const hookEventSchema: z.ZodEnum<["pre_tool_use", "post_tool_use", "pre_file_read", "post_file_read", "pre_file_write", "post_file_write", "pre_command", "post_command", "pre_mcp_tool", "post_mcp_tool", "pre_prompt", "session_start", "session_end", "agent_stop"]>;
|
|
7
|
+
export type HookEvent = z.infer<typeof hookEventSchema>;
|
|
8
|
+
/**
|
|
9
|
+
* Individual hook action configuration.
|
|
10
|
+
*/
|
|
11
|
+
export declare const hookActionSchema: z.ZodObject<{
|
|
12
|
+
command: z.ZodString;
|
|
13
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
show_output: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
working_directory: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
command: string;
|
|
18
|
+
timeout?: number | undefined;
|
|
19
|
+
show_output?: boolean | undefined;
|
|
20
|
+
working_directory?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
command: string;
|
|
23
|
+
timeout?: number | undefined;
|
|
24
|
+
show_output?: boolean | undefined;
|
|
25
|
+
working_directory?: string | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type HookAction = z.infer<typeof hookActionSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* Hook matcher with associated actions. The matcher is an optional regex pattern to filter events.
|
|
30
|
+
*/
|
|
31
|
+
export declare const hookMatcherSchema: z.ZodObject<{
|
|
32
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
33
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
34
|
+
command: z.ZodString;
|
|
35
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
show_output: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
working_directory: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
command: string;
|
|
40
|
+
timeout?: number | undefined;
|
|
41
|
+
show_output?: boolean | undefined;
|
|
42
|
+
working_directory?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
command: string;
|
|
45
|
+
timeout?: number | undefined;
|
|
46
|
+
show_output?: boolean | undefined;
|
|
47
|
+
working_directory?: string | undefined;
|
|
48
|
+
}>, "many">;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
hooks: {
|
|
51
|
+
command: string;
|
|
52
|
+
timeout?: number | undefined;
|
|
53
|
+
show_output?: boolean | undefined;
|
|
54
|
+
working_directory?: string | undefined;
|
|
55
|
+
}[];
|
|
56
|
+
matcher?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
hooks: {
|
|
59
|
+
command: string;
|
|
60
|
+
timeout?: number | undefined;
|
|
61
|
+
show_output?: boolean | undefined;
|
|
62
|
+
working_directory?: string | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
matcher?: string | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
export type HookMatcher = z.infer<typeof hookMatcherSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* Full hooks configuration - maps event types to arrays of matchers.
|
|
69
|
+
*/
|
|
70
|
+
export declare const hooksSchema: z.ZodRecord<z.ZodEnum<["pre_tool_use", "post_tool_use", "pre_file_read", "post_file_read", "pre_file_write", "post_file_write", "pre_command", "post_command", "pre_mcp_tool", "post_mcp_tool", "pre_prompt", "session_start", "session_end", "agent_stop"]>, z.ZodArray<z.ZodObject<{
|
|
71
|
+
matcher: z.ZodOptional<z.ZodString>;
|
|
72
|
+
hooks: z.ZodArray<z.ZodObject<{
|
|
73
|
+
command: z.ZodString;
|
|
74
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
show_output: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
working_directory: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
command: string;
|
|
79
|
+
timeout?: number | undefined;
|
|
80
|
+
show_output?: boolean | undefined;
|
|
81
|
+
working_directory?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
command: string;
|
|
84
|
+
timeout?: number | undefined;
|
|
85
|
+
show_output?: boolean | undefined;
|
|
86
|
+
working_directory?: string | undefined;
|
|
87
|
+
}>, "many">;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
hooks: {
|
|
90
|
+
command: string;
|
|
91
|
+
timeout?: number | undefined;
|
|
92
|
+
show_output?: boolean | undefined;
|
|
93
|
+
working_directory?: string | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
matcher?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
hooks: {
|
|
98
|
+
command: string;
|
|
99
|
+
timeout?: number | undefined;
|
|
100
|
+
show_output?: boolean | undefined;
|
|
101
|
+
working_directory?: string | undefined;
|
|
102
|
+
}[];
|
|
103
|
+
matcher?: string | undefined;
|
|
104
|
+
}>, "many">>;
|
|
105
|
+
export type HooksConfig = z.infer<typeof hooksSchema>;
|
|
106
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,eAAe,kPAiBG,CAAC;AAEhC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAOY,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKY,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAEgC,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Generic hook event types that map to editor-specific events.
|
|
4
|
+
* These are normalized event names that adapters translate to native formats.
|
|
5
|
+
*/
|
|
6
|
+
export const hookEventSchema = z
|
|
7
|
+
.enum([
|
|
8
|
+
'pre_tool_use',
|
|
9
|
+
'post_tool_use',
|
|
10
|
+
'pre_file_read',
|
|
11
|
+
'post_file_read',
|
|
12
|
+
'pre_file_write',
|
|
13
|
+
'post_file_write',
|
|
14
|
+
'pre_command',
|
|
15
|
+
'post_command',
|
|
16
|
+
'pre_mcp_tool',
|
|
17
|
+
'post_mcp_tool',
|
|
18
|
+
'pre_prompt',
|
|
19
|
+
'session_start',
|
|
20
|
+
'session_end',
|
|
21
|
+
'agent_stop',
|
|
22
|
+
])
|
|
23
|
+
.describe('Hook event type');
|
|
24
|
+
/**
|
|
25
|
+
* Individual hook action configuration.
|
|
26
|
+
*/
|
|
27
|
+
export const hookActionSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
command: z.string().describe('Shell command to execute'),
|
|
30
|
+
timeout: z.number().positive().optional().describe('Timeout in seconds'),
|
|
31
|
+
show_output: z.boolean().optional().describe('Whether to show command output in UI'),
|
|
32
|
+
working_directory: z.string().optional().describe('Working directory for the command'),
|
|
33
|
+
})
|
|
34
|
+
.describe('Hook action configuration');
|
|
35
|
+
/**
|
|
36
|
+
* Hook matcher with associated actions. The matcher is an optional regex pattern to filter events.
|
|
37
|
+
*/
|
|
38
|
+
export const hookMatcherSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
matcher: z.string().optional().describe('Pattern to match (regex supported, editor-specific)'),
|
|
41
|
+
hooks: z.array(hookActionSchema).describe('Hooks to execute when matched'),
|
|
42
|
+
})
|
|
43
|
+
.describe('Hook matcher configuration');
|
|
44
|
+
/**
|
|
45
|
+
* Full hooks configuration - maps event types to arrays of matchers.
|
|
46
|
+
*/
|
|
47
|
+
export const hooksSchema = z
|
|
48
|
+
.record(hookEventSchema, z.array(hookMatcherSchema))
|
|
49
|
+
.describe('Hooks configuration for lifecycle events');
|
|
50
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC5B,IAAI,CAAC;IACH,cAAc;IACd,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,YAAY;IACZ,eAAe;IACf,aAAa;IACb,YAAY;CACd,CAAC;KACD,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAIhC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACL,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACxE,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACpF,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CACxF,CAAC;KACD,QAAQ,CAAC,2BAA2B,CAAC,CAAC;AAI1C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACL,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IAC9F,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CAC5E,CAAC;KACD,QAAQ,CAAC,4BAA4B,CAAC,CAAC;AAI3C;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACxB,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACnD,QAAQ,CAAC,0CAA0C,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './version.js';
|
|
2
|
+
export * from './core.js';
|
|
3
|
+
export * from './references.js';
|
|
4
|
+
export * from './skills.js';
|
|
5
|
+
export * from './skill.js';
|
|
6
|
+
export * from './mcp.js';
|
|
7
|
+
export * from './rules.js';
|
|
8
|
+
export * from './prompts.js';
|
|
9
|
+
export * from './hooks.js';
|
|
10
|
+
export * from './editors.js';
|
|
11
|
+
export * from './aix.js';
|
|
12
|
+
export * from './config.js';
|
|
13
|
+
export * from './validate.js';
|
|
14
|
+
export * from './migrate.js';
|
|
15
|
+
export * from './jsonc.js';
|
|
16
|
+
export * from './normalize.js';
|
|
17
|
+
export * from './factory.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './version.js';
|
|
2
|
+
export * from './core.js';
|
|
3
|
+
export * from './references.js';
|
|
4
|
+
export * from './skills.js';
|
|
5
|
+
export * from './skill.js';
|
|
6
|
+
export * from './mcp.js';
|
|
7
|
+
export * from './rules.js';
|
|
8
|
+
export * from './prompts.js';
|
|
9
|
+
export * from './hooks.js';
|
|
10
|
+
export * from './editors.js';
|
|
11
|
+
export * from './aix.js';
|
|
12
|
+
export * from './config.js';
|
|
13
|
+
export * from './validate.js';
|
|
14
|
+
export * from './migrate.js';
|
|
15
|
+
export * from './jsonc.js';
|
|
16
|
+
export * from './normalize.js';
|
|
17
|
+
export * from './factory.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
package/dist/jsonc.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface JsoncParseResult<T> {
|
|
2
|
+
data?: T;
|
|
3
|
+
errors: Array<{
|
|
4
|
+
message: string;
|
|
5
|
+
offset: number;
|
|
6
|
+
length: number;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseJsonc<T = unknown>(content: string): JsoncParseResult<T>;
|
|
10
|
+
//# sourceMappingURL=jsonc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../src/jsonc.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrE;AAED,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAe5E"}
|
package/dist/jsonc.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { parse, printParseErrorCode } from 'jsonc-parser';
|
|
2
|
+
export function parseJsonc(content) {
|
|
3
|
+
const errors = [], data = parse(content, errors, {
|
|
4
|
+
allowTrailingComma: true,
|
|
5
|
+
disallowComments: false,
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
data: errors.length === 0 ? data : undefined,
|
|
9
|
+
errors: errors.map((e) => ({
|
|
10
|
+
message: printParseErrorCode(e.error),
|
|
11
|
+
offset: e.offset,
|
|
12
|
+
length: e.length,
|
|
13
|
+
})),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=jsonc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.js","sourceRoot":"","sources":["../src/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAO3E,MAAM,UAAU,UAAU,CAAc,OAAe;IACpD,MAAM,MAAM,GAAiB,EAAE,EACzB,IAAI,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE;QAC3B,kBAAkB,EAAE,IAAI;QACxB,gBAAgB,EAAE,KAAK;KACzB,CAAM,CAAC;IAEd,OAAO;QACJ,IAAI,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC5C,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACxB,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC;YACrC,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,MAAM,EAAE,CAAC,CAAC,MAAM;SAClB,CAAC,CAAC;KACL,CAAC;AACL,CAAC"}
|