@penpair/core 0.1.2 → 0.1.3
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/cli-main.js +3 -3
- package/dist/skills.d.ts +4 -0
- package/dist/skills.js +13 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli-main.js
CHANGED
|
@@ -44,7 +44,7 @@ Read-only:
|
|
|
44
44
|
penpair export <shapeId> <out.png> [--page <name>] [--scale 1]
|
|
45
45
|
@@INSTANCE@@Skills (the rules an AI agent follows, shipped with penpair):
|
|
46
46
|
penpair skills list them
|
|
47
|
-
penpair skills install [--to
|
|
47
|
+
penpair skills install [--to <folder>] [--only <name>] [--force] copy them into the project and make them discoverable
|
|
48
48
|
Snippets (the built-in ones and the project's own, listed under "snippets" in penpair.config.json):
|
|
49
49
|
penpair snippets what can be run, with its parameters
|
|
50
50
|
penpair snippets check validate the project's snippets without a connection
|
|
@@ -208,7 +208,7 @@ async function main(argv, cli) {
|
|
|
208
208
|
local: cli.local,
|
|
209
209
|
installSkills: async () => {
|
|
210
210
|
const report = await installSkills({ root });
|
|
211
|
-
console.log(`Installed ${report.installed.length} rule file(s) in .
|
|
211
|
+
console.log(`Installed ${report.installed.length} rule file(s) in ${report.to}/ (${report.unchanged.length} already there). Add these rows to your AGENTS.md skills table:\n${report.agentsRows.join("\n")}`);
|
|
212
212
|
},
|
|
213
213
|
});
|
|
214
214
|
return 0;
|
|
@@ -258,7 +258,7 @@ async function main(argv, cli) {
|
|
|
258
258
|
const result = await init(root, { instance: values.instance, port: values.port ? Number(values.port) : undefined, gitignore: values.gitignore, external: values.external }, { local: cli.local });
|
|
259
259
|
if (isExternal(result.config)) {
|
|
260
260
|
console.log(`${result.createdConfig ? "created" : "kept"} penpair.config.json (external Penpot at ${result.config.profile.origin})`);
|
|
261
|
-
console.log("next:
|
|
261
|
+
console.log("next: in Penpot switch on Account, Integrations, MCP Server and copy the address; open a design file and choose File, MCP Server, Connect; then run penpair connect (takes the address without showing it)");
|
|
262
262
|
return 0;
|
|
263
263
|
}
|
|
264
264
|
console.log(`${result.createdConfig ? "created" : "kept"} penpair.config.json (instance ${result.config.instance}, Penpot ${result.config.penpotVersion}, port ${result.config.ports.frontend})`);
|
package/dist/skills.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface InstallOptions {
|
|
|
23
23
|
/** Skills that changed name. Installing the new one leaves the old folder behind, which `installSkills` then reports. */
|
|
24
24
|
export declare const renamedSkills: Record<string, string>;
|
|
25
25
|
export interface InstallReport {
|
|
26
|
+
/** The folder the skills went to, relative to the root. */
|
|
27
|
+
to: string;
|
|
26
28
|
installed: string[];
|
|
27
29
|
unchanged: string[];
|
|
28
30
|
/** Files that differ from the shipped ones and were left alone. */
|
|
@@ -37,4 +39,6 @@ export interface InstallReport {
|
|
|
37
39
|
carriedFacts: boolean;
|
|
38
40
|
}[];
|
|
39
41
|
}
|
|
42
|
+
/** Where the penpair skills already live in a project as real folders (not links), so a later install goes to the same place. */
|
|
43
|
+
export declare function existingSkillsFolder(root: string): Promise<string | undefined>;
|
|
40
44
|
export declare function installSkills(options: InstallOptions): Promise<InstallReport>;
|
package/dist/skills.js
CHANGED
|
@@ -46,15 +46,26 @@ export async function describeSkill(skillDirectory) {
|
|
|
46
46
|
}
|
|
47
47
|
/** Skills that changed name. Installing the new one leaves the old folder behind, which `installSkills` then reports. */
|
|
48
48
|
export const renamedSkills = { "penpot-design": "penpair-design" };
|
|
49
|
+
/** Where the penpair skills already live in a project as real folders (not links), so a later install goes to the same place. */
|
|
50
|
+
export async function existingSkillsFolder(root) {
|
|
51
|
+
for (const folder of [".skills", ".claude/skills", ".agents/skills"]) {
|
|
52
|
+
for (const name of ["penpair-design", "penpair-setup", ...Object.keys(renamedSkills)]) {
|
|
53
|
+
const found = await lstat(path.join(root, folder, name)).catch(() => undefined);
|
|
54
|
+
if (found?.isDirectory())
|
|
55
|
+
return folder;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
49
60
|
export async function installSkills(options) {
|
|
50
61
|
const source = options.source ?? bundledSkillsDirectory();
|
|
51
|
-
const to = options.to ?? ".skills";
|
|
62
|
+
const to = options.to ?? (await existingSkillsFolder(options.root)) ?? ".skills";
|
|
52
63
|
const names = await listBundledSkills(source);
|
|
53
64
|
const chosen = options.only ? options.only : names;
|
|
54
65
|
for (const name of chosen)
|
|
55
66
|
if (!names.includes(name))
|
|
56
67
|
throw new Error(`no skill named ${name}; shipped: ${names.join(", ")}`);
|
|
57
|
-
const report = { installed: [], unchanged: [], kept: [], linked: [], agentsRows: [], legacy: [] };
|
|
68
|
+
const report = { to, installed: [], unchanged: [], kept: [], linked: [], agentsRows: [], legacy: [] };
|
|
58
69
|
for (const name of chosen) {
|
|
59
70
|
const from = path.join(source, name);
|
|
60
71
|
for (const file of await filesUnder(from)) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Kept in its own file so that the command line and the library entry can both read it without importing each other. Equals package.json (a test checks). */
|
|
2
|
-
export declare const version = "0.1.
|
|
2
|
+
export declare const version = "0.1.3";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Kept in its own file so that the command line and the library entry can both read it without importing each other. Equals package.json (a test checks). */
|
|
2
|
-
export const version = "0.1.
|
|
2
|
+
export const version = "0.1.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penpair/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Design together. Build together. The library and engine behind penpair: connect AI agents and people to a Penpot design file, safely. Install @penpair/web or @penpair/docker for the command.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|