@pidgeon-ai/cli 1.44.0 → 2.1.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/CHANGELOG.md +24 -0
- package/LICENSE +55 -21
- package/README.md +31 -90
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +12 -0
- package/dist/cli.d.ts +11 -2
- package/dist/cli.js +615 -24
- package/package.json +22 -45
- package/dist/chunk-FZA3INVW.js +0 -5172
- package/dist/chunk-FZA3INVW.js.map +0 -1
- package/dist/chunk-M4R74E7X.js +0 -3339
- package/dist/chunk-M4R74E7X.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands.gen.d.ts +0 -24
- package/dist/commands.gen.js +0 -8
- package/dist/commands.gen.js.map +0 -1
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
- Email: `pidgeon mail list|read|wait`, `pidgeon search`, `pidgeon threads
|
|
6
|
+
list|show|file|hand-over`, `pidgeon app-passwords`, and `--domain` on
|
|
7
|
+
`inboxes create`.
|
|
8
|
+
- Bouncer: `pidgeon verify` and `pidgeon reports create`.
|
|
9
|
+
- Auth: `pidgeon sites` and `pidgeon mandates`.
|
|
10
|
+
- `pidgeon webhooks list|create|remove`.
|
|
11
|
+
|
|
12
|
+
## 2.0.0
|
|
13
|
+
|
|
14
|
+
The command line for the new Pidgeon. A new major version: 1.x spoke the old
|
|
15
|
+
email API at `/api/v1`, which is retired seven days after the switch.
|
|
16
|
+
|
|
17
|
+
- `pidgeon login`: sign in with the browser through Pidgeon's OAuth server,
|
|
18
|
+
choosing what this machine may do; the session is refreshed from then on.
|
|
19
|
+
`PIDGEON_API_KEY` still wins over it.
|
|
20
|
+
- `pidgeon agents create`: register an agent, make its key on this machine,
|
|
21
|
+
publish it signed with itself, keep it in a file only you can read.
|
|
22
|
+
`agents list`, `agents show` (keys and reputation), `keys create`, `keys list`.
|
|
23
|
+
- Email: `inboxes`, `send`, `drafts` (create, show, send, approval, remove).
|
|
24
|
+
- `events`, and `pidgeon api <method> <path>` for any `/v1` call. `--json` everywhere.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
16
|
+
|
|
17
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
18
|
+
|
|
19
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
22
|
+
|
|
23
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
24
|
+
|
|
25
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
26
|
+
|
|
27
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
28
|
+
|
|
29
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
30
|
+
|
|
31
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
32
|
+
|
|
33
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
+
|
|
35
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
36
|
+
|
|
37
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
38
|
+
|
|
39
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
40
|
+
|
|
41
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
42
|
+
|
|
43
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -1,104 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pidgeon-ai/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
just like a human. This is every endpoint as a command, so an agent with a
|
|
6
|
-
shell, or you, can create an address, send, receive and reply.
|
|
3
|
+
`pidgeon`, Pidgeon from a terminal: sign in, set agents up with keys made on
|
|
4
|
+
your machine, and send from their inboxes. https://pidgeon.ai
|
|
7
5
|
|
|
8
6
|
```sh
|
|
9
7
|
npm install -g @pidgeon-ai/cli
|
|
8
|
+
pidgeon login
|
|
9
|
+
pidgeon agents create "Booking agent" --purpose "Books tables."
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[pidgeon.ai/app/developers/keys](https://pidgeon.ai/signup?utm_source=npm&utm_medium=readme&utm_campaign=cli&next=/app/developers/keys), or
|
|
18
|
-
let your agent sign itself up: [pidgeon.ai/skill.md](https://pidgeon.ai/skill.md)
|
|
19
|
-
is two calls, and the only thing it needs from a person is a six-digit code.
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
export PIDGEON_API_KEY=pgn_live_…
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Create an address, send, receive, reply
|
|
12
|
+
`agents create` registers the agent, makes its Ed25519 key on this machine,
|
|
13
|
+
publishes the public half in a request signed with the key, and keeps the
|
|
14
|
+
private half in `~/.config/pidgeon/agents/<id>.json`, readable by you only.
|
|
15
|
+
Your agent signs with it: `agentFromKeyFile(path)` from `@pidgeon-ai/sdk/node`,
|
|
16
|
+
or `PIDGEON_AGENT_KEY` (the file's `private_jwk`) and `PIDGEON_DIRECTORY`.
|
|
26
17
|
|
|
27
18
|
```sh
|
|
28
|
-
pidgeon
|
|
29
|
-
pidgeon
|
|
30
|
-
|
|
31
|
-
pidgeon
|
|
32
|
-
pidgeon
|
|
19
|
+
pidgeon agents show <agent-id> # its keys, and how websites see it
|
|
20
|
+
pidgeon inboxes create bookings --agent <agent-id>
|
|
21
|
+
pidgeon send <inbox-id> --to ana@example.com --subject "Table for two" --text "Friday at 8?"
|
|
22
|
+
pidgeon drafts create <inbox-id> --to ana@example.com --subject "…" --text "…"
|
|
23
|
+
pidgeon drafts approval <draft-id> # a person sends or rejects it
|
|
24
|
+
pidgeon mail wait <inbox-id> # until mail arrives
|
|
25
|
+
pidgeon mail read <message-id> # as the Firewall cleaned it
|
|
26
|
+
pidgeon threads hand-over <thread-id> # to a person
|
|
27
|
+
pidgeon app-passwords create <inbox-id> "Apple Mail"
|
|
28
|
+
pidgeon sites create Shop --redirect https://shop.example/callback
|
|
29
|
+
pidgeon reports create <verification-id> --category spam --evidence "…"
|
|
30
|
+
pidgeon events
|
|
31
|
+
pidgeon api GET /v1/email/rules # any /v1 call
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
one request open until mail arrives, and prints it with `extracted.codes` and
|
|
37
|
-
`extracted.links` already pulled out.
|
|
38
|
-
|
|
39
|
-
`pidgeon --help` lists every group; `pidgeon <group> <command> --help`
|
|
40
|
-
describes one command, with its endpoint and its flags. Documentation:
|
|
41
|
-
[pidgeon.ai/docs/cli](https://pidgeon.ai/docs/cli).
|
|
42
|
-
|
|
43
|
-
## Check who sent something
|
|
44
|
-
|
|
45
|
-
`pidgeon id` needs no key. It checks a message, or signs a request as one of
|
|
46
|
-
your agents:
|
|
47
|
-
|
|
48
|
-
```sh
|
|
49
|
-
pidgeon id verify message.eml
|
|
50
|
-
pidgeon id curl -I https://shop.example --as sunny
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
`verify` asks the public verifier and says whether the signature holds, which
|
|
54
|
-
agent sent it, who it acts for and whether the body changed. `curl` signs the
|
|
55
|
-
request the way Web Bot Auth asks and prints what it sent. `pidgeon id --help`
|
|
56
|
-
lists the rest, including `init` for your own domain.
|
|
57
|
-
|
|
58
|
-
## Flags
|
|
59
|
-
|
|
60
|
-
- Repeat a list flag: `--to one@example.com --to two@example.com`.
|
|
61
|
-
- `--flag value` and `--flag=value` both work, and a subject may contain
|
|
62
|
-
an `=`.
|
|
63
|
-
- A nested object takes JSON: `--some_field '{"a":1}'`.
|
|
64
|
-
- `PIDGEON_BASE_URL` points it somewhere other than production.
|
|
65
|
-
|
|
66
|
-
## Retrying a send
|
|
67
|
-
|
|
68
|
-
Every command that sends takes `--idempotency-key`. Run it again with the
|
|
69
|
-
same key and the message goes out once; the second run prints the first
|
|
70
|
-
answer. Without one, each run makes up its own key. `--verbose` prints it
|
|
71
|
-
on stderr before the call, and a failure that may already have sent (no
|
|
72
|
-
answer, or a 5xx) prints it in the error, so a script can retry with it.
|
|
73
|
-
|
|
74
|
-
## When it fails
|
|
75
|
-
|
|
76
|
-
A refusal from the API exits 1 and prints the status, the API's code and
|
|
77
|
-
its sentence, as in `403 abuse_blocked: That message has already gone to a
|
|
78
|
-
lot of people today…`. Branch on the code. A mistake in the command itself,
|
|
79
|
-
such as a missing flag, exits 2. Before 1.8.4 a refusal also exited 2 and
|
|
80
|
-
printed only the sentence.
|
|
81
|
-
|
|
82
|
-
## It is generated
|
|
83
|
-
|
|
84
|
-
One command per operation in [the published
|
|
85
|
-
contract](https://pidgeon.ai/openapi.json), which is generated from the
|
|
86
|
-
schemas the API validates with. The group is the operation's tag, the
|
|
87
|
-
command is the rest of its `operationId`, and the flags are its parameters
|
|
88
|
-
and the top level of its request body.
|
|
34
|
+
`pidgeon --help` lists every command; `--json` prints the API's own answer.
|
|
89
35
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
36
|
+
Signing in opens the browser once; the session is kept in
|
|
37
|
+
`~/.config/pidgeon/credentials.json` and refreshed. On a machine with no
|
|
38
|
+
browser, set `PIDGEON_API_KEY` instead. `PIDGEON_CONFIG_DIR` and
|
|
39
|
+
`PIDGEON_BASE_URL` move the files and the server.
|
|
94
40
|
|
|
95
|
-
|
|
41
|
+
Version 2 is for the new Pidgeon; 1.x spoke the old API at `/api/v1`.
|
|
96
42
|
|
|
97
|
-
|
|
98
|
-
[pidgeon-ai/pidgeon-js](https://github.com/pidgeon-ai/pidgeon-js), which is
|
|
99
|
-
copied from Pidgeon's main repository on every release, so a pull request
|
|
100
|
-
there cannot be merged as written.
|
|
101
|
-
[Open an issue](https://github.com/pidgeon-ai/pidgeon-js/issues) and say what
|
|
102
|
-
is wrong, or email [support@pidgeon.ai](mailto:support@pidgeon.ai).
|
|
43
|
+
## License
|
|
103
44
|
|
|
104
|
-
|
|
45
|
+
Apache-2.0
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { run } from "./cli.js";
|
|
3
|
+
run(process.argv.slice(2), {
|
|
4
|
+
out: (line) => process.stdout.write(`${line}\n`),
|
|
5
|
+
err: (line) => process.stderr.write(`${line}\n`),
|
|
6
|
+
env: process.env,
|
|
7
|
+
}).then((code) => {
|
|
8
|
+
process.exitCode = code;
|
|
9
|
+
}, (error) => {
|
|
10
|
+
process.stderr.write(`${error instanceof Error ? (error.stack ?? error.message) : String(error)}\n`);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
});
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export declare const VERSION = "2.1.0";
|
|
2
|
+
export type Io = {
|
|
3
|
+
out: (line: string) => void;
|
|
4
|
+
err: (line: string) => void;
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
/** For tests: what a person does in the browser when signing in. */
|
|
8
|
+
onSignInUrl?: (url: string) => void;
|
|
9
|
+
openBrowser?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function run(argv: string[], io: Io): Promise<number>;
|