@gobing-ai/knowledge-kit 0.0.12 → 0.0.13
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/index.js +100 -26
- package/package.json +1 -1
- package/plugins/generations/content-gen/dist/index.js +22167 -0
- package/plugins/generations/content-gen/plugin.json +1 -1
- package/plugins/generations/core-facts-gen/dist/index.js +22048 -0
- package/plugins/generations/core-facts-gen/plugin.json +1 -1
- package/plugins/generations/daily-article-gen/dist/index.js +22022 -0
- package/plugins/generations/daily-article-gen/plugin.json +1 -1
- package/plugins/generations/dailynews-gen/dist/index.js +22324 -0
- package/plugins/generations/dailynews-gen/plugin.json +1 -1
- package/plugins/generations/episode-plan-gen/dist/index.js +22479 -0
- package/plugins/generations/episode-plan-gen/plugin.json +1 -1
- package/plugins/generations/image-gen/config.example.yaml +75 -0
- package/plugins/generations/image-gen/dist/index.js +22619 -0
- package/plugins/generations/image-gen/package.json +17 -0
- package/plugins/generations/image-gen/plugin.json +7 -0
- package/plugins/generations/image-gen/presets/formats/cover.yaml +57 -0
- package/plugins/generations/image-gen/presets/formats/free.yaml +46 -0
- package/plugins/generations/image-gen/presets/formats/illustration.yaml +48 -0
- package/plugins/generations/image-gen/presets/styles/clean-webapp-ui.yaml +28 -0
- package/plugins/generations/image-gen/presets/styles/cute.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/editorial.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/fresh.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/minimalist.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/photorealistic.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/sketch.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/technical-diagram.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/vibrant.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/warm.yaml +3 -0
- package/plugins/generations/image-gen/src/bytes.ts +19 -0
- package/plugins/generations/image-gen/src/index.ts +319 -0
- package/plugins/generations/image-gen/src/job.ts +143 -0
- package/plugins/generations/image-gen/src/paths.ts +31 -0
- package/plugins/generations/image-gen/src/presets.ts +344 -0
- package/plugins/generations/image-gen/src/providers/seedream.ts +128 -0
- package/plugins/generations/image-gen/src/providers/types.ts +285 -0
- package/plugins/generations/image-gen/tsconfig.json +8 -0
- package/plugins/generations/voice-gen/dist/index.js +23027 -0
- package/plugins/generations/voice-gen/plugin.json +1 -1
- package/plugins/ingestions/aihot-ingest/dist/index.js +22358 -0
- package/plugins/ingestions/aihot-ingest/plugin.json +1 -1
- package/plugins/ingestions/horizon-ingest/dist/index.js +22105 -0
- package/plugins/ingestions/horizon-ingest/plugin.json +1 -1
- package/plugins/ingestions/karakeep-local/dist/index.js +24204 -0
- package/plugins/ingestions/karakeep-local/plugin.json +1 -1
- package/plugins/ingestions/last30days-ingest/dist/index.js +22050 -0
- package/plugins/ingestions/last30days-ingest/plugin.json +1 -1
- package/plugins/ingestions/web-search/dist/index.js +24379 -0
- package/plugins/ingestions/web-search/plugin.json +1 -1
- package/plugins/kk/commands/image-generate.md +15 -0
- package/plugins/kk/config.example.yaml +80 -0
- package/plugins/kk/skills/image-authoring/SKILL.md +250 -0
- package/plugins/kk/skills/image-authoring/references/illustration-positions.md +87 -0
- package/plugins/kk/skills/image-authoring/references/migrating-from-wt.md +31 -0
- package/plugins/kk/skills/image-authoring/references/providers.md +52 -0
- package/plugins/kk/skills/image-authoring/references/style-extraction.md +134 -0
- package/plugins/publishings/emdash-pub/dist/index.js +22243 -0
- package/plugins/publishings/emdash-pub/plugin.json +1 -1
- package/plugins/publishings/podcast-pub/dist/index.js +22596 -0
- package/plugins/publishings/podcast-pub/plugin.json +8 -2
- package/plugins/publishings/qiita-pub/dist/index.js +22081 -0
- package/plugins/publishings/qiita-pub/plugin.json +1 -1
- package/plugins/publishings/surfdash-pub/dist/index.js +22233 -0
- package/plugins/publishings/surfdash-pub/plugin.json +1 -1
- package/plugins/publishings/zenn-pub/dist/index.js +22122 -0
- package/plugins/publishings/zenn-pub/plugin.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Style extraction from reference images
|
|
2
|
+
|
|
3
|
+
Loaded by the image-authoring skill when the operator hands over one or more
|
|
4
|
+
reference images and wants the look captured as a reusable style preset.
|
|
5
|
+
Extraction is a **skill operation** — the running agent reads the image(s) with
|
|
6
|
+
its own vision and writes a YAML file. No plugin code, no vision API call, no
|
|
7
|
+
provider credential is involved.
|
|
8
|
+
|
|
9
|
+
There are two mechanisms for using a reference image, and this file owns the
|
|
10
|
+
boundary between them:
|
|
11
|
+
|
|
12
|
+
| baoyu usage | kk mechanism | What happens |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| `direct` | pass-through | The file rides `ImageJobSpec.referenceImages` (0104) to a provider whose `supportsReferenceImages(model)` is true (0103). Highest fidelity; produces one image, nothing reusable. |
|
|
15
|
+
| `style` | extraction (this file) | The look is analysed and written as a `styles/<name>.yaml`. Works with every provider; reusable and editable. |
|
|
16
|
+
| `palette` | extraction, partial | Same procedure, but only `palette`, `name` and `description` are filled; `modifiers` stays a one-line summary. |
|
|
17
|
+
|
|
18
|
+
## Where the preset goes
|
|
19
|
+
|
|
20
|
+
Write to the **user root**: `~/.config/kk/image-presets/styles/<name>.yaml`. A cloned
|
|
21
|
+
look is usually the operator's, not the repository's. An operator who wants the
|
|
22
|
+
preset shared with a team writes to the project root
|
|
23
|
+
(`<KNOWLEDGE_KIT_PROJECT_ROOT>/.kk/image-presets/styles/`) instead — it ranks
|
|
24
|
+
higher in the loader chain. No registration step exists or is needed: the
|
|
25
|
+
loader discovers presets by scanning these directories (0102). If the chosen
|
|
26
|
+
name matches a shipped preset, the new file **shadows** it whole-file and the
|
|
27
|
+
loader emits a `shadowed` diagnostic naming both paths — that is the intended
|
|
28
|
+
way to adjust a shipped style, not an accident.
|
|
29
|
+
|
|
30
|
+
## Input rules
|
|
31
|
+
|
|
32
|
+
- **One to five reference images.** Count them before reading anything.
|
|
33
|
+
- **Cap refusal (exact wording):** if the operator supplies more than 5, refuse
|
|
34
|
+
before reading any of them:
|
|
35
|
+
`Refusing extraction: <N> reference images requested; the cap is 5. Split the set into coherent groups, or drop the least representative references and re-run.`
|
|
36
|
+
The cap is a constant, not a design commitment; changing it means changing
|
|
37
|
+
this number and this message only.
|
|
38
|
+
|
|
39
|
+
## Output rules — the schema is frozen
|
|
40
|
+
|
|
41
|
+
Emit **YAML only** — no prose, no code fence. The document fills **exactly**
|
|
42
|
+
the `StylePreset` fields of `plugins/generations/image-gen/src/presets.ts` and
|
|
43
|
+
nothing else. **Inventing a field outside this list is a defect, not an
|
|
44
|
+
enhancement.** Field-by-field:
|
|
45
|
+
|
|
46
|
+
| Field | Required | Rule |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `name` | yes | kebab-case, derived from the look, never from the filename. |
|
|
49
|
+
| `description` | yes | One or two sentences naming the look and where it works. |
|
|
50
|
+
| `modifiers` | yes | A comma-separated prompt fragment in the same voice as the shipped styles under `plugins/generations/image-gen/presets/styles/` — `composePrompt` concatenates it as segment 3 of a comma-joined prompt. Read two shipped styles before writing one; a style in the wrong voice produces a prompt in two voices. |
|
|
51
|
+
| `palette` | no | 3–6 entries of `{role, name, hex}`. `role` from `{primary, secondary, accent, background, text}`. `hex` uppercase `#RRGGBB`, sampled from the image, never invented. (A merged set may legitimately keep fewer than 3 — only colours common to every reference survive; see merge rules.) |
|
|
52
|
+
| `typography` | no | Only when the image evidences it. Omit rather than guess. |
|
|
53
|
+
| `visualElements` | no | Array of strings naming recurring visual devices (borders, banding, grain, iconography). Only what the image shows. |
|
|
54
|
+
| `bestFor` | no | The content types this look suits. Inferred from the image's own subject matter. |
|
|
55
|
+
| `negative` | no | What this look must avoid — inferred from what is conspicuously absent. |
|
|
56
|
+
| `source` | yes for extraction | `kind: extracted`, `refImages` = the absolute input paths **in the order given**, `extractedAt` = ISO-8601 timestamp, `confidence` = the judgement below. |
|
|
57
|
+
|
|
58
|
+
### The `confidence` decision rule (human-judged, not computed)
|
|
59
|
+
|
|
60
|
+
- `high` — a single clean image with an obvious, consistent look.
|
|
61
|
+
- `medium` — mixed or noisy references, or a merged set where the references
|
|
62
|
+
disagree on any of the four fidelity axes.
|
|
63
|
+
- `low` — the look is ambiguous, or the image is photographic content rather
|
|
64
|
+
than a designed style (a photo *of* something is not a style).
|
|
65
|
+
|
|
66
|
+
## Multi-image merge rules
|
|
67
|
+
|
|
68
|
+
With N references (1 ≤ N ≤ 5) the output is **one merged preset**, not N
|
|
69
|
+
presets and not an average:
|
|
70
|
+
|
|
71
|
+
- `palette` — colours **common to the set**. A colour appearing in one image
|
|
72
|
+
only is dropped, not averaged into a muddy midpoint.
|
|
73
|
+
- `modifiers` — traits present in **every** image. Divergent traits are
|
|
74
|
+
dropped, and each discarded trait is **named in the extraction report** so
|
|
75
|
+
the operator sees exactly what was thrown away.
|
|
76
|
+
- `confidence` — capped at `medium` when the set disagrees on any fidelity axis.
|
|
77
|
+
- `source.refImages` — all N absolute paths, in the order given.
|
|
78
|
+
|
|
79
|
+
## What extraction never writes
|
|
80
|
+
|
|
81
|
+
**Style only — no format extraction in v1.** A `FormatPreset` carries
|
|
82
|
+
`template`, `variables`, `keywords`, `defaultStyle`, `outputFilename` — none of
|
|
83
|
+
which is recoverable from a picture. Never write a `formats/*.yaml` file. What
|
|
84
|
+
an image *does* yield is arithmetic, not extraction: the extraction report
|
|
85
|
+
**states the observed pixel dimensions and the nearest named aspect ratio** of
|
|
86
|
+
each reference, chosen from `21:9`, `4:3`, `1:1`, `16:9`, `3:4`, `9:16`, as a
|
|
87
|
+
suggestion for which existing format to pair the style with.
|
|
88
|
+
|
|
89
|
+
## Pass-through degradation (visible, never silent)
|
|
90
|
+
|
|
91
|
+
When the operator wants `direct` (pass-through) and the selected provider's
|
|
92
|
+
`supportsReferenceImages(model)` returns `false`, the skill must state it in
|
|
93
|
+
these terms and offer the alternative:
|
|
94
|
+
|
|
95
|
+
`Provider <name> cannot accept reference images for model <model> (supportsReferenceImages: false). Pass-through is unavailable; offering style extraction instead.`
|
|
96
|
+
|
|
97
|
+
**Never silently proceed without the reference.** A plausible image generated
|
|
98
|
+
from a dropped reference is the worst outcome available — worse than an error.
|
|
99
|
+
|
|
100
|
+
## Validate after writing
|
|
101
|
+
|
|
102
|
+
After writing the YAML, run the dry run: `KK_IMAGE_DRY_RUN=1` `image-gen`
|
|
103
|
+
(0104) with a job whose `style` is the new preset's name. A malformed or
|
|
104
|
+
unloadable file fails there loudly, naming the file and the schema violation,
|
|
105
|
+
before any provider spend. No validator is written; 0102's loader and the dry
|
|
106
|
+
run already are one.
|
|
107
|
+
|
|
108
|
+
## Fidelity check (v1 method: human eyeball)
|
|
109
|
+
|
|
110
|
+
To answer "did the clone work": extract from reference **I**, regenerate with
|
|
111
|
+
the extracted preset using a prompt describing **I's own subject** (so subject
|
|
112
|
+
variance does not contaminate the comparison), then compare **I** and the
|
|
113
|
+
regeneration on exactly four axes — **palette, rendering technique,
|
|
114
|
+
composition density, typographic treatment**. The v1 comparison method is a
|
|
115
|
+
human eyeballing the pair; no metric is computed. Record the verdict in the
|
|
116
|
+
preset's `source.confidence`; if the fidelity verdict disagrees with the
|
|
117
|
+
extraction-side judgement, take the lower.
|
|
118
|
+
|
|
119
|
+
## Worked output shape
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
name: example-look
|
|
123
|
+
description: Flat colour-band composition with deep teal over warm cream.
|
|
124
|
+
modifiers: flat colour-band composition, deep teal and warm cream palette, hard edges, no gradients, minimal detail
|
|
125
|
+
palette:
|
|
126
|
+
- { role: primary, name: deep teal, hex: '#1D5C63' }
|
|
127
|
+
- { role: background, name: warm cream, hex: '#F5EFE0' }
|
|
128
|
+
source:
|
|
129
|
+
kind: extracted
|
|
130
|
+
refImages:
|
|
131
|
+
- /absolute/path/to/reference.png
|
|
132
|
+
extractedAt: '2026-09-09T18:00:00Z'
|
|
133
|
+
confidence: high
|
|
134
|
+
```
|