@shrkcrft/plugin-api 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/ai-provider-plugin.d.ts +9 -0
- package/dist/ai-provider-plugin.d.ts.map +1 -0
- package/dist/ai-provider-plugin.js +1 -0
- package/dist/command-plugin.d.ts +11 -0
- package/dist/command-plugin.d.ts.map +1 -0
- package/dist/command-plugin.js +1 -0
- package/dist/construct.d.ts +57 -0
- package/dist/construct.d.ts.map +1 -0
- package/dist/construct.js +18 -0
- package/dist/convention.d.ts +77 -0
- package/dist/convention.d.ts.map +1 -0
- package/dist/convention.js +50 -0
- package/dist/generator-plugin.d.ts +6 -0
- package/dist/generator-plugin.d.ts.map +1 -0
- package/dist/generator-plugin.js +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/knowledge-plugin.d.ts +15 -0
- package/dist/knowledge-plugin.d.ts.map +1 -0
- package/dist/knowledge-plugin.js +1 -0
- package/dist/mcp-tool-plugin.d.ts +9 -0
- package/dist/mcp-tool-plugin.d.ts.map +1 -0
- package/dist/mcp-tool-plugin.js +1 -0
- package/dist/pack-helper.d.ts +63 -0
- package/dist/pack-helper.d.ts.map +1 -0
- package/dist/pack-helper.js +40 -0
- package/dist/pack-manifest.d.ts +138 -0
- package/dist/pack-manifest.d.ts.map +1 -0
- package/dist/pack-manifest.js +96 -0
- package/dist/pack-signing.d.ts +50 -0
- package/dist/pack-signing.d.ts.map +1 -0
- package/dist/pack-signing.js +114 -0
- package/dist/playbook.d.ts +43 -0
- package/dist/playbook.d.ts.map +1 -0
- package/dist/playbook.js +13 -0
- package/dist/plugin-lifecycle-profile.d.ts +98 -0
- package/dist/plugin-lifecycle-profile.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile.js +119 -0
- package/dist/policy-check.d.ts +28 -0
- package/dist/policy-check.d.ts.map +1 -0
- package/dist/policy-check.js +3 -0
- package/dist/registration-hint.d.ts +96 -0
- package/dist/registration-hint.d.ts.map +1 -0
- package/dist/registration-hint.js +47 -0
- package/dist/scaffold-pattern.d.ts +56 -0
- package/dist/scaffold-pattern.d.ts.map +1 -0
- package/dist/scaffold-pattern.js +32 -0
- package/dist/search-tuning.d.ts +33 -0
- package/dist/search-tuning.d.ts.map +1 -0
- package/dist/search-tuning.js +3 -0
- package/dist/sharkcraft-plugin.d.ts +13 -0
- package/dist/sharkcraft-plugin.d.ts.map +1 -0
- package/dist/sharkcraft-plugin.js +1 -0
- package/dist/task-routing-hint.d.ts +49 -0
- package/dist/task-routing-hint.d.ts.map +1 -0
- package/dist/task-routing-hint.js +29 -0
- package/dist/template-plugin.d.ts +10 -0
- package/dist/template-plugin.d.ts.map +1 -0
- package/dist/template-plugin.js +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SharkCraft contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @shrkcrft/plugin-api
|
|
2
|
+
|
|
3
|
+
SharkCraft plugin API: extension points for commands, knowledge, templates, MCP tools.
|
|
4
|
+
|
|
5
|
+
Part of [SharkCraft](https://github.com/shrkcrft/sharkcraft) — a deterministic, local-first toolkit that gives AI coding agents durable project context. See the main repo for documentation, examples, and the `shrk` CLI.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @shrkcrft/plugin-api
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ISharkCraftPlugin } from './sharkcraft-plugin.js';
|
|
2
|
+
export interface IAiProviderRegistration {
|
|
3
|
+
providerId: string;
|
|
4
|
+
providerName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAiProviderPlugin extends ISharkCraftPlugin {
|
|
7
|
+
readonly providers: readonly IAiProviderRegistration[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ai-provider-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-provider-plugin.d.ts","sourceRoot":"","sources":["../src/ai-provider-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,QAAQ,CAAC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ISharkCraftPlugin } from './sharkcraft-plugin.js';
|
|
2
|
+
export interface ICommandPluginCommand {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
/** Returns exit code: 0 success, non-zero failure. */
|
|
6
|
+
run: (args: readonly string[]) => Promise<number> | number;
|
|
7
|
+
}
|
|
8
|
+
export interface ICommandPlugin extends ISharkCraftPlugin {
|
|
9
|
+
readonly commands: readonly ICommandPluginCommand[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=command-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-plugin.d.ts","sourceRoot":"","sources":["../src/command-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC5D;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharkCraft constructs: a generic, project-agnostic system for modeling
|
|
3
|
+
* "the thing this codebase calls X" — plugins, services, modules, features,
|
|
4
|
+
* etc. A construct bundles together files, public API entries, events,
|
|
5
|
+
* tokens, commands, and related knowledge / rules / templates so that
|
|
6
|
+
* `shrk constructs trace <id>` can give a single coherent view.
|
|
7
|
+
*
|
|
8
|
+
* Constructs intentionally have no hardcoded "type" set. The `type` field is
|
|
9
|
+
* a free string so packs can model their own domain (one project might
|
|
10
|
+
* use 'plugin' / 'policy' / 'capability'; another might use 'service' /
|
|
11
|
+
* 'module' / 'feature').
|
|
12
|
+
*/
|
|
13
|
+
export interface IConstructFacetValue {
|
|
14
|
+
/** Stable id within the facet. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** The actual value (e.g. event topic, token name). */
|
|
17
|
+
value: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
source?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IConstructInput {
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
tags?: readonly string[];
|
|
27
|
+
/** Files belonging to the construct (relative to projectRoot). */
|
|
28
|
+
files?: readonly string[];
|
|
29
|
+
/** Public-API entries (re-exports, entrypoint files, named exports). */
|
|
30
|
+
publicApi?: readonly string[];
|
|
31
|
+
/** Stable event topics emitted / consumed by this construct. */
|
|
32
|
+
events?: readonly string[];
|
|
33
|
+
/** Stable token names (DI / capability / config keys). */
|
|
34
|
+
tokens?: readonly string[];
|
|
35
|
+
/** CLI / shell commands attached to the construct. */
|
|
36
|
+
commands?: readonly string[];
|
|
37
|
+
/** Knowledge ids related to this construct. */
|
|
38
|
+
relatedKnowledge?: readonly string[];
|
|
39
|
+
relatedRules?: readonly string[];
|
|
40
|
+
relatedTemplates?: readonly string[];
|
|
41
|
+
relatedPipelines?: readonly string[];
|
|
42
|
+
relatedPathConventions?: readonly string[];
|
|
43
|
+
/** Free-form facets keyed by name (e.g. capabilities, hooks, …). */
|
|
44
|
+
facets?: Record<string, readonly IConstructFacetValue[]>;
|
|
45
|
+
}
|
|
46
|
+
export declare function defineConstruct(input: IConstructInput): IConstructInput;
|
|
47
|
+
export interface IConstructFacetInput {
|
|
48
|
+
id: string;
|
|
49
|
+
constructId: string;
|
|
50
|
+
/** Free-string kind: 'event' | 'token' | 'api' | 'file' | 'command' | … */
|
|
51
|
+
kind: string;
|
|
52
|
+
value: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
source?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function defineConstructFacet(input: IConstructFacetInput): IConstructFacetInput;
|
|
57
|
+
//# sourceMappingURL=construct.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct.d.ts","sourceRoot":"","sources":["../src/construct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,kEAAkE;IAClE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAC,CAAC;CAC1D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAEvE;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAEtF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharkCraft constructs: a generic, project-agnostic system for modeling
|
|
3
|
+
* "the thing this codebase calls X" — plugins, services, modules, features,
|
|
4
|
+
* etc. A construct bundles together files, public API entries, events,
|
|
5
|
+
* tokens, commands, and related knowledge / rules / templates so that
|
|
6
|
+
* `shrk constructs trace <id>` can give a single coherent view.
|
|
7
|
+
*
|
|
8
|
+
* Constructs intentionally have no hardcoded "type" set. The `type` field is
|
|
9
|
+
* a free string so packs can model their own domain (one project might
|
|
10
|
+
* use 'plugin' / 'policy' / 'capability'; another might use 'service' /
|
|
11
|
+
* 'module' / 'feature').
|
|
12
|
+
*/
|
|
13
|
+
export function defineConstruct(input) {
|
|
14
|
+
return input;
|
|
15
|
+
}
|
|
16
|
+
export function defineConstructFacet(input) {
|
|
17
|
+
return input;
|
|
18
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic naming / path / barrel / layout convention.
|
|
3
|
+
*
|
|
4
|
+
* Packs and local config contribute conventions via `conventionFiles[]`.
|
|
5
|
+
* The engine has zero built-in conventions; everything comes from
|
|
6
|
+
* contributions.
|
|
7
|
+
*
|
|
8
|
+
* A convention is static data — no executable code. Rules describe
|
|
9
|
+
* patterns to expect / forbid; the engine matches files against them.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ConventionKind {
|
|
12
|
+
Path = "path",
|
|
13
|
+
Naming = "naming",
|
|
14
|
+
Barrel = "barrel",
|
|
15
|
+
Layout = "layout",
|
|
16
|
+
Command = "command",
|
|
17
|
+
Validation = "validation",
|
|
18
|
+
Ownership = "ownership",
|
|
19
|
+
Testing = "testing",
|
|
20
|
+
Release = "release",
|
|
21
|
+
Safety = "safety"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ConventionSeverity {
|
|
24
|
+
Info = "info",
|
|
25
|
+
Warning = "warning",
|
|
26
|
+
Error = "error"
|
|
27
|
+
}
|
|
28
|
+
export interface IConventionAppliesTo {
|
|
29
|
+
readonly languages?: readonly string[];
|
|
30
|
+
readonly frameworks?: readonly string[];
|
|
31
|
+
readonly fileGlobs?: readonly string[];
|
|
32
|
+
readonly constructKinds?: readonly string[];
|
|
33
|
+
readonly profileIds?: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
export interface IConventionRule {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly description: string;
|
|
38
|
+
/** Optional regex describing what *should* match. */
|
|
39
|
+
readonly expectMatch?: string;
|
|
40
|
+
/** Optional regex describing what *must not* match. */
|
|
41
|
+
readonly forbidMatch?: string;
|
|
42
|
+
/** Optional file-name pattern. */
|
|
43
|
+
readonly filePattern?: string;
|
|
44
|
+
/** Optional severity override for this rule (else parent severity). */
|
|
45
|
+
readonly severity?: ConventionSeverity;
|
|
46
|
+
}
|
|
47
|
+
export interface IConventionExample {
|
|
48
|
+
readonly description: string;
|
|
49
|
+
readonly good?: readonly string[];
|
|
50
|
+
readonly bad?: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
export interface IConventionReference {
|
|
53
|
+
readonly kind: 'file' | 'doc' | 'command' | 'knowledge' | 'rule';
|
|
54
|
+
readonly value: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IConvention {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly title: string;
|
|
59
|
+
readonly description?: string;
|
|
60
|
+
readonly kind: ConventionKind;
|
|
61
|
+
readonly appliesTo?: IConventionAppliesTo;
|
|
62
|
+
readonly rules: readonly IConventionRule[];
|
|
63
|
+
readonly examples?: readonly IConventionExample[];
|
|
64
|
+
readonly references?: readonly IConventionReference[];
|
|
65
|
+
readonly severity: ConventionSeverity;
|
|
66
|
+
readonly tags?: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
export interface IConventionValidationIssue {
|
|
69
|
+
readonly field: string;
|
|
70
|
+
readonly message: string;
|
|
71
|
+
}
|
|
72
|
+
export interface IConventionValidationResult {
|
|
73
|
+
readonly valid: boolean;
|
|
74
|
+
readonly issues: readonly IConventionValidationIssue[];
|
|
75
|
+
}
|
|
76
|
+
export declare function validateConvention(value: unknown): IConventionValidationResult;
|
|
77
|
+
//# sourceMappingURL=convention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convention.d.ts","sourceRoot":"","sources":["../src/convention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAoB9E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic naming / path / barrel / layout convention.
|
|
3
|
+
*
|
|
4
|
+
* Packs and local config contribute conventions via `conventionFiles[]`.
|
|
5
|
+
* The engine has zero built-in conventions; everything comes from
|
|
6
|
+
* contributions.
|
|
7
|
+
*
|
|
8
|
+
* A convention is static data — no executable code. Rules describe
|
|
9
|
+
* patterns to expect / forbid; the engine matches files against them.
|
|
10
|
+
*/
|
|
11
|
+
export var ConventionKind;
|
|
12
|
+
(function (ConventionKind) {
|
|
13
|
+
ConventionKind["Path"] = "path";
|
|
14
|
+
ConventionKind["Naming"] = "naming";
|
|
15
|
+
ConventionKind["Barrel"] = "barrel";
|
|
16
|
+
ConventionKind["Layout"] = "layout";
|
|
17
|
+
ConventionKind["Command"] = "command";
|
|
18
|
+
ConventionKind["Validation"] = "validation";
|
|
19
|
+
ConventionKind["Ownership"] = "ownership";
|
|
20
|
+
ConventionKind["Testing"] = "testing";
|
|
21
|
+
ConventionKind["Release"] = "release";
|
|
22
|
+
ConventionKind["Safety"] = "safety";
|
|
23
|
+
})(ConventionKind || (ConventionKind = {}));
|
|
24
|
+
export var ConventionSeverity;
|
|
25
|
+
(function (ConventionSeverity) {
|
|
26
|
+
ConventionSeverity["Info"] = "info";
|
|
27
|
+
ConventionSeverity["Warning"] = "warning";
|
|
28
|
+
ConventionSeverity["Error"] = "error";
|
|
29
|
+
})(ConventionSeverity || (ConventionSeverity = {}));
|
|
30
|
+
export function validateConvention(value) {
|
|
31
|
+
const issues = [];
|
|
32
|
+
if (!value || typeof value !== 'object') {
|
|
33
|
+
return { valid: false, issues: [{ field: '<root>', message: 'convention must be an object' }] };
|
|
34
|
+
}
|
|
35
|
+
const obj = value;
|
|
36
|
+
if (typeof obj.id !== 'string' || obj.id.length === 0) {
|
|
37
|
+
issues.push({ field: 'id', message: 'id must be a non-empty string' });
|
|
38
|
+
}
|
|
39
|
+
if (typeof obj.title !== 'string' || obj.title.length === 0) {
|
|
40
|
+
issues.push({ field: 'title', message: 'title must be a non-empty string' });
|
|
41
|
+
}
|
|
42
|
+
const knownKinds = new Set(Object.values(ConventionKind));
|
|
43
|
+
if (typeof obj.kind !== 'string' || !knownKinds.has(obj.kind)) {
|
|
44
|
+
issues.push({ field: 'kind', message: 'kind must be one of ConventionKind' });
|
|
45
|
+
}
|
|
46
|
+
if (!Array.isArray(obj.rules)) {
|
|
47
|
+
issues.push({ field: 'rules', message: 'rules must be an array' });
|
|
48
|
+
}
|
|
49
|
+
return { valid: issues.length === 0, issues };
|
|
50
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ISharkCraftPlugin } from './sharkcraft-plugin.js';
|
|
2
|
+
export interface IGeneratorPlugin extends ISharkCraftPlugin {
|
|
3
|
+
/** Returns generator IDs this plugin provides. */
|
|
4
|
+
listGeneratorIds(): readonly string[];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=generator-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-plugin.d.ts","sourceRoot":"","sources":["../src/generator-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,kDAAkD;IAClD,gBAAgB,IAAI,SAAS,MAAM,EAAE,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './sharkcraft-plugin.js';
|
|
2
|
+
export * from './command-plugin.js';
|
|
3
|
+
export * from './knowledge-plugin.js';
|
|
4
|
+
export * from './template-plugin.js';
|
|
5
|
+
export * from './generator-plugin.js';
|
|
6
|
+
export * from './ai-provider-plugin.js';
|
|
7
|
+
export * from './mcp-tool-plugin.js';
|
|
8
|
+
export * from './pack-manifest.js';
|
|
9
|
+
export * from './pack-signing.js';
|
|
10
|
+
export * from './scaffold-pattern.js';
|
|
11
|
+
export * from './construct.js';
|
|
12
|
+
export * from './playbook.js';
|
|
13
|
+
export * from './policy-check.js';
|
|
14
|
+
export * from './search-tuning.js';
|
|
15
|
+
export * from './plugin-lifecycle-profile.js';
|
|
16
|
+
export * from './convention.js';
|
|
17
|
+
export * from './pack-helper.js';
|
|
18
|
+
export * from './task-routing-hint.js';
|
|
19
|
+
export * from './registration-hint.js';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./sharkcraft-plugin.js";
|
|
2
|
+
export * from "./command-plugin.js";
|
|
3
|
+
export * from "./knowledge-plugin.js";
|
|
4
|
+
export * from "./template-plugin.js";
|
|
5
|
+
export * from "./generator-plugin.js";
|
|
6
|
+
export * from "./ai-provider-plugin.js";
|
|
7
|
+
export * from "./mcp-tool-plugin.js";
|
|
8
|
+
export * from "./pack-manifest.js";
|
|
9
|
+
export * from "./pack-signing.js";
|
|
10
|
+
export * from "./scaffold-pattern.js";
|
|
11
|
+
export * from "./construct.js";
|
|
12
|
+
export * from "./playbook.js";
|
|
13
|
+
export * from "./policy-check.js";
|
|
14
|
+
export * from "./search-tuning.js";
|
|
15
|
+
export * from "./plugin-lifecycle-profile.js";
|
|
16
|
+
export * from "./convention.js";
|
|
17
|
+
export * from "./pack-helper.js";
|
|
18
|
+
export * from "./task-routing-hint.js";
|
|
19
|
+
export * from "./registration-hint.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ISharkCraftPlugin } from './sharkcraft-plugin.js';
|
|
2
|
+
export interface IKnowledgePluginEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
type: string;
|
|
6
|
+
priority: string;
|
|
7
|
+
scope: readonly string[];
|
|
8
|
+
tags: readonly string[];
|
|
9
|
+
appliesWhen: readonly string[];
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IKnowledgePlugin extends ISharkCraftPlugin {
|
|
13
|
+
readonly entries: readonly IKnowledgePluginEntry[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=knowledge-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-plugin.d.ts","sourceRoot":"","sources":["../src/knowledge-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ISharkCraftPlugin } from './sharkcraft-plugin.js';
|
|
2
|
+
export interface IMcpToolRegistration {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IMcpToolPlugin extends ISharkCraftPlugin {
|
|
7
|
+
readonly tools: readonly IMcpToolRegistration[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=mcp-tool-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-tool-plugin.d.ts","sourceRoot":"","sources":["../src/mcp-tool-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack-contributed helper definition.
|
|
3
|
+
*
|
|
4
|
+
* Packs can ship project-specific helpers via `helperFiles[]`. Each helper is
|
|
5
|
+
* static data — no executable pack code beyond declarative operations the
|
|
6
|
+
* engine understands. The engine plans and previews; never auto-applies.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PackHelperOutputKind {
|
|
9
|
+
Preview = "preview",
|
|
10
|
+
Plan = "plan",
|
|
11
|
+
Checklist = "checklist"
|
|
12
|
+
}
|
|
13
|
+
export interface IPackHelperSafety {
|
|
14
|
+
readonly readOnly?: boolean;
|
|
15
|
+
readonly writesDrafts?: boolean;
|
|
16
|
+
readonly writesSource?: boolean;
|
|
17
|
+
readonly requiresProfile?: boolean;
|
|
18
|
+
readonly requiresHumanReview?: boolean;
|
|
19
|
+
readonly destructivePotential?: boolean;
|
|
20
|
+
readonly outputKind: PackHelperOutputKind;
|
|
21
|
+
}
|
|
22
|
+
export interface IPackHelperVariable {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly required: boolean;
|
|
25
|
+
readonly description: string;
|
|
26
|
+
readonly defaultValue?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IPackHelperOperationInput {
|
|
29
|
+
readonly kind: 'append-line' | 'insert-before' | 'replace-line' | 'remove-line' | 'manual-checklist';
|
|
30
|
+
readonly targetPath?: string;
|
|
31
|
+
readonly anchor?: string;
|
|
32
|
+
readonly snippet?: string;
|
|
33
|
+
readonly find?: string;
|
|
34
|
+
readonly replaceWith?: string;
|
|
35
|
+
readonly checklist?: readonly string[];
|
|
36
|
+
readonly description: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IPackHelper {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly title: string;
|
|
41
|
+
readonly description: string;
|
|
42
|
+
readonly variables: readonly IPackHelperVariable[];
|
|
43
|
+
/**
|
|
44
|
+
* Declarative operation list. The engine renders these as plan v2 ops
|
|
45
|
+
* (no arbitrary pack code execution). When `operations` is empty, the
|
|
46
|
+
* helper acts as a checklist generator only.
|
|
47
|
+
*/
|
|
48
|
+
readonly operations?: readonly IPackHelperOperationInput[];
|
|
49
|
+
readonly manualChecklist?: readonly string[];
|
|
50
|
+
readonly tags?: readonly string[];
|
|
51
|
+
readonly appliesWhen?: readonly string[];
|
|
52
|
+
readonly safety: IPackHelperSafety;
|
|
53
|
+
}
|
|
54
|
+
export interface IPackHelperValidationIssue {
|
|
55
|
+
readonly field: string;
|
|
56
|
+
readonly message: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IPackHelperValidationResult {
|
|
59
|
+
readonly valid: boolean;
|
|
60
|
+
readonly issues: readonly IPackHelperValidationIssue[];
|
|
61
|
+
}
|
|
62
|
+
export declare function validatePackHelper(value: unknown): IPackHelperValidationResult;
|
|
63
|
+
//# sourceMappingURL=pack-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-helper.d.ts","sourceRoot":"","sources":["../src/pack-helper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAC;IACrG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC3D,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAyB9E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack-contributed helper definition.
|
|
3
|
+
*
|
|
4
|
+
* Packs can ship project-specific helpers via `helperFiles[]`. Each helper is
|
|
5
|
+
* static data — no executable pack code beyond declarative operations the
|
|
6
|
+
* engine understands. The engine plans and previews; never auto-applies.
|
|
7
|
+
*/
|
|
8
|
+
export var PackHelperOutputKind;
|
|
9
|
+
(function (PackHelperOutputKind) {
|
|
10
|
+
PackHelperOutputKind["Preview"] = "preview";
|
|
11
|
+
PackHelperOutputKind["Plan"] = "plan";
|
|
12
|
+
PackHelperOutputKind["Checklist"] = "checklist";
|
|
13
|
+
})(PackHelperOutputKind || (PackHelperOutputKind = {}));
|
|
14
|
+
export function validatePackHelper(value) {
|
|
15
|
+
const issues = [];
|
|
16
|
+
if (!value || typeof value !== 'object') {
|
|
17
|
+
return { valid: false, issues: [{ field: '<root>', message: 'helper must be an object' }] };
|
|
18
|
+
}
|
|
19
|
+
const o = value;
|
|
20
|
+
if (typeof o.id !== 'string' || o.id.length === 0) {
|
|
21
|
+
issues.push({ field: 'id', message: 'id required' });
|
|
22
|
+
}
|
|
23
|
+
if (typeof o.title !== 'string' || o.title.length === 0) {
|
|
24
|
+
issues.push({ field: 'title', message: 'title required' });
|
|
25
|
+
}
|
|
26
|
+
if (!Array.isArray(o.variables)) {
|
|
27
|
+
issues.push({ field: 'variables', message: 'variables must be an array' });
|
|
28
|
+
}
|
|
29
|
+
const safety = o.safety;
|
|
30
|
+
if (!safety || typeof safety !== 'object') {
|
|
31
|
+
issues.push({ field: 'safety', message: 'safety required' });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const validOutput = new Set(['preview', 'plan', 'checklist']);
|
|
35
|
+
if (typeof safety.outputKind !== 'string' || !validOutput.has(safety.outputKind)) {
|
|
36
|
+
issues.push({ field: 'safety.outputKind', message: 'outputKind must be preview|plan|checklist' });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { valid: issues.length === 0, issues };
|
|
40
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SharkCraft pack manifest.
|
|
3
|
+
*
|
|
4
|
+
* A "pack" is a third-party npm package that ships SharkCraft assets —
|
|
5
|
+
* knowledge entries, rules, paths, templates, pipelines, MCP-tool registrations,
|
|
6
|
+
* AI-provider adapters, etc.
|
|
7
|
+
*
|
|
8
|
+
* The pack itself is just an npm package whose `package.json` declares a
|
|
9
|
+
* `sharkcraft.manifest` entry pointing at a TS/JS file that default-exports an
|
|
10
|
+
* `ISharkCraftPackManifest`. The discovery scanner (planned for v0.2) finds
|
|
11
|
+
* these manifests in `node_modules/` and registers their contributions.
|
|
12
|
+
*
|
|
13
|
+
* Today this file declares the types and a small validator. The discovery
|
|
14
|
+
* runner is intentionally out of scope for v0.1 — see docs/packs.md.
|
|
15
|
+
*/
|
|
16
|
+
export interface ISharkCraftPackInfo {
|
|
17
|
+
/** Package name as published (e.g. "@example/sharkcraft-pack"). */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Pack version (typically the package version). */
|
|
20
|
+
version: string;
|
|
21
|
+
/** Short human-readable description. */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Author / vendor. */
|
|
24
|
+
author?: string;
|
|
25
|
+
/** Homepage / repo URL. */
|
|
26
|
+
homepage?: string;
|
|
27
|
+
/** Free-form license string. */
|
|
28
|
+
license?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ISharkCraftPackContributions {
|
|
31
|
+
/** Relative paths (from the pack root) to knowledge files. */
|
|
32
|
+
knowledgeFiles?: readonly string[];
|
|
33
|
+
ruleFiles?: readonly string[];
|
|
34
|
+
pathFiles?: readonly string[];
|
|
35
|
+
templateFiles?: readonly string[];
|
|
36
|
+
pipelineFiles?: readonly string[];
|
|
37
|
+
docsFiles?: readonly string[];
|
|
38
|
+
/** Preset definition files (default export = array of IPreset). */
|
|
39
|
+
presetFiles?: readonly string[];
|
|
40
|
+
/** Boundary rule files (default export = array of IBoundaryRule). */
|
|
41
|
+
boundaryFiles?: readonly string[];
|
|
42
|
+
/** Context regression test files. */
|
|
43
|
+
contextTestFiles?: readonly string[];
|
|
44
|
+
/** Agent contract test files. */
|
|
45
|
+
agentTestFiles?: readonly string[];
|
|
46
|
+
/** Future: MCP tool registrations, AI providers, etc. */
|
|
47
|
+
mcpToolFiles?: readonly string[];
|
|
48
|
+
aiProviderFiles?: readonly string[];
|
|
49
|
+
/** Scaffold pattern files (default export = array of IScaffoldPattern). */
|
|
50
|
+
scaffoldPatternFiles?: readonly string[];
|
|
51
|
+
/** Policy check files (default export = array of IPackPolicyCheck). */
|
|
52
|
+
policyCheckFiles?: readonly string[];
|
|
53
|
+
/** Construct definition files (default export = array of IConstructInput). */
|
|
54
|
+
constructFiles?: readonly string[];
|
|
55
|
+
/** Standalone construct facet files. */
|
|
56
|
+
constructFacetFiles?: readonly string[];
|
|
57
|
+
/** Playbook definition files (default export = array of IPlaybookInput). */
|
|
58
|
+
playbookFiles?: readonly string[];
|
|
59
|
+
/** Search-tuning definition files (default export = array of ISearchTuning). */
|
|
60
|
+
searchTuningFiles?: readonly string[];
|
|
61
|
+
/** Pack-extensible feedback rules (default export = array of IFeedbackRule). */
|
|
62
|
+
feedbackRuleFiles?: readonly string[];
|
|
63
|
+
/** TypeScript-authored decision records (default export = array of IDecision). */
|
|
64
|
+
decisionFiles?: readonly string[];
|
|
65
|
+
/** Pack-extensible path conventions when separate from `pathFiles`. */
|
|
66
|
+
pathConventionFiles?: readonly string[];
|
|
67
|
+
/** Pack-contributed plugin lifecycle profiles. Files default-export `readonly IPluginLifecycleProfile[]`. */
|
|
68
|
+
pluginLifecycleProfileFiles?: readonly string[];
|
|
69
|
+
/** Pack-contributed agent-contract templates. Files default-export `readonly IAgentContractTemplate[]`. */
|
|
70
|
+
contractTemplateFiles?: readonly string[];
|
|
71
|
+
/** Pack-contributed migration readiness profiles. */
|
|
72
|
+
migrationProfileFiles?: readonly string[];
|
|
73
|
+
/** Pack-contributed naming/path/barrel conventions. */
|
|
74
|
+
conventionFiles?: readonly string[];
|
|
75
|
+
/** Pack-contributed helpers. Files default-export `readonly IPackHelper[]`. */
|
|
76
|
+
helperFiles?: readonly string[];
|
|
77
|
+
/** Pack-contributed task routing hints. Files default-export `readonly ITaskRoutingHint[]`. */
|
|
78
|
+
taskRoutingHintFiles?: readonly string[];
|
|
79
|
+
/** Pack-contributed registration hints. Files default-export `readonly IRegistrationHint[]`. */
|
|
80
|
+
registrationHintFiles?: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
export interface ISharkCraftPackSignature {
|
|
83
|
+
/** Algorithm marker (HMAC-SHA256). */
|
|
84
|
+
algo: 'sha256';
|
|
85
|
+
/** Hex-encoded HMAC over canonical-JSON(info + contributions + postInstallNotes). */
|
|
86
|
+
hmac: string;
|
|
87
|
+
/** ISO timestamp of when the manifest was signed. */
|
|
88
|
+
signedAt: string;
|
|
89
|
+
/**
|
|
90
|
+
* Identifier (opaque) of the key used to produce the signature. Lets consumers
|
|
91
|
+
* keep a registry of trusted key ids — see docs/pack-signing.md.
|
|
92
|
+
*/
|
|
93
|
+
keyId?: string;
|
|
94
|
+
/**
|
|
95
|
+
* When `true`, this signature was produced by the dev/local signing
|
|
96
|
+
* flow (`shrk packs sign --dev`) and is NOT release-trusted. Apply paths
|
|
97
|
+
* that require release-level signing must reject dev signatures unless
|
|
98
|
+
* the caller opts in with `--allow-dev-signature`.
|
|
99
|
+
*
|
|
100
|
+
* Dev signatures use a well-known dev secret so any developer can produce
|
|
101
|
+
* them mid-session without holding the release secret. They are honest
|
|
102
|
+
* about being dev-only — they do not prove publisher identity.
|
|
103
|
+
*/
|
|
104
|
+
dev?: boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface ISharkCraftPackManifest {
|
|
107
|
+
/** Schema marker; reserved for forward compatibility. */
|
|
108
|
+
schema: 'sharkcraft.pack/v1';
|
|
109
|
+
info: ISharkCraftPackInfo;
|
|
110
|
+
contributions: ISharkCraftPackContributions;
|
|
111
|
+
/** Optional human-readable post-install notes. */
|
|
112
|
+
postInstallNotes?: readonly string[];
|
|
113
|
+
/**
|
|
114
|
+
* Optional HMAC signature over the manifest content. When present, consumers
|
|
115
|
+
* can verify the manifest hasn't been tampered with by an attacker who
|
|
116
|
+
* substituted the npm tarball. See {@link signPackManifest}.
|
|
117
|
+
*/
|
|
118
|
+
signature?: ISharkCraftPackSignature;
|
|
119
|
+
}
|
|
120
|
+
export interface IPackManifestValidationIssue {
|
|
121
|
+
field: string;
|
|
122
|
+
message: string;
|
|
123
|
+
}
|
|
124
|
+
export interface IPackManifestValidationResult {
|
|
125
|
+
valid: boolean;
|
|
126
|
+
issues: IPackManifestValidationIssue[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Lightweight runtime validation of a pack manifest. We do not use zod here
|
|
130
|
+
* because plugin-api should remain dependency-light; consumers can layer zod
|
|
131
|
+
* on top if they want.
|
|
132
|
+
*/
|
|
133
|
+
export declare function validatePackManifest(value: unknown): IPackManifestValidationResult;
|
|
134
|
+
/**
|
|
135
|
+
* Convenience for pack authors to write a manifest with type help.
|
|
136
|
+
*/
|
|
137
|
+
export declare function definePackManifest(input: ISharkCraftPackManifest): ISharkCraftPackManifest;
|
|
138
|
+
//# sourceMappingURL=pack-manifest.d.ts.map
|