cyber-agentkit 1.1.0 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyber-agentkit",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "An agent-harness-agnostic toolkit: the fundamental features agent tools need, working the same on every harness. Detect the running harness, check plugin dependencies, resolve layered reference documents, and lease git worktrees.",
5
5
  "keywords": [
6
6
  "agent-harness",
@@ -53,7 +53,8 @@
53
53
  "plugin.json",
54
54
  ".claude-plugin",
55
55
  ".cursor-plugin",
56
- ".codex-plugin"
56
+ ".codex-plugin",
57
+ "CHANGELOG.md"
57
58
  ],
58
59
  "peerDependencies": {
59
60
  "clibuilder": "^12.0.0"
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "cyber-agentkit",
4
- "version": "1.1.0",
4
+ "version": "2.0.0",
5
5
  "description": "An agent-harness-agnostic toolkit: the fundamental features agent tools need, working the same on every harness. Detect the running harness, check plugin dependencies, resolve layered reference documents, and lease git worktrees.",
6
6
  "author": {
7
7
  "name": "unional"
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "scripts": {
23
23
  "skills/reference/scripts/reference.mjs": "src/references/reference.skill-script.ts",
24
- "skills/asset/scripts/asset.mjs": "src/assets/asset.skill-script.ts"
24
+ "skills/asset/scripts/asset.mjs": "src/assets/asset.skill-script.ts",
25
+ "skills/prose-update/scripts/prose-update.mjs": "src/prose-update/prose-update.skill-script.ts"
25
26
  }
26
27
  }
27
28
  }
package/readme.md CHANGED
@@ -260,7 +260,7 @@ a run stopped by a turn or budget cap is told apart by the `result` message's `s
260
260
  A reference is a named Markdown document an agent reads on demand, such as a checklist or a set of
261
261
  weights a skill applies. A plugin ships a contribution, a skill ships its default at
262
262
  `<skill>/references/<name>.default.md`, and anyone can add their own without editing the plugin: a
263
- project in `.agents/references/<name>.md`, a person in `~/.agents/references/<name>.md`.
263
+ repository in `.agents/references/<name>.md`, a person in `~/.agents/references/<name>.md`.
264
264
 
265
265
  ```ts
266
266
  import { loadReference } from 'cyber-agentkit'
@@ -277,24 +277,26 @@ if (resolved.status === 'found') console.log(resolved.content)
277
277
 
278
278
  `status` is `found`, `missing`, `ambiguous` (nothing orders the plugins holding the name; pick one
279
279
  of `resolved.options`, such as `my-plugin/agent-readiness-weights`, or settle it with
280
- `reference select`), or `invalid` (not a reference name). A name not found also has a `code`, such
281
- as `reference-missing`. A library function never throws for a bad name. `warnings` holds each fault
280
+ `reference customize --extends`), or `invalid` (not a reference name). A name not found also has a
281
+ `code`, such as `reference-missing`. `loadReference` never throws for a bad name. `warnings` holds each fault
282
282
  as `{ code, message }`, and `trace` says how the document was built.
283
283
 
284
284
  The tiers, highest first:
285
285
 
286
286
  | Tier | Folders |
287
287
  | --- | --- |
288
- | managed | a `references/` beside each detected harness's managed-policy files |
289
- | project | `.agents/references/` in the root and each folder above it, up to the repository root |
288
+ | managed | a `references/` beside the managed-policy files of the harness, read only when detection names exactly one harness |
289
+ | repo | `.agents/references/` at the repository root |
290
290
  | user | `~/.agents/references/` |
291
- | plugin | the calling plugin's `references/`, each plugin the harness has enabled, then each declared dependency that has a plugin manifest, named by that manifest |
291
+ | plugin | the calling plugin's `references/`, each plugin the harness has enabled, then each dependency in the root's `package.json` that has a plugin manifest, named by that manifest |
292
292
  | default | `<skill folder>/references/<name>.default.md` of the skill loading the name |
293
293
 
294
- In each folder, only `<name>.md` and `<name>/README.md` answer a name, in that order.
294
+ The repository root is the nearest folder at or above the working folder that holds `.git` (a folder
295
+ or a file, so a git worktree counts), else the working folder. In each folder, only `<name>.md` and
296
+ `<name>/README.md` answer a name, in that order.
295
297
 
296
298
  Contributions apply bottom first: the plugins and the default, in the order `extends` gives them,
297
- then user, project, and managed. Each applies over what is below it with its frontmatter `merge`:
299
+ then user, repo, and managed. Each applies over what is below it with its frontmatter `merge`:
298
300
 
299
301
  - `patch` (the default): its sections replace the text they match by heading path, and the rest is
300
302
  kept.
@@ -305,11 +307,28 @@ then user, project, and managed. Each applies over what is below it with its fro
305
307
 
306
308
  A `<!-- merge: <operation> -->` marker under a heading applies an operation to that section alone.
307
309
  Frontmatter `extends` lists what a contribution builds on, bottom first: plugins by their manifest
308
- name, and `default`. The highest `extends` written in the managed, project, or user tier builds the
310
+ name, and `default`. The highest `extends` written in the managed, repo, or user tier builds the
309
311
  stack; without one, the plugins' own `extends` order them. `resolved.metadata` holds the composed
310
312
  frontmatter, the higher contribution winning each key, without `merge` and `extends`. Frontmatter
311
313
  that is not a YAML mapping is ignored with a warning.
312
314
 
315
+ A `.agents/references/<name>.md` in a folder below the root, one that git does not ignore, is a
316
+ project section for that folder. It is not a tier. `load` delivers each one after the main document,
317
+ in path order, as `<project folder="...">...</project>` in text and as `projectSections` records in
318
+ structured output. The managed contribution applies over each section.
319
+
320
+ A plugin listed in the `package.json` of a folder below the root, and not already in the plugin tier,
321
+ adds a project section for that folder instead of a plugin layer: its own document for the name,
322
+ delivered ahead of the folder's own section and marked `plugin="..."` in text. So one package of a
323
+ monorepo can use a different plugin's version of a name, and the rest of the repository is unaffected.
324
+
325
+ A document written by `customize` from a request records its `sources` and `request`. `load` warns
326
+ `reference-stale` when a source plugin's version has changed since. A plugin or skill default can
327
+ list older names in `aliases`; a load of an older name resolves the new one with a
328
+ `reference-renamed` warning. An `extends` step's `sections` limits it to those top-level sections.
329
+ A reference that is not Markdown reads its description, tags, aliases, and picks from
330
+ `<name>.meta.md` beside it.
331
+
313
332
  | Function | Does |
314
333
  | --- | --- |
315
334
  | `loadReference(name, options)` | Resolves one name for a root, with every tier read |
@@ -318,49 +337,63 @@ that is not a YAML mapping is ignored with a warning.
318
337
  | `listReferences(layers)`, `referenceNames(layers)` | Every name the layers hold, one row each, and a row per layer holding it |
319
338
  | `listReferences(layers, { pattern })` | Every reference by exact name pattern |
320
339
  | `searchReferences(query, layers)` | Names matching a query by name, description, heading, or body |
321
- | `whereReference(name, layers, options)` | The project and user files a customization is written to, and the heading paths below each |
322
- | `projectReferencesDir()`, `userReferencesDir()`, `defaultLayer()` | Single folders and layers |
340
+ | `whereReference(name, layers, options)` | The files a customization is written to, what hides each, and the heading paths below |
341
+ | `createReference(options)`, `deleteReference(options)` | Start or delete a contribution; a plugin or skill source folder is `pluginFolder` or `default`, and `plugin` stays the host plugin |
342
+ | `customizeReference(options)` | Write the picks or a generated body for a name, as `reference customize` does; runs no model |
343
+ | `ReferenceError`, `referenceCodes` | The error a library function throws when it cannot complete, carrying a stable `code`, and the table of codes |
344
+ | `repoReferencesDir()`, `userReferencesDir()`, `defaultLayer()` | Single folders and layers |
323
345
  | `declaredDependencies()`, `packageDir()`, `pluginManifestName()` | A manifest's declared packages, where each is installed, and a plugin's manifest name |
324
346
  | `harnessSkillFolders()`, `pluginSkillFolders()`, `skillsIn()` | The skill folders a harness reads, and the skills in them, known by their `SKILL.md` name |
325
347
  | `referenceImplementations(id, layers)` | The implementations of an interface a consumer can load, and those left out with why |
326
- | `checkReferences(layers, options)` | Checks interface documents and their implementations, each as `show` composes it |
348
+ | `checkReferences(layers, options)` | Checks interface documents and their implementations, each as `load` composes it |
327
349
 
328
350
  ### The reference command
329
351
 
330
- The package ships a `reference` command with `show`, `list`, `search`, `where`, `implementations`,
331
- `check`, `create`, `select`, and `delete` subcommands:
352
+ The package ships a `reference` command with `load`, `list`, `search`, `where`, `implementations`,
353
+ `check`, `create`, `customize`, and `delete` subcommands:
332
354
 
333
355
  ```sh
334
- npx -y cyber-agentkit reference show <name>... --root <repository root> --default <skill folder>
356
+ npx -y cyber-agentkit reference load <name>... --root <repository root> --default <skill folder>
335
357
  npx -y cyber-agentkit reference list
336
358
  npx -y cyber-agentkit reference list 'project-tracker.capabilities.*'
337
359
  npx -y cyber-agentkit reference implementations <interface id> --accept 1,2
338
360
  npx -y cyber-agentkit reference check
339
361
  npx -y cyber-agentkit reference create <name> --merge combine
340
- npx -y cyber-agentkit reference select <name> <plugin> --scope user
341
- npx -y cyber-agentkit reference delete <name> --scope project --dry-run
362
+ npx -y cyber-agentkit reference customize <name> --extends <plugin> --scope user
363
+ npx -y cyber-agentkit reference delete <name> --scope repo --dry-run
342
364
  ```
343
365
 
344
366
  `implementations` lists what a consumer can load for an interface (a `<id>.interface` document) with
345
367
  each one's pin, description, and unsupported sections. `check` verifies interface documents and
346
- their implementations, and exits 1 on any failure.
368
+ their implementations, and exits 0; failures are entries in the result's `failed` list.
347
369
 
348
- `create`, `select`, and `delete` act on `.agents/references/` (the project, the default) or
349
- `~/.agents/references/` (`--scope user`). `create` and `delete` also take `--plugin <plugin folder>`
350
- or `--default <skill folder>` for a plugin's or a skill's source in the repository. `delete` reports
370
+ `create`, `customize`, and `delete` act on `.agents/references/` at the root (`--scope repo`, the
371
+ default) or `~/.agents/references/` (`--scope user`), or on a folder's project section with
372
+ `--in <folder>`. `create` and `delete` also take `--plugin <plugin folder>` or
373
+ `--default <skill folder>` for a plugin's or a skill's source in the repository. `delete` reports
351
374
  what answers the name afterwards, and never deletes a managed contribution or an installed copy.
352
- `select` writes the `extends` that picks what a name builds on, and `--clear` removes it.
375
+
376
+ `customize` runs no model. `--extends <step>...` writes the picks of what a name builds on, a step
377
+ being a plugin, `<plugin>:<merge>`, or `default`, and `--extends none` removes them. `--request <file>
378
+ --body <file>` writes a body a generator wrote, with the picks, sources, and request recorded;
379
+ `--implements <interface>` makes it a whole implementation; `--base` prints the input the generator
380
+ reads and writes nothing.
353
381
 
354
382
  Output is [TOON](https://github.com/toon-format/toon) by default, for an agent to parse; pass
355
- `--format json` or `--format text` (`show`, `create`, `select`, and `delete` default to `text`).
356
- Each command prints only the fields that answer it; on `show`, `--metadata` adds the status and the
383
+ `--format json` or `--format text` (`load`, `create`, `customize`, and `delete` default to `text`).
384
+ Each command prints only the fields that answer it; on `load`, `--metadata` adds the status and the
357
385
  composed frontmatter, and `--trace` adds how the document was built. Every warning carries a stable
358
- `code`. The formats
386
+ `code`. A command that answered exits 0, including `load` for a name not found and `list`,
387
+ `search`, or `implementations` with nothing to show (an `empty:` message with `help` lines). A
388
+ command that could not complete exits 1, and a usage error exits 2; both print exactly one error
389
+ value on stdout, with `error`, `code`, any detail fields, and `help`, and write nothing to stderr.
390
+ In `text` a warning prints on stderr as `warning: <code>: <message>`; in `json` and `toon` it is in
391
+ the record's `warnings` list. A warning never changes the exit code. The formats
359
392
  follow [`clibuilder`](https://www.npmjs.com/package/clibuilder) 12, and any other value is a
360
393
  usage error (exit code 2). A CLI built on clibuilder 12
361
394
  can host the same command under its own plugin name, imported from the `./commands` subpath. `--format`
362
395
  is the host's global option, so the host's `cli({ format })` sets the default for every subcommand;
363
- the `text` default of `show`, `create`, `select`, and `delete` belongs to the `cyber-agentkit` CLI:
396
+ the `text` default of `load`, `create`, `customize`, and `delete` belongs to the `cyber-agentkit` CLI:
364
397
 
365
398
  ```ts
366
399
  import { createReferenceCommand } from 'cyber-agentkit/commands'