openbriefing 0.5.0 → 1.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/README.md +3 -3
- package/dist/cli.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This package is the reference parser and checker for the [Open Briefing Standard (OBS)](https://openbriefingstandard.org). OBS is how a publisher says how their content should be summarized and presented when software consumes it.
|
|
4
4
|
|
|
5
|
-
**Version
|
|
5
|
+
**Version 1.** It contains the parser, `openbriefing check` and the publisher's tag tools, and reads spec version 1. One tag, `obs:summary`, is enough: `obs:modified` is optional, and the parser reports where a modified time came from. `check` reads a page, a feed or a whole sitemap from the web.
|
|
6
6
|
|
|
7
7
|
## Check a page, a feed or a site
|
|
8
8
|
|
|
@@ -66,13 +66,13 @@ To have the tags written when a post is published, run the hook where Ghost can
|
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
export GHOST_WEBHOOK_SECRET=… # any long random text
|
|
69
|
-
export ANTHROPIC_API_KEY=…
|
|
69
|
+
export ANTHROPIC_API_KEY=… # your own Anthropic key; one call per post, billed to you
|
|
70
70
|
export OBS_HOOK_URL=https://your-hook.example # registers the two webhooks on start
|
|
71
71
|
npx openbriefing ghost hook # POST /ghost, GET /healthz, on PORT or 8080
|
|
72
72
|
npx openbriefing ghost draft --dry-run # the same for posts already published
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
The hook drafts with Claude (`OBS_MODEL` picks the model)
|
|
75
|
+
The hook drafts with Claude on your own key (`OBS_MODEL` picks the model) and will not start without one. It keeps only highlights it finds in the post, and stamps its block `<!-- obs:auto … -->`. Edit the tags in the post's Code injection and they are yours: the hook never writes to that post again. It leaves members-only posts and posts under 200 words alone. These tags are published before you read them; use `pull` and `push` if you would rather approve each one.
|
|
76
76
|
|
|
77
77
|
## Use the parser
|
|
78
78
|
|
package/dist/cli.js
CHANGED
|
@@ -417,6 +417,11 @@ async function ghost(args) {
|
|
|
417
417
|
const { Ghost, pull, push } = await import("./ghost.js");
|
|
418
418
|
const client = new Ghost({ url, key });
|
|
419
419
|
if (action === "draft" || action === "hook") {
|
|
420
|
+
// The publisher brings the key: every draft is one call to Claude, billed to their own account.
|
|
421
|
+
if (!process.env.ANTHROPIC_API_KEY && !(action === "draft" && args.dryRun)) {
|
|
422
|
+
console.error("Set ANTHROPIC_API_KEY to your own Anthropic API key (console.anthropic.com). Each post is one call to Claude, billed to that key.");
|
|
423
|
+
return 2;
|
|
424
|
+
}
|
|
420
425
|
const { claudeDrafter, draftAll, hookServer, registerWebhooks } = await import("./hook.js");
|
|
421
426
|
const model = process.env.OBS_MODEL;
|
|
422
427
|
const drafter = claudeDrafter(model ? { model } : {});
|
package/package.json
CHANGED