scrollport 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/README.md +117 -105
  2. package/package.json +26 -2
package/README.md CHANGED
@@ -1,30 +1,65 @@
1
- # scrollport CLI
1
+ # scrollport
2
2
 
3
- Provision an agent's key against one prepaid wallet.
3
+ Pay-per-use API tools for AI agents. The `scrollport` CLI connects an agent to
4
+ Scrollport's catalog of verified API tools through one prepaid wallet, with no
5
+ per-provider signups, subscriptions or API keys to paste.
4
6
 
5
- ```
7
+ ```bash
6
8
  npx scrollport setup
7
9
  ```
8
10
 
9
- Two clicks, no typing, no per-provider signup. The command prints a link with the
10
- approval code already in it, opens your browser, and waits. You sign in, you
11
- approve, it stores the key. The key is never shown, never pasted, and never
12
- touches your shell history.
11
+ Requires Node.js 22 or later.
12
+
13
+ [Website](https://scrollport.com) · [Setup guide](https://scrollport.com/docs/setup) ·
14
+ [Agent start page](https://scrollport.com/start) ·
15
+ [Control Skill](https://github.com/Scrollport/scrollport-control-skill) ·
16
+ [Support](https://scrollport.com/support)
17
+
18
+ ## Connect an agent
19
+
20
+ `scrollport setup` prints a link with the approval code already in it, opens
21
+ your browser and waits. You sign in with Google, check that the code matches,
22
+ and approve. The CLI stores a scoped key. The key is never shown, never pasted
23
+ and never touches your shell history.
24
+
25
+ Other ways to connect:
26
+
27
+ - **Let the agent choose.** Give it this prompt: `Read https://scrollport.com/start and then help me set up Scrollport.`
28
+ It reuses an existing connection, or picks the CLI, Remote MCP or the direct API for its environment.
29
+ - **Invite.** `npx scrollport setup --invite <code>` redeems an agent invite that a
30
+ human already created. There is no browser and nothing left to approve.
31
+ - **Remote MCP.** Chat clients and coding agents can connect over OAuth without
32
+ the CLI. See the [Remote MCP guide](https://scrollport.com/docs/mcp).
33
+
34
+ The [control Skill](https://github.com/Scrollport/scrollport-control-skill)
35
+ teaches an agent when and how to use these commands.
36
+
37
+ ## Use tools
38
+
39
+ ```bash
40
+ scrollport search_tools "find company email addresses"
41
+ scrollport inspect_tool <tool-id>
42
+ scrollport run_tool <tool-id> --input '{"domain":"example.com"}'
43
+ scrollport get_run <run-id>
44
+ scrollport get_wallet
45
+ ```
13
46
 
14
- > **Published as [`scrollport`](https://www.npmjs.com/package/scrollport)**, so
15
- > `npx scrollport setup` resolves. The package name and the bin are now the same
16
- > word, which is what the API's 401 hint has always promised.
17
- >
18
- > The root workspace package was renamed `scrollport-monorepo` in the same
19
- > change: with both named `scrollport`, `pnpm --filter scrollport …` resolved to
20
- > the root and silently ran `pnpm -r test` — the DB-backed API suites — instead
21
- > of this package's hermetic ones.
47
+ `search_tools` and `inspect_tool` show the published price before anything
48
+ runs. Single lookups display a request price. Fractional usage shows its
49
+ minimum billable charge when declared; JSON preserves `minimum_call_usd` (null
50
+ for request and result pricing). When a run needs approval, the CLI prints the
51
+ approval URL. `--confirm` only waits for a human decision; it cannot approve or
52
+ alter a spend limit.
22
53
 
23
54
  ## Commands
24
55
 
56
+ The CLI is a thin client over the API's nine control tools. The API remains the
57
+ authority for pricing, run lifecycle, wallet holds and human approval.
58
+
25
59
  | command | what it does |
26
60
  | --- | --- |
27
61
  | `scrollport setup` | device flow: get a key and store it |
62
+ | `scrollport setup --invite <code>` | redeem an agent invite instead of the device flow |
28
63
  | `scrollport status` | is there a key, and does the API still accept it? |
29
64
  | `scrollport logout` | remove the key stored on this machine |
30
65
  | `scrollport list_apps [provider]` | check which workspace apps are available and connected |
@@ -33,25 +68,40 @@ touches your shell history.
33
68
  | `scrollport run_tool <tool-id> --input '<json>'\|@file [--confirm] [--new]` | submit one retry-safe paid intent and wait for its persisted result |
34
69
  | `scrollport get_run <run-id> [--wait-seconds 0..120]` | read status, result, artifacts and cost; never starts or bills |
35
70
  | `scrollport get_wallet` | read available funds and human-controlled spending controls |
71
+ | `scrollport upload_file [path]` | stream a local file into workspace storage, or print a human upload link |
72
+ | `scrollport get_files [file-id]` | list files and storage usage, or refresh one file's reference URL |
73
+ | `scrollport delete_file <file-id>` | permanently delete an authorised file |
36
74
  | `scrollport help` / `version` | |
37
75
 
38
- The CLI is a thin client over the API's permanent nine control tools. The API
39
- remains the authority for pricing, lifecycle, wallet holds and human approval.
40
- `search_tools` and `inspect_tool` show the published customer unit rate. Single
41
- lookups display a request price. Fractional usage shows its minimum billable
42
- charge when declared; JSON preserves `minimum_call_usd` (null for new
43
- request/result pricing).
44
- When a run needs approval, the CLI prints the approval URL. `--confirm` only
45
- waits for a human decision; it cannot approve or alter a spend limit.
76
+ ### Safe retries
77
+
78
+ Before submitting, `run_tool` stores a UUID for the canonical API, tool and
79
+ input under `SCROLLPORT_HOME/run-intents`, without storing the input or the
80
+ API key. If the process dies or the response is lost, rerunning the identical
81
+ command reuses that UUID and the API returns the original run. The file is
82
+ cleared once the API returns a durable run ID. Use `--new` only after checking
83
+ Activity, and only when a second paid execution is intentional.
84
+
85
+ `get_run` waits up to 50 seconds by default; `--wait-seconds 0` returns
86
+ immediately. It accepts no input or new-run flags.
46
87
 
47
- Before submitting, the CLI stores a UUID for the canonical API/tool/input
48
- intent under `SCROLLPORT_HOME/run-intents` without storing the input or API key.
49
- If the process dies or the response is lost, rerunning the identical command
50
- reuses that UUID and the API returns the original run. The file is cleared after
51
- the API returns a durable run ID. Use `--new` only after checking Activity and only
52
- when a second paid execution is intentional.
88
+ ### Workspace files
89
+
90
+ `scrollport upload_file /path/reference.png` streams a local file into private
91
+ workspace storage. With no path, it prints a human drag-and-drop link.
92
+ `scrollport upload_file --source-url https://example.com/reference.png` imports
93
+ a directly downloadable public HTTPS file. Binary and base64 content never go
94
+ through MCP.
53
95
 
54
- `get_run` defaults to a 50-second wait; `--wait-seconds 0` returns immediately. It accepts no input or new-run flags. Retired control commands and `run --resume` are not supported.
96
+ `scrollport get_files [file-id] [--query reference] [--offset 25]` lists files,
97
+ refreshes signed reference URLs and reports the workspace's shared 1 GB usage.
98
+ Use the ready file URL in the inspected tool's reference field.
99
+
100
+ Uploads reserve space and expire after one hour if unfinished. On an uncertain
101
+ response, read the returned file ID before retrying to avoid duplicate uploads.
102
+ Existing agent connections need the `files` scope before managing storage; new
103
+ human-approved connections include it. Files stay until deleted or the
104
+ workspace closes, except connected Google content, which has shorter retention.
55
105
 
56
106
  ## Flags
57
107
 
@@ -61,26 +111,30 @@ when a second paid execution is intentional.
61
111
  | `--api-url <url>` | API origin. Default `https://api.scrollport.com` |
62
112
  | `--force` | `setup`: provision a new key even if one already works |
63
113
  | `--no-browser` | `setup`: print the link, open nothing |
114
+ | `--invite <code>` | `setup`: redeem an agent invite instead of the device flow |
64
115
  | `--offline` | `status`: report what is on disk, skip the API check |
65
116
  | `--input <json>\|@file` | `run_tool`: JSON literal or a local JSON file prefixed with `@` |
66
117
  | `--confirm` | `run_tool`: keep polling after printing a human approval URL |
67
- | `--wait-seconds <0..120>` | `get_run`: bounded wait for a terminal state; default 50 |
68
118
  | `--new` | `run_tool`: abandon a retained uncertain intent and intentionally create a fresh paid run |
119
+ | `--wait-seconds <0..120>` | `get_run`: bounded wait for a terminal state; default 50 |
120
+ | `--content-type <mime>` | `upload_file`: set the content type instead of inferring it from the file extension |
121
+ | `--source-url <https-url>` | `upload_file`: import a directly downloadable public file |
122
+ | `--query <text>` / `--offset <n>` | `get_files`: filter and page the file list |
69
123
 
70
124
  ## Environment
71
125
 
72
126
  | variable | |
73
127
  | --- | --- |
74
- | `SCROLLPORT_API_KEY` | a key to use instead of the stored one. **Read, never written** — this is the CI path, where the right store is your platform's secret manager |
128
+ | `SCROLLPORT_API_KEY` | a key to use instead of the stored one. **Read, never written.** This is the CI path, where the right store is your platform's secret manager |
75
129
  | `SCROLLPORT_API_URL` | default for `--api-url` |
76
130
  | `SCROLLPORT_HOME` | config directory (default `~/.scrollport`) |
77
131
  | `SCROLLPORT_NO_BROWSER` | set to anything to never open a browser |
78
132
 
79
133
  ## `--json`
80
134
 
81
- **stdout carries exactly one JSON object. Everything else goes to stderr.** That
82
- holds for progress, warnings and errors alike, so `JSON.parse(stdout)` is always
83
- safe.
135
+ **stdout carries exactly one JSON object. Everything else goes to stderr.**
136
+ That holds for progress, warnings and errors alike, so `JSON.parse(stdout)` is
137
+ always safe.
84
138
 
85
139
  Success:
86
140
 
@@ -90,7 +144,8 @@ Success:
90
144
  "verified": true, "already_configured": false }
91
145
  ```
92
146
 
93
- Failure — the API's own `{ error, message, hint }` envelope, plus the exit code:
147
+ Failure returns the API's own `{ error, message, hint }` envelope, plus the
148
+ exit code:
94
149
 
95
150
  ```json
96
151
  { "ok": false, "command": "setup", "error": "access_denied",
@@ -101,22 +156,23 @@ Failure — the API's own `{ error, message, hint }` envelope, plus the exit cod
101
156
 
102
157
  Fields present per command:
103
158
 
104
- - `setup` — `already_configured`, `account_id`, `api_key_masked`, `api_url`,
159
+ - `setup`: `already_configured`, `account_id`, `api_key_masked`, `api_url`,
105
160
  `credentials_path`, `verified` (`true` when the API accepted the key, `false`
106
161
  when it could not be reached to check).
107
- - `status` — `authenticated`, `source` (`"file"` or `"env"`), `account_id`,
162
+ - `status`: `authenticated`, `source` (`"file"` or `"env"`), `account_id`,
108
163
  `api_key_masked`, `api_url`, `credentials_path` (`null` for an env key),
109
164
  `verified` (`null` when unchecked), and `permissions_warning` when the file is
110
165
  readable beyond its owner.
111
- - `logout` — `removed`, `credentials_path`, `env_key_still_set`.
112
- - `search_tools` — `query`, `discovery` (the API's typed capability/tool result).
113
- - `inspect_tool` — `tool_id`, `tool` (the API's full inspection response).
114
- - `get_run` — `run_id` plus the current `run` or approval state; terminal reads include `estimate`. No idempotency key is used.
115
- - `list_apps` — the account-scoped app inventory.
116
- - `run_tool` — `run_id`, `estimate`, `run_tool`. A completed failed run returns JSON with
117
- `ok: false` and exit code `1`; API refusal errors retain their own teaching
118
- error and exit code.
119
- - `get_wallet` — `wallet` (the API's current wallet response).
166
+ - `logout`: `removed`, `credentials_path`, `env_key_still_set`.
167
+ - `search_tools`: `query`, `discovery` (the API's typed tool result).
168
+ - `inspect_tool`: `tool_id`, `tool` (the API's full inspection response).
169
+ - `get_run`: `run_id` plus the current `run` or approval state; terminal reads
170
+ include `estimate`. No idempotency key is used.
171
+ - `list_apps`: the account-scoped app inventory.
172
+ - `run_tool`: `run_id`, `estimate`, `run_tool`. A completed failed run returns
173
+ JSON with `ok: false` and exit code `1`; API refusal errors keep their own
174
+ teaching error and exit code.
175
+ - `get_wallet`: `wallet` (the API's current wallet response).
120
176
 
121
177
  **The API key itself is never emitted**, in either mode. Masked only. A key in
122
178
  stdout is a key in a log, a CI artifact and a screen recording.
@@ -128,72 +184,28 @@ Agents branch on these, so they are part of the contract.
128
184
  | code | meaning |
129
185
  | --- | --- |
130
186
  | 0 | success |
131
- | 1 | unexpected error (a bug in the CLI) |
187
+ | 1 | unexpected error, or a completed run that failed |
132
188
  | 2 | usage: unknown command, bad flag |
133
189
  | 3 | a human declined the approval |
134
190
  | 4 | the code expired, or was already spent |
135
191
  | 5 | the API could not be reached |
136
- | 6 | no usable key — run `scrollport setup` |
192
+ | 6 | no usable key: run `scrollport setup` |
137
193
  | 130 | interrupted (Ctrl-C) |
138
194
 
139
195
  ## Where the key is stored
140
196
 
141
- `~/.scrollport/credentials.json`, file mode `0600`, in a `0700` directory,
142
- written atomically (temp file created with the mode already set, then renamed —
143
- so the key is never briefly visible at your umask).
144
-
145
- **Why a file and not the OS keychain.** The keychain is the better answer for a
146
- desktop app and the wrong answer here. macOS Keychain, libsecret and Windows
147
- Credential Manager all need a logged-in, unlocked user session; in a container,
148
- over SSH, or in CI, that is not a degraded experience but a hang with no visible
149
- prompt — and containers, SSH and CI are exactly where agents run. Every keychain
150
- binding also drags in a native module whose prebuilt binaries are a recurring
151
- `npx` failure. A file is what issue #12 specifies and what `gh`, `aws` and `fly`
152
- all do, for the same reasons.
153
-
154
- What the file has to earn in exchange, and does:
155
-
156
- - `0600` in a `0700` directory, verified on write and **warned about on read** if
157
- something has loosened it.
158
- - Atomic write, so an interrupted `setup` cannot leave half a credential.
159
- - The key is never a command-line argument and is never echoed — the CLI writes
160
- it itself, straight from the poll response. Nothing about the happy path puts
161
- it in shell history or terminal scrollback.
162
- - `SCROLLPORT_API_KEY` is read but never written, so CI keeps its key in a real
163
- secret manager rather than in our file.
164
-
165
- The residual risk, stated plainly: anything running as your user can read this
166
- file. A keychain would narrow that to "anything running as your user that can
167
- also satisfy an unlock prompt". If we ship a desktop-first surface later, a
168
- keychain backend belongs behind `credentials.ts` — nothing above that module
169
- assumes a file.
170
-
171
- ## Development
197
+ `~/.scrollport/credentials.json`, file mode `0600`, in a `0700` directory. The
198
+ file is written atomically: a temporary file is created with the mode already
199
+ set, then renamed, so the key is never briefly readable at your umask. The CLI
200
+ warns on read if something has loosened those permissions.
172
201
 
173
- ```
174
- pnpm --filter scrollport build
175
- pnpm --filter scrollport test # hermetic: no server, no database
176
- node packages/cli/dist/cli.js search_tools "research company funding" --api-url http://localhost:8787
177
- ```
178
-
179
- The tests stub `fetch` and point `SCROLLPORT_HOME` at a temp directory. They
180
- stand up nothing and touch no database.
202
+ The CLI uses a file rather than the OS keychain because agents run in
203
+ containers, over SSH and in CI, where a keychain needs an unlocked desktop
204
+ session and would hang with no visible prompt. `gh`, `aws` and `fly` make the
205
+ same choice. The residual risk: anything running as your user can read this
206
+ file. In CI, set `SCROLLPORT_API_KEY` from your secret manager instead; the CLI
207
+ never writes it to disk.
181
208
 
209
+ ## License
182
210
 
183
- ## Workspace files
184
-
185
- `scrollport upload_file /path/reference.png` streams a local file into private
186
- workspace storage. `scrollport upload_file` prints a human drag-and-drop link;
187
- `scrollport upload_file --source-url https://example.com/reference.png` imports
188
- a directly downloadable public HTTPS file. Binary/base64 never goes into MCP.
189
-
190
- `scrollport get_files [file-id] [--query reference] [--offset 25]` lists files,
191
- refreshes signed reference URLs and reports the workspace's shared 1 GB usage.
192
- Use the ready file URL in the inspected tool's reference field.
193
- `scrollport delete_file <file-id>` permanently deletes an authorised file.
194
-
195
- Uploads reserve space and expire after one hour if unfinished. On an uncertain
196
- response, read the returned file ID before retrying to avoid duplicate uploads.
197
- Existing agent connections need the `files` scope before managing storage; new
198
- human-approved connections include it. Files stay until deleted or workspace
199
- closure, except connected Google content's shorter retention.
211
+ MIT
package/package.json CHANGED
@@ -1,8 +1,32 @@
1
1
  {
2
2
  "name": "scrollport",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
- "description": "scrollport CLI — provision an agent's key against one prepaid wallet.",
5
+ "description": "Connect AI agents to pay-per-use API tools through one prepaid wallet: device-flow setup, tool search, paid runs and wallet checks from the shell.",
6
+ "keywords": [
7
+ "scrollport",
8
+ "mcp",
9
+ "model-context-protocol",
10
+ "ai-agents",
11
+ "agent-tools",
12
+ "api-tools",
13
+ "pay-per-use",
14
+ "claude-code",
15
+ "codex",
16
+ "cursor",
17
+ "openclaw",
18
+ "hermes",
19
+ "skills",
20
+ "cli"
21
+ ],
22
+ "homepage": "https://scrollport.com/docs/setup",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/Scrollport/scrollport-control-skill.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://scrollport.com/support"
29
+ },
6
30
  "license": "MIT",
7
31
  "engines": {
8
32
  "node": ">=22"