draftie 0.1.2 → 0.1.4

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 CHANGED
@@ -66,8 +66,9 @@ dirty, and in GitHub Actions the run's link and actor. The dashboard shows them
66
66
 
67
67
  ## For agents
68
68
 
69
- `skills/draftie/SKILL.md` in this package tells an agent how to write the HTML, upload it and
70
- read a page back. For Claude Code, copy the folder `skills/draftie` to `~/.claude/skills/`.
69
+ `skills/draftie/SKILL.md` in this package tells an agent how to upload an HTML file, read a page
70
+ back, and change or delete a page. For Claude Code, copy the folder `skills/draftie` to
71
+ `~/.claude/skills/`.
71
72
 
72
73
  ## License
73
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftie",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Upload one HTML file, get a stable link. For the plans, reports and mockups that agents write.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,79 +1,42 @@
1
1
  ---
2
2
  name: draftie
3
- description: Publish one HTML file with draftie and return its link, or read a page from a draftie link. Use when the user asks to publish, share or upload a plan, report, analysis, write-up or mockup as HTML, or gives a link whose path starts with /api/d/.
3
+ description: Use when the user asks to upload, publish, or share an HTML file through draftie, or gives a draftie link (path starts with /api/d/).
4
4
  ---
5
5
 
6
6
  # draftie
7
7
 
8
- draftie hosts single HTML files. `draftie upload` returns a stable link. Uploading the same file
9
- again adds a version at the same link.
10
-
11
- ## Read a page from a link
12
-
13
- Run the CLI. Do not use a browser or web search: a page that is not public needs the API key,
14
- which only the CLI sends.
8
+ ## Upload
15
9
 
16
10
  ```sh
17
- npx draftie get '<link>' > /tmp/draftie-page.html
11
+ npx draftie upload <file>
18
12
  ```
19
13
 
20
- - The link may end in `/raw` or not. `<link>/v/3` is version 3.
21
- - If the command fails, report its message. Do not replace the page with a guess.
22
-
23
- ## Write the HTML
24
-
25
- Write one complete, static HTML file that needs nothing but itself. No JavaScript runs in a
26
- draftie page, and `draftie upload` refuses a file that holds any.
27
-
28
- Works:
29
-
30
- - Inline CSS in a `<style>` block or in `style` attributes.
31
- - Images, video and audio from `https:` addresses or `data:` URLs.
32
- - Links to other pages. A link with `target="_blank"` opens a new tab.
33
- - `<details>` and CSS such as `:target` and `:checked`, for parts that open, close or switch.
34
- - A `<title>`. It becomes the page's name.
14
+ Give the user the `URL:` line it prints. Uploading the same file again adds a version at the same link.
35
15
 
36
- Does not work:
16
+ - `--visibility public` lets anyone with the link open the page. The default, `private`, is only the user. Use `public` only when the user wants someone else to open it.
17
+ - `--expires 7d` deletes the page after that time: `30m`, `12h`, `2w`, or `never`.
18
+ - `--new` uploads the file as a new page instead of a new version.
37
19
 
38
- - JavaScript: `<script>`, inline handlers such as `onclick`, and `javascript:` links.
39
- - `<link rel="stylesheet">`, web fonts from an address, and CSS `@import`. Put the CSS inline.
40
- - Forms, `<iframe>`, `<object>`, `<embed>`, and `<meta http-equiv="refresh">`.
20
+ If it fails with "an upload needs an API key", tell the user to run `npx draftie auth login`. Only they can sign in.
41
21
 
42
- Never put secrets, tokens or passwords in the file. The file must be UTF-8 and at most 2 MB.
22
+ If it fails with "this HTML holds …", tell the user what the message names. Do not change the file.
43
23
 
44
- ## Upload
24
+ ## Read a page from a link
45
25
 
46
26
  ```sh
47
- npx draftie upload <file>
27
+ npx draftie get '<link>'
48
28
  ```
49
29
 
50
- It prints `URL:`, the link for people, and `Raw HTML:`, the link for agents. Give the user the
51
- `URL:` line.
52
-
53
- - `--visibility private|public` sets who sees the page. `private`, the default, is only the
54
- user, signed in. `public` is anyone with the link, without signing in. Use `public` only when
55
- the user wants someone else to open the link.
56
- - `--expires 7d` deletes the page after that time: `30m`, `12h`, `7d`, `2w`, or `never`.
57
- - `--description "<text>"` sets a short description for the page list.
58
- - The CLI remembers which file went to which page. `--new` uploads the file as a new page.
59
- `--page <id>` adds a version to another page.
60
- - "Unchanged" means the file's bytes equal the latest version, so no version was added.
61
-
62
- If the upload fails with "an upload needs an API key", tell the user to run
63
- `npx draftie auth login`. Only they can sign in.
64
-
65
- If it fails with "this HTML holds …", remove what the message names and upload again.
30
+ Use this, not a browser or web fetch. A private page needs the API key, and only the CLI sends it.
66
31
 
67
32
  ## Change or delete a page
68
33
 
69
- `<page>` is the file that was uploaded, the page's link, or its id.
34
+ `<page>` is the uploaded file, the page's link, or its id.
70
35
 
71
36
  ```sh
72
37
  npx draftie set <page> --visibility public
73
- npx draftie set <page> --expires never
74
- npx draftie delete <page> --yes
75
38
  npx draftie list
39
+ npx draftie delete <page> --yes
76
40
  ```
77
41
 
78
- `delete` erases the page and every version, and nothing can bring it back. Run it only when the
79
- user asks.
42
+ Run `delete` only when the user asks. It erases every version.