kimaki 0.4.78 → 0.4.80

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.
Files changed (90) hide show
  1. package/dist/anthropic-auth-plugin.js +628 -0
  2. package/dist/channel-management.js +2 -2
  3. package/dist/cli.js +316 -129
  4. package/dist/commands/action-buttons.js +1 -1
  5. package/dist/commands/login.js +634 -277
  6. package/dist/commands/model.js +91 -6
  7. package/dist/commands/paginated-select.js +57 -0
  8. package/dist/commands/resume.js +2 -2
  9. package/dist/commands/tasks.js +205 -0
  10. package/dist/commands/undo-redo.js +80 -18
  11. package/dist/context-awareness-plugin.js +347 -0
  12. package/dist/database.js +103 -7
  13. package/dist/db.js +39 -1
  14. package/dist/discord-bot.js +42 -19
  15. package/dist/discord-urls.js +11 -0
  16. package/dist/discord-ws-proxy.js +350 -0
  17. package/dist/discord-ws-proxy.test.js +500 -0
  18. package/dist/errors.js +1 -1
  19. package/dist/gateway-session.js +163 -0
  20. package/dist/hrana-server.js +114 -4
  21. package/dist/interaction-handler.js +30 -7
  22. package/dist/ipc-tools-plugin.js +186 -0
  23. package/dist/message-preprocessing.js +56 -11
  24. package/dist/onboarding-welcome.js +1 -1
  25. package/dist/opencode-interrupt-plugin.js +133 -75
  26. package/dist/opencode-plugin.js +12 -389
  27. package/dist/opencode.js +59 -5
  28. package/dist/parse-permission-rules.test.js +117 -0
  29. package/dist/queue-drain-after-interactive-ui.e2e.test.js +119 -0
  30. package/dist/session-handler/thread-session-runtime.js +68 -29
  31. package/dist/startup-time.e2e.test.js +295 -0
  32. package/dist/store.js +1 -0
  33. package/dist/system-message.js +3 -1
  34. package/dist/task-runner.js +7 -3
  35. package/dist/task-schedule.js +12 -0
  36. package/dist/thread-message-queue.e2e.test.js +13 -1
  37. package/dist/undo-redo.e2e.test.js +166 -0
  38. package/dist/utils.js +4 -1
  39. package/dist/voice-attachment.js +34 -0
  40. package/dist/voice-handler.js +11 -9
  41. package/dist/voice-message.e2e.test.js +78 -0
  42. package/dist/voice.test.js +31 -0
  43. package/package.json +12 -7
  44. package/skills/egaki/SKILL.md +80 -15
  45. package/skills/errore/SKILL.md +13 -0
  46. package/skills/lintcn/SKILL.md +749 -0
  47. package/skills/npm-package/SKILL.md +17 -3
  48. package/skills/spiceflow/SKILL.md +14 -0
  49. package/skills/zele/SKILL.md +9 -0
  50. package/src/anthropic-auth-plugin.ts +732 -0
  51. package/src/channel-management.ts +2 -2
  52. package/src/cli.ts +354 -132
  53. package/src/commands/action-buttons.ts +1 -0
  54. package/src/commands/login.ts +836 -337
  55. package/src/commands/model.ts +102 -7
  56. package/src/commands/paginated-select.ts +81 -0
  57. package/src/commands/resume.ts +6 -1
  58. package/src/commands/tasks.ts +293 -0
  59. package/src/commands/undo-redo.ts +87 -20
  60. package/src/context-awareness-plugin.ts +469 -0
  61. package/src/database.ts +138 -7
  62. package/src/db.ts +40 -1
  63. package/src/discord-bot.ts +46 -19
  64. package/src/discord-urls.ts +12 -0
  65. package/src/errors.ts +1 -1
  66. package/src/hrana-server.ts +124 -3
  67. package/src/interaction-handler.ts +41 -9
  68. package/src/ipc-tools-plugin.ts +228 -0
  69. package/src/message-preprocessing.ts +82 -11
  70. package/src/onboarding-welcome.ts +1 -1
  71. package/src/opencode-interrupt-plugin.ts +164 -91
  72. package/src/opencode-plugin.ts +13 -483
  73. package/src/opencode.ts +60 -5
  74. package/src/parse-permission-rules.test.ts +127 -0
  75. package/src/queue-drain-after-interactive-ui.e2e.test.ts +151 -0
  76. package/src/session-handler/thread-runtime-state.ts +4 -1
  77. package/src/session-handler/thread-session-runtime.ts +82 -20
  78. package/src/startup-time.e2e.test.ts +372 -0
  79. package/src/store.ts +8 -0
  80. package/src/system-message.ts +10 -1
  81. package/src/task-runner.ts +9 -22
  82. package/src/task-schedule.ts +15 -0
  83. package/src/thread-message-queue.e2e.test.ts +14 -1
  84. package/src/undo-redo.e2e.test.ts +207 -0
  85. package/src/utils.ts +7 -0
  86. package/src/voice-attachment.ts +51 -0
  87. package/src/voice-handler.ts +15 -7
  88. package/src/voice-message.e2e.test.ts +95 -0
  89. package/src/voice.test.ts +36 -0
  90. package/src/onboarding-tutorial-plugin.ts +0 -93
@@ -1,35 +1,100 @@
1
1
  ---
2
2
  name: egaki
3
3
  description: >
4
- AI image generation CLI. Generates images from text prompts using Google Imagen
5
- and Gemini multimodal models via the Vercel AI SDK. Supports image editing,
6
- inpainting, and multiple output formats.
4
+ AI image and video generation CLI. Use this skill to install egaki, configure
5
+ auth, run help commands, and generate images or videos with provider keys or
6
+ an Egaki subscription.
7
7
  ---
8
8
 
9
9
  # egaki
10
10
 
11
- AI image generation from the terminal. Text-to-image, image editing, and inpainting
12
- with Google Imagen and Gemini models.
11
+ Generate AI images and videos from the terminal.
12
+ Use this for text-to-image, image editing, mask-based edits, text-to-video,
13
+ image-to-video, and model discovery.
13
14
 
14
- Run `egaki --help` before using this CLI. The help output has all commands,
15
- options, defaults, and usage examples.
15
+ ## Install
16
16
 
17
- For subcommand details: `egaki <command> --help` (e.g. `egaki image --help`, `egaki login --help`)
17
+ ```bash
18
+ pnpm add -g egaki
19
+ ```
20
+
21
+ ## Always check help first
22
+
23
+ Run the full help output before using commands:
24
+
25
+ ```bash
26
+ egaki --help
27
+ ```
28
+
29
+ Do not truncate help output with `head`.
30
+
31
+ For subcommand details: `egaki <command> --help` (e.g. `egaki image --help`, `egaki video --help`, `egaki login --help`)
32
+
33
+ ## Auth options
34
+
35
+ You can authenticate in two ways:
36
+
37
+ 1. Egaki subscription key (recommended — all models, one key)
38
+ 2. Provider API keys (Google, OpenAI, Fal, Replicate) via `egaki login`
39
+
40
+ If using Egaki subscription, set it up first with `egaki subscribe`, then store
41
+ the key with `egaki login --provider egaki --key egaki_...`.
18
42
 
19
- ## Quick start
43
+ ## Login behavior for remote agents
44
+
45
+ When login requires a URL flow, run login in the background and send the login URL
46
+ to the user so they can complete auth interactively.
47
+
48
+ ## Example commands
20
49
 
21
50
  ```bash
22
- # configure an API key
51
+ # configure key interactively
23
52
  egaki login
24
53
 
54
+ # show login status
55
+ egaki login --show
56
+
57
+ # subscribe to Egaki for all supported models
58
+ egaki subscribe
59
+
60
+ # check subscription usage
61
+ egaki usage
62
+
25
63
  # generate an image
26
- egaki image "a sunset over mars"
64
+ egaki image "a watercolor fox reading a map" -o fox.png
65
+
66
+ # select a model explicitly
67
+ egaki image "isometric floating city, soft colors" -m imagen-4.0-generate-001 -o city.png
27
68
 
28
69
  # edit an existing image (local file or URL)
29
- egaki image "add a wizard hat" --input photo.jpg
30
- egaki image "make it pop art" --input https://example.com/photo.jpg
70
+ egaki image "add a red scarf and make it winter" --input portrait.jpg -o portrait-winter.png
71
+ egaki image "turn this into a manga panel" --input https://example.com/photo.jpg -o manga.png
72
+
73
+ # inpainting with a mask
74
+ egaki image "replace the sky with a dramatic sunset" --input scene.png --mask mask.png -o scene-sunset.png
31
75
 
32
- # pipe to another tool
33
- egaki image "logo" --stdout | convert - -resize 512x512 logo.png
76
+ # generate a video — use a 5 minute timeout, video generation is slow
77
+ egaki video "a paper boat drifting on a calm lake at sunrise" -o boat.mp4
78
+
79
+ # generate a video with a specific model
80
+ egaki video "timelapse of a stormy sea, cinematic" -m google/veo-3.1-fast-generate-001 --duration 6 -o storm.mp4
81
+
82
+ # cheap video model
83
+ egaki video "a cat walking on a rooftop at night" -m klingai/kling-v2.5-turbo-t2v --duration 5 -o cat.mp4
84
+
85
+ # image-to-video (model must support i2v)
86
+ egaki video "slowly animate the clouds" --input photo.jpg -m klingai/kling-v2.6-i2v -o animated.mp4
87
+
88
+ # discover all models (image + video)
89
+ egaki models
90
+
91
+ # filter by type
92
+ egaki models --type video
93
+ egaki models --type image
34
94
  ```
35
95
 
96
+ ## Video generation note for agents
97
+
98
+ Video generation can be very slow — some models take 1–3 minutes per request.
99
+ Always use a command timeout of **at least 5 minutes** when invoking `egaki video`
100
+ from automation or agent workflows.
@@ -533,6 +533,19 @@ async function legacyHandler(id: string) {
533
533
 
534
534
  > At boundaries where legacy code expects exceptions, check `instanceof Error` and throw with `cause`. This preserves the error chain and keeps the pattern consistent.
535
535
 
536
+ ### Converting `{ data, error }` Returns
537
+
538
+ Some SDKs (Supabase, Stripe, etc.) return `{ data, error }` instead of throwing. Destructure inline, check `error` first (truthy, not `instanceof` — most SDKs return plain objects), wrap in a tagged error, then continue with `data`:
539
+
540
+ ```ts
541
+ const { data, error } = await supabase.from('users').select('*').eq('id', id)
542
+ if (error) return new SupabaseError({ cause: error })
543
+ if (data === null) return new NotFoundError({ id })
544
+ // data is narrowed here
545
+ ```
546
+
547
+ > If the SDK's `error` is already an `Error` instance you can return it directly, but wrapping in a domain error is better — gives you `_tag`, typed properties, and `cause` chain. Check `error` with truthy check, not `instanceof Error`, since most SDK error objects are plain objects.
548
+
536
549
  ### Partition: Splitting Successes and Failures
537
550
 
538
551
  ```ts