@specstream/pi-package 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SpecStream SAS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,75 @@
1
- # Temporary Holding Version
1
+ # SpecStream for Pi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Ask for any list in plain words and get every match from the live web, each row with the page it was read from: lead lists, company lists, grants, jobs, places. You see the price before anything runs and pay for each row delivered, from 10 cents each.
4
+
5
+ This is a [Pi package](https://pi.dev/packages). It adds the hosted [SpecStream](https://specstream.ai) MCP server and four skills, so Pi reads your request back, gets the price, asks you to approve it, and returns the finished list.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pi install npm:@specstream/pi-package
11
+ pi mcp login specstream
12
+ ```
13
+
14
+ The second command opens SpecStream in your browser. Sign in and approve access; Pi stores the token and refreshes it. New accounts get $10 of work free for 30 days. Inside a session, `/mcp` shows the connection and lets you sign in or out.
15
+
16
+ Try it for one run without installing: `pi -e npm:@specstream/pi-package`.
17
+
18
+ ## What you get
19
+
20
+ - **The SpecStream MCP server** at `https://api.specstream.ai/mcp`, registered by a small extension (`extensions/specstream.ts`). It uses Pi's built-in MCP support, OAuth 2.1 with dynamic client registration, and no stored credentials. Five tools stay in view (`compile`, `quote_capacity_work`, `authorize_capacity_work`, `get_find`, `list_find_rows`); the rest load on demand through `tool_search`. In Pi they are named `mcp__specstream__<tool>`.
21
+ - **Four skills**, loaded when the task calls for them or by name:
22
+
23
+ | Skill | What it does |
24
+ |---|---|
25
+ | `/skill:specstream-compile` | Reads your request back before anything runs |
26
+ | `/skill:specstream-review-work` | Gets the exact price and its expiry |
27
+ | `/skill:specstream-approve-work` | Starts the list after you approve that price |
28
+ | `/skill:specstream-continue-work` | Reads every row, sends them to Sheets, Excel, Notion, Airtable, HubSpot or Salesforce, brings back more, refreshes, monitors |
29
+
30
+ ## Try it
31
+
32
+ ```text
33
+ Find every independent bookstore in Oregon with a website and a phone number.
34
+ ```
35
+
36
+ ```text
37
+ List open grants for food banks in Texas, with the deadline and the award size.
38
+ ```
39
+
40
+ Reading a request and getting its price are free. Nothing that costs money runs until you approve an exact maximum.
41
+
42
+ ## Use an API key instead (servers, CI)
43
+
44
+ Create a key under **Agents & API** in the [workspace](https://specstream.ai/workspace), give it only what the task needs (read, prepare or execute), its projects, an expiry and a spending limit, then export it before starting Pi:
45
+
46
+ ```bash
47
+ export SPECSTREAM_API_KEY=your-key-here
48
+ ```
49
+
50
+ When the variable is set, the extension sends it as `Authorization: Bearer ${SPECSTREAM_API_KEY}`. Pi fills the value in from your environment, so the key is never written to a file by this package.
51
+
52
+ ## Only the MCP server, no package
53
+
54
+ ```bash
55
+ pi mcp add specstream --url https://api.specstream.ai/mcp
56
+ pi mcp login specstream
57
+ ```
58
+
59
+ That adds the server to `~/.pi/agent/mcp.json` and skips the skills. A server of the same name in `mcp.json` takes precedence over the one this package registers.
60
+
61
+ ## What it sends
62
+
63
+ Your request and your answers to the price go to `api.specstream.ai` over HTTPS, and results come back from the same API. The extension reads one environment variable, `SPECSTREAM_API_KEY`, and only to decide whether to add the header. It reads no files, runs no commands and installs no dependencies.
64
+
65
+ ## Price
66
+
67
+ A list runs only after you approve its maximum price. Results cost 10 cents, 30 cents or $1 each depending on the kind of work, plus 10 cents for a person's email and 25 cents for a phone. Nothing is charged when nothing matches, and possible matches that were not confirmed are never billed. [Pricing](https://specstream.ai/pricing)
68
+
69
+ ## Links
70
+
71
+ [Documentation](https://specstream.ai/docs/mcp) · [Privacy](https://specstream.ai/privacy) · [Terms](https://specstream.ai/terms) · support@specstream.ai
72
+
73
+ ## License
74
+
75
+ MIT
@@ -0,0 +1,31 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+
3
+ export const SERVER_NAME = "specstream";
4
+ export const MCP_URL = "https://api.specstream.ai/mcp";
5
+
6
+ const DESCRIPTION =
7
+ "SpecStream: ask for any list in plain words and get every match from the live web, each row with its source. Reads a request back and prices it for free; paid work needs the person's approval of an exact maximum.";
8
+
9
+ // The flow that every list goes through stays visible to the model. The rest of the
10
+ // server's tools load on demand through tool_search.
11
+ const DIRECT_TOOLS = ["compile", "quote_capacity_work", "authorize_capacity_work", "get_find", "list_find_rows"];
12
+
13
+ /**
14
+ * The server entry registered with Pi. Without a key Pi signs in with OAuth (`/mcp login specstream`).
15
+ * With SPECSTREAM_API_KEY set the entry sends it as a Bearer header; the value stays a `${...}`
16
+ * reference, so Pi reads the key from the environment when it connects and this file never holds it.
17
+ */
18
+ export function serverConfig(env: Record<string, string | undefined> = process.env) {
19
+ const useKey = Boolean(env.SPECSTREAM_API_KEY?.trim());
20
+ return {
21
+ url: MCP_URL,
22
+ description: DESCRIPTION,
23
+ exposure: "deferred" as const,
24
+ toolExposure: Object.fromEntries(DIRECT_TOOLS.map((name) => [name, "direct" as const])),
25
+ ...(useKey ? { headers: { Authorization: "Bearer ${SPECSTREAM_API_KEY}" } } : {}),
26
+ };
27
+ }
28
+
29
+ export default function specstream(pi: ExtensionAPI) {
30
+ pi.registerMcpServer(SERVER_NAME, serverConfig());
31
+ }
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@specstream/pi-package",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "SpecStream for Pi: ask for any list in plain words and get every match from the live web, each row with its source. Adds the SpecStream MCP server and four agent skills.",
5
+ "type": "module",
6
+ "keywords": [
7
+ "pi-package",
8
+ "pi-extension",
9
+ "pi-skill",
10
+ "specstream",
11
+ "mcp",
12
+ "lead-lists",
13
+ "web-data",
14
+ "web-search",
15
+ "agent-skills"
16
+ ],
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/specstream/specstream-tools.git",
21
+ "directory": "integrations/pi"
22
+ },
23
+ "homepage": "https://specstream.ai/docs/mcp",
24
+ "author": {
25
+ "name": "SpecStream",
26
+ "email": "support@specstream.ai",
27
+ "url": "https://specstream.ai"
28
+ },
29
+ "files": [
30
+ "extensions",
31
+ "skills",
32
+ "LICENSE",
33
+ "README.md"
34
+ ],
35
+ "pi": {
36
+ "extensions": [
37
+ "./extensions/specstream.ts"
38
+ ],
39
+ "skills": [
40
+ "./skills"
41
+ ]
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "scripts": {
47
+ "check": "tsc --noEmit",
48
+ "test": "node --experimental-strip-types --disable-warning=ExperimentalWarning --test test/package.test.ts"
49
+ },
50
+ "peerDependencies": {
51
+ "@earendil-works/pi-coding-agent": "*"
52
+ },
53
+ "devDependencies": {
54
+ "@earendil-works/pi-coding-agent": "^1.2.0",
55
+ "@types/node": "^22.0.0",
56
+ "typescript": "^5.6.0"
57
+ }
58
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: specstream-approve-work
3
+ description: Approve an exact SpecStream price, up to the maximum the person set. This starts paid work.
4
+ license: MIT
5
+ metadata:
6
+ category: search
7
+ author: SpecStream
8
+ ---
9
+
10
+ # Approve a price
11
+
12
+ SpecStream is the live web data engine for teams and agents. Use the configured MCP server at `https://api.specstream.ai/mcp`.
13
+
14
+ `authorize_capacity_work` starts paid work, so treat it as a write. It needs the reviewed `quote_id` and `quote_hash`, the approved maximum as an integer in `confirm_max_cents`, and a stable `idempotency_key`. A standing project or agent authority must cover this exact scope and limit. A funded account is not enough.
15
+
16
+ Save the same key before you send the call. If the response is unclear, recover the same work with `get_capacity_request` or `get_capacity_quote`. Never create a new key, price or run just to recover a lost response. A price that expired or changed needs a new approval.
17
+
18
+ Do not top up, subscribe, add a seat or open a payment page. If the balance or the authority is missing, say exactly what is missing and keep the request.
19
+
20
+ Use `get_find` for progress. Rows appear while the run works, and a run can be stopped and keeps what it found. Only delivered matches are charged. Unsure results stay unsure.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: specstream-compile
3
+ description: Get the whole list from the live web by asking in plain words (leads, companies, grants, jobs, places). Reads the request back first; nothing runs or costs until a price is approved. Use when someone wants to find, build or monitor a list.
4
+ license: MIT
5
+ metadata:
6
+ category: search
7
+ author: SpecStream
8
+ ---
9
+
10
+ # Read the request
11
+
12
+ SpecStream is the live web data engine for teams and agents. Use the configured MCP server at `https://api.specstream.ai/mcp`.
13
+
14
+ Use `compile` to read the person's request. Say back what it found: the kind of thing, the conditions, the details to bring back and the quantity. Separate the conditions that must hold from the details that are nice to have. Use `edit_spec` for a deliberate change. Never drop a hard condition quietly, and never treat missing evidence as a no. Reading a request does not start any work.
15
+
16
+ Suggest requests that work well: local businesses with ratings, companies from registries, grants, tenders, clinical trials, papers, datasets, regulations, vulnerabilities, apps, repositories, packages, podcasts and books. Companies that use a tool, funding and new-executive signals, US nonprofits and UK financial firms by FCA status also work. If someone asks for people by job title, say that results may be few. `list_request_templates` returns requests that already work for each kind.
17
+
18
+ The same saved request can be revised, branched, compared and shared, in the workspace or through this agent. Never ask for an API key in chat. Use the connector's own sign-in.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: specstream-continue-work
3
+ description: Read the finished SpecStream rows with the page behind each fact, send them where the person works, and start new work only on purpose.
4
+ license: MIT
5
+ metadata:
6
+ category: search
7
+ author: SpecStream
8
+ ---
9
+
10
+ # Read, send and continue
11
+
12
+ SpecStream is the live web data engine for teams and agents. Use the configured MCP server at `https://api.specstream.ai/mcp`.
13
+
14
+ Read `list_find_rows` and follow each `next_cursor` through the `cursor` argument until it is null. The first page is not the whole result. Open `get_find_decisions` to show each condition check with the value observed, its source and the time it was read. Never invent links or fill in unknown facts. Keep the original read times and do not call reused evidence fresh.
15
+
16
+ When the person asks, `send_to_destination` sends selected results to Google Sheets, Excel, Notion, Airtable, HubSpot, Salesforce or an Outlook draft. An Outlook draft lands in the person's own Drafts folder and is never sent. `export_find` makes a download link as CSV, Excel, JSON or HTML. Reading, exporting and sharing cost nothing.
17
+
18
+ Finding more, adding facts or rechecking is new work with its own reviewed price. A recheck costs half the rate for a row that changed and 1 cent for a row that did not.
19
+
20
+ `create_capacity_schedule` sets up a monitor and is a write. It needs a scope, a cadence, a validity period and limits per run and per period. A monitor reruns on its schedule and labels each change: still matches, no longer matches, unresolved or unavailable. Creating one does not fund it. A blocked or missed run is not an unchanged result and is not bought later. Pause or revoke a monitor when the owner says so.
21
+
22
+ The workspace is the place to explore the full history. Do not present a small result widget as the whole workspace.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: specstream-review-work
3
+ description: Get the real SpecStream price for the exact request. Nothing runs.
4
+ license: MIT
5
+ metadata:
6
+ category: search
7
+ author: SpecStream
8
+ ---
9
+
10
+ # See the price
11
+
12
+ SpecStream is the live web data engine for teams and agents. Use the configured MCP server at `https://api.specstream.ai/mcp`.
13
+
14
+ Call `quote_capacity_work` with the `ast_hash` from `compile`, the operation, the number of results wanted, the useful minimum, and the original `parent_find_id`, `project_id` or `revision_id` when one applies. Asking for more uses `extend`, adding facts uses `add_facts` and rechecking uses `refresh`.
15
+
16
+ Say the scope, the conditions, the maximum price and the expiry in text. Results cost 5 cents, 15 cents or $1 each, plus 5 cents for a person's email and 15 cents for a phone, and nothing when nothing matches. A price lasts 30 minutes. The price does not spend any balance and does not start a job.
17
+
18
+ Use `get_capacity_balance` to read the balance. A balance is not permission to spend. Do not copy the maximum into an approval unless the person said to, or an existing bounded task already allows it. Plans and top-ups live in the person's account, not in chat.