@hagicode/hagitask 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.
Files changed (32) hide show
  1. package/README.md +241 -0
  2. package/dist/cli.d.ts +4 -0
  3. package/dist/cli.js +36 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/validate-command.d.ts +4 -0
  6. package/dist/commands/validate-command.js +14 -0
  7. package/dist/commands/validate-command.js.map +1 -0
  8. package/dist/index.d.ts +15 -0
  9. package/dist/index.js +31 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/validation/diagnostics.d.ts +13 -0
  12. package/dist/validation/diagnostics.js +16 -0
  13. package/dist/validation/diagnostics.js.map +1 -0
  14. package/dist/validation/package-discovery.d.ts +10 -0
  15. package/dist/validation/package-discovery.js +45 -0
  16. package/dist/validation/package-discovery.js.map +1 -0
  17. package/dist/validation/package-validator.d.ts +4 -0
  18. package/dist/validation/package-validator.js +374 -0
  19. package/dist/validation/package-validator.js.map +1 -0
  20. package/dist/validation/schema-loader.d.ts +8 -0
  21. package/dist/validation/schema-loader.js +50 -0
  22. package/dist/validation/schema-loader.js.map +1 -0
  23. package/package.json +44 -0
  24. package/schemas/community-index-v1.schema.json +159 -0
  25. package/schemas/community-task-detail-v1.schema.json +182 -0
  26. package/schemas/task-preset-plugin/commands.schema.json +122 -0
  27. package/schemas/task-preset-plugin/locales.schema.json +24 -0
  28. package/schemas/task-preset-plugin/manifest.schema.json +225 -0
  29. package/schemas/task-preset-plugin/panel.schema.json +190 -0
  30. package/schemas/task-preset-plugin/prompt-package.schema.json +262 -0
  31. package/schemas/task-preset-plugin/store-page-frontmatter.schema.json +73 -0
  32. package/schemas/task-preset-plugin/task-preset.schema.json +153 -0
@@ -0,0 +1,159 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tasks.hagicode.com/schemas/community-index-v1.schema.json",
4
+ "title": "HagiTask Community Index v1",
5
+ "description": "Lightweight, machine-readable discovery contract for community HagiTask entries. Every document published at /index.json MUST conform to this schema. It carries only discovery and acquisition metadata; executable detail lives in the standalone detail documents.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "generatedAt", "publisher", "tasks"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "const": 1,
12
+ "description": "Protocol version. Independent from any task package version."
13
+ },
14
+ "generatedAt": {
15
+ "type": "string",
16
+ "format": "date-time",
17
+ "description": "RFC 3339 timestamp when this index document was produced by the build."
18
+ },
19
+ "publisher": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "description": "Organization or team publishing the community catalog."
23
+ },
24
+ "source": {
25
+ "type": "string",
26
+ "description": "Optional root URL or repository reference for the catalog source."
27
+ },
28
+ "tasks": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "uniqueItems": true,
32
+ "items": { "$ref": "#/$defs/taskEntry" }
33
+ }
34
+ },
35
+ "$defs": {
36
+ "taskEntry": {
37
+ "type": "object",
38
+ "required": [
39
+ "taskId",
40
+ "name",
41
+ "summary",
42
+ "category",
43
+ "tags",
44
+ "publisher",
45
+ "source",
46
+ "version",
47
+ "publishedAt",
48
+ "detailUrl",
49
+ "packageUrl",
50
+ "compatibility",
51
+ "integrity"
52
+ ],
53
+ "additionalProperties": false,
54
+ "properties": {
55
+ "taskId": {
56
+ "type": "string",
57
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
58
+ "description": "Canonical, stable package identifier. Human-facing aliases MUST NOT be emitted as additional task IDs."
59
+ },
60
+ "name": {
61
+ "type": "object",
62
+ "minProperties": 1,
63
+ "additionalProperties": { "type": "string", "minLength": 1 },
64
+ "description": "Localized display name keyed by locale code (e.g. \"en-US\")."
65
+ },
66
+ "summary": {
67
+ "type": "object",
68
+ "minProperties": 1,
69
+ "additionalProperties": { "type": "string", "minLength": 1 },
70
+ "description": "Localized short summary keyed by locale code."
71
+ },
72
+ "category": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "description": "Primary discovery category used by the listing filters."
76
+ },
77
+ "tags": {
78
+ "type": "array",
79
+ "items": { "type": "string", "minLength": 1 },
80
+ "description": "Secondary discovery tags."
81
+ },
82
+ "publisher": {
83
+ "type": "string",
84
+ "minLength": 1,
85
+ "description": "Publisher of this specific task entry."
86
+ },
87
+ "source": {
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "description": "Source reference for this entry (repository or catalog root)."
91
+ },
92
+ "version": {
93
+ "type": "string",
94
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
95
+ "description": "Semver-like package version copied from the HagiTask manifest."
96
+ },
97
+ "publishedAt": {
98
+ "type": "string",
99
+ "format": "date-time",
100
+ "description": "RFC 3339 timestamp of the task publication."
101
+ },
102
+ "detailUrl": {
103
+ "type": "string",
104
+ "pattern": "^/tasks/[a-z0-9][a-z0-9-]*\\.json$",
105
+ "description": "Stable public path to the standalone detail document."
106
+ },
107
+ "packageUrl": {
108
+ "type": "string",
109
+ "pattern": "^/packages/[a-z0-9][a-z0-9-]*\\.zip$",
110
+ "description": "Stable public path to the downloadable package archive."
111
+ },
112
+ "compatibility": { "$ref": "#/$defs/compatibility" },
113
+ "integrity": { "$ref": "#/$defs/integrity" }
114
+ }
115
+ },
116
+ "compatibility": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "agent": {
121
+ "type": "string",
122
+ "description": "Required agent capability name, or \"any\"."
123
+ },
124
+ "skills": {
125
+ "type": "array",
126
+ "items": { "type": "string", "minLength": 1 },
127
+ "description": "Required skill names."
128
+ },
129
+ "cli": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "object",
133
+ "required": ["name"],
134
+ "additionalProperties": false,
135
+ "properties": {
136
+ "name": { "type": "string", "minLength": 1 },
137
+ "command": { "type": "string" },
138
+ "args": { "type": "array", "items": { "type": "string" } }
139
+ }
140
+ },
141
+ "description": "Required CLI tooling."
142
+ }
143
+ }
144
+ },
145
+ "integrity": {
146
+ "type": "object",
147
+ "required": ["sha256"],
148
+ "additionalProperties": false,
149
+ "properties": {
150
+ "algorithm": { "const": "sha256" },
151
+ "sha256": {
152
+ "type": "string",
153
+ "pattern": "^[a-f0-9]{64}$",
154
+ "description": "Lowercase SHA-256 digest of the exact published package archive bytes."
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
@@ -0,0 +1,182 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tasks.hagicode.com/schemas/community-task-detail-v1.schema.json",
4
+ "title": "HagiTask Community Task Detail v1",
5
+ "description": "Standalone, machine-readable detail contract for a single community HagiTask. Published at /tasks/<taskId>.json. It repeats identity metadata for standalone retrieval and adds description, requirements, resources, installation, documentation, and localization. The package archive is the installation unit; documentation links are optional metadata.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "taskId",
10
+ "version",
11
+ "publisher",
12
+ "source",
13
+ "name",
14
+ "summary",
15
+ "category",
16
+ "tags",
17
+ "compatibility",
18
+ "resources",
19
+ "installation",
20
+ "documentation"
21
+ ],
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "schemaVersion": { "const": 1 },
25
+ "taskId": {
26
+ "type": "string",
27
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
28
+ },
29
+ "version": {
30
+ "type": "string",
31
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
32
+ },
33
+ "publisher": { "type": "string", "minLength": 1 },
34
+ "source": { "type": "string", "minLength": 1 },
35
+ "publishedAt": { "type": "string", "format": "date-time" },
36
+ "generatedAt": { "type": "string", "format": "date-time" },
37
+ "name": {
38
+ "type": "object",
39
+ "minProperties": 1,
40
+ "additionalProperties": { "type": "string", "minLength": 1 }
41
+ },
42
+ "summary": {
43
+ "type": "object",
44
+ "minProperties": 1,
45
+ "additionalProperties": { "type": "string", "minLength": 1 }
46
+ },
47
+ "description": {
48
+ "type": "object",
49
+ "minProperties": 1,
50
+ "additionalProperties": { "type": "string" },
51
+ "description": "Optional longer localized description keyed by locale."
52
+ },
53
+ "category": { "type": "string", "minLength": 1 },
54
+ "tags": {
55
+ "type": "array",
56
+ "items": { "type": "string", "minLength": 1 }
57
+ },
58
+ "compatibility": { "$ref": "#/$defs/compatibility" },
59
+ "requirements": {
60
+ "type": "array",
61
+ "description": "Normalized runtime requirements derived from backend/task-preset.json.",
62
+ "items": {
63
+ "type": "object",
64
+ "required": ["type", "name"],
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "type": { "type": "string", "enum": ["agent", "skills", "cli", "host", "capability"] },
68
+ "name": { "type": "string", "minLength": 1 },
69
+ "command": { "type": "string" },
70
+ "args": { "type": "array", "items": { "type": "string" } }
71
+ }
72
+ }
73
+ },
74
+ "resources": {
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "properties": {
78
+ "manifest": { "type": "string", "description": "Public URL or site-root-relative path to the manifest." },
79
+ "backend": { "type": "string" },
80
+ "frontend": { "type": "string" },
81
+ "prompts": { "type": "string" },
82
+ "locales": {
83
+ "type": "array",
84
+ "items": { "type": "string" },
85
+ "description": "Locale bundle identifiers or public paths."
86
+ },
87
+ "storePage": {
88
+ "type": "array",
89
+ "items": { "type": "string" },
90
+ "description": "Public paths to store-page documents."
91
+ }
92
+ }
93
+ },
94
+ "installation": {
95
+ "type": "object",
96
+ "required": ["packageUrl", "mediaType", "sha256"],
97
+ "additionalProperties": false,
98
+ "properties": {
99
+ "packageUrl": {
100
+ "type": "string",
101
+ "pattern": "^/packages/[a-z0-9][a-z0-9-]*\\.zip$"
102
+ },
103
+ "mediaType": { "const": "application/zip" },
104
+ "size": {
105
+ "type": "integer",
106
+ "minimum": 0,
107
+ "description": "Byte size of the published archive when known."
108
+ },
109
+ "sha256": {
110
+ "type": "string",
111
+ "pattern": "^[a-f0-9]{64}$",
112
+ "description": "Lowercase SHA-256 digest of the exact published archive bytes."
113
+ },
114
+ "algorithm": { "const": "sha256" }
115
+ }
116
+ },
117
+ "documentation": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "storePage": {
122
+ "type": "object",
123
+ "description": "Localized store-page URLs keyed by locale code.",
124
+ "additionalProperties": { "type": "string" }
125
+ },
126
+ "external": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "object",
130
+ "required": ["label", "url"],
131
+ "additionalProperties": false,
132
+ "properties": {
133
+ "label": { "type": "string" },
134
+ "url": { "type": "string" }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ },
140
+ "localization": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "properties": {
144
+ "defaultLocale": { "type": "string" },
145
+ "supportedLocales": {
146
+ "type": "array",
147
+ "items": { "type": "string" }
148
+ }
149
+ }
150
+ },
151
+ "metadata": {
152
+ "type": "object",
153
+ "description": "Optional source-of-truth metadata preserved from the package manifest (owner, status, icon, kind, etc.)."
154
+ }
155
+ },
156
+ "$defs": {
157
+ "compatibility": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "properties": {
161
+ "agent": { "type": "string" },
162
+ "skills": {
163
+ "type": "array",
164
+ "items": { "type": "string", "minLength": 1 }
165
+ },
166
+ "cli": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "object",
170
+ "required": ["name"],
171
+ "additionalProperties": false,
172
+ "properties": {
173
+ "name": { "type": "string", "minLength": 1 },
174
+ "command": { "type": "string" },
175
+ "args": { "type": "array", "items": { "type": "string" } }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://hagicode.local/designs/task-preset-plugin-schemas/commands.schema.json",
4
+ "title": "Task Preset Plugin Command Catalog",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "selectionMode",
9
+ "groups",
10
+ "commands"
11
+ ],
12
+ "properties": {
13
+ "$schema": {
14
+ "type": "string"
15
+ },
16
+ "schemaVersion": {
17
+ "type": "string",
18
+ "const": "1.1"
19
+ },
20
+ "selectionMode": {
21
+ "type": "string",
22
+ "enum": [
23
+ "single",
24
+ "multiple"
25
+ ]
26
+ },
27
+ "docs": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "baseUrl": {
32
+ "type": "string"
33
+ },
34
+ "routeTemplate": {
35
+ "type": "string"
36
+ },
37
+ "languageResolver": {
38
+ "type": "string"
39
+ }
40
+ }
41
+ },
42
+ "groups": {
43
+ "type": "array",
44
+ "minItems": 1,
45
+ "items": {
46
+ "$ref": "#/$defs/group"
47
+ }
48
+ },
49
+ "commands": {
50
+ "type": "array",
51
+ "minItems": 1,
52
+ "items": {
53
+ "$ref": "#/$defs/command"
54
+ }
55
+ }
56
+ },
57
+ "$defs": {
58
+ "group": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "id",
63
+ "title"
64
+ ],
65
+ "properties": {
66
+ "id": {
67
+ "type": "string"
68
+ },
69
+ "title": {
70
+ "$ref": "#/$defs/localizedKey"
71
+ },
72
+ "description": {
73
+ "$ref": "#/$defs/localizedKey"
74
+ }
75
+ }
76
+ },
77
+ "command": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "id",
82
+ "groupId",
83
+ "label"
84
+ ],
85
+ "properties": {
86
+ "id": {
87
+ "type": "string"
88
+ },
89
+ "groupId": {
90
+ "type": "string"
91
+ },
92
+ "label": {
93
+ "type": "string"
94
+ },
95
+ "skill": {
96
+ "type": "string"
97
+ },
98
+ "description": {
99
+ "$ref": "#/$defs/localizedKey"
100
+ },
101
+ "docsSlug": {
102
+ "type": "string"
103
+ },
104
+ "preludeTemplate": {
105
+ "type": "string"
106
+ }
107
+ }
108
+ },
109
+ "localizedKey": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": [
113
+ "key"
114
+ ],
115
+ "properties": {
116
+ "key": {
117
+ "type": "string"
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://hagicode.local/designs/task-preset-plugin-schemas/locales.schema.json",
4
+ "title": "Task Preset Plugin Locale Bundle",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "$ref": "#/$defs/localeNode"
8
+ },
9
+ "$defs": {
10
+ "localeNode": {
11
+ "oneOf": [
12
+ {
13
+ "type": "string"
14
+ },
15
+ {
16
+ "type": "object",
17
+ "additionalProperties": {
18
+ "$ref": "#/$defs/localeNode"
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ }
24
+ }