cp-toolkit 2.1.0 ā 2.1.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/package.json +1 -1
- package/src/commands/init.js +20 -7
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -259,9 +259,11 @@ const TEMPLATE_INSTRUCTIONS = {
|
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
export async function initCommand(directory, options) {
|
|
262
|
-
const
|
|
262
|
+
const targetDir = directory ? path.resolve(directory) : process.cwd();
|
|
263
|
+
const dirName = path.basename(targetDir);
|
|
264
|
+
const templatesDir = path.join(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '../../templates');
|
|
263
265
|
|
|
264
|
-
console.log(chalk.bold.cyan('\nš cp-
|
|
266
|
+
console.log(chalk.bold.cyan('\nš cp-toolkit - GitHub Copilot Agent Toolkit\n'));
|
|
265
267
|
|
|
266
268
|
// Create directory if needed
|
|
267
269
|
if (directory && !fs.existsSync(targetDir)) {
|
|
@@ -275,7 +277,7 @@ const templatesDir = path.resolve(__dirname, '../../templates');
|
|
|
275
277
|
const { overwrite } = await prompts({
|
|
276
278
|
type: 'confirm',
|
|
277
279
|
name: 'overwrite',
|
|
278
|
-
message: 'cp-
|
|
280
|
+
message: 'cp-toolkit (.agent) already initialized. Overwrite?',
|
|
279
281
|
initial: false
|
|
280
282
|
});
|
|
281
283
|
|
|
@@ -396,14 +398,23 @@ const templatesDir = path.resolve(__dirname, '../../templates');
|
|
|
396
398
|
|
|
397
399
|
function generateAgentFile(agent) {
|
|
398
400
|
// Deprecated generally, using static files now, but keeping for fallback
|
|
399
|
-
return
|
|
401
|
+
return `---
|
|
402
|
+
name: ${agent.name}
|
|
403
|
+
description: ${agent.description}
|
|
404
|
+
skills: [${agent.skills.join(', ')}]
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
# ${agent.name}
|
|
408
|
+
|
|
409
|
+
${agent.description}
|
|
410
|
+
`;
|
|
400
411
|
}
|
|
401
412
|
|
|
402
413
|
function generateCopilotInstructions(config) {
|
|
403
|
-
return
|
|
414
|
+
return `# GitHub Copilot Instructions
|
|
404
415
|
|
|
405
416
|
> **Antigravity Kit Active**
|
|
406
|
-
> Profile:
|
|
417
|
+
> Profile: ${config.projectName}
|
|
407
418
|
|
|
408
419
|
## š§ Core Protocols
|
|
409
420
|
|
|
@@ -424,7 +435,9 @@ Always read \`.agent/rules/GEMINI.md\` first.
|
|
|
424
435
|
## š ļø MCP Tools
|
|
425
436
|
An MCP server is configured at \`.agent/scripts/mcp-server.js\`.
|
|
426
437
|
Use it to list available tools, resources, and prompts.
|
|
427
|
-
|
|
438
|
+
`;
|
|
428
439
|
}
|
|
440
|
+
|
|
429
441
|
export default initCommand;
|
|
430
442
|
|
|
443
|
+
|