@pluginfinity/targets 0.2.0 → 0.3.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.
- package/claude.js +72 -8
- package/copilot.js +26 -5
- package/index.d.ts +62 -0
- package/package.json +2 -2
- package/version.js +1 -1
package/claude.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLAUDE_HOOK_EVENTS, LSP_FIELDS, Target, drop, keep } from "@pluginfinity/core";
|
|
1
|
+
import { CLAUDE_HOOK_EVENTS, LSP_FIELDS, Target, drop, inManifest, keep } from "@pluginfinity/core";
|
|
2
2
|
|
|
3
3
|
//#region src/claude.ts
|
|
4
4
|
const ROOT = `\${CLAUDE_PLUGIN_ROOT}`;
|
|
@@ -62,7 +62,9 @@ const CLAUDE = Target.make({
|
|
|
62
62
|
"homepage",
|
|
63
63
|
"repository",
|
|
64
64
|
"license",
|
|
65
|
-
"keywords"
|
|
65
|
+
"keywords",
|
|
66
|
+
"mcpServers",
|
|
67
|
+
"lspServers"
|
|
66
68
|
]
|
|
67
69
|
},
|
|
68
70
|
pluginRoot: {
|
|
@@ -75,7 +77,12 @@ const CLAUDE = Target.make({
|
|
|
75
77
|
dir: "skills",
|
|
76
78
|
fields: skillFields,
|
|
77
79
|
hostFields: [],
|
|
78
|
-
invoke: "/{plugin}:{skill}"
|
|
80
|
+
invoke: "/{plugin}:{skill}",
|
|
81
|
+
dirSpelling: {
|
|
82
|
+
own: `\${CLAUDE_SKILL_DIR}`,
|
|
83
|
+
other: `\${CLAUDE_PLUGIN_ROOT}/skills/{skill}`,
|
|
84
|
+
agent: `\${CLAUDE_PLUGIN_ROOT}/skills/{skill}`
|
|
85
|
+
}
|
|
79
86
|
},
|
|
80
87
|
agents: {
|
|
81
88
|
dir: "agents",
|
|
@@ -88,17 +95,74 @@ const CLAUDE = Target.make({
|
|
|
88
95
|
path: "hooks/hooks.json",
|
|
89
96
|
format: "claude-hooks-json",
|
|
90
97
|
events: Object.fromEntries(CLAUDE_HOOK_EVENTS.map((event) => [event, event])),
|
|
91
|
-
ownEvents: []
|
|
98
|
+
ownEvents: [],
|
|
99
|
+
matcherIgnored: [],
|
|
100
|
+
envShell: [
|
|
101
|
+
"SessionStart",
|
|
102
|
+
"Setup",
|
|
103
|
+
"CwdChanged",
|
|
104
|
+
"FileChanged"
|
|
105
|
+
],
|
|
106
|
+
output: {
|
|
107
|
+
context: [
|
|
108
|
+
"SessionStart",
|
|
109
|
+
"SubagentStart",
|
|
110
|
+
"PostModelSwitch",
|
|
111
|
+
"UserPromptSubmit",
|
|
112
|
+
"UserPromptExpansion",
|
|
113
|
+
"PreToolUse",
|
|
114
|
+
"PostToolUse",
|
|
115
|
+
"PostToolUseFailure",
|
|
116
|
+
"PostToolBatch",
|
|
117
|
+
"Stop",
|
|
118
|
+
"SubagentStop"
|
|
119
|
+
],
|
|
120
|
+
system_message: [
|
|
121
|
+
"SessionStart",
|
|
122
|
+
"Setup",
|
|
123
|
+
"UserPromptSubmit",
|
|
124
|
+
"UserPromptExpansion",
|
|
125
|
+
"PreToolUse",
|
|
126
|
+
"PermissionRequest",
|
|
127
|
+
"PermissionDenied",
|
|
128
|
+
"PostToolUse",
|
|
129
|
+
"PostToolUseFailure",
|
|
130
|
+
"PostToolBatch",
|
|
131
|
+
"MessageDisplay",
|
|
132
|
+
"SubagentStart",
|
|
133
|
+
"SubagentStop",
|
|
134
|
+
"TaskCreated",
|
|
135
|
+
"TaskCompleted",
|
|
136
|
+
"Stop",
|
|
137
|
+
"StopFailure",
|
|
138
|
+
"TeammateIdle",
|
|
139
|
+
"InstructionsLoaded",
|
|
140
|
+
"CwdChanged",
|
|
141
|
+
"DirectoryAdded",
|
|
142
|
+
"FileChanged",
|
|
143
|
+
"WorktreeCreate",
|
|
144
|
+
"WorktreeRemove",
|
|
145
|
+
"PostCompact",
|
|
146
|
+
"PreModelSwitch",
|
|
147
|
+
"PostModelSwitch",
|
|
148
|
+
"Elicitation",
|
|
149
|
+
"ElicitationResult"
|
|
150
|
+
]
|
|
151
|
+
}
|
|
92
152
|
},
|
|
93
153
|
mcp: {
|
|
94
|
-
|
|
95
|
-
format: "claude-mcp-
|
|
154
|
+
placement: inManifest("mcpServers", ".mcp.json"),
|
|
155
|
+
format: "claude-mcp-servers"
|
|
96
156
|
},
|
|
97
157
|
lsp: {
|
|
98
|
-
|
|
99
|
-
format: "claude-lsp-
|
|
158
|
+
placement: inManifest("lspServers", ".lsp.json"),
|
|
159
|
+
format: "claude-lsp-servers",
|
|
100
160
|
fields: lspFields
|
|
101
161
|
},
|
|
162
|
+
monitors: {
|
|
163
|
+
path: "monitors/monitors.json",
|
|
164
|
+
root: ROOT
|
|
165
|
+
},
|
|
102
166
|
references: { style: "path" },
|
|
103
167
|
tools: {
|
|
104
168
|
names: {},
|
package/copilot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLAUDE_HOOK_EVENTS, Target, absent, degrade, drop, keep, rename, translate, unresolved } from "@pluginfinity/core";
|
|
1
|
+
import { CLAUDE_HOOK_EVENTS, Target, absent, degrade, drop, inFile, keep, rename, translate, unresolved } from "@pluginfinity/core";
|
|
2
2
|
|
|
3
3
|
//#region src/copilot.ts
|
|
4
4
|
const ROOT = `\${PLUGIN_ROOT}`;
|
|
@@ -116,7 +116,12 @@ const COPILOT = Target.make({
|
|
|
116
116
|
dir: "skills",
|
|
117
117
|
fields: skillFields,
|
|
118
118
|
hostFields: [],
|
|
119
|
-
invoke: "/{plugin}:{skill}"
|
|
119
|
+
invoke: "/{plugin}:{skill}",
|
|
120
|
+
dirSpelling: {
|
|
121
|
+
own: "<skill base directory>",
|
|
122
|
+
other: "<skill base directory>/../{skill}",
|
|
123
|
+
agent: unresolved("an agent has no skill base directory on copilot; name the path in the skill instead")
|
|
124
|
+
}
|
|
120
125
|
},
|
|
121
126
|
agents: {
|
|
122
127
|
id: "{plugin}:{agent}",
|
|
@@ -141,18 +146,34 @@ const COPILOT = Target.make({
|
|
|
141
146
|
path: "com.github.copilot/hooks/hooks.json",
|
|
142
147
|
format: "copilot-hooks-v1",
|
|
143
148
|
events: Object.fromEntries(CLAUDE_HOOK_EVENTS.map((event) => [event, PASCAL_CASE.has(event) ? event : CAMEL_CASE[event] ?? absent])),
|
|
144
|
-
ownEvents: [...COPILOT_OWN_EVENTS]
|
|
149
|
+
ownEvents: [...COPILOT_OWN_EVENTS],
|
|
150
|
+
matcherIgnored: [
|
|
151
|
+
"SessionStart",
|
|
152
|
+
"SessionEnd",
|
|
153
|
+
"SubagentStop"
|
|
154
|
+
],
|
|
155
|
+
output: {
|
|
156
|
+
context: [
|
|
157
|
+
"SessionStart",
|
|
158
|
+
"SubagentStart",
|
|
159
|
+
"PostToolUse",
|
|
160
|
+
"Notification"
|
|
161
|
+
],
|
|
162
|
+
system_message: []
|
|
163
|
+
},
|
|
164
|
+
envShell: []
|
|
145
165
|
},
|
|
146
166
|
mcp: {
|
|
147
|
-
|
|
167
|
+
placement: inFile("mcp.json"),
|
|
148
168
|
format: "agent-plugins-mcp-1.0",
|
|
149
169
|
schema: "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"
|
|
150
170
|
},
|
|
151
171
|
lsp: {
|
|
152
|
-
|
|
172
|
+
placement: inFile("com.github.copilot/lsp.json"),
|
|
153
173
|
format: "copilot-lsp-json",
|
|
154
174
|
fields: lspFields
|
|
155
175
|
},
|
|
176
|
+
monitors: unresolved("Copilot CLI has no monitors"),
|
|
156
177
|
references: { style: "prose" },
|
|
157
178
|
tools: {
|
|
158
179
|
names: {
|
package/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare const isKnownTargetId: (id: string) => id is KnownTargetId;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const ClaudeSetting: Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
|
|
61
61
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
62
|
+
readonly files: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
62
63
|
readonly hooks: Schema.optionalKey<Schema.Struct<import("@pluginfinity/core").HooksFields<readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd"]>>>;
|
|
63
64
|
readonly mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
64
65
|
readonly type: Schema.optionalKey<Schema.Literal<"stdio">>;
|
|
@@ -85,6 +86,16 @@ export declare const ClaudeSetting: Schema.Union<readonly [Schema.Literal<true>,
|
|
|
85
86
|
readonly maxRestarts: Schema.optionalKey<Schema.Number>;
|
|
86
87
|
readonly diagnostics: Schema.optionalKey<Schema.Boolean>;
|
|
87
88
|
}>>>;
|
|
89
|
+
readonly monitors: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
90
|
+
readonly description: Schema.String;
|
|
91
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
92
|
+
readonly script: Schema.String;
|
|
93
|
+
readonly args: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
94
|
+
}>, Schema.Struct<{
|
|
95
|
+
readonly description: Schema.String;
|
|
96
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
97
|
+
readonly command: Schema.String;
|
|
98
|
+
}>]>>>;
|
|
88
99
|
}>]>;
|
|
89
100
|
/**
|
|
90
101
|
* The `copilot` key's value: hooks overrides may also use Copilot's own events.
|
|
@@ -93,6 +104,7 @@ export declare const ClaudeSetting: Schema.Union<readonly [Schema.Literal<true>,
|
|
|
93
104
|
*/
|
|
94
105
|
export declare const CopilotSetting: Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
|
|
95
106
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
107
|
+
readonly files: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
96
108
|
readonly hooks: Schema.optionalKey<Schema.Struct<import("@pluginfinity/core").HooksFields<readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd", "userPromptTransformed", "errorOccurred"]>>>;
|
|
97
109
|
readonly mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
98
110
|
readonly type: Schema.optionalKey<Schema.Literal<"stdio">>;
|
|
@@ -119,6 +131,16 @@ export declare const CopilotSetting: Schema.Union<readonly [Schema.Literal<true>
|
|
|
119
131
|
readonly maxRestarts: Schema.optionalKey<Schema.Number>;
|
|
120
132
|
readonly diagnostics: Schema.optionalKey<Schema.Boolean>;
|
|
121
133
|
}>>>;
|
|
134
|
+
readonly monitors: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly description: Schema.String;
|
|
136
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
137
|
+
readonly script: Schema.String;
|
|
138
|
+
readonly args: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
139
|
+
}>, Schema.Struct<{
|
|
140
|
+
readonly description: Schema.String;
|
|
141
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
142
|
+
readonly command: Schema.String;
|
|
143
|
+
}>]>>>;
|
|
122
144
|
}>]>;
|
|
123
145
|
/**
|
|
124
146
|
* The whole `pluginfinity.config.ts` shape: the plugin-wide fields from
|
|
@@ -172,9 +194,28 @@ export declare const PluginfinityConfig: Schema.Struct<{
|
|
|
172
194
|
readonly maxRestarts: Schema.optionalKey<Schema.Number>;
|
|
173
195
|
readonly diagnostics: Schema.optionalKey<Schema.Boolean>;
|
|
174
196
|
}>>>;
|
|
197
|
+
readonly monitors: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
198
|
+
readonly description: Schema.String;
|
|
199
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
200
|
+
readonly script: Schema.String;
|
|
201
|
+
readonly args: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
202
|
+
}>, Schema.Struct<{
|
|
203
|
+
readonly description: Schema.String;
|
|
204
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
205
|
+
readonly command: Schema.String;
|
|
206
|
+
}>]>>>;
|
|
175
207
|
readonly files: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
208
|
+
readonly env: Schema.optionalKey<Schema.Struct<{
|
|
209
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
210
|
+
readonly vars: Schema.$Record<Schema.String, Schema.Struct<{
|
|
211
|
+
readonly default: Schema.optionalKey<Schema.String>;
|
|
212
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
213
|
+
}>>;
|
|
214
|
+
readonly setup: Schema.optionalKey<Schema.String>;
|
|
215
|
+
}>>;
|
|
176
216
|
readonly claude: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
|
|
177
217
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
218
|
+
readonly files: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
178
219
|
readonly hooks: Schema.optionalKey<Schema.Struct<import("@pluginfinity/core").HooksFields<readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd"]>>>;
|
|
179
220
|
readonly mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
180
221
|
readonly type: Schema.optionalKey<Schema.Literal<"stdio">>;
|
|
@@ -201,9 +242,20 @@ export declare const PluginfinityConfig: Schema.Struct<{
|
|
|
201
242
|
readonly maxRestarts: Schema.optionalKey<Schema.Number>;
|
|
202
243
|
readonly diagnostics: Schema.optionalKey<Schema.Boolean>;
|
|
203
244
|
}>>>;
|
|
245
|
+
readonly monitors: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
246
|
+
readonly description: Schema.String;
|
|
247
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
248
|
+
readonly script: Schema.String;
|
|
249
|
+
readonly args: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
250
|
+
}>, Schema.Struct<{
|
|
251
|
+
readonly description: Schema.String;
|
|
252
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
253
|
+
readonly command: Schema.String;
|
|
254
|
+
}>]>>>;
|
|
204
255
|
}>]>>;
|
|
205
256
|
readonly copilot: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<true>, Schema.Struct<{
|
|
206
257
|
readonly name: Schema.optionalKey<Schema.String>;
|
|
258
|
+
readonly files: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
207
259
|
readonly hooks: Schema.optionalKey<Schema.Struct<import("@pluginfinity/core").HooksFields<readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd", "userPromptTransformed", "errorOccurred"]>>>;
|
|
208
260
|
readonly mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
209
261
|
readonly type: Schema.optionalKey<Schema.Literal<"stdio">>;
|
|
@@ -230,6 +282,16 @@ export declare const PluginfinityConfig: Schema.Struct<{
|
|
|
230
282
|
readonly maxRestarts: Schema.optionalKey<Schema.Number>;
|
|
231
283
|
readonly diagnostics: Schema.optionalKey<Schema.Boolean>;
|
|
232
284
|
}>>>;
|
|
285
|
+
readonly monitors: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
286
|
+
readonly description: Schema.String;
|
|
287
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
288
|
+
readonly script: Schema.String;
|
|
289
|
+
readonly args: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
290
|
+
}>, Schema.Struct<{
|
|
291
|
+
readonly description: Schema.String;
|
|
292
|
+
readonly when: Schema.optionalKey<Schema.Union<readonly [Schema.Literal<"always">, Schema.String]>>;
|
|
293
|
+
readonly command: Schema.String;
|
|
294
|
+
}>]>>>;
|
|
233
295
|
}>]>>;
|
|
234
296
|
}>;
|
|
235
297
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluginfinity/targets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The host targets pluginfinity builds for (Claude Code, GitHub Copilot), described as data against the @pluginfinity/core Target schema.",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@pluginfinity/core": "0.
|
|
39
|
+
"@pluginfinity/core": "0.3.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"effect": "^4.0.0"
|