@lesliechan721/aw-plugin-core 0.1.0-beta.1
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/file-rules.d.ts +2 -0
- package/dist/file-rules.js +42 -0
- package/dist/file-rules.js.map +1 -0
- package/dist/generated/plugin-manifest-v1.d.ts +368 -0
- package/dist/generated/plugin-manifest-v1.js +3 -0
- package/dist/generated/plugin-manifest-v1.js.map +1 -0
- package/dist/hooks-contract.d.ts +189 -0
- package/dist/hooks-contract.js +967 -0
- package/dist/hooks-contract.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest-contract.d.ts +96 -0
- package/dist/manifest-contract.js +2730 -0
- package/dist/manifest-contract.js.map +1 -0
- package/dist/manifest-type-contract.d.ts +7 -0
- package/dist/manifest-type-contract.js +2 -0
- package/dist/manifest-type-contract.js.map +1 -0
- package/dist/manifest.d.ts +27 -0
- package/dist/manifest.js +59 -0
- package/dist/manifest.js.map +1 -0
- package/dist/permission-command.d.ts +3 -0
- package/dist/permission-command.js +11 -0
- package/dist/permission-command.js.map +1 -0
- package/dist/platform-entries.d.ts +13 -0
- package/dist/platform-entries.js +20 -0
- package/dist/platform-entries.js.map +1 -0
- package/dist/platform-support.d.ts +6 -0
- package/dist/platform-support.js +38 -0
- package/dist/platform-support.js.map +1 -0
- package/dist/plugin-release.d.ts +30 -0
- package/dist/plugin-release.js +187 -0
- package/dist/plugin-release.js.map +1 -0
- package/dist/plugin-script-contract.d.ts +33 -0
- package/dist/plugin-script-contract.js +599 -0
- package/dist/plugin-script-contract.js.map +1 -0
- package/dist/portable-skill-validation.d.ts +7 -0
- package/dist/portable-skill-validation.js +111 -0
- package/dist/portable-skill-validation.js.map +1 -0
- package/dist/read-json.d.ts +1 -0
- package/dist/read-json.js +5 -0
- package/dist/read-json.js.map +1 -0
- package/dist/runtime-export-source.d.ts +14 -0
- package/dist/runtime-export-source.js +73 -0
- package/dist/runtime-export-source.js.map +1 -0
- package/dist/skill-authoring.d.ts +2 -0
- package/dist/skill-authoring.js +13 -0
- package/dist/skill-authoring.js.map +1 -0
- package/dist/skill-frontmatter-capabilities.d.ts +36 -0
- package/dist/skill-frontmatter-capabilities.js +120 -0
- package/dist/skill-frontmatter-capabilities.js.map +1 -0
- package/dist/skill-frontmatter-capabilities.json +200 -0
- package/dist/slash-commands.d.ts +43 -0
- package/dist/slash-commands.js +394 -0
- package/dist/slash-commands.js.map +1 -0
- package/dist/template-engine.d.ts +2 -0
- package/dist/template-engine.js +26 -0
- package/dist/template-engine.js.map +1 -0
- package/dist/types.d.ts +428 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/workspace.d.ts +105 -0
- package/dist/workspace.js +963 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +46 -0
- package/schemas/plugin-manifest-v1.json +329 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
function escapeRegexSegment(value) {
|
|
3
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
4
|
+
}
|
|
5
|
+
function compileGlob(pattern) {
|
|
6
|
+
const normalized = pattern.split(path.sep).join('/');
|
|
7
|
+
let source = '^';
|
|
8
|
+
for (let index = 0; index < normalized.length; index += 1) {
|
|
9
|
+
const char = normalized[index];
|
|
10
|
+
const next = normalized[index + 1];
|
|
11
|
+
if (char === '*' && next === '*') {
|
|
12
|
+
source += '.*';
|
|
13
|
+
index += 1;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (char === '*') {
|
|
17
|
+
source += '[^/]*';
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (char === '?') {
|
|
21
|
+
source += '.';
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
source += escapeRegexSegment(char);
|
|
25
|
+
}
|
|
26
|
+
source += '$';
|
|
27
|
+
return new RegExp(source);
|
|
28
|
+
}
|
|
29
|
+
function normalizeRelativePath(filePath) {
|
|
30
|
+
return path.posix.normalize(filePath.split(path.sep).join('/'));
|
|
31
|
+
}
|
|
32
|
+
export function matchesGlob(filePath, pattern) {
|
|
33
|
+
return compileGlob(pattern).test(normalizeRelativePath(filePath));
|
|
34
|
+
}
|
|
35
|
+
export function applyFileRules(filePaths, include, exclude = []) {
|
|
36
|
+
return filePaths
|
|
37
|
+
.map((filePath) => normalizeRelativePath(filePath))
|
|
38
|
+
.filter((filePath) => include.some((pattern) => matchesGlob(filePath, pattern)) &&
|
|
39
|
+
!exclude.some((pattern) => matchesGlob(filePath, pattern)))
|
|
40
|
+
.sort();
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=file-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-rules.js","sourceRoot":"","sources":["../src/file-rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,MAAM,GAAG,GAAG,CAAC;IAEjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAEnC,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjC,MAAM,IAAI,IAAI,CAAC;YACf,KAAK,IAAI,CAAC,CAAC;YACX,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,OAAO,CAAC;YAClB,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,CAAC;YACd,SAAS;QACX,CAAC;QAED,MAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,GAAG,CAAC;IACd,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,OAAe;IAC3D,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,SAAmB,EACnB,OAAiB,EACjB,UAAoB,EAAE;IAEtB,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;SAClD,MAAM,CACL,CAAC,QAAQ,EAAE,EAAE,CACX,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAC7D;SACA,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
3
|
+
* via the `definition` "semver".
|
|
4
|
+
*/
|
|
5
|
+
export type Semver = string;
|
|
6
|
+
/**
|
|
7
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
8
|
+
* via the `definition` "pluginPath".
|
|
9
|
+
*/
|
|
10
|
+
export type PluginPath = string;
|
|
11
|
+
/**
|
|
12
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
13
|
+
* via the `definition` "stringArray".
|
|
14
|
+
*/
|
|
15
|
+
export type StringArray = string[];
|
|
16
|
+
/**
|
|
17
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
18
|
+
* via the `definition` "lifecycleDefinition".
|
|
19
|
+
*/
|
|
20
|
+
export type LifecycleDefinition = (string | {
|
|
21
|
+
default?: ScriptEntry;
|
|
22
|
+
unix?: ScriptEntry;
|
|
23
|
+
windows?: ScriptEntry;
|
|
24
|
+
linux?: ScriptEntry;
|
|
25
|
+
darwin?: ScriptEntry;
|
|
26
|
+
win32?: ScriptEntry;
|
|
27
|
+
});
|
|
28
|
+
export interface PluginManifestSourceV1 {
|
|
29
|
+
schemaVersion?: 1;
|
|
30
|
+
name: string;
|
|
31
|
+
version: Semver;
|
|
32
|
+
description: string;
|
|
33
|
+
/**
|
|
34
|
+
* @maxItems 64
|
|
35
|
+
*/
|
|
36
|
+
dependencies?: string[];
|
|
37
|
+
compatibility?: Compatibility;
|
|
38
|
+
skills?: PluginPath;
|
|
39
|
+
slashCommands?: PluginPath;
|
|
40
|
+
mcpServers?: PluginPath;
|
|
41
|
+
apps?: PluginPath;
|
|
42
|
+
distributions?: Distributions;
|
|
43
|
+
marketplace: Marketplace;
|
|
44
|
+
interface?: Interface;
|
|
45
|
+
extensions?: Extensions;
|
|
46
|
+
artifacts?: Artifacts;
|
|
47
|
+
buildConfig?: BuildConfig;
|
|
48
|
+
scripts?: Scripts;
|
|
49
|
+
config?: Config;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
53
|
+
* via the `definition` "compatibility".
|
|
54
|
+
*/
|
|
55
|
+
export interface Compatibility {
|
|
56
|
+
aw: {
|
|
57
|
+
minVersion: Semver;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
62
|
+
* via the `definition` "distributions".
|
|
63
|
+
*/
|
|
64
|
+
export interface Distributions {
|
|
65
|
+
agentSkills?: {
|
|
66
|
+
skills?: PluginPath;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
71
|
+
* via the `definition` "marketplace".
|
|
72
|
+
*/
|
|
73
|
+
export interface Marketplace {
|
|
74
|
+
category: string;
|
|
75
|
+
tags?: string[];
|
|
76
|
+
strict: boolean;
|
|
77
|
+
policy: {
|
|
78
|
+
installation: ("AVAILABLE" | "NOT_AVAILABLE" | "INSTALLED_BY_DEFAULT");
|
|
79
|
+
authentication: ("ON_INSTALL" | "ON_USE");
|
|
80
|
+
products?: string[];
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
85
|
+
* via the `definition` "interface".
|
|
86
|
+
*/
|
|
87
|
+
export interface Interface {
|
|
88
|
+
displayName?: string;
|
|
89
|
+
shortDescription?: string;
|
|
90
|
+
capabilities?: string[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
94
|
+
* via the `definition` "extensions".
|
|
95
|
+
*/
|
|
96
|
+
export interface Extensions {
|
|
97
|
+
instructions?: Instruction[];
|
|
98
|
+
permissions?: Permission[];
|
|
99
|
+
hooks?: Hook[];
|
|
100
|
+
nativeHooks?: {
|
|
101
|
+
claude?: NativeHook[];
|
|
102
|
+
codex?: NativeHook[];
|
|
103
|
+
};
|
|
104
|
+
agents?: Agent[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
108
|
+
* via the `definition` "instruction".
|
|
109
|
+
*/
|
|
110
|
+
export interface Instruction {
|
|
111
|
+
name: string;
|
|
112
|
+
title: string;
|
|
113
|
+
content: string;
|
|
114
|
+
paths?: StringArray;
|
|
115
|
+
agentOverrides?: PlatformOverrides;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
119
|
+
* via the `definition` "platformOverrides".
|
|
120
|
+
*/
|
|
121
|
+
export interface PlatformOverrides {
|
|
122
|
+
claude?: ({
|
|
123
|
+
[k: string]: unknown | undefined;
|
|
124
|
+
} | null);
|
|
125
|
+
codex?: ({
|
|
126
|
+
[k: string]: unknown | undefined;
|
|
127
|
+
} | null);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
131
|
+
* via the `definition` "permission".
|
|
132
|
+
*/
|
|
133
|
+
export interface Permission {
|
|
134
|
+
name: string;
|
|
135
|
+
allow?: StringArray;
|
|
136
|
+
ask?: StringArray;
|
|
137
|
+
deny?: StringArray;
|
|
138
|
+
agentOverrides?: PlatformOverrides;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
142
|
+
* via the `definition` "hook".
|
|
143
|
+
*/
|
|
144
|
+
export interface Hook {
|
|
145
|
+
event: string;
|
|
146
|
+
matcher?: string;
|
|
147
|
+
command: string;
|
|
148
|
+
agentOverrides?: PlatformOverrides;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
152
|
+
* via the `definition` "nativeHook".
|
|
153
|
+
*/
|
|
154
|
+
export interface NativeHook {
|
|
155
|
+
event: string;
|
|
156
|
+
matcher?: string;
|
|
157
|
+
command: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
161
|
+
* via the `definition` "agent".
|
|
162
|
+
*/
|
|
163
|
+
export interface Agent {
|
|
164
|
+
name: string;
|
|
165
|
+
description: string;
|
|
166
|
+
prompt: string;
|
|
167
|
+
tools?: StringArray;
|
|
168
|
+
agentOverrides?: PlatformOverrides;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
172
|
+
* via the `definition` "artifacts".
|
|
173
|
+
*/
|
|
174
|
+
export interface Artifacts {
|
|
175
|
+
targets?: ArtifactTarget[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
179
|
+
* via the `definition` "artifactTarget".
|
|
180
|
+
*/
|
|
181
|
+
export interface ArtifactTarget {
|
|
182
|
+
id: string;
|
|
183
|
+
platform?: ("codex" | "claude");
|
|
184
|
+
distribution?: "agent-skills";
|
|
185
|
+
scopes: ("user" | "project")[];
|
|
186
|
+
target: ("codex.developerInstructionsBlock" | "codex.agentRole" | "codex.skill" | "claude.skill" | "agent-skills.skill");
|
|
187
|
+
kind?: ("instruction" | "codexRole" | "skill");
|
|
188
|
+
projectManagedKind?: ("skill" | "mcpServer" | "instruction" | "permission" | "hook" | "agent");
|
|
189
|
+
states: ("present" | "disabled")[];
|
|
190
|
+
refreshKeys: StringArray;
|
|
191
|
+
requiresCodexProjectConfig?: boolean;
|
|
192
|
+
roleKey?: string;
|
|
193
|
+
skillKey?: string;
|
|
194
|
+
sourceDirs?: StringArray;
|
|
195
|
+
runtimeImports?: {
|
|
196
|
+
name: string;
|
|
197
|
+
plugin: string;
|
|
198
|
+
export: string;
|
|
199
|
+
resolved?: {
|
|
200
|
+
path: string;
|
|
201
|
+
digest: string;
|
|
202
|
+
providerPluginId: string;
|
|
203
|
+
providerVersion: Semver;
|
|
204
|
+
source: string;
|
|
205
|
+
};
|
|
206
|
+
}[];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
210
|
+
* via the `definition` "buildConfig".
|
|
211
|
+
*/
|
|
212
|
+
export interface BuildConfig {
|
|
213
|
+
cacheable?: true;
|
|
214
|
+
templates?: {
|
|
215
|
+
vars: {
|
|
216
|
+
[k: string]: PlatformTemplateValue | undefined;
|
|
217
|
+
};
|
|
218
|
+
include: StringArray;
|
|
219
|
+
};
|
|
220
|
+
fileRules?: {
|
|
221
|
+
claude?: FileRules;
|
|
222
|
+
codex?: FileRules;
|
|
223
|
+
};
|
|
224
|
+
manifestOverrides?: {
|
|
225
|
+
claude?: {
|
|
226
|
+
commands?: string;
|
|
227
|
+
outputStyles?: string;
|
|
228
|
+
lspServers?: unknown;
|
|
229
|
+
userConfig?: unknown;
|
|
230
|
+
channels?: unknown;
|
|
231
|
+
};
|
|
232
|
+
codex?: {
|
|
233
|
+
[k: string]: unknown | undefined;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
runtimeExports?: {
|
|
237
|
+
name: string;
|
|
238
|
+
source: string;
|
|
239
|
+
}[];
|
|
240
|
+
buildImports?: {
|
|
241
|
+
plugin: string;
|
|
242
|
+
export: string;
|
|
243
|
+
env: string;
|
|
244
|
+
}[];
|
|
245
|
+
skillRuntimeFiles?: {
|
|
246
|
+
skill: string;
|
|
247
|
+
target: string;
|
|
248
|
+
platforms?: ("codex" | "claude")[];
|
|
249
|
+
distributions?: ("agent-skills")[];
|
|
250
|
+
source?: string;
|
|
251
|
+
import?: ImportReference;
|
|
252
|
+
}[];
|
|
253
|
+
generatedSkillRuntimeFiles?: {
|
|
254
|
+
skill: string;
|
|
255
|
+
target: string;
|
|
256
|
+
distributions?: ("agent-skills")[];
|
|
257
|
+
}[];
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
261
|
+
* via the `definition` "platformTemplateValue".
|
|
262
|
+
*/
|
|
263
|
+
export interface PlatformTemplateValue {
|
|
264
|
+
claude: (string | boolean);
|
|
265
|
+
codex: (string | boolean);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
269
|
+
* via the `definition` "fileRules".
|
|
270
|
+
*/
|
|
271
|
+
export interface FileRules {
|
|
272
|
+
include: StringArray;
|
|
273
|
+
exclude: StringArray;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
277
|
+
* via the `definition` "importReference".
|
|
278
|
+
*/
|
|
279
|
+
export interface ImportReference {
|
|
280
|
+
plugin: string;
|
|
281
|
+
export: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
285
|
+
* via the `definition` "scripts".
|
|
286
|
+
*/
|
|
287
|
+
export interface Scripts {
|
|
288
|
+
timeoutMs?: number;
|
|
289
|
+
lifecycle?: {
|
|
290
|
+
install?: LifecycleDefinition;
|
|
291
|
+
upgrade?: LifecycleDefinition;
|
|
292
|
+
uninstall?: LifecycleDefinition;
|
|
293
|
+
};
|
|
294
|
+
helpers?: {
|
|
295
|
+
config: string;
|
|
296
|
+
};
|
|
297
|
+
node?: {
|
|
298
|
+
packageRoot?: string;
|
|
299
|
+
build?: ScriptEntry;
|
|
300
|
+
};
|
|
301
|
+
artifacts?: {
|
|
302
|
+
render?: ScriptEntry;
|
|
303
|
+
};
|
|
304
|
+
tests?: {
|
|
305
|
+
node?: StringArray;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
310
|
+
* via the `definition` "scriptEntry".
|
|
311
|
+
*/
|
|
312
|
+
export interface ScriptEntry {
|
|
313
|
+
runner: ("node" | "sh" | "bash" | "pwsh" | "powershell" | "cmd" | "auto");
|
|
314
|
+
path: string;
|
|
315
|
+
args?: StringArray;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
319
|
+
* via the `definition` "config".
|
|
320
|
+
*/
|
|
321
|
+
export interface Config {
|
|
322
|
+
schema: {
|
|
323
|
+
[k: string]: ConfigField | undefined;
|
|
324
|
+
};
|
|
325
|
+
presentation?: {
|
|
326
|
+
groups?: {
|
|
327
|
+
id: string;
|
|
328
|
+
title: string;
|
|
329
|
+
description?: string;
|
|
330
|
+
fields: StringArray;
|
|
331
|
+
advanced?: boolean;
|
|
332
|
+
}[];
|
|
333
|
+
fields?: {
|
|
334
|
+
[k: string]: {
|
|
335
|
+
valueLabels?: {
|
|
336
|
+
[k: string]: string | undefined;
|
|
337
|
+
};
|
|
338
|
+
recommendedValue?: (string | number | boolean);
|
|
339
|
+
placeholder?: string;
|
|
340
|
+
unit?: string;
|
|
341
|
+
advanced?: boolean;
|
|
342
|
+
} | undefined;
|
|
343
|
+
};
|
|
344
|
+
presets?: {
|
|
345
|
+
id: string;
|
|
346
|
+
title: string;
|
|
347
|
+
description?: string;
|
|
348
|
+
values: {
|
|
349
|
+
[k: string]: (string | number | boolean) | undefined;
|
|
350
|
+
};
|
|
351
|
+
}[];
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* This interface was referenced by `PluginManifestSourceV1`'s JSON-Schema
|
|
356
|
+
* via the `definition` "configField".
|
|
357
|
+
*/
|
|
358
|
+
export interface ConfigField {
|
|
359
|
+
type: ("string" | "number" | "boolean" | "enum" | "file" | "directory");
|
|
360
|
+
title?: string;
|
|
361
|
+
description?: string;
|
|
362
|
+
default?: (string | number | boolean);
|
|
363
|
+
required?: boolean;
|
|
364
|
+
sensitive?: boolean;
|
|
365
|
+
values?: StringArray;
|
|
366
|
+
min?: number;
|
|
367
|
+
max?: number;
|
|
368
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manifest-v1.js","sourceRoot":"","sources":["../../src/generated/plugin-manifest-v1.ts"],"names":[],"mappings":"AAAA,uFAAuF"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { CodexSharedHookGroup, HookDefinition, HookEvent, NativeHookDefinition, PlatformName, NormalizedPluginManifest, RenderedHookGroup, TrackedHookGroupIdentity } from './types.js';
|
|
2
|
+
export declare const PUBLIC_HOOK_EVENTS: ["before_tool", "after_tool", "session_start"];
|
|
3
|
+
export declare const PUBLIC_SESSION_START_SOURCES: readonly ["startup", "resume", "clear"];
|
|
4
|
+
export declare const PUBLIC_SESSION_START_DEFAULT_MATCHER: string;
|
|
5
|
+
export declare const PUBLIC_HOOK_EVENT_RENDER_MAP: {
|
|
6
|
+
readonly before_tool: {
|
|
7
|
+
readonly claude: "PreToolUse";
|
|
8
|
+
readonly codex: "PreToolUse";
|
|
9
|
+
};
|
|
10
|
+
readonly after_tool: {
|
|
11
|
+
readonly claude: "PostToolUse";
|
|
12
|
+
readonly codex: "PostToolUse";
|
|
13
|
+
};
|
|
14
|
+
readonly session_start: {
|
|
15
|
+
readonly claude: "SessionStart";
|
|
16
|
+
readonly codex: "SessionStart";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const CLAUDE_NATIVE_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "Notification", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "StopFailure", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "PermissionRequest", "PermissionDenied", "Setup", "TeammateIdle", "TaskCreated", "TaskCompleted", "Elicitation", "ElicitationResult", "ConfigChange", "WorktreeCreate", "WorktreeRemove", "InstructionsLoaded", "CwdChanged", "FileChanged"];
|
|
20
|
+
export declare const CODEX_NATIVE_HOOK_EVENTS: readonly ["PreToolUse", "PermissionRequest", "PostToolUse", "SessionStart", "UserPromptSubmit", "Stop"];
|
|
21
|
+
export declare const NATIVE_HOOK_EVENT_CONTRACTS: {
|
|
22
|
+
readonly claude: {
|
|
23
|
+
readonly PreToolUse: {
|
|
24
|
+
readonly matcherAllowed: true;
|
|
25
|
+
};
|
|
26
|
+
readonly PostToolUse: {
|
|
27
|
+
readonly matcherAllowed: true;
|
|
28
|
+
};
|
|
29
|
+
readonly PostToolUseFailure: {
|
|
30
|
+
readonly matcherAllowed: true;
|
|
31
|
+
};
|
|
32
|
+
readonly Notification: {
|
|
33
|
+
readonly matcherAllowed: true;
|
|
34
|
+
};
|
|
35
|
+
readonly UserPromptSubmit: {
|
|
36
|
+
readonly matcherAllowed: false;
|
|
37
|
+
};
|
|
38
|
+
readonly SessionStart: {
|
|
39
|
+
readonly matcherAllowed: true;
|
|
40
|
+
};
|
|
41
|
+
readonly SessionEnd: {
|
|
42
|
+
readonly matcherAllowed: true;
|
|
43
|
+
};
|
|
44
|
+
readonly Stop: {
|
|
45
|
+
readonly matcherAllowed: false;
|
|
46
|
+
};
|
|
47
|
+
readonly StopFailure: {
|
|
48
|
+
readonly matcherAllowed: true;
|
|
49
|
+
};
|
|
50
|
+
readonly SubagentStart: {
|
|
51
|
+
readonly matcherAllowed: true;
|
|
52
|
+
};
|
|
53
|
+
readonly SubagentStop: {
|
|
54
|
+
readonly matcherAllowed: true;
|
|
55
|
+
};
|
|
56
|
+
readonly PreCompact: {
|
|
57
|
+
readonly matcherAllowed: true;
|
|
58
|
+
};
|
|
59
|
+
readonly PostCompact: {
|
|
60
|
+
readonly matcherAllowed: true;
|
|
61
|
+
};
|
|
62
|
+
readonly PermissionRequest: {
|
|
63
|
+
readonly matcherAllowed: true;
|
|
64
|
+
};
|
|
65
|
+
readonly PermissionDenied: {
|
|
66
|
+
readonly matcherAllowed: true;
|
|
67
|
+
};
|
|
68
|
+
readonly Setup: {
|
|
69
|
+
readonly matcherAllowed: true;
|
|
70
|
+
};
|
|
71
|
+
readonly TeammateIdle: {
|
|
72
|
+
readonly matcherAllowed: false;
|
|
73
|
+
};
|
|
74
|
+
readonly TaskCreated: {
|
|
75
|
+
readonly matcherAllowed: false;
|
|
76
|
+
};
|
|
77
|
+
readonly TaskCompleted: {
|
|
78
|
+
readonly matcherAllowed: false;
|
|
79
|
+
};
|
|
80
|
+
readonly Elicitation: {
|
|
81
|
+
readonly matcherAllowed: true;
|
|
82
|
+
};
|
|
83
|
+
readonly ElicitationResult: {
|
|
84
|
+
readonly matcherAllowed: true;
|
|
85
|
+
};
|
|
86
|
+
readonly ConfigChange: {
|
|
87
|
+
readonly matcherAllowed: true;
|
|
88
|
+
};
|
|
89
|
+
readonly WorktreeCreate: {
|
|
90
|
+
readonly matcherAllowed: false;
|
|
91
|
+
};
|
|
92
|
+
readonly WorktreeRemove: {
|
|
93
|
+
readonly matcherAllowed: false;
|
|
94
|
+
};
|
|
95
|
+
readonly InstructionsLoaded: {
|
|
96
|
+
readonly matcherAllowed: true;
|
|
97
|
+
};
|
|
98
|
+
readonly CwdChanged: {
|
|
99
|
+
readonly matcherAllowed: false;
|
|
100
|
+
};
|
|
101
|
+
readonly FileChanged: {
|
|
102
|
+
readonly matcherAllowed: true;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
readonly codex: {
|
|
106
|
+
readonly PreToolUse: {
|
|
107
|
+
readonly matcherAllowed: true;
|
|
108
|
+
};
|
|
109
|
+
readonly PermissionRequest: {
|
|
110
|
+
readonly matcherAllowed: true;
|
|
111
|
+
};
|
|
112
|
+
readonly PostToolUse: {
|
|
113
|
+
readonly matcherAllowed: true;
|
|
114
|
+
};
|
|
115
|
+
readonly SessionStart: {
|
|
116
|
+
readonly matcherAllowed: true;
|
|
117
|
+
};
|
|
118
|
+
readonly UserPromptSubmit: {
|
|
119
|
+
readonly matcherAllowed: false;
|
|
120
|
+
};
|
|
121
|
+
readonly Stop: {
|
|
122
|
+
readonly matcherAllowed: false;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export interface ResolvedPublicHookDefinition {
|
|
127
|
+
kind: 'public';
|
|
128
|
+
event: HookEvent;
|
|
129
|
+
matcher?: string;
|
|
130
|
+
command: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ResolvedNativeHookDefinition {
|
|
133
|
+
kind: 'native';
|
|
134
|
+
event: string;
|
|
135
|
+
matcher?: string;
|
|
136
|
+
command: string;
|
|
137
|
+
}
|
|
138
|
+
export type ResolvedPlatformHookDefinition = ResolvedPublicHookDefinition | ResolvedNativeHookDefinition;
|
|
139
|
+
export interface ParsedCodexSharedHookGroup {
|
|
140
|
+
rawGroup: CodexSharedHookGroup;
|
|
141
|
+
managedIdentity?: TrackedHookGroupIdentity;
|
|
142
|
+
}
|
|
143
|
+
export interface ParsedCodexSharedHooksFile {
|
|
144
|
+
groups: ParsedCodexSharedHookGroup[];
|
|
145
|
+
rawGroups: CodexSharedHookGroup[];
|
|
146
|
+
managedIdentities: TrackedHookGroupIdentity[];
|
|
147
|
+
opaqueRawGroups: CodexSharedHookGroup[];
|
|
148
|
+
}
|
|
149
|
+
export interface PlannedCodexSharedHooksUpdate {
|
|
150
|
+
rerenderedAwRawGroups: CodexSharedHookGroup[];
|
|
151
|
+
preservedHistoricalAwRawGroups: CodexSharedHookGroup[];
|
|
152
|
+
preservedForeignRawGroups: CodexSharedHookGroup[];
|
|
153
|
+
}
|
|
154
|
+
export declare function assertPublicHookEvent(value: unknown, fieldName: string): HookEvent;
|
|
155
|
+
export declare function renderPublicHookEvent(event: HookEvent, platform: PlatformName): string;
|
|
156
|
+
export declare function assertNativeHookEvent(event: string, platform: PlatformName, fieldName: string): string;
|
|
157
|
+
export declare function assertHookMatcherAllowed(options: {
|
|
158
|
+
kind: 'public';
|
|
159
|
+
event: HookEvent;
|
|
160
|
+
matcher: string | undefined;
|
|
161
|
+
fieldName: string;
|
|
162
|
+
} | {
|
|
163
|
+
kind: 'native';
|
|
164
|
+
platform: PlatformName;
|
|
165
|
+
event: string;
|
|
166
|
+
matcher: string | undefined;
|
|
167
|
+
fieldName: string;
|
|
168
|
+
}): void;
|
|
169
|
+
export declare function resolvePlatformHookDefinitions(manifest: Pick<NormalizedPluginManifest, 'extensions'>, platform: PlatformName): ResolvedPlatformHookDefinition[];
|
|
170
|
+
export declare function renderHookDefinitionGroup(definition: ResolvedPlatformHookDefinition, platform: PlatformName): RenderedHookGroup;
|
|
171
|
+
export declare function normalizeRenderedHookGroupIdentity(options: {
|
|
172
|
+
platform: PlatformName;
|
|
173
|
+
event: string;
|
|
174
|
+
matcher?: string | null;
|
|
175
|
+
command: string;
|
|
176
|
+
mode?: 'strict' | 'codex-shared-read';
|
|
177
|
+
}): TrackedHookGroupIdentity;
|
|
178
|
+
export declare function serializeTrackedHookGroupIdentity(identity: TrackedHookGroupIdentity): string;
|
|
179
|
+
export declare function renderTrackedHookGroupIdentity(identity: TrackedHookGroupIdentity): RenderedHookGroup;
|
|
180
|
+
export declare function trackedHookGroupsContainAll(actualGroups: TrackedHookGroupIdentity[], expectedGroups: TrackedHookGroupIdentity[]): boolean;
|
|
181
|
+
export declare function subtractTrackedHookGroupIdentities(groups: TrackedHookGroupIdentity[], removedGroups: TrackedHookGroupIdentity[]): TrackedHookGroupIdentity[];
|
|
182
|
+
export declare function normalizeCodexSharedHookGroupForRead(event: string, value: unknown, fieldName: string): ParsedCodexSharedHookGroup;
|
|
183
|
+
export declare function parseCodexSharedHooksFile(content: unknown, fieldName?: string): ParsedCodexSharedHooksFile;
|
|
184
|
+
export declare function planCodexSharedHooksUpdate(parsed: ParsedCodexSharedHooksFile, options: {
|
|
185
|
+
rerenderedIdentities: TrackedHookGroupIdentity[];
|
|
186
|
+
historicalIdentities?: TrackedHookGroupIdentity[];
|
|
187
|
+
}): PlannedCodexSharedHooksUpdate;
|
|
188
|
+
export declare function normalizeNativeHookDefinition(entry: NativeHookDefinition): ResolvedNativeHookDefinition;
|
|
189
|
+
export declare function normalizePublicHookDefinition(entry: HookDefinition): ResolvedPublicHookDefinition;
|