draftie 0.1.1 → 0.1.3
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 +4 -3
- package/dist/state.js +1 -1
- package/package.json +1 -1
- package/skills/draftie/SKILL.md +15 -52
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npx draftie upload plan.html
|
|
|
18
18
|
- `upload` prints the page's link, `URL:`, and the link that returns the exact bytes,
|
|
19
19
|
`Raw HTML:`.
|
|
20
20
|
|
|
21
|
-
The commands talk to `https://draftie.
|
|
21
|
+
The commands talk to `https://draftie.tourik.dev`. For another server, log in with its
|
|
22
22
|
address once: `npx draftie auth login --url https://draftie.example.com`. That server is then
|
|
23
23
|
the default.
|
|
24
24
|
|
|
@@ -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
|
|
70
|
-
|
|
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/dist/state.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
export const DEFAULT_URL = "https://draftie.
|
|
4
|
+
export const DEFAULT_URL = "https://draftie.tourik.dev";
|
|
5
5
|
const DIR = path.join(os.homedir(), ".draftie");
|
|
6
6
|
const CONFIG_PATH = path.join(DIR, "config.json");
|
|
7
7
|
const DRAFTS_PATH = path.join(DIR, "drafts.json");
|
package/package.json
CHANGED
package/skills/draftie/SKILL.md
CHANGED
|
@@ -1,79 +1,42 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: draftie
|
|
3
|
-
description:
|
|
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
|
-
|
|
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
|
|
11
|
+
npx draftie upload <file>
|
|
18
12
|
```
|
|
19
13
|
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
22
|
+
If it fails with "this HTML holds …", tell the user what the message names. Do not change the file.
|
|
43
23
|
|
|
44
|
-
##
|
|
24
|
+
## Read a page from a link
|
|
45
25
|
|
|
46
26
|
```sh
|
|
47
|
-
npx draftie
|
|
27
|
+
npx draftie get '<link>'
|
|
48
28
|
```
|
|
49
29
|
|
|
50
|
-
|
|
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
|
|
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`
|
|
79
|
-
user asks.
|
|
42
|
+
Run `delete` only when the user asks. It erases every version.
|