@kybernesis/create 0.7.0 → 0.7.1
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/doctor.js +6 -2
- package/dist/init.js +26 -1
- package/package.json +1 -1
- package/skills/.claude/skills/certification/SKILL.md +75 -0
- package/skills/.claude/skills/connect-agents/SKILL.md +119 -0
- package/skills/.claude/skills/control-plane/SKILL.md +80 -0
- package/skills/.claude/skills/eve-building/SKILL.md +106 -0
- package/skills/.claude/skills/fde-engagement/SKILL.md +35 -0
- package/skills/.claude/skills/fde-engagement/references/playbook.md +2312 -0
- package/skills/.claude/skills/kybernesis-packages/SKILL.md +148 -0
- package/skills/.claude/skills/self-hosting/SKILL.md +206 -0
- package/skills/.claude/skills/source-of-truth/SKILL.md +60 -0
- package/skills/fde-engagement/references/playbook.md +48 -0
- package/skills/self-hosting/SKILL.md +5 -0
package/dist/doctor.js
CHANGED
|
@@ -247,7 +247,11 @@ export async function doctor() {
|
|
|
247
247
|
// deployment is incomplete. This is NOT a value to go and set by hand: the
|
|
248
248
|
// switch in Studio installs it, and a missing one means nobody has turned
|
|
249
249
|
// local access on yet.
|
|
250
|
-
|
|
250
|
+
// `env`, not `process.env`: every other check reads the merged view, and
|
|
251
|
+
// reading the bare environment here reported a missing credential on an
|
|
252
|
+
// agent whose .env.local had one two lines above. A preflight tool that
|
|
253
|
+
// cries wolf is a preflight tool people learn to skip.
|
|
254
|
+
if (env.KYBERNESIS_AGENT_CREDENTIAL) {
|
|
251
255
|
add("pass", "local execution can identify this agent to the control plane");
|
|
252
256
|
}
|
|
253
257
|
else {
|
|
@@ -257,7 +261,7 @@ export async function doctor() {
|
|
|
257
261
|
if (hasManage) {
|
|
258
262
|
// manage authorizes with the caller's control-plane grant, so it needs to
|
|
259
263
|
// know which agent it IS before it can check one.
|
|
260
|
-
if (
|
|
264
|
+
if (env.KYBERNESIS_AGENT) {
|
|
261
265
|
add("pass", "management routes can resolve this agent's grants");
|
|
262
266
|
}
|
|
263
267
|
else {
|
package/dist/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { chmodSync, copyFileSync, cpSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import { DEFAULT_ISSUER, EVE_VERSION, REGISTRY_URL, ask, bold, closePrompts, dim, green, run, slug, yellow, } from "./util.js";
|
|
4
4
|
import { CHANNEL_KINDS, channelPlan, engineerPlan, envExample, evalFileTs, evalScript, hostAgentTs, hostSteps, identityMd, rootArcanaTs, subagentAgentTs, subagentArcanaTs, subagentInstructionsMd, } from "./templates.js";
|
|
@@ -111,6 +111,31 @@ export async function init(rawName, options = {}) {
|
|
|
111
111
|
writeFileSync(join(dir, "agent/agent.ts"), hostAgentTs(host, DEFAULT_MODEL));
|
|
112
112
|
writeFileSync(join(dir, "agent/extensions/arcana.ts"), rootArcanaTs());
|
|
113
113
|
writeFileSync(join(dir, "evals/kybernesis.eval.ts"), evalFileTs(displayName, depts));
|
|
114
|
+
/**
|
|
115
|
+
* A self-hosted agent gets its restart script installed, not described.
|
|
116
|
+
*
|
|
117
|
+
* There is no deploy pipeline off Vercel, so restarting IS the release — and
|
|
118
|
+
* the script that does it carries every lesson that path has cost: serialize
|
|
119
|
+
* concurrent restarts, build when the source moved, wait for in-flight turns,
|
|
120
|
+
* and count servers by what they are rather than by who mentions them.
|
|
121
|
+
*
|
|
122
|
+
* It used to ship inside @kybernesis/exe with a line in the docs telling
|
|
123
|
+
* people where to find it, which means a new deployment starts with none of
|
|
124
|
+
* that and rediscovers it one outage at a time.
|
|
125
|
+
*/
|
|
126
|
+
if (host === "exe") {
|
|
127
|
+
const source = join(dir, "node_modules/@kybernesis/exe/scripts/eve-server.sh");
|
|
128
|
+
const target = join(dir, "scripts/eve-server.sh");
|
|
129
|
+
try {
|
|
130
|
+
mkdirSync(join(dir, "scripts"), { recursive: true });
|
|
131
|
+
copyFileSync(source, target);
|
|
132
|
+
chmodSync(target, 0o755);
|
|
133
|
+
console.log(dim(" scripts/eve-server.sh — restart with proof (serialized, builds if stale)"));
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
console.log(yellow(" ! could not install scripts/eve-server.sh — copy it from node_modules/@kybernesis/exe/scripts/"));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
114
139
|
if (plan.file) {
|
|
115
140
|
console.log(bold(`\n4/6 Channel: ${channel} …`));
|
|
116
141
|
mkdirSync(join(dir, "agent/channels"), { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kybernesis/create",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "The Kybernesis agent scaffolder and FDE toolkit: one command to a governed, remembering, multiplayer, self-testing eve agent — plus doctor and upgrade.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when running evals, certifying an agent or an eve version bump, debugging eval failures, or preparing a release — the Kybernesis QA discipline and its run hygiene.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Certification & eval discipline
|
|
6
|
+
|
|
7
|
+
The rule: **evals gate every deploy, and the consuming agent's suite is the
|
|
8
|
+
release gate for every package change.** Nothing ships on "it looks right" —
|
|
9
|
+
green suite or it doesn't go.
|
|
10
|
+
|
|
11
|
+
## The suite
|
|
12
|
+
|
|
13
|
+
`kybernesisBaseline()` from `@kybernesis/evals` in `evals/kybernesis.eval.ts`:
|
|
14
|
+
smoke (boots, replies, identifies itself), five memory evals (no memory
|
|
15
|
+
thrash on greetings; explicit remember never refused; proactive storage;
|
|
16
|
+
brain-note two-step in order; cross-session unprompted recall), one routing
|
|
17
|
+
eval per department, and with `engineer: true` the vision-loop eval
|
|
18
|
+
(screenshot tool fires and the judge confirms the model SAW the render).
|
|
19
|
+
Judge model is configured in `evals/evals.config.ts` and must NEVER be the
|
|
20
|
+
model under test.
|
|
21
|
+
|
|
22
|
+
## Run hygiene (each rule ate a real run)
|
|
23
|
+
|
|
24
|
+
- `npm run eval` — always through the npm script: it forces every Arcana
|
|
25
|
+
workspace to `<name>-eval` so evals never write into a real brain.
|
|
26
|
+
- **Kill any running dev server first** (`pkill -f "eve dev"`) — eve eval
|
|
27
|
+
attaches to an existing instance and runs stale code.
|
|
28
|
+
- **Never edit the repo mid-run** — the dev runtime watches `agent/`; an
|
|
29
|
+
edit breaks the rebuild and kills remaining evals.
|
|
30
|
+
- Engineer eval: hosted Vercel sandbox (no Docker), needs `vercel link` +
|
|
31
|
+
`vercel env pull` (VERCEL_OIDC_TOKEN). Warm template ≈3–4 min; a
|
|
32
|
+
pre-first-deploy cold bake is budgeted 20 min.
|
|
33
|
+
- Stale sandbox state (migration errors, re-baking templates):
|
|
34
|
+
`rm -rf .eve/sandbox-cache .eve/dev-runtime` and rerun.
|
|
35
|
+
- Don't pipe the eval command through `tail` in scripts — it masks the exit
|
|
36
|
+
code (and `| tail -N` on a backgrounded run destroys the per-eval detail —
|
|
37
|
+
`tee` to a file instead).
|
|
38
|
+
- **Heavy-model suites: `maxConcurrency: 1` locally.** At 2, long opus turns
|
|
39
|
+
overload the local world-queue transport (`Queue delivery failed … fetch
|
|
40
|
+
failed`); crashed deliveries REPLAY subagent steps, surfacing as
|
|
41
|
+
`lost continuationToken` races and phantom failures that move between runs.
|
|
42
|
+
The deployed runtime uses real queue infra — this is a local-harness limit.
|
|
43
|
+
- **AI Gateway budget is a silent eval killer**: Vercel applies a default
|
|
44
|
+
per-project budget (e.g. $10/daily); a suite of real opus turns can exhaust
|
|
45
|
+
it MID-RUN → `MODEL_CALL_FAILED` on whatever ran last. Check/raise:
|
|
46
|
+
`vercel ai-gateway budgets list` / `budgets set project <name> --limit 30
|
|
47
|
+
--refresh-period monthly`.
|
|
48
|
+
- **"run parked on N unanswered input request(s)"** = the agent called a
|
|
49
|
+
human-in-the-loop tool (`approval: status=pending tool=ask_question` in the
|
|
50
|
+
turn log) — no one answers in an eval. Usually a behavior finding: the
|
|
51
|
+
fixture was self-contained and the agent asked instead of acting. Fix the
|
|
52
|
+
agent's bias-to-act instructions, not the fixture.
|
|
53
|
+
|
|
54
|
+
## eve version certification
|
|
55
|
+
|
|
56
|
+
Clients pin the **Kybernesis-certified** eve version (`kyb upgrade` carries
|
|
57
|
+
them there — never blind npm-latest). Certifying a new eve: bump in a branch
|
|
58
|
+
→ typecheck → `npx eve info` → full suite → live smoke on the deployed
|
|
59
|
+
surface → advance the pin in @kybernesis/create → record the certification.
|
|
60
|
+
|
|
61
|
+
## When an eval fails
|
|
62
|
+
|
|
63
|
+
Read the eval's transcript before touching fixtures. Order of suspicion:
|
|
64
|
+
(1) environment (stale dev server, missing env, cold template), (2) a real
|
|
65
|
+
behavior regression — fix the agent, (3) only THEN the fixture — and if a
|
|
66
|
+
fixture changes, the reason becomes a comment on it. A failure that reveals
|
|
67
|
+
a new failure mode becomes a new fixture: that is how the suite grew every
|
|
68
|
+
guard it has.
|
|
69
|
+
|
|
70
|
+
## Release flow (packages)
|
|
71
|
+
|
|
72
|
+
Edit in `~/platform` → build → bump → human publishes (browser auth) →
|
|
73
|
+
consuming agent bumps → **full suite green** → deploy → registry item update
|
|
74
|
+
+ deploy if install files changed. Then propagate the lesson (see the
|
|
75
|
+
`source-of-truth` skill).
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when connecting two deployed eve agents so one can delegate to the other — "connect agent A to agent B", agent-to-agent communication, remote peers, cross-deployment delegation. Wires @kybernesis/dispatch edges end to end.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Connecting two eve agents (@kybernesis/dispatch)
|
|
6
|
+
|
|
7
|
+
An **edge** lets one deployed eve agent call another as if it were a local
|
|
8
|
+
subagent, with the human's identity carried across the hop. One edge covers a
|
|
9
|
+
full question-and-answer round trip (the caller parks until the peer's callback
|
|
10
|
+
returns). Wire the mirror-image edge only if the other agent should also be
|
|
11
|
+
able to *initiate*.
|
|
12
|
+
|
|
13
|
+
## Before wiring — gather the facts
|
|
14
|
+
|
|
15
|
+
1. **Both repos' eve versions must be compatible** (`node_modules/eve/package.json`
|
|
16
|
+
in each). An old receiver silently drops principal forwarding and runs as
|
|
17
|
+
service identity — no error. Upgrade both ends together first if they differ.
|
|
18
|
+
2. **Vercel identities** of both projects: team slug + project name as shown in
|
|
19
|
+
`npx vercel ls <project>` (slugs, not `team_…`/`prj_…` IDs).
|
|
20
|
+
3. **Stable production URL** of the callee: `npx vercel inspect <latest-prod-url>`
|
|
21
|
+
→ Aliases — then **verify the alias is OPEN before wiring it**:
|
|
22
|
+
`curl -s -o /dev/null -w "%{http_code}" <url>/eve/v1/health` must return
|
|
23
|
+
**200**. The `<project>-<team>.vercel.app` aliases commonly sit behind
|
|
24
|
+
Vercel SSO deployment protection (302 → vercel.com/sso-api) and CANNOT
|
|
25
|
+
receive dispatches; the shorter production alias is usually the open one.
|
|
26
|
+
4. Both repos need `@kybernesis/dispatch` installed (`npm i @kybernesis/dispatch`).
|
|
27
|
+
|
|
28
|
+
## Caller side — one file
|
|
29
|
+
|
|
30
|
+
`agent/subagents/<peer-name>.ts` (file name = tool name the model routes to):
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { remotePeer } from "@kybernesis/dispatch";
|
|
34
|
+
|
|
35
|
+
export default remotePeer({
|
|
36
|
+
envVar: "GTM_AGENT_URL",
|
|
37
|
+
description: "…", // see below — this is the whole routing story
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Write the description from the CALLEE's actual capabilities.** Read the peer
|
|
42
|
+
repo's `agent/instructions*`, subagent descriptions, and skills, then write the
|
|
43
|
+
concrete topics people ask about ("posting cadence, open GTM plays, outreach
|
|
44
|
+
targets, content drafting in the house voice") — not a generic blurb. If the
|
|
45
|
+
caller has local subagents with overlapping remits, differentiate explicitly or
|
|
46
|
+
routing will be ambiguous.
|
|
47
|
+
|
|
48
|
+
Set the env var on the caller's Vercel project:
|
|
49
|
+
`printf "<stable-prod-url>" | npx vercel env add GTM_AGENT_URL production`
|
|
50
|
+
|
|
51
|
+
## Receiver side — one file
|
|
52
|
+
|
|
53
|
+
`agent/channels/eve.ts` on the callee:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { dispatchChannel } from "@kybernesis/dispatch";
|
|
57
|
+
|
|
58
|
+
export default dispatchChannel({
|
|
59
|
+
trustedPeers: [{ teamSlug: "<caller-team>", projectName: "<caller-project>" }],
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If the callee already has an authored `agent/channels/eve.ts` with app auth,
|
|
64
|
+
either migrate it to `dispatchChannel({ trustedPeers, extraAuth: […] })` or add
|
|
65
|
+
the peer by hand to BOTH the `vercelOidc({ subjects })` list and the
|
|
66
|
+
`trustedForwarders` predicate — they must never drift apart. Never write
|
|
67
|
+
`trustedForwarders: () => true`.
|
|
68
|
+
|
|
69
|
+
## Verify
|
|
70
|
+
|
|
71
|
+
1. `npx eve info` in both repos: 0 diagnostics; the caller's manifest gains a
|
|
72
|
+
`remoteAgents` entry (it does NOT appear in the local subagent count).
|
|
73
|
+
2. `npm run typecheck` both.
|
|
74
|
+
3. Deploy BOTH (`npx eve deploy` / git push per repo convention). The edge is
|
|
75
|
+
live only when both ends are.
|
|
76
|
+
4. Live test from the caller's real surface (e.g. Slack): ask something only
|
|
77
|
+
the peer knows. Confirm delegation in the caller's reply, then check
|
|
78
|
+
telemetry (PostHog): the peer-side turn should carry the human's
|
|
79
|
+
distinct_id, plus the `eve:forwarded-by` attribute naming the caller.
|
|
80
|
+
|
|
81
|
+
## Failure signatures
|
|
82
|
+
|
|
83
|
+
- **403 on dispatch** → receiver has no authored eve channel, or the caller
|
|
84
|
+
isn't in `trustedPeers`. Check team slug/project name spelling — a typo
|
|
85
|
+
silently rejects everything.
|
|
86
|
+
- **`principal_required` on the peer's user-scoped connections** → forwarding
|
|
87
|
+
isn't arriving: receiver predates forwarding, or the assertion was dropped.
|
|
88
|
+
- **Peer never gets called** → routing description too vague, or it collides
|
|
89
|
+
with a local subagent's remit. Rewrite from the callee's real capabilities.
|
|
90
|
+
- **Works locally, 401 in production** → caller's OIDC not accepted: the
|
|
91
|
+
receiver's `trustedPeers` names the wrong environment (default is
|
|
92
|
+
production-only) or wrong project.
|
|
93
|
+
|
|
94
|
+
## Governed mode (control-plane edges — preferred when the client runs the admin)
|
|
95
|
+
|
|
96
|
+
Instead of hand-enumerated peers, edges are GRANTED in the Kybernesis control
|
|
97
|
+
plane and enforced with 300s A2A tokens. Full lifecycle proven live 2026-08-07
|
|
98
|
+
(grant → dispatch → revoke → refused ≤5 min → re-grant → restored, no deploys).
|
|
99
|
+
|
|
100
|
+
Setup, per agent (admin UI /agents):
|
|
101
|
+
1. Register both agents as eve deployments — URL must be the OPEN production
|
|
102
|
+
alias (health 200; forms sanitize pasted punctuation as of this writing).
|
|
103
|
+
2. Grant the edge on the CALLEE's panel ("Agent-to-agent edges" → allow calls
|
|
104
|
+
from <caller> + purpose; expiry optional — self-destructing edge).
|
|
105
|
+
3. Mint each agent's credential (shown ONCE) → set as Sensitive env
|
|
106
|
+
`KYBERNESIS_AGENT_CREDENTIAL` on that agent's Vercel project.
|
|
107
|
+
|
|
108
|
+
Then in code (dispatch ≥0.2.1 + enterprise ≥0.2.0 both installed):
|
|
109
|
+
- caller: `remotePeer({ callee: "<EXACT registered name>", governed: { issuer },
|
|
110
|
+
envVar, fallbackUrl, description })` — envVar/fallbackUrl kept as overrides;
|
|
111
|
+
registry supplies the URL when the credential is present.
|
|
112
|
+
- receiver: `dispatchChannel({ governed: { issuer, agent: "<own name>" } })`.
|
|
113
|
+
|
|
114
|
+
Gotchas: names are case-sensitive ("Kyber" ≠ "kyber" — copy from the admin);
|
|
115
|
+
credentials are one JWS line ~3 segments, an ES256 signature is 86 base64url
|
|
116
|
+
chars — a truncated paste fails verification silently, so length-check it;
|
|
117
|
+
scheduled/cron turns still forward no human (service identity at the peer);
|
|
118
|
+
the deployed agent's model spend shares the project's AI Gateway budget with
|
|
119
|
+
local eval runs — size the budget for BOTH or production goes model-dead.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when registering an agent with the Kybernesis control plane, granting/revoking user access, wiring kybernesisAuth, running the governance E2E check, or debugging 401/403s from a governed agent.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# The Kybernesis control plane (agent.kybernesis.ai)
|
|
6
|
+
|
|
7
|
+
The control plane governs WHO may talk to which agent. It is an OIDC-style
|
|
8
|
+
issuer (per-org ES256 keys at `/api/jwks`) minting **IdentitySessions**
|
|
9
|
+
`{ issuer, token, bundle, jwks }`; the policy bundle carries
|
|
10
|
+
`agentGrants[{agent, level}]`. Agents verify OFFLINE via
|
|
11
|
+
`kybernesisAuth()` from `@kybernesis/enterprise` — no callback to the plane
|
|
12
|
+
on each request.
|
|
13
|
+
|
|
14
|
+
## Wiring a governed agent
|
|
15
|
+
|
|
16
|
+
Env: `KYBERNESIS_ISSUER=https://agent.kybernesis.ai` and
|
|
17
|
+
`KYBERNESIS_AGENT=<agent-name>` (must equal the name registered in the
|
|
18
|
+
admin). The registry item writes the route-auth file; `kyb doctor` checks
|
|
19
|
+
JWKS reachability. Callers send `authorization: Bearer <token>` +
|
|
20
|
+
`x-kybernesis-bundle: <bundle>`. Expected failures: 401 = no/bad
|
|
21
|
+
credentials; 403 `agent_not_granted` = valid user, no grant for THIS agent.
|
|
22
|
+
|
|
23
|
+
## Admin flow (browser, agent.kybernesis.ai)
|
|
24
|
+
|
|
25
|
+
Register the agent under Agents (runtime: ▲ eve + deployment URL — the row
|
|
26
|
+
shows a health probe). Grant users under their profile (grants resolve at
|
|
27
|
+
MINT time). Users page also links/revokes chat identities (Slack ↔ user).
|
|
28
|
+
Sign-in for humans is RFC 8628 device flow (user code, e.g. ABCD-EFGH).
|
|
29
|
+
|
|
30
|
+
## Timing semantics (the support-ticket section)
|
|
31
|
+
|
|
32
|
+
Token TTL defaults to 1h — that IS the revocation SLA for already-minted
|
|
33
|
+
sessions. Suspension blocks new mints immediately; revocation of a grant
|
|
34
|
+
takes effect at next mint. Tune `IDENTITY_TOKEN_TTL_SECONDS` to the client's
|
|
35
|
+
appetite and tell them the number.
|
|
36
|
+
|
|
37
|
+
## The governance E2E check (run before any client demo)
|
|
38
|
+
|
|
39
|
+
1. Call the governed agent with no credentials → expect 401.
|
|
40
|
+
2. Mint via device flow WITHOUT a grant → call → expect 403 agent_not_granted.
|
|
41
|
+
3. Grant the user in the admin → re-mint → call → expect 200/202.
|
|
42
|
+
4. Revoke the grant → old token still works until TTL; re-mint refused.
|
|
43
|
+
5. Suspend the user → mint refused immediately; restore → mint works.
|
|
44
|
+
|
|
45
|
+
This exact sequence was verified against production 2026-08-05. The demo
|
|
46
|
+
moment for clients is step 3→4 — access appearing and disappearing from the
|
|
47
|
+
admin screen.
|
|
48
|
+
|
|
49
|
+
## It also brokers connectors and the user's own machine
|
|
50
|
+
|
|
51
|
+
Governance was the first job; the plane now also holds the two things an agent
|
|
52
|
+
cannot hold itself.
|
|
53
|
+
|
|
54
|
+
**Connectors** (`/api/connectors`, `link`, `disconnect`, `tools`, `execute`,
|
|
55
|
+
`custom`, `mcp`, `mcp/test`). Each ORG holds its own broker (Composio) API key,
|
|
56
|
+
encrypted at rest with `SECRET_ENCRYPTION_KEY` (AES-256-GCM,
|
|
57
|
+
`v1:<iv>:<tag>:<ct>`), set
|
|
58
|
+
through the admin — never an env var, never our key used for a client. The
|
|
59
|
+
agent asks the plane which services the CURRENT principal has connected;
|
|
60
|
+
`@kybernesis/connectors` turns the answer into tools for that turn only. The
|
|
61
|
+
broker's entity is `<registered-agent-name>:<userId>` — the registered NAME,
|
|
62
|
+
not the agent's UUID.
|
|
63
|
+
|
|
64
|
+
**Local access** (`/api/local-exec/*`). A device enrolls, the user grants it
|
|
65
|
+
once, and that grant is STANDING — no expiry. Requests and responses are relayed
|
|
66
|
+
as frames; the plane never executes anything. See `@kybernesis/local`.
|
|
67
|
+
|
|
68
|
+
**A client must refresh on the earlier of the token and the bundle.** They have
|
|
69
|
+
independent lifetimes: a token with 57 minutes left and a bundle with 12 will
|
|
70
|
+
start returning 401 while every dashboard says the session is fine. This cost a
|
|
71
|
+
full day, presented to the user as "log out and log back in", and the fix is one
|
|
72
|
+
line — `Math.min(tokenExpiry, bundleExpiry)`. On a 401, force a refresh and
|
|
73
|
+
retry ONCE before showing a human anything.
|
|
74
|
+
|
|
75
|
+
## Boundaries to state plainly
|
|
76
|
+
|
|
77
|
+
Control-plane grants govern the HTTP/desktop doors — NOT the Slack door
|
|
78
|
+
(Slack access = workspace membership). Person-scoped approvals and
|
|
79
|
+
`governedSlackChannel()` are specced, not built. HITL approvals are
|
|
80
|
+
session-scoped; any thread member can click them.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when building out an eve agent — adding channels (Slack, iMessage, Telegram, Discord…), connections to client systems, agent skills, model pinning, instructions, or testing in eve dev. The how-to for every eve authoring surface.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Building eve agents
|
|
6
|
+
|
|
7
|
+
**The prime rule: read the pinned docs before writing eve code.** The
|
|
8
|
+
installed framework docs are the source of truth for THIS project's version:
|
|
9
|
+
`node_modules/eve/docs/` (README.md indexes them). Never author a channel,
|
|
10
|
+
connection, sandbox, or schedule from memory — read its doc page first.
|
|
11
|
+
Fallback when docs are absent: https://eve.dev/docs.
|
|
12
|
+
|
|
13
|
+
## The loop
|
|
14
|
+
|
|
15
|
+
`read the doc → write the file → npx eve info (0 diagnostics) → test a turn
|
|
16
|
+
in npx eve dev → eval`. Every authoring task follows it.
|
|
17
|
+
|
|
18
|
+
## Model (agent/agent.ts)
|
|
19
|
+
|
|
20
|
+
`defineAgent({ model })`. No agent.ts → defaults to anthropic/claude-sonnet-5;
|
|
21
|
+
once the file exists, `model` is required. String = Vercel AI Gateway id
|
|
22
|
+
(`anthropic/claude-opus-4.8`, dot version) — the client-deploy default.
|
|
23
|
+
Direct provider: install `@ai-sdk/<provider>`, pass `anthropic("claude-opus-4-8")`
|
|
24
|
+
(hyphen version) + provider key in env. Dynamic per-principal selection via
|
|
25
|
+
`defineDynamic({ fallback, events })` — prefer `session.started` scope (prompt
|
|
26
|
+
caches are per model). Docs: `agent-config.md`.
|
|
27
|
+
|
|
28
|
+
## Channels (agent/channels/, one file per surface)
|
|
29
|
+
|
|
30
|
+
Filename = channel id. eve normalizes every surface into one runtime — tools/
|
|
31
|
+
instructions/memory never change per channel. Available: Slack, Photon
|
|
32
|
+
(iMessage), Telegram, Discord, Teams, Twilio (SMS/voice), GitHub, Linear,
|
|
33
|
+
web (eve HTTP + useEveAgent), custom (`defineChannel`). Install:
|
|
34
|
+
`eve add channel/<name>` (e.g. `channel/photon-imessage`, `channel/telegram`).
|
|
35
|
+
|
|
36
|
+
Setup is always three steps: (1) the channel file, (2) provider-side
|
|
37
|
+
credentials in env — the HUMAN runs anything with a browser login, (3) point
|
|
38
|
+
the provider at the mounted route (`/eve/v1/<channel>`). Each channel's doc
|
|
39
|
+
page (`docs/channels/<name>.mdx`) has the complete recipe including webhook
|
|
40
|
+
registration and HITL behavior. For Kybernesis Slack deploys use
|
|
41
|
+
`@kybernesis/multiplayer` (group semantics) — see the `kybernesis-packages`
|
|
42
|
+
skill.
|
|
43
|
+
|
|
44
|
+
## Connections (agent/connections/)
|
|
45
|
+
|
|
46
|
+
Search before writing: `eve registry list` / `search <term>` / `view <item>`
|
|
47
|
+
/ `add <item>` (setup flows resume via `eve add <item> --skip-install`).
|
|
48
|
+
Hand-author only for client-internal services. Two shapes: MCP server →
|
|
49
|
+
`defineMcpClientConnection`; OpenAPI 3.x doc → `defineOpenAPIConnection`.
|
|
50
|
+
Four auth modes: static token (`auth.getToken` from env — pilot default),
|
|
51
|
+
Vercel Connect user-scoped (`connect("<connector-UID>")` — UID not short
|
|
52
|
+
name; first use posts an OAuth link in-thread, turn parks + resumes), Connect
|
|
53
|
+
app-scoped (`connect({connector, principalType:"app"})` — non-interactive),
|
|
54
|
+
or none. Connector provisioning is CLI-able:
|
|
55
|
+
`vercel connect create <service> --name <n>` + `vercel connect attach <uid> --yes`.
|
|
56
|
+
Subagents have NO user principal — static or app-scoped only. Write the
|
|
57
|
+
connection `description` as a capability naming the systems; decide surface
|
|
58
|
+
gating (fail-closed) and `approval` gates per connection at install time.
|
|
59
|
+
Docs: `docs/connections/*`.
|
|
60
|
+
|
|
61
|
+
## Skills (agent/skills/)
|
|
62
|
+
|
|
63
|
+
On-demand procedures (model calls `load_skill` when the description matches).
|
|
64
|
+
Forms: flat `.md` (first line = routing description) → packaged dir with
|
|
65
|
+
`SKILL.md` (+`references/`, description frontmatter required) → `defineSkill`
|
|
66
|
+
(only for typed/generated content). The description is a ROUTING HINT — write
|
|
67
|
+
it as the triggering task ("Use when…") and test by asking without naming the
|
|
68
|
+
skill. Scoped per agent: subagents need their own copies (or subagent-local
|
|
69
|
+
extension mounts that ship them). Community marketplace: skills.sh — included
|
|
70
|
+
in `eve registry search`; install `eve add @skills/<owner>/<repo>/<name>`;
|
|
71
|
+
ALWAYS review the diff before running. Docs: `docs/skills.mdx`.
|
|
72
|
+
|
|
73
|
+
## Instructions (agent/instructions.md or instructions/)
|
|
74
|
+
|
|
75
|
+
Always-on context: identity, tone, standing rules ONLY — procedures go in
|
|
76
|
+
skills. Directory entries combine alphabetically (root file first); `.ts`
|
|
77
|
+
entries wrap `defineInstructions` (compile-time) or `defineDynamic`
|
|
78
|
+
(per-session, e.g. surface-aware greetings). Draft with Claude from discovery
|
|
79
|
+
notes, then judge by test (eve dev turns + evals), never by reading.
|
|
80
|
+
|
|
81
|
+
## Subagents (agent/subagents/<id>/)
|
|
82
|
+
|
|
83
|
+
Inherit NOTHING. Own tools/skills/connections/instructions/sandbox; on eve
|
|
84
|
+
≥0.30 also OWN extension mounts (`subagents/<id>/extensions/` — mounts only
|
|
85
|
+
into that subagent). No channels/schedules; no user principal; whole job must
|
|
86
|
+
fit one delegation call. Docs: `docs/subagents.mdx`.
|
|
87
|
+
|
|
88
|
+
**Sandbox layout trap:** a FLAT `agent/sandbox.ts` is discovered but scopes to
|
|
89
|
+
the ROOT agent only — subagents silently fall back to the default backend
|
|
90
|
+
chain (Docker → microsandbox → just-bash), which surfaces as
|
|
91
|
+
`opening sandbox session "subagents/<id>" on backend "docker"` in eval logs.
|
|
92
|
+
Use the directory form `agent/sandbox/sandbox.ts` — that one is app-level and
|
|
93
|
+
subagents get it free. (Cost a debugging session on eve-gtm, 2026-08-07.)
|
|
94
|
+
|
|
95
|
+
**Parallel same-subagent delegation collides** (`Session … lost
|
|
96
|
+
continuationToken … to session …`, failed subagent-result actions): two
|
|
97
|
+
delegations to the SAME subagent fired in one step race on child sessions.
|
|
98
|
+
Instruct serial delegation ("one draft at a time, wait for each result").
|
|
99
|
+
|
|
100
|
+
## Test in eve dev
|
|
101
|
+
|
|
102
|
+
`npx eve dev` boots the local runtime + chat TUI. Walk: identity → skill
|
|
103
|
+
routing (watch load_skill) → delegation → memory round-trip → (engineer)
|
|
104
|
+
screenshot turn. Local principal counts as a DM surface. Kill the dev server
|
|
105
|
+
before `npm run eval`. The TUI is NOT the deployed agent — redeploy after
|
|
106
|
+
every change.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when running or planning a Kybernesis FDE client engagement — pilot phases, discovery questions, day-by-day plan, demo script, handover. The operating manual for deploying an eve agent at a client.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Kybernesis FDE engagement
|
|
6
|
+
|
|
7
|
+
Kybernesis forward-deploys engineers into companies to agentify them: we build
|
|
8
|
+
eve-framework agents the client reaches on surfaces they already use (Slack,
|
|
9
|
+
iMessage, Telegram, web…), wired to their systems, governed by our control
|
|
10
|
+
plane (agent.kybernesis.ai), remembering through Arcana, and quality-gated by
|
|
11
|
+
evals. You (Claude) are the FDE's co-builder for all of it.
|
|
12
|
+
|
|
13
|
+
The complete engagement runbook is `references/playbook.md` — READ THE PHASE
|
|
14
|
+
YOU ARE IN before acting. Map of the playbook:
|
|
15
|
+
|
|
16
|
+
- **Fast path**: `npm create @kybernesis <name> -- [--engineer]` scaffolds the
|
|
17
|
+
entire baseline (governance + memory + multiplayer Slack + evals, optional
|
|
18
|
+
engineer layer). `kyb doctor` checks wiring at any point.
|
|
19
|
+
- **Phase 1–2**: pre-engagement checklist; the discovery conversation (agent
|
|
20
|
+
name, departments, SURFACES — never assume Slack, §2.3 — cohort, data
|
|
21
|
+
sensitivities). Leave discovery with the §2.6 table filled in.
|
|
22
|
+
- **Phase 3**: environment setup — scaffold, `vercel link`, registry, version
|
|
23
|
+
pins (eve pinned to the Kybernesis-CERTIFIED version, never blind latest).
|
|
24
|
+
- **Phase 4**: the build — model pinning (§4.0b), our packages (§4.1–4.3b),
|
|
25
|
+
channels/connections/skills for the client's stack (§4.3c–e), instructions
|
|
26
|
+
(§4.4), `eve dev` test-drive (§4.4b), subagents (§4.5), evals (§4.8).
|
|
27
|
+
- **Phase 5–6**: deploy + control-plane registration and grants.
|
|
28
|
+
- **Phase 7–9**: pilot onboarding, the acceptance demo script, handover.
|
|
29
|
+
- **§10**: troubleshooting appendix — check it before debugging from scratch.
|
|
30
|
+
- **§11**: known gaps — state them plainly to the client, never sell around.
|
|
31
|
+
|
|
32
|
+
Non-negotiables that survive every engagement: production promotion is
|
|
33
|
+
human-approved; evals gate every deploy; secrets live in env (Vercel
|
|
34
|
+
Sensitive), never in code or memory; every live failure becomes a playbook or
|
|
35
|
+
skill edit the same day (see the `source-of-truth` skill).
|