@orchid-labs/pluxx 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -8
- package/bin/pluxx.js +19 -28
- package/dist/agents.d.ts +16 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/cli/agent.d.ts +62 -0
- package/dist/cli/agent.d.ts.map +1 -1
- package/dist/cli/doctor.d.ts +2 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/entry.d.ts +2 -0
- package/dist/cli/entry.d.ts.map +1 -0
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +21810 -0
- package/dist/cli/init-from-mcp.d.ts +17 -1
- package/dist/cli/init-from-mcp.d.ts.map +1 -1
- package/dist/cli/install.d.ts +1 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/lint.d.ts +3 -1
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/mcp-proxy.d.ts.map +1 -1
- package/dist/cli/migrate.d.ts.map +1 -1
- package/dist/cli/primitive-summary.d.ts +14 -0
- package/dist/cli/primitive-summary.d.ts.map +1 -0
- package/dist/cli/prompt.d.ts +1 -1
- package/dist/cli/publish.d.ts +6 -1
- package/dist/cli/publish.d.ts.map +1 -1
- package/dist/cli/sync-from-mcp.d.ts.map +1 -1
- package/dist/cli/verify-install.d.ts +25 -0
- package/dist/cli/verify-install.d.ts.map +1 -0
- package/dist/commands.d.ts +10 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/compiler-intent.d.ts +165 -0
- package/dist/compiler-intent.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/delegation.d.ts +11 -0
- package/dist/delegation.d.ts.map +1 -0
- package/dist/generators/amp/index.d.ts.map +1 -1
- package/dist/generators/base.d.ts +5 -0
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/claude-code/index.d.ts.map +1 -1
- package/dist/generators/cline/index.d.ts.map +1 -1
- package/dist/generators/codex/index.d.ts +4 -0
- package/dist/generators/codex/index.d.ts.map +1 -1
- package/dist/generators/cursor/index.d.ts +1 -0
- package/dist/generators/cursor/index.d.ts.map +1 -1
- package/dist/generators/gemini-cli/index.d.ts.map +1 -1
- package/dist/generators/github-copilot/index.d.ts.map +1 -1
- package/dist/generators/opencode/index.d.ts +1 -0
- package/dist/generators/opencode/index.d.ts.map +1 -1
- package/dist/generators/openhands/index.d.ts.map +1 -1
- package/dist/generators/roo-code/index.d.ts.map +1 -1
- package/dist/generators/shared/claude-family.d.ts.map +1 -1
- package/dist/generators/warp/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5371 -553
- package/dist/schema.d.ts +91 -42
- package/dist/schema.d.ts.map +1 -1
- package/dist/text-files.d.ts +5 -0
- package/dist/text-files.d.ts.map +1 -0
- package/dist/validation/platform-rules.d.ts +15 -1
- package/dist/validation/platform-rules.d.ts.map +1 -1
- package/package.json +15 -13
- package/src/cli/agent.ts +0 -1455
- package/src/cli/dev.ts +0 -112
- package/src/cli/doctor.ts +0 -987
- package/src/cli/eval.ts +0 -470
- package/src/cli/index.ts +0 -2933
- package/src/cli/init-from-mcp.ts +0 -2115
- package/src/cli/install.ts +0 -860
- package/src/cli/lint.ts +0 -1249
- package/src/cli/mcp-proxy.ts +0 -322
- package/src/cli/migrate.ts +0 -867
- package/src/cli/prompt.ts +0 -82
- package/src/cli/publish.ts +0 -401
- package/src/cli/runtime.ts +0 -86
- package/src/cli/sync-from-mcp.ts +0 -586
- package/src/cli/test.ts +0 -142
- package/src/compatibility/matrix.ts +0 -149
- package/src/config/define.ts +0 -20
- package/src/config/load.ts +0 -74
- package/src/generators/amp/index.ts +0 -63
- package/src/generators/base.ts +0 -188
- package/src/generators/claude-code/index.ts +0 -172
- package/src/generators/cline/index.ts +0 -35
- package/src/generators/codex/index.ts +0 -143
- package/src/generators/cursor/index.ts +0 -158
- package/src/generators/gemini-cli/index.ts +0 -83
- package/src/generators/github-copilot/index.ts +0 -32
- package/src/generators/hooks-warning.ts +0 -51
- package/src/generators/index.ts +0 -71
- package/src/generators/opencode/index.ts +0 -526
- package/src/generators/openhands/index.ts +0 -32
- package/src/generators/roo-code/index.ts +0 -35
- package/src/generators/shared/claude-family.ts +0 -215
- package/src/generators/warp/index.ts +0 -32
- package/src/hook-events.ts +0 -33
- package/src/index.ts +0 -34
- package/src/mcp/introspect.ts +0 -1107
- package/src/permissions.ts +0 -260
- package/src/schema.ts +0 -312
- package/src/user-config.ts +0 -177
- package/src/validation/platform-rules.ts +0 -686
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'fs'
|
|
2
|
-
import { resolve } from 'path'
|
|
3
|
-
import { warnDroppedHookFields } from '../hooks-warning'
|
|
4
|
-
import type { PluginConfig, TargetPlatform } from '../../schema'
|
|
5
|
-
import { mapHookEventToPascalCase } from '../../hook-events'
|
|
6
|
-
import { buildGeneratedPermissionHookScript } from '../../permissions'
|
|
7
|
-
|
|
8
|
-
export interface ClaudeFamilyOptions {
|
|
9
|
-
manifestPath: string
|
|
10
|
-
instructionsFile: string
|
|
11
|
-
pluginRootVar: string
|
|
12
|
-
titleSuffix?: string
|
|
13
|
-
mapEventName?: (event: string) => string
|
|
14
|
-
includeStandardHooksManifest?: boolean
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function generateClaudeFamilyOutputs(args: {
|
|
18
|
-
config: PluginConfig
|
|
19
|
-
rootDir: string
|
|
20
|
-
platform: TargetPlatform
|
|
21
|
-
options: ClaudeFamilyOptions
|
|
22
|
-
writeJson: (relativePath: string, data: unknown) => Promise<void>
|
|
23
|
-
writeFile: (relativePath: string, content: string) => Promise<void>
|
|
24
|
-
}): Promise<void> {
|
|
25
|
-
const {
|
|
26
|
-
config,
|
|
27
|
-
rootDir,
|
|
28
|
-
platform,
|
|
29
|
-
options,
|
|
30
|
-
writeJson,
|
|
31
|
-
writeFile,
|
|
32
|
-
} = args
|
|
33
|
-
|
|
34
|
-
await Promise.all([
|
|
35
|
-
writeManifest(config, options, writeJson),
|
|
36
|
-
writeMcpConfig(config, platform, writeJson),
|
|
37
|
-
writeHooks(config, platform, options, writeJson, writeFile),
|
|
38
|
-
writeInstructions(config, rootDir, options, writeFile),
|
|
39
|
-
])
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function writeManifest(
|
|
43
|
-
config: PluginConfig,
|
|
44
|
-
options: ClaudeFamilyOptions,
|
|
45
|
-
writeJson: (relativePath: string, data: unknown) => Promise<void>,
|
|
46
|
-
): Promise<void> {
|
|
47
|
-
const manifest: Record<string, unknown> = {
|
|
48
|
-
name: config.name,
|
|
49
|
-
version: config.version,
|
|
50
|
-
description: config.description,
|
|
51
|
-
author: config.author,
|
|
52
|
-
license: config.license,
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (config.repository) {
|
|
56
|
-
manifest.repository = config.repository
|
|
57
|
-
}
|
|
58
|
-
if (config.keywords) {
|
|
59
|
-
manifest.keywords = config.keywords
|
|
60
|
-
}
|
|
61
|
-
if (config.commands) {
|
|
62
|
-
manifest.commands = './commands/'
|
|
63
|
-
}
|
|
64
|
-
if (config.agents) {
|
|
65
|
-
manifest.agents = './agents/'
|
|
66
|
-
}
|
|
67
|
-
manifest.skills = './skills/'
|
|
68
|
-
if ((config.hooks || config.permissions) && options.includeStandardHooksManifest !== false) {
|
|
69
|
-
manifest.hooks = './hooks/hooks.json'
|
|
70
|
-
}
|
|
71
|
-
if (config.mcp) {
|
|
72
|
-
manifest.mcpServers = './.mcp.json'
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
await writeJson(options.manifestPath, manifest)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function writeMcpConfig(
|
|
79
|
-
config: PluginConfig,
|
|
80
|
-
platform: TargetPlatform,
|
|
81
|
-
writeJson: (relativePath: string, data: unknown) => Promise<void>,
|
|
82
|
-
): Promise<void> {
|
|
83
|
-
if (!config.mcp) return
|
|
84
|
-
|
|
85
|
-
const mcpServers: Record<string, unknown> = {}
|
|
86
|
-
const usesPlatformManagedAuth = platform === 'claude-code'
|
|
87
|
-
&& config.platforms?.['claude-code']?.mcpAuth === 'platform'
|
|
88
|
-
|
|
89
|
-
for (const [name, server] of Object.entries(config.mcp)) {
|
|
90
|
-
if (server.transport === 'stdio' && server.command) {
|
|
91
|
-
mcpServers[name] = {
|
|
92
|
-
command: server.command,
|
|
93
|
-
args: server.args ?? [],
|
|
94
|
-
env: server.env ?? {},
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
const entry: Record<string, unknown> = {
|
|
98
|
-
type: server.transport === 'sse' ? 'sse' : 'http',
|
|
99
|
-
url: server.url,
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (usesPlatformManagedAuth || server.auth?.type === 'platform') {
|
|
103
|
-
mcpServers[name] = entry
|
|
104
|
-
continue
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (server.auth?.type === 'bearer' && server.auth.envVar) {
|
|
108
|
-
entry.headers = {
|
|
109
|
-
Authorization: `Bearer \${${server.auth.envVar}}`,
|
|
110
|
-
}
|
|
111
|
-
} else if (server.auth?.type === 'header' && server.auth.envVar) {
|
|
112
|
-
entry.headers = {
|
|
113
|
-
[server.auth.headerName]: server.auth.headerTemplate.replace(
|
|
114
|
-
'${value}',
|
|
115
|
-
`\${${server.auth.envVar}}`,
|
|
116
|
-
),
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
mcpServers[name] = entry
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
await writeJson('.mcp.json', { mcpServers })
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async function writeHooks(
|
|
128
|
-
config: PluginConfig,
|
|
129
|
-
platform: TargetPlatform,
|
|
130
|
-
options: ClaudeFamilyOptions,
|
|
131
|
-
writeJson: (relativePath: string, data: unknown) => Promise<void>,
|
|
132
|
-
writeFile: (relativePath: string, content: string) => Promise<void>,
|
|
133
|
-
): Promise<void> {
|
|
134
|
-
const hooks: Record<string, unknown[]> = {}
|
|
135
|
-
const mapEventName = options.mapEventName ?? defaultMapEventName
|
|
136
|
-
const usesPlatformManagedAuth = platform === 'claude-code'
|
|
137
|
-
&& config.platforms?.['claude-code']?.mcpAuth === 'platform'
|
|
138
|
-
const permissionScript = buildGeneratedPermissionHookScript(config.permissions)
|
|
139
|
-
|
|
140
|
-
if (permissionScript) {
|
|
141
|
-
await writeFile('hooks/pluxx-permissions.mjs', permissionScript)
|
|
142
|
-
hooks.PreToolUse = [{
|
|
143
|
-
hooks: [{
|
|
144
|
-
type: 'command',
|
|
145
|
-
command: `node \${${options.pluginRootVar}}/hooks/pluxx-permissions.mjs claude-pretool`,
|
|
146
|
-
}],
|
|
147
|
-
}]
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!config.hooks) {
|
|
151
|
-
if (Object.keys(hooks).length > 0) {
|
|
152
|
-
await writeJson('hooks/hooks.json', { hooks })
|
|
153
|
-
}
|
|
154
|
-
return
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
for (const [event, entries] of Object.entries(config.hooks)) {
|
|
158
|
-
if (!entries) continue
|
|
159
|
-
|
|
160
|
-
warnDroppedHookFields(platform, event, entries)
|
|
161
|
-
const mappedEvent = mapEventName(event)
|
|
162
|
-
const commandEntries = entries.filter((entry) => {
|
|
163
|
-
if (entry.type === 'prompt' || !entry.command) return false
|
|
164
|
-
if (
|
|
165
|
-
usesPlatformManagedAuth
|
|
166
|
-
&& entry.command.includes('check-env.sh')
|
|
167
|
-
) {
|
|
168
|
-
return false
|
|
169
|
-
}
|
|
170
|
-
return true
|
|
171
|
-
})
|
|
172
|
-
if (commandEntries.length === 0) continue
|
|
173
|
-
|
|
174
|
-
hooks[mappedEvent] = [
|
|
175
|
-
...(hooks[mappedEvent] ?? []),
|
|
176
|
-
...commandEntries.map(entry => ({
|
|
177
|
-
...(entry.matcher !== undefined ? { matcher: entry.matcher } : {}),
|
|
178
|
-
hooks: [{
|
|
179
|
-
type: 'command',
|
|
180
|
-
command: entry.command!.replace('${PLUGIN_ROOT}', `\${${options.pluginRootVar}}`),
|
|
181
|
-
}],
|
|
182
|
-
})),
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
await writeJson('hooks/hooks.json', { hooks })
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async function writeInstructions(
|
|
190
|
-
config: PluginConfig,
|
|
191
|
-
rootDir: string,
|
|
192
|
-
options: ClaudeFamilyOptions,
|
|
193
|
-
writeFile: (relativePath: string, content: string) => Promise<void>,
|
|
194
|
-
): Promise<void> {
|
|
195
|
-
if (!config.instructions) return
|
|
196
|
-
|
|
197
|
-
const srcPath = resolve(rootDir, config.instructions)
|
|
198
|
-
if (!existsSync(srcPath)) return
|
|
199
|
-
|
|
200
|
-
const content = await Bun.file(srcPath).text()
|
|
201
|
-
const titleSuffix = options.titleSuffix ?? 'Plugin'
|
|
202
|
-
const instructions = [
|
|
203
|
-
`# ${config.brand?.displayName ?? config.name} ${titleSuffix}`,
|
|
204
|
-
'',
|
|
205
|
-
config.brand?.shortDescription ?? config.description,
|
|
206
|
-
'',
|
|
207
|
-
content,
|
|
208
|
-
].join('\n')
|
|
209
|
-
|
|
210
|
-
await writeFile(options.instructionsFile, instructions)
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function defaultMapEventName(event: string): string {
|
|
214
|
-
return mapHookEventToPascalCase(event)
|
|
215
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'fs'
|
|
2
|
-
import { Generator } from '../base'
|
|
3
|
-
import type { TargetPlatform } from '../../schema'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Warp reads skills from .agents/skills/ and .warp/skills/.
|
|
7
|
-
* Uses AGENTS.md for instructions. MCP via config.
|
|
8
|
-
* No formal plugin manifest — generates skills + AGENTS.md + MCP config.
|
|
9
|
-
*/
|
|
10
|
-
export class WarpGenerator extends Generator {
|
|
11
|
-
readonly platform: TargetPlatform = 'warp'
|
|
12
|
-
|
|
13
|
-
async generate(): Promise<void> {
|
|
14
|
-
await Promise.all([
|
|
15
|
-
this.generateAgentsMd(),
|
|
16
|
-
this.generateMcpConfig('mcp.json'),
|
|
17
|
-
])
|
|
18
|
-
|
|
19
|
-
this.copySkills()
|
|
20
|
-
this.copyScripts()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private async generateAgentsMd(): Promise<void> {
|
|
24
|
-
if (!this.config.instructions) return
|
|
25
|
-
const srcPath = this.resolveConfigPath(this.config.instructions, 'instructions')
|
|
26
|
-
if (!existsSync(srcPath)) return
|
|
27
|
-
|
|
28
|
-
const content = await Bun.file(srcPath).text()
|
|
29
|
-
await this.writeFile('AGENTS.md', content)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
package/src/hook-events.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export const CURSOR_SUPPORTED_HOOK_EVENTS = [
|
|
2
|
-
'sessionStart',
|
|
3
|
-
'sessionEnd',
|
|
4
|
-
'preToolUse',
|
|
5
|
-
'postToolUse',
|
|
6
|
-
'postToolUseFailure',
|
|
7
|
-
'subagentStart',
|
|
8
|
-
'subagentStop',
|
|
9
|
-
'beforeShellExecution',
|
|
10
|
-
'afterShellExecution',
|
|
11
|
-
'beforeMCPExecution',
|
|
12
|
-
'afterMCPExecution',
|
|
13
|
-
'beforeReadFile',
|
|
14
|
-
'afterFileEdit',
|
|
15
|
-
'beforeSubmitPrompt',
|
|
16
|
-
'preCompact',
|
|
17
|
-
'stop',
|
|
18
|
-
'afterAgentResponse',
|
|
19
|
-
'afterAgentThought',
|
|
20
|
-
'beforeTabFileRead',
|
|
21
|
-
'afterTabFileEdit',
|
|
22
|
-
] as const
|
|
23
|
-
|
|
24
|
-
export const CURSOR_LOOP_LIMIT_HOOK_EVENTS = ['stop', 'subagentStop'] as const
|
|
25
|
-
|
|
26
|
-
const PASCAL_CASE_HOOK_ALIASES: Record<string, string> = {
|
|
27
|
-
beforeSubmitPrompt: 'UserPromptSubmit',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function mapHookEventToPascalCase(event: string): string {
|
|
31
|
-
return PASCAL_CASE_HOOK_ALIASES[event]
|
|
32
|
-
?? event.charAt(0).toUpperCase() + event.slice(1)
|
|
33
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
PluginConfigSchema,
|
|
3
|
-
type PluginConfig,
|
|
4
|
-
type TargetPlatform,
|
|
5
|
-
type UserConfigEntry,
|
|
6
|
-
type PermissionRule,
|
|
7
|
-
type Permissions,
|
|
8
|
-
} from './schema'
|
|
9
|
-
export { definePlugin } from './config/define'
|
|
10
|
-
export {
|
|
11
|
-
PLATFORM_LIMITS,
|
|
12
|
-
PLATFORM_LIMIT_POLICIES,
|
|
13
|
-
PLATFORM_VALIDATION_RULES,
|
|
14
|
-
getPlatformRules,
|
|
15
|
-
type PlatformLimitKind,
|
|
16
|
-
type PlatformLimitPolicy,
|
|
17
|
-
type PlatformLimitPolicies,
|
|
18
|
-
type PlatformLimits,
|
|
19
|
-
type PlatformRules,
|
|
20
|
-
type PlatformRuleSource,
|
|
21
|
-
} from './validation/platform-rules'
|
|
22
|
-
export { getPlatformCompatibilityMatrix, renderCompatibilityMatrixMarkdown, type PlatformCompatibilityRow } from './compatibility/matrix'
|
|
23
|
-
export {
|
|
24
|
-
buildGeneratedPermissionHookScript,
|
|
25
|
-
buildOpenCodePermissionMap,
|
|
26
|
-
collectPermissionRules,
|
|
27
|
-
parsePermissionRule,
|
|
28
|
-
permissionRulesNeedToolLevelDowngrade,
|
|
29
|
-
type OpenCodePermissionMap,
|
|
30
|
-
type ParsedPermissionRule,
|
|
31
|
-
type PermissionAction,
|
|
32
|
-
type PermissionRuleKind,
|
|
33
|
-
} from './permissions'
|
|
34
|
-
export { formatPublishPlan, planPublish, runPublish, type PublishAssetPlan, type PublishCheck, type PublishPlan, type PublishPlanOptions, type PublishRunResult } from './cli/publish'
|