@ekanos/cli 0.1.4 → 0.1.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/README.md +53 -6
- package/dist/commands/publish.d.ts +46 -1
- package/dist/commands/publish.js +174 -13
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/sources.d.ts +17 -0
- package/dist/commands/sources.js +75 -0
- package/dist/commands/sources.js.map +1 -0
- package/dist/commands/use.d.ts +21 -0
- package/dist/commands/use.js +62 -0
- package/dist/commands/use.js.map +1 -0
- package/dist/commands/whoami.d.ts +6 -0
- package/dist/commands/whoami.js +26 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +47 -3
- package/dist/index.js.map +1 -1
- package/dist/seats.d.ts +21 -0
- package/dist/seats.js +15 -0
- package/dist/seats.js.map +1 -0
- package/dist/sources-api.d.ts +44 -0
- package/dist/sources-api.js +69 -0
- package/dist/sources-api.js.map +1 -0
- package/package.json +1 -1
- package/templates/AGENTS.md.tmpl +57 -18
- package/templates/claude-skill.md.tmpl +32 -11
package/templates/AGENTS.md.tmpl
CHANGED
|
@@ -156,10 +156,20 @@ activationData is updated — **seed the cache in `onActivate`; the schedule
|
|
|
156
156
|
keeps it fresh.** Without it, a cache-backed widget is empty until the first
|
|
157
157
|
schedule tick. v1 errors are non-fatal: a throw is logged as a warning and the
|
|
158
158
|
activation stays connected, so this is for cache seeding and eager
|
|
159
|
-
validation, never a connect gate. Seed BEST-EFFORT
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
validation, never a connect gate. Seed BEST-EFFORT — swallow what you can
|
|
160
|
+
name, log loudly what you can't: catch the upstream error classes you can
|
|
161
|
+
reason about (timeouts, 5xx, provider errors) and warn; log anything
|
|
162
|
+
unrecognized as an error and return, so a genuine bug stays visible in logs
|
|
163
|
+
without telling a user their brand-new connection failed. Reserve the throw
|
|
164
|
+
for misconfiguration the user can actually fix. Treat onActivate as an
|
|
165
|
+
OPTIMIZATION, never a correctness dependency: the schedule remains the
|
|
166
|
+
freshness guarantee, and a config fingerprint keeps the stale window safe
|
|
167
|
+
whether or not the hook fires.
|
|
168
|
+
|
|
169
|
+
Troubleshooting `ekanos dev`: adding/removing/re-adding handler modules can
|
|
170
|
+
leave the harness's Turbopack cache resolving a deleted path ("Module not
|
|
171
|
+
found" for a file that exists). Clear it with `rm -rf .ekanos/harness/.next`
|
|
172
|
+
and restart.
|
|
163
173
|
|
|
164
174
|
A cache invalidated only by age still serves the *previous* activation's data
|
|
165
175
|
for a while even with `onActivate` wired up. Close that gap with a
|
|
@@ -190,8 +200,17 @@ system. Available modules (import individually, e.g. `@ekanos/ui/button`):
|
|
|
190
200
|
`switch`, `textarea`, `tooltip`, `trans`, `utils` (the `cn()` helper),
|
|
191
201
|
`ai-prompt-input`, plus the stylesheets `styles.css` / `tokens.css` /
|
|
192
202
|
`theme.css` / `base.css`. Icons are Font Awesome glyph names via
|
|
193
|
-
`@ekanos/ui/icon
|
|
194
|
-
|
|
203
|
+
`@ekanos/ui/icon`. This generated shell loads Font Awesome **Free**
|
|
204
|
+
(`@fortawesome/fontawesome-free`) — a much smaller set than the Pro kit Fusion
|
|
205
|
+
itself runs — so a name that's Pro-only (or just mistyped) renders a
|
|
206
|
+
circle-question disc instead of vanishing, and dev builds `console.warn` once
|
|
207
|
+
per name to catch it before a screenshot review does. `fa-light` / `fa-duotone`
|
|
208
|
+
/ `fa-thin` are rewritten to `fa-solid`, the one weight Free ships, so author
|
|
209
|
+
`fa-light` anyway — it degrades harmlessly today, and the intended weight
|
|
210
|
+
survives if this host ever loads Pro instead. Verify a glyph name against the
|
|
211
|
+
Free set (`pnpm --filter @ekanos/ui check:fa-free-names`, or
|
|
212
|
+
https://fontawesome.com/search?o=r&s=solid,regular,brands) before relying on
|
|
213
|
+
it looking like anything in particular.
|
|
195
214
|
|
|
196
215
|
## Testing
|
|
197
216
|
|
|
@@ -237,20 +256,40 @@ carries an imperative `hint`; treat hints as remediation instructions.
|
|
|
237
256
|
| `ekanos test` | Run this project's test script through its package manager |
|
|
238
257
|
| `ekanos login --host <url>` | Device-flow login to a Fusion deployment (stores the host for later verbs) |
|
|
239
258
|
| `ekanos status` | Login state for the resolved host + this project's submissions |
|
|
240
|
-
| `ekanos
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
`
|
|
246
|
-
|
|
247
|
-
|
|
259
|
+
| `ekanos sources` | List every Fusion source you hold a developer/admin seat on, marking this project's current target |
|
|
260
|
+
| `ekanos use <source-slug>` | Set this project's publish target — refuses (`forbidden`) a slug you hold no seat on |
|
|
261
|
+
| `ekanos publish` | Validate, pack (whitelist: ekanos.json, package.json, README.md, src/), verify the target, and submit. Refuses on any error-severity finding |
|
|
262
|
+
|
|
263
|
+
Host resolution for `logout`/`whoami`/`status`/`sources`/`use`/`publish`:
|
|
264
|
+
`--host` flag → `EKANOS_HOST` → the `host` field in ekanos.json → the sole
|
|
265
|
+
stored login. The first successful `publish` saves `host` and `source` into
|
|
266
|
+
ekanos.json. `login` is the exception — it never reads ekanos.json for a host
|
|
267
|
+
(`--host` → `EKANOS_HOST` → the sole stored login only), since it is the verb
|
|
268
|
+
that creates credentials and a committed file must not be able to redirect it.
|
|
269
|
+
|
|
270
|
+
### Publish targeting — do not skip this if you hold more than one seat
|
|
271
|
+
|
|
272
|
+
`publish` verifies its target BEFORE packing or submitting anything: it fetches
|
|
273
|
+
your seat list and refuses (`forbidden`, exit 5) a source you hold no seat on,
|
|
274
|
+
naming your actual seats in the hint. If the target came from ekanos.json
|
|
275
|
+
(not `--source` this run) and you hold more than one seat, a scripted/agent
|
|
276
|
+
run (JSON mode, which is what running under an agent means) is refused with
|
|
277
|
+
`validation` (exit 3) and the seat list **unless `--yes` is passed** — publish
|
|
278
|
+
never guesses and never prompts in this mode.
|
|
279
|
+
|
|
280
|
+
**As an agent: never pass `--yes` to paper over that ambiguity.** Run
|
|
281
|
+
`ekanos sources` first and pass `--source <slug>` explicitly, or run
|
|
282
|
+
`ekanos use <slug>` once to set the project's target deliberately. `--yes` is
|
|
283
|
+
for a human who already confirmed the target, or a pipeline pinned to one
|
|
284
|
+
source — not a way to silence the check when you are unsure.
|
|
248
285
|
|
|
249
286
|
Exit codes (frozen contract — branch on these): `0` ok, `1` internal, `2`
|
|
250
|
-
usage, `3` validation
|
|
251
|
-
`
|
|
252
|
-
`
|
|
253
|
-
|
|
287
|
+
usage, `3` validation (also: ambiguous publish target — pass `--source` or
|
|
288
|
+
`--yes`), `4` auth required (run `ekanos login`), `5` forbidden (also: no seat
|
|
289
|
+
on the target source — check `ekanos sources`), `6` not found, `7` invalid
|
|
290
|
+
state (e.g. version already submitted — bump `package.json#version`), `8`
|
|
291
|
+
network (retry, do NOT re-login), `9` precondition failed, `10` publish gate
|
|
292
|
+
failed (fix `data.findings`).
|
|
254
293
|
|
|
255
294
|
The loop: `ekanos dev` → edit → `npx tsc --noEmit` → `ekanos validate` →
|
|
256
295
|
`ekanos test` → `ekanos publish`.
|
|
@@ -18,8 +18,14 @@ root. Read it before writing integration code. The definition is one
|
|
|
18
18
|
3. `npx tsc --noEmit` — types clean.
|
|
19
19
|
4. `npx ekanos validate --json` — findings clean.
|
|
20
20
|
5. `npm test` — green.
|
|
21
|
-
6.
|
|
22
|
-
|
|
21
|
+
6. **Before publishing, know your target.** If you hold more than one
|
|
22
|
+
developer seat, run `npx ekanos sources --json` and pass the intended
|
|
23
|
+
`--source <slug>` explicitly to `publish`. Never pass `--yes` to get past
|
|
24
|
+
an ambiguous-target error you have not actually resolved — `--yes` is
|
|
25
|
+
consent to a target you already chose, not a way to silence the check.
|
|
26
|
+
7. `npx ekanos publish --source <slug>` — submits to the Fusion host (refuses
|
|
27
|
+
while any error-severity finding remains, and refuses `forbidden` if you
|
|
28
|
+
hold no seat on that source).
|
|
23
29
|
|
|
24
30
|
## Reading CLI output
|
|
25
31
|
|
|
@@ -32,22 +38,37 @@ remediation instructions and follow them verbatim.** `ekanos validate` puts
|
|
|
32
38
|
findings in `data.findings`; `ekanos publish` refuses with exit 10 and the
|
|
33
39
|
same findings in `data.findings`.
|
|
34
40
|
|
|
35
|
-
Exit codes to branch on: `0` ok · `2` usage · `3` validation
|
|
36
|
-
|
|
41
|
+
Exit codes to branch on: `0` ok · `2` usage · `3` validation (also: ambiguous
|
|
42
|
+
publish target — pass `--source` or `--yes`, never guess) · `4` run
|
|
43
|
+
`ekanos login` · `5` forbidden (also: no seat on the target source — run
|
|
44
|
+
`ekanos sources`) · `7` version already submitted (bump `package.json#version`) ·
|
|
37
45
|
`8` network (retry — do NOT re-login) · `9` precondition · `10` fix findings,
|
|
38
46
|
publish again.
|
|
39
47
|
|
|
40
48
|
## Hosts and sessions
|
|
41
49
|
|
|
42
50
|
`ekanos login --host <url>` stores a session; after that, `logout`/`whoami`/
|
|
43
|
-
`status`/`publish` resolve the host from `--host` →
|
|
44
|
-
ekanos.json's `host` field → the sole stored login. `login`
|
|
45
|
-
ekanos.json for a host — only `--host`, `EKANOS_HOST`, or
|
|
46
|
-
login — since it is the verb that creates credentials.
|
|
47
|
-
who you are logged in as and what this project has
|
|
48
|
-
successful publish saves `host` and `source` into
|
|
51
|
+
`status`/`sources`/`use`/`publish` resolve the host from `--host` →
|
|
52
|
+
`EKANOS_HOST` → ekanos.json's `host` field → the sole stored login. `login`
|
|
53
|
+
itself never reads ekanos.json for a host — only `--host`, `EKANOS_HOST`, or
|
|
54
|
+
the sole stored login — since it is the verb that creates credentials.
|
|
55
|
+
`ekanos status` shows who you are logged in as and what this project has
|
|
56
|
+
submitted. The first successful publish saves `host` and `source` into
|
|
57
|
+
ekanos.json.
|
|
58
|
+
|
|
59
|
+
## Publish targets, when you hold more than one seat
|
|
60
|
+
|
|
61
|
+
`ekanos sources` lists every source you hold a seat on; `ekanos use <slug>`
|
|
62
|
+
sets this project's saved target (seat-checked — refuses a slug you don't
|
|
63
|
+
hold). `publish` verifies its resolved target against your seats before
|
|
64
|
+
packing anything, and — running as an agent, which is JSON/non-interactive
|
|
65
|
+
mode — never prompts: an ambiguous implicit target (ekanos.json, more than one
|
|
66
|
+
seat) is refused with the seat list unless you pass `--yes`. **Always resolve
|
|
67
|
+
the ambiguity yourself** (pick the right `--source`) rather than reaching for
|
|
68
|
+
`--yes` on a target you have not verified.
|
|
49
69
|
|
|
50
70
|
## Before claiming done
|
|
51
71
|
|
|
52
72
|
Run steps 3-5 above and confirm all three are clean — a publish is only as
|
|
53
|
-
good as the validate that precedes it.
|
|
73
|
+
good as the validate that precedes it. If publishing, confirm you named the
|
|
74
|
+
right `--source` rather than relying on `--yes`.
|