flowbook 0.2.3 → 0.2.5
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.js +17 -17
- package/package.json +1 -1
- package/src/client/components/Header.tsx +5 -15
- package/src/client/index.html +4 -1
- package/src/client/public/android-chrome-192x192.png +0 -0
- package/src/client/public/android-chrome-512x512.png +0 -0
- package/src/client/public/apple-touch-icon.png +0 -0
- package/src/client/public/favicon-16x16.png +0 -0
- package/src/client/public/favicon-32x32.png +0 -0
- package/src/client/public/favicon.ico +0 -0
- package/src/client/public/site.webmanifest +11 -0
- package/src/node/skill.ts +22 -23
package/dist/cli.js
CHANGED
|
@@ -330,10 +330,10 @@ function resolveAgents(agentArg) {
|
|
|
330
330
|
}
|
|
331
331
|
function installFile(src, destDir, destFilename) {
|
|
332
332
|
const dest = resolve3(destDir, destFilename);
|
|
333
|
-
|
|
333
|
+
const existed = existsSync2(dest);
|
|
334
334
|
mkdirSync(destDir, { recursive: true });
|
|
335
335
|
copyFileSync(src, dest);
|
|
336
|
-
return
|
|
336
|
+
return { action: existed ? "updated" : "installed" };
|
|
337
337
|
}
|
|
338
338
|
function installSkills(agentArg, global) {
|
|
339
339
|
const agents = resolveAgents(agentArg);
|
|
@@ -343,32 +343,32 @@ function installSkills(agentArg, global) {
|
|
|
343
343
|
console.error(" \u2717 Skill source file not found. Reinstall flowbook.");
|
|
344
344
|
process.exit(1);
|
|
345
345
|
}
|
|
346
|
-
let
|
|
347
|
-
let
|
|
346
|
+
let installedSkills = 0;
|
|
347
|
+
let updatedSkills = 0;
|
|
348
|
+
let installedCmds = 0;
|
|
349
|
+
let updatedCmds = 0;
|
|
348
350
|
for (const agent of agents) {
|
|
349
351
|
const skillDir = resolve3(base, global ? agent.skill.global : agent.skill.project);
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
352
|
+
const skillResult = installFile(skillSrc, skillDir, "SKILL.md");
|
|
353
|
+
if (skillResult.action === "installed") installedSkills++;
|
|
354
|
+
else if (skillResult.action === "updated") updatedSkills++;
|
|
353
355
|
if (agent.command) {
|
|
354
356
|
const cmdSrc = getCommandSrc(agent.command.format);
|
|
355
357
|
if (existsSync2(cmdSrc)) {
|
|
356
358
|
const cmdDir = resolve3(base, global ? agent.command.global : agent.command.project);
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
const cmdResult = installFile(cmdSrc, cmdDir, "flowbook.md");
|
|
360
|
+
if (cmdResult.action === "installed") installedCmds++;
|
|
361
|
+
else if (cmdResult.action === "updated") updatedCmds++;
|
|
360
362
|
}
|
|
361
363
|
}
|
|
362
364
|
}
|
|
363
365
|
const scope = global ? "global" : "project";
|
|
364
366
|
const agentNames = agents.map((a) => a.name).join(", ");
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
console.log(` \u2713 Already installed for: ${agentNames}`);
|
|
371
|
-
}
|
|
367
|
+
if (installedSkills > 0) console.log(` \u2713 Installed skill to ${installedSkills} ${scope} director${installedSkills > 1 ? "ies" : "y"}`);
|
|
368
|
+
if (updatedSkills > 0) console.log(` \u2713 Updated skill in ${updatedSkills} ${scope} director${updatedSkills > 1 ? "ies" : "y"}`);
|
|
369
|
+
if (installedCmds > 0) console.log(` \u2713 Installed /flowbook command to ${installedCmds} ${scope} director${installedCmds > 1 ? "ies" : "y"}`);
|
|
370
|
+
if (updatedCmds > 0) console.log(` \u2713 Updated /flowbook command in ${updatedCmds} ${scope} director${updatedCmds > 1 ? "ies" : "y"}`);
|
|
371
|
+
console.log(` Agents: ${agentNames}`);
|
|
372
372
|
}
|
|
373
373
|
function printSkillUsage() {
|
|
374
374
|
console.log(`
|
package/package.json
CHANGED
|
@@ -12,21 +12,11 @@ export function Header({
|
|
|
12
12
|
return (
|
|
13
13
|
<header className="h-14 border-b border-zinc-800 flex items-center px-4 gap-4 shrink-0 bg-zinc-950">
|
|
14
14
|
<div className="flex items-center gap-2.5">
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
strokeWidth="2"
|
|
21
|
-
strokeLinecap="round"
|
|
22
|
-
strokeLinejoin="round"
|
|
23
|
-
>
|
|
24
|
-
<rect x="3" y="3" width="7" height="7" rx="1" />
|
|
25
|
-
<rect x="14" y="3" width="7" height="7" rx="1" />
|
|
26
|
-
<rect x="8" y="14" width="7" height="7" rx="1" />
|
|
27
|
-
<path d="M6.5 10v1.5a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1V10" />
|
|
28
|
-
<path d="M11.5 12.5V14" />
|
|
29
|
-
</svg>
|
|
15
|
+
<img
|
|
16
|
+
src="/favicon-32x32.png"
|
|
17
|
+
alt="Flowbook"
|
|
18
|
+
className="w-6 h-6"
|
|
19
|
+
/>
|
|
30
20
|
<h1 className="text-lg font-semibold tracking-tight text-zinc-100">
|
|
31
21
|
Flowbook
|
|
32
22
|
</h1>
|
package/src/client/index.html
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon"
|
|
5
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
6
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
7
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
8
|
+
<link rel="manifest" href="/site.webmanifest" />
|
|
6
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
10
|
<title>Flowbook</title>
|
|
8
11
|
</head>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Flowbook",
|
|
3
|
+
"short_name": "Flowbook",
|
|
4
|
+
"icons": [
|
|
5
|
+
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
|
|
6
|
+
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
|
|
7
|
+
],
|
|
8
|
+
"theme_color": "#ffffff",
|
|
9
|
+
"background_color": "#ffffff",
|
|
10
|
+
"display": "standalone"
|
|
11
|
+
}
|
package/src/node/skill.ts
CHANGED
|
@@ -135,12 +135,12 @@ function resolveAgents(agentArg: string): AgentConfig[] {
|
|
|
135
135
|
return found;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
function installFile(src: string, destDir: string, destFilename: string):
|
|
138
|
+
function installFile(src: string, destDir: string, destFilename: string): { action: "installed" | "updated" | "skipped" } {
|
|
139
139
|
const dest = resolve(destDir, destFilename);
|
|
140
|
-
|
|
140
|
+
const existed = existsSync(dest);
|
|
141
141
|
mkdirSync(destDir, { recursive: true });
|
|
142
142
|
copyFileSync(src, dest);
|
|
143
|
-
return
|
|
143
|
+
return { action: existed ? "updated" : "installed" };
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export function installSkills(agentArg: string, global: boolean): void {
|
|
@@ -153,22 +153,24 @@ export function installSkills(agentArg: string, global: boolean): void {
|
|
|
153
153
|
process.exit(1);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
let
|
|
157
|
-
let
|
|
156
|
+
let installedSkills = 0;
|
|
157
|
+
let updatedSkills = 0;
|
|
158
|
+
let installedCmds = 0;
|
|
159
|
+
let updatedCmds = 0;
|
|
158
160
|
|
|
159
161
|
for (const agent of agents) {
|
|
160
162
|
const skillDir = resolve(base, global ? agent.skill.global : agent.skill.project);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
const skillResult = installFile(skillSrc, skillDir, "SKILL.md");
|
|
164
|
+
if (skillResult.action === "installed") installedSkills++;
|
|
165
|
+
else if (skillResult.action === "updated") updatedSkills++;
|
|
164
166
|
|
|
165
167
|
if (agent.command) {
|
|
166
168
|
const cmdSrc = getCommandSrc(agent.command.format);
|
|
167
169
|
if (existsSync(cmdSrc)) {
|
|
168
170
|
const cmdDir = resolve(base, global ? agent.command.global : agent.command.project);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
const cmdResult = installFile(cmdSrc, cmdDir, "flowbook.md");
|
|
172
|
+
if (cmdResult.action === "installed") installedCmds++;
|
|
173
|
+
else if (cmdResult.action === "updated") updatedCmds++;
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
}
|
|
@@ -176,13 +178,11 @@ export function installSkills(agentArg: string, global: boolean): void {
|
|
|
176
178
|
const scope = global ? "global" : "project";
|
|
177
179
|
const agentNames = agents.map((a) => a.name).join(", ");
|
|
178
180
|
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
console.log(` ✓ Already installed for: ${agentNames}`);
|
|
185
|
-
}
|
|
181
|
+
if (installedSkills > 0) console.log(` ✓ Installed skill to ${installedSkills} ${scope} director${installedSkills > 1 ? "ies" : "y"}`);
|
|
182
|
+
if (updatedSkills > 0) console.log(` ✓ Updated skill in ${updatedSkills} ${scope} director${updatedSkills > 1 ? "ies" : "y"}`);
|
|
183
|
+
if (installedCmds > 0) console.log(` ✓ Installed /flowbook command to ${installedCmds} ${scope} director${installedCmds > 1 ? "ies" : "y"}`);
|
|
184
|
+
if (updatedCmds > 0) console.log(` ✓ Updated /flowbook command in ${updatedCmds} ${scope} director${updatedCmds > 1 ? "ies" : "y"}`);
|
|
185
|
+
console.log(` Agents: ${agentNames}`);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
/** Used by init.ts — installs skills only (no commands) to all agents at project level */
|
|
@@ -191,14 +191,13 @@ export function installAllProjectSkills(): number {
|
|
|
191
191
|
const skillSrc = getSkillSrc();
|
|
192
192
|
if (!existsSync(skillSrc)) return 0;
|
|
193
193
|
|
|
194
|
-
let
|
|
194
|
+
let count = 0;
|
|
195
195
|
for (const agent of AGENTS) {
|
|
196
196
|
const dir = resolve(cwd, agent.skill.project);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
197
|
+
const result = installFile(skillSrc, dir, "SKILL.md");
|
|
198
|
+
if (result.action !== "skipped") count++;
|
|
200
199
|
}
|
|
201
|
-
return
|
|
200
|
+
return count;
|
|
202
201
|
}
|
|
203
202
|
|
|
204
203
|
export function printSkillUsage(): void {
|