@a1st/aix-schema 0.0.3 → 0.0.6
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 +49 -0
- package/dist/normalize.d.ts +36 -1
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +75 -4
- package/dist/normalize.js.map +1 -1
- package/dist/skill.d.ts +7 -6
- package/dist/skill.d.ts.map +1 -1
- package/dist/skill.js +3 -2
- package/dist/skill.js.map +1 -1
- package/package.json +8 -1
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @a1st/aix-schema
|
|
2
|
+
|
|
3
|
+
Zod schemas and JSON Schema for [aix](https://github.com/a1st-dev/aix/blob/main/README.md)
|
|
4
|
+
configuration files.
|
|
5
|
+
|
|
6
|
+
## Role in aix
|
|
7
|
+
|
|
8
|
+
This package defines the structure and validation for `ai.json` files. It's used by
|
|
9
|
+
`@a1st/aix-core` and `@a1st/aix` to parse and validate configurations.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Zod schemas** — Runtime validation with TypeScript inference
|
|
14
|
+
- **JSON Schema** — IDE autocompletion and validation via `schema.json`
|
|
15
|
+
- **Normalization** — Convert shorthand syntax to canonical object form
|
|
16
|
+
|
|
17
|
+
## Key Exports
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import {
|
|
21
|
+
parseConfig, // Parse and validate a full ai.json config
|
|
22
|
+
parseLocalConfig, // Parse config allowing local-only fields
|
|
23
|
+
aiJsonSchema, // Zod schema for ai.json
|
|
24
|
+
type AiJsonConfig, // TypeScript type for validated config
|
|
25
|
+
} from '@a1st/aix-schema';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## JSON Schema
|
|
29
|
+
|
|
30
|
+
The package exports `schema.json` for IDE integration:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"$schema": "node_modules/@a1st/aix-schema/schema.json"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @a1st/aix-schema
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Note:** This package is primarily for internal use. Most users should install
|
|
45
|
+
> `@a1st/aix` (the CLI) instead.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/dist/normalize.d.ts
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import type { AiJsonConfig } from './config.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Source types for config and asset references. This is the single source of truth for determining
|
|
4
|
+
* what kind of source a string represents.
|
|
5
|
+
*/
|
|
6
|
+
export type SourceType =
|
|
7
|
+
/** Local file path (./file, ../file, /absolute, or implicit like prompts/file.md) */
|
|
8
|
+
'local'
|
|
9
|
+
/** Git shorthand (github:org/repo, gitlab:org/repo, bitbucket:org/repo) */
|
|
10
|
+
| 'git-shorthand'
|
|
11
|
+
/** HTTPS URL pointing to a file (blob URL or direct .json file) */
|
|
12
|
+
| 'https-file'
|
|
13
|
+
/** HTTPS URL pointing to a repository root */
|
|
14
|
+
| 'https-repo'
|
|
15
|
+
/** Unsupported HTTP URL (non-HTTPS) */
|
|
16
|
+
| 'http-unsupported'
|
|
17
|
+
/** npm package reference */
|
|
18
|
+
| 'npm';
|
|
19
|
+
/**
|
|
20
|
+
* Detect the source type of a string. This is the single source of truth for source type detection
|
|
21
|
+
* and should be used everywhere instead of ad-hoc checks.
|
|
22
|
+
*
|
|
23
|
+
* Detection order (first match wins):
|
|
24
|
+
* 1. Git shorthand (github:, gitlab:, bitbucket:)
|
|
25
|
+
* 2. HTTPS URLs (file vs repo)
|
|
26
|
+
* 3. HTTP URLs (unsupported)
|
|
27
|
+
* 4. Local paths (explicit prefixes or file extensions)
|
|
28
|
+
* 5. npm packages (fallback)
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectSourceType(source: string): SourceType;
|
|
31
|
+
/**
|
|
32
|
+
* Detect if a string is a local path reference. Recognizes:
|
|
33
|
+
* - Explicit relative paths: `./file`, `../file`
|
|
34
|
+
* - Absolute paths: `/path/to/file`
|
|
35
|
+
* - file: protocol: `file:../foo/bar.md`
|
|
36
|
+
* - Implicit relative paths with file extensions: `prompts/file.md`, `file.txt`
|
|
37
|
+
*
|
|
38
|
+
* Excludes URLs and git shorthands even if they have matching extensions.
|
|
4
39
|
*/
|
|
5
40
|
export declare function isLocalPath(value: string): boolean;
|
|
6
41
|
/**
|
package/dist/normalize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD;;;GAGG;AACH,MAAM,MAAM,UAAU;AACnB,qFAAqF;AACnF,OAAO;AACT,2EAA2E;GACzE,eAAe;AACjB,mEAAmE;GACjE,YAAY;AACd,8CAA8C;GAC5C,YAAY;AACd,uCAAuC;GACrC,kBAAkB;AACpB,4BAA4B;GAC1B,KAAK,CAAC;AAEX;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAuB3D;AAyBD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAkBlD;AAmDD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBnG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAOzC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACzD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAOzC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC7B,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrF,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,CAmB9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,CAiC7D"}
|
package/dist/normalize.js
CHANGED
|
@@ -1,12 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* File extensions that indicate a local file (for implicit relative paths).
|
|
3
3
|
*/
|
|
4
|
-
const
|
|
4
|
+
const LOCAL_FILE_EXTENSIONS = /\.(md|txt|json|ya?ml|prompt\.md)$/i;
|
|
5
5
|
/**
|
|
6
|
-
* Detect
|
|
6
|
+
* Detect the source type of a string. This is the single source of truth for source type detection
|
|
7
|
+
* and should be used everywhere instead of ad-hoc checks.
|
|
8
|
+
*
|
|
9
|
+
* Detection order (first match wins):
|
|
10
|
+
* 1. Git shorthand (github:, gitlab:, bitbucket:)
|
|
11
|
+
* 2. HTTPS URLs (file vs repo)
|
|
12
|
+
* 3. HTTP URLs (unsupported)
|
|
13
|
+
* 4. Local paths (explicit prefixes or file extensions)
|
|
14
|
+
* 5. npm packages (fallback)
|
|
15
|
+
*/
|
|
16
|
+
export function detectSourceType(source) {
|
|
17
|
+
// Git shorthand: github:org/repo, gitlab:org/repo, bitbucket:org/repo
|
|
18
|
+
if (/^(github|gitlab|bitbucket):/.test(source)) {
|
|
19
|
+
return 'git-shorthand';
|
|
20
|
+
}
|
|
21
|
+
// HTTPS URL
|
|
22
|
+
if (source.startsWith('https://')) {
|
|
23
|
+
return isHttpsFileUrl(source) ? 'https-file' : 'https-repo';
|
|
24
|
+
}
|
|
25
|
+
// HTTP URL (reject for security)
|
|
26
|
+
if (source.startsWith('http://')) {
|
|
27
|
+
return 'http-unsupported';
|
|
28
|
+
}
|
|
29
|
+
// Local path detection
|
|
30
|
+
if (isLocalPath(source)) {
|
|
31
|
+
return 'local';
|
|
32
|
+
}
|
|
33
|
+
// Everything else is npm
|
|
34
|
+
return 'npm';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if an HTTPS URL points directly to a file (blob URL or direct file URL).
|
|
38
|
+
*/
|
|
39
|
+
function isHttpsFileUrl(url) {
|
|
40
|
+
// GitHub blob URL: https://github.com/org/repo/blob/ref/path
|
|
41
|
+
if (/^https:\/\/github\.com\/[^/]+\/[^/]+\/blob\//.test(url)) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
// GitLab blob URL: https://gitlab.com/group/project/-/blob/ref/path
|
|
45
|
+
if (/^https:\/\/gitlab\.com\/[^/]+\/[^/]+\/-\/blob\//.test(url)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
// Bitbucket src URL: https://bitbucket.org/workspace/repo/src/ref/path
|
|
49
|
+
if (/^https:\/\/bitbucket\.org\/[^/]+\/[^/]+\/src\//.test(url)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
// Direct file URL (ending in .json)
|
|
53
|
+
if (url.endsWith('.json')) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Detect if a string is a local path reference. Recognizes:
|
|
60
|
+
* - Explicit relative paths: `./file`, `../file`
|
|
61
|
+
* - Absolute paths: `/path/to/file`
|
|
62
|
+
* - file: protocol: `file:../foo/bar.md`
|
|
63
|
+
* - Implicit relative paths with file extensions: `prompts/file.md`, `file.txt`
|
|
64
|
+
*
|
|
65
|
+
* Excludes URLs and git shorthands even if they have matching extensions.
|
|
7
66
|
*/
|
|
8
67
|
export function isLocalPath(value) {
|
|
9
|
-
|
|
68
|
+
// Explicit relative or absolute paths (including file: protocol)
|
|
69
|
+
if (value.startsWith('./') ||
|
|
70
|
+
value.startsWith('../') ||
|
|
71
|
+
value.startsWith('/') ||
|
|
72
|
+
value.startsWith('file:')) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
// Exclude URLs and git shorthand
|
|
76
|
+
if (value.includes('://') || /^(github|gitlab|bitbucket):/.test(value)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
// Implicit relative path with file extension (e.g., "prompts/add-skill.md")
|
|
80
|
+
return LOCAL_FILE_EXTENSIONS.test(value);
|
|
10
81
|
}
|
|
11
82
|
/**
|
|
12
83
|
* Parse npm package reference with optional subpath from a string.
|
package/dist/normalize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,qBAAqB,GAAG,oCAAoC,CAAC;AAoBnE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC5C,sEAAsE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UAAU,CAAC,OAAO,GAAG,gBAAgB,CAClC,UAAU,CAAC,OAAiD,CAC9D,CAAC;IACL,CAAC;IAED,kCAAkC;IAClC,IAAI,UAAU,CAAC,KAAK,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAChG,UAAU,CAAC,KAAK,GAAG,oBAAoB,CACpC,UAAU,CAAC,KAAyD,CACtE,CAAC;IACL,CAAC;IAED,oCAAoC;IACpC,IACG,UAAU,CAAC,OAAO;QAClB,OAAO,UAAU,CAAC,OAAO,KAAK,QAAQ;QACtC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EACnC,CAAC;QACA,UAAU,CAAC,OAAO,GAAG,sBAAsB,CACxC,UAAU,CAAC,OAA2D,CACxE,CAAC;IACL,CAAC;IAED,OAAO,UAA0B,CAAC;AACrC,CAAC"}
|
package/dist/skill.d.ts
CHANGED
|
@@ -4,22 +4,22 @@ import { z } from 'zod';
|
|
|
4
4
|
* @see https://agentskills.io/specification.md
|
|
5
5
|
*/
|
|
6
6
|
export declare const skillFrontmatterSchema: z.ZodObject<{
|
|
7
|
-
name: z.ZodString
|
|
8
|
-
description: z.ZodString
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
9
|
license: z.ZodOptional<z.ZodString>;
|
|
10
10
|
compatibility: z.ZodOptional<z.ZodString>;
|
|
11
11
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
12
|
'allowed-tools': z.ZodOptional<z.ZodString>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
description
|
|
15
|
-
name
|
|
14
|
+
description?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
16
|
license?: string | undefined;
|
|
17
17
|
compatibility?: string | undefined;
|
|
18
18
|
metadata?: Record<string, string> | undefined;
|
|
19
19
|
'allowed-tools'?: string | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
description
|
|
22
|
-
name
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
23
|
license?: string | undefined;
|
|
24
24
|
compatibility?: string | undefined;
|
|
25
25
|
metadata?: Record<string, string> | undefined;
|
|
@@ -30,6 +30,7 @@ export type SkillFrontmatter = z.infer<typeof skillFrontmatterSchema>;
|
|
|
30
30
|
* Parsed skill with frontmatter and body content
|
|
31
31
|
*/
|
|
32
32
|
export interface ParsedSkill {
|
|
33
|
+
/** Frontmatter metadata, may be empty if SKILL.md has no frontmatter */
|
|
33
34
|
frontmatter: SkillFrontmatter;
|
|
34
35
|
body: string;
|
|
35
36
|
basePath: string;
|
package/dist/skill.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAejC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,WAAW;IACzB,wEAAwE;IACxE,WAAW,EAAE,gBAAgB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;CAClC"}
|
package/dist/skill.js
CHANGED
|
@@ -8,8 +8,9 @@ export const skillFrontmatterSchema = z.object({
|
|
|
8
8
|
.string()
|
|
9
9
|
.min(1)
|
|
10
10
|
.max(64)
|
|
11
|
-
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Name must be lowercase alphanumeric with single hyphens, not starting/ending with hyphen')
|
|
12
|
-
|
|
11
|
+
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Name must be lowercase alphanumeric with single hyphens, not starting/ending with hyphen')
|
|
12
|
+
.optional(),
|
|
13
|
+
description: z.string().min(1).max(1024).optional(),
|
|
13
14
|
license: z.string().optional(),
|
|
14
15
|
compatibility: z.string().max(500).optional(),
|
|
15
16
|
metadata: z.record(z.string()).optional(),
|
package/dist/skill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,KAAK,CACH,0BAA0B,EAC1B,0FAA0F,CAC5F;
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,KAAK,CACH,0BAA0B,EAC1B,0FAA0F,CAC5F;SACA,QAAQ,EAAE;IACd,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IACnD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a1st/aix-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "JSON Schema and validation for aix configuration",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai-config",
|
|
7
|
+
"json-schema",
|
|
8
|
+
"schema",
|
|
9
|
+
"validation",
|
|
10
|
+
"zod"
|
|
11
|
+
],
|
|
5
12
|
"files": [
|
|
6
13
|
"dist",
|
|
7
14
|
"schema.json"
|