@sqaoss/flowy 1.1.1 → 1.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.
@@ -1,14 +1,28 @@
1
1
  services:
2
2
  server:
3
- build: ./server
3
+ build:
4
+ context: .
5
+ dockerfile_inline: |
6
+ FROM oven/bun:1.3.11
7
+ WORKDIR /app
8
+ RUN bun init -y && bun add @sqaoss/flowy
9
+ WORKDIR /app/node_modules/@sqaoss/flowy/server
10
+ RUN bun install --production
11
+ EXPOSE 4000
12
+ VOLUME /data
13
+ CMD ["bun", "src/index.ts"]
4
14
  ports:
5
15
  - "4000:4000"
16
+ volumes:
17
+ - flowy-data:/data
6
18
  environment:
7
- - NODE_ENV=production
8
- restart: unless-stopped
19
+ - FLOWY_DB_PATH=/data/flowy.sqlite
20
+ - PORT=4000
9
21
  healthcheck:
10
- test: ["CMD", "bun", "-e", "const r = await fetch('http://localhost:4000/health'); if (!r.ok) process.exit(1)"]
11
- interval: 10s
12
- timeout: 5s
13
- retries: 3
14
- start_period: 5s
22
+ test: ["CMD", "bun", "-e", "fetch('http://localhost:4000/health').then(r => r.ok ? process.exit(0) : process.exit(1))"]
23
+ interval: 5s
24
+ timeout: 3s
25
+ retries: 5
26
+
27
+ volumes:
28
+ flowy-data:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sqaoss/flowy",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Agentic persistent planning",
5
5
  "type": "module",
6
6
  "bin": {
package/server/Dockerfile CHANGED
@@ -1,14 +1,8 @@
1
- FROM oven/bun:1.3.11 AS base
1
+ FROM oven/bun:1.3.11
2
2
  WORKDIR /app
3
-
4
- FROM base AS install
5
- COPY package.json bun.lock ./
6
- RUN bun install --frozen-lockfile --production
7
-
8
- FROM base
9
- COPY --from=install /app/node_modules node_modules
10
- COPY src src
11
- COPY tsconfig.json .
12
-
3
+ RUN bun init -y && bun add @sqaoss/flowy
4
+ WORKDIR /app/node_modules/@sqaoss/flowy/server
5
+ RUN bun install --production
13
6
  EXPOSE 4000
7
+ VOLUME /data
14
8
  CMD ["bun", "src/index.ts"]
@@ -1,22 +1,50 @@
1
1
  import { spawnSync } from 'node:child_process'
2
- import { existsSync } from 'node:fs'
3
- import { dirname, resolve } from 'node:path'
4
- import { fileURLToPath } from 'node:url'
2
+ import { mkdirSync, writeFileSync } from 'node:fs'
3
+ import { homedir } from 'node:os'
4
+ import { resolve } from 'node:path'
5
5
  import { Command } from 'commander'
6
6
  import { loadConfig, saveConfig } from '../util/config.ts'
7
7
  import { output, outputError } from '../util/format.ts'
8
8
 
9
- function findComposeFile(): string {
10
- let dir = dirname(fileURLToPath(import.meta.url))
11
- while (dir !== dirname(dir)) {
12
- const candidate = resolve(dir, 'docker-compose.yml')
13
- if (existsSync(candidate)) return candidate
14
- dir = dirname(dir)
15
- }
16
- throw new Error('docker-compose.yml not found in any parent directory.')
9
+ const COMPOSE_CONTENT = `services:
10
+ server:
11
+ build:
12
+ context: .
13
+ dockerfile_inline: |
14
+ FROM oven/bun:1.3.11
15
+ WORKDIR /app
16
+ RUN bun init -y && bun add @sqaoss/flowy
17
+ WORKDIR /app/node_modules/@sqaoss/flowy/server
18
+ RUN bun install --production
19
+ EXPOSE 4000
20
+ VOLUME /data
21
+ CMD ["bun", "src/index.ts"]
22
+ ports:
23
+ - "4000:4000"
24
+ volumes:
25
+ - flowy-data:/data
26
+ environment:
27
+ - FLOWY_DB_PATH=/data/flowy.sqlite
28
+ - PORT=4000
29
+ healthcheck:
30
+ test: ["CMD", "bun", "-e", "fetch('http://localhost:4000/health').then(r => r.ok ? process.exit(0) : process.exit(1))"]
31
+ interval: 5s
32
+ timeout: 3s
33
+ retries: 5
34
+
35
+ volumes:
36
+ flowy-data:
37
+ `
38
+
39
+ function ensureComposeFile(): string {
40
+ const dir = resolve(homedir(), '.config', 'flowy')
41
+ mkdirSync(dir, { recursive: true })
42
+ const composePath = resolve(dir, 'docker-compose.yml')
43
+ writeFileSync(composePath, COMPOSE_CONTENT)
44
+ return composePath
17
45
  }
18
46
 
19
- async function pollHealth(url: string, timeoutMs = 30_000): Promise<void> {
47
+ async function pollHealth(url: string, timeoutMs = 60_000): Promise<void> {
20
48
  const start = Date.now()
21
49
  while (Date.now() - start < timeoutMs) {
22
50
  try {
@@ -31,7 +59,7 @@ async function pollHealth(url: string, timeoutMs = 30_000): Promise<void> {
31
59
  }
32
60
 
33
61
  export const setupCommand = new Command('setup').description(
34
- 'Configure the Flowy CLI use "flowy setup local" or "flowy setup remote"',
62
+ 'Configure the Flowy CLI \u2014 use "flowy setup local" or "flowy setup remote"',
35
63
  )
36
64
 
37
65
  setupCommand
@@ -46,7 +74,7 @@ setupCommand
46
74
  throw new Error('Docker is required but was not found.')
47
75
  }
48
76
 
49
- const composePath = findComposeFile()
77
+ const composePath = ensureComposeFile()
50
78
  spawnSync(
51
79
  'docker',
52
80
  ['compose', '-f', composePath, 'up', '-d', '--build'],
@@ -62,6 +90,10 @@ setupCommand
62
90
  config.mode = 'local'
63
91
  config.apiUrl = apiUrl
64
92
  saveConfig(config)
93
+ spawnSync('npx', ['skills', 'add', 'sqaoss/flowy', '--yes'], {
94
+ stdio: 'inherit',
95
+ })
96
+
65
97
  output({ mode: 'local', apiUrl })
66
98
  } catch (error) {
67
99
  outputError(error)
package/src/index.ts CHANGED
@@ -1,5 +1,16 @@
1
1
  #!/usr/bin/env bun
2
+ import { readFileSync } from 'node:fs'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
2
5
  import { Command } from 'commander'
6
+
7
+ const pkgPath = resolve(
8
+ dirname(fileURLToPath(import.meta.url)),
9
+ '..',
10
+ 'package.json',
11
+ )
12
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
13
+
3
14
  import { approveCommand } from './commands/approve.ts'
4
15
  import { clientCommand } from './commands/client.ts'
5
16
  import { featureCommand } from './commands/feature.ts'
@@ -14,8 +25,8 @@ import { whoamiCommand } from './commands/whoami.ts'
14
25
 
15
26
  const program = new Command()
16
27
  .name('flowy')
17
- .description('Project management for AI coding agents')
18
- .version('0.2.0')
28
+ .description(pkg.description)
29
+ .version(pkg.version)
19
30
 
20
31
  program.addCommand(initCommand)
21
32
  program.addCommand(setupCommand)