@shigureni/minion 0.1.0

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.
@@ -0,0 +1,20 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { readConfig, writeConfig } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion config set <key> <value>
10
+
11
+ 設定値を書き込む。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ const key = c.req.param("key") ?? ""
15
+ const value = c.req.param("value") ?? ""
16
+ const config = readConfig()
17
+ config[key] = value
18
+ writeConfig(config)
19
+ return c.text(`${key} = ${value}`)
20
+ })
@@ -0,0 +1,17 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { killApp, startApp } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion dev
10
+
11
+ 一旦停止してから、デバッグビルドで起動し直す。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ const killMessage = killApp()
15
+ const startMessage = await startApp(true)
16
+ return c.text([killMessage, startMessage].join("\n"))
17
+ })
@@ -0,0 +1,15 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { killApp } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion kill
10
+
11
+ アプリとgatewayを停止する。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ return c.text(killApp())
15
+ })
@@ -0,0 +1,8 @@
1
+ import type { NotFoundHandler } from "hono"
2
+
3
+ export const notFound: NotFoundHandler = (c) => {
4
+ return c.text(
5
+ `使い方: minion [start|dev|kill|reboot|status|config]\n不明なコマンド: ${c.req.path}`,
6
+ 404,
7
+ )
8
+ }
@@ -0,0 +1,17 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { killApp, startApp } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion reboot
10
+
11
+ 一旦停止してから、リリースビルドで起動し直す。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ const killMessage = killApp()
15
+ const startMessage = await startApp(false)
16
+ return c.text([killMessage, startMessage].join("\n"))
17
+ })
@@ -0,0 +1,16 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { startApp } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion start
10
+
11
+ アプリをリリースビルドで起動する。すでに起動中なら何もしない。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ const message = await startApp(false)
15
+ return c.text(message)
16
+ })
@@ -0,0 +1,15 @@
1
+ import { zValidator } from "@hono/zod-validator"
2
+ import { z } from "zod"
3
+ import { factory } from "@/factory"
4
+ import { helpGuard } from "@/lib/help-guard"
5
+ import { statusApp } from "@/lib/process"
6
+
7
+ const schema = z.object({})
8
+
9
+ export const help = `Usage: minion status
10
+
11
+ アプリとgatewayの起動状況を表示する。`
12
+
13
+ export default factory.createHandlers(helpGuard(help), zValidator("json", schema), async (c) => {
14
+ return c.text(statusApp())
15
+ })
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@shigureni/minion",
3
+ "version": "0.1.0",
4
+ "description": "Desktop pet that reacts to your Claude Code session activity",
5
+ "keywords": [
6
+ "claude-code",
7
+ "cli",
8
+ "desktop-pet",
9
+ "macos"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "shigurenimo",
13
+ "bin": {
14
+ "minion": "cli/src/index.ts"
15
+ },
16
+ "files": [
17
+ "cli/src",
18
+ "swift",
19
+ "tsconfig.json",
20
+ "!cli/src/**/*.test.ts",
21
+ "!swift/.build"
22
+ ],
23
+ "type": "module",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "check": "vp check",
29
+ "fmt": "vp fmt",
30
+ "lint": "vp lint",
31
+ "test": "vp test"
32
+ },
33
+ "dependencies": {
34
+ "@hono/zod-validator": "^0.7.6",
35
+ "hono": "^4.12.8",
36
+ "zod": "^4.3.6"
37
+ },
38
+ "devDependencies": {
39
+ "@types/bun": "^1.3.14",
40
+ "@types/node": "^26.1.0",
41
+ "@voidzero-dev/vite-plus-core": "^0.2.2",
42
+ "typescript": "^6.0.3",
43
+ "vite-plus": "^0.2.2"
44
+ },
45
+ "engines": {
46
+ "bun": ">=1.0.0"
47
+ }
48
+ }
@@ -0,0 +1,19 @@
1
+ // swift-tools-version: 6.3
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "open-minion",
6
+ platforms: [
7
+ .macOS(.v14)
8
+ ],
9
+ targets: [
10
+ .executableTarget(
11
+ name: "open-minion",
12
+ path: "Sources/open-minion",
13
+ resources: [
14
+ .copy("Resources/ChickBlue.png")
15
+ ]
16
+ ),
17
+ ],
18
+ swiftLanguageModes: [.v6]
19
+ )