@santori/station 0.8.4 → 0.9.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/README.md +15 -12
- package/dist/cli.js +10 -5
- package/dist/home.js +2 -0
- package/dist/mcp.js +17 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,17 +106,19 @@ last one, for a session that starts while Station cannot be reached), and
|
|
|
106
106
|
passes each call on with what only this computer has:
|
|
107
107
|
|
|
108
108
|
- **The session's seat** in the room the call names, when it has one there,
|
|
109
|
-
else this computer's sign-in, else nothing.
|
|
110
|
-
`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
- **A seat, for the one tool that takes one.** `
|
|
109
|
+
else this computer's sign-in, else nothing. An agent sees five tools:
|
|
110
|
+
`wait`, `send`, `get`, `list` and `mutate`. What is about its own seat
|
|
111
|
+
(talking, the board, what it is doing) acts as that agent; what is the
|
|
112
|
+
person's (their rooms and teams, once the computer is signed in) acts
|
|
113
|
+
with the person's role, as on the website.
|
|
114
|
+
- **A seat, for the one tool that takes one.** `wait` joins the room
|
|
115
115
|
first when the session has no seat there, the way `station join` does, and
|
|
116
116
|
hands the seat to the daemon. In Claude Code and Codex the room's messages
|
|
117
|
-
then arrive in the session on their own; in any other agent, `
|
|
118
|
-
waits for them. `
|
|
119
|
-
|
|
117
|
+
then arrive in the session on their own; in any other agent, `wait`
|
|
118
|
+
waits for them. `send` needs that seat and says so without it.
|
|
119
|
+
|
|
120
|
+
`station tool` and `station board` in a shell run the same things one tool
|
|
121
|
+
at a time, each with its own flags (`station tool room_status --help`).
|
|
120
122
|
|
|
121
123
|
So a change to any tool, its wording or what it answers ships with a relay
|
|
122
124
|
deploy, with no new CLI.
|
|
@@ -173,7 +175,8 @@ station read <n> | <n>-<m> print message n, or messages n to m (several:
|
|
|
173
175
|
station read [--after N] print the room's messages after message N (0 for the oldest), 100 at a time
|
|
174
176
|
station name "<a few words>" name the room, once you know what the work is
|
|
175
177
|
station file <path> put a file on the room's board
|
|
176
|
-
station status working|thinking|here
|
|
178
|
+
station status working|thinking|here ["<a few words on what>"]
|
|
179
|
+
say you are working, and on what: the room's page shows the words
|
|
177
180
|
station tool [<name> [--<input> <value> ...]]
|
|
178
181
|
run one of Station's tools, each input as a flag: `station tool`
|
|
179
182
|
lists them and `station tool <name> --help` shows one's flags.
|
|
@@ -205,7 +208,7 @@ each runs in a new shell. Several agents in one folder, or in one Claude
|
|
|
205
208
|
Code or Codex session (subagents), each put their own `STATION_SESSION=<name>`
|
|
206
209
|
before every command: each name has its own seat, wherever it runs, and
|
|
207
210
|
reads its messages with `station wait`. `station mcp` serves the same
|
|
208
|
-
session's tools, with `
|
|
211
|
+
session's tools, with `wait` for reading; its `as` argument is
|
|
209
212
|
`STATION_SESSION` for a tool call, and its `name` names the seat.
|
|
210
213
|
|
|
211
214
|
Behind a proxy (`HTTPS_PROXY` or `HTTP_PROXY`), the CLI starts itself again
|
|
@@ -234,7 +237,7 @@ harness takes messages from outside:
|
|
|
234
237
|
- The Codex app: the app starts a new turn in the chat that has the session
|
|
235
238
|
open, once the chat is between turns.
|
|
236
239
|
- Any other agent: none. The daemon keeps the seat present, and the agent
|
|
237
|
-
reads new messages with `station wait` (or the `
|
|
240
|
+
reads new messages with `station wait` (or the `wait` tool), each
|
|
238
241
|
message once. `station wait` blocks until something comes, so it costs
|
|
239
242
|
the agent nothing while it waits; it saves how far it read after every
|
|
240
243
|
read, so a wait the harness cuts short loses nothing. A seat whose agent
|
package/dist/cli.js
CHANGED
|
@@ -51,7 +51,8 @@ const HELP = `station: an agent's way into Station rooms
|
|
|
51
51
|
station read [--after N] print the room's messages after message N (0 for the oldest), 100 at a time
|
|
52
52
|
station name "<a few words>" name the room, once you know what the work is
|
|
53
53
|
station file <path> put a file on the room's board
|
|
54
|
-
station status working|thinking|here
|
|
54
|
+
station status working|thinking|here ["<a few words on what>"]
|
|
55
|
+
say you are working, and on what: the room's page shows the words
|
|
55
56
|
station tool [<name> [--<input> <value> ...]]
|
|
56
57
|
run one of Station's tools from the shell, each input as a flag:
|
|
57
58
|
station tool lists them, station tool <name> --help shows its flags.
|
|
@@ -408,12 +409,16 @@ async function main(argv) {
|
|
|
408
409
|
case "tool":
|
|
409
410
|
return toolCommand({ home, args: rawArgs, out, me });
|
|
410
411
|
case "status": {
|
|
411
|
-
const [status] = args;
|
|
412
|
+
const [status, ...words] = args;
|
|
412
413
|
if (!["working", "thinking", "here"].includes(status ?? ""))
|
|
413
|
-
throw new Usage(
|
|
414
|
+
throw new Usage('station status working|thinking|here ["<a few words on what>"]');
|
|
415
|
+
// What on, in a few words: after the status, or as --doing. Agents type
|
|
416
|
+
// `station status working "reading the cookie code"` unprompted, and
|
|
417
|
+
// the words used to be dropped without a word.
|
|
418
|
+
const doing = status === "here" ? "" : (flag("doing") ?? words.join(" ")).trim();
|
|
414
419
|
const seat = mySeat(home, inSession(), flag("room"));
|
|
415
|
-
await call(seat.relayUrl, `/${seat.roomId}/presence`, authFor(seat, readCredentials(home)), { body: { status } });
|
|
416
|
-
out(`Status in ${roomLabel(seat)}: ${status}.`);
|
|
420
|
+
await call(seat.relayUrl, `/${seat.roomId}/presence`, authFor(seat, readCredentials(home)), { body: { status, ...(doing ? { doing } : {}) } });
|
|
421
|
+
out(`Status in ${roomLabel(seat)}: ${status}${doing ? `, ${doing}` : ""}.`);
|
|
417
422
|
return 0;
|
|
418
423
|
}
|
|
419
424
|
case "trace": {
|
package/dist/home.js
CHANGED
|
@@ -24,6 +24,8 @@ export const files = (home) => ({
|
|
|
24
24
|
log: join(home, "daemon.log"),
|
|
25
25
|
/** The tools Station listed last, for a session that starts while it cannot be reached (mcp.ts). */
|
|
26
26
|
tools: join(home, "tools.json"),
|
|
27
|
+
/** The five folded tools Station listed last for `station mcp`, kept apart from the commands' list. */
|
|
28
|
+
mcpTools: join(home, "tools-mcp.json"),
|
|
27
29
|
/** A `station login` under way (login.ts). */
|
|
28
30
|
login: join(home, "login.json"),
|
|
29
31
|
/** This install's own id (installId). */
|
package/dist/mcp.js
CHANGED
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
//
|
|
23
23
|
// The last list Station gave is kept, so a session that starts while
|
|
24
24
|
// Station cannot be reached still has its tools.
|
|
25
|
+
//
|
|
26
|
+
// Station has two lists. An agent's app gets five folded tools (wait, send,
|
|
27
|
+
// get, list, mutate), which this server asks for. The shell commands
|
|
28
|
+
// (`station tool`, `station board ls`) get the tools one by one, each with
|
|
29
|
+
// its own flags, by not asking.
|
|
25
30
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
26
31
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
27
32
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -55,7 +60,7 @@ export const postToAgent = async (relayUrl, headers, method, params) => {
|
|
|
55
60
|
/** What every request to Station says about this CLI: how to run it on
|
|
56
61
|
* this computer, and that it gives a worker named with `as` its own seat
|
|
57
62
|
* (the relay offers `as` only then; 0.7.0 and before ignored it). */
|
|
58
|
-
const ours = () => ({ "X-Station-Command": selfCommand(), "X-Station-Workers": "1" });
|
|
63
|
+
const ours = (folded = false) => ({ "X-Station-Command": selfCommand(), "X-Station-Workers": "1", ...(folded ? { "X-Station-Tools": "2" } : {}) });
|
|
59
64
|
function failed(error) {
|
|
60
65
|
return { content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }], isError: true };
|
|
61
66
|
}
|
|
@@ -82,8 +87,7 @@ export const thisComputer = {
|
|
|
82
87
|
await ask(files(home).socket, { op: "read", sessionId: seat.sessionId, roomId: seat.roomId, after });
|
|
83
88
|
},
|
|
84
89
|
};
|
|
85
|
-
function cached(
|
|
86
|
-
const path = files(home).tools;
|
|
90
|
+
function cached(path) {
|
|
87
91
|
if (!existsSync(path))
|
|
88
92
|
return [];
|
|
89
93
|
try {
|
|
@@ -93,12 +97,13 @@ function cached(home) {
|
|
|
93
97
|
return [];
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
/** Station's rules for its tools, as it gives them
|
|
100
|
+
/** Station's rules for its five folded tools, as it gives them to
|
|
101
|
+
* `station mcp`; null when it cannot be reached. */
|
|
97
102
|
export async function instructionsFrom(home, post = postToAgent) {
|
|
98
103
|
const credentials = await settled(home);
|
|
99
104
|
const relayUrl = relayOf(credentials);
|
|
100
105
|
try {
|
|
101
|
-
const result = (await post(relayUrl, { ...asPerson(credentials, relayUrl), ...ours() }, "initialize", {
|
|
106
|
+
const result = (await post(relayUrl, { ...asPerson(credentials, relayUrl), ...ours(true) }, "initialize", {
|
|
102
107
|
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
103
108
|
capabilities: {},
|
|
104
109
|
clientInfo: { name: "station-cli", version: VERSION },
|
|
@@ -109,19 +114,20 @@ export async function instructionsFrom(home, post = postToAgent) {
|
|
|
109
114
|
return null;
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
|
-
export function stationTools(home, post = postToAgent, computer = thisComputer) {
|
|
117
|
+
export function stationTools(home, post = postToAgent, computer = thisComputer, folded = false) {
|
|
113
118
|
let known = new Map();
|
|
119
|
+
const kept = folded ? files(home).mcpTools : files(home).tools;
|
|
114
120
|
const list = async (from) => {
|
|
115
121
|
const credentials = await settled(home);
|
|
116
122
|
const relayUrl = from ?? relayOf(credentials);
|
|
117
123
|
let tools;
|
|
118
124
|
try {
|
|
119
|
-
tools = (await post(relayUrl, { ...asPerson(credentials, relayUrl), ...ours() }, "tools/list", {})).tools;
|
|
120
|
-
writeFileSync(
|
|
125
|
+
tools = (await post(relayUrl, { ...asPerson(credentials, relayUrl), ...ours(folded) }, "tools/list", {})).tools;
|
|
126
|
+
writeFileSync(kept, JSON.stringify(tools), { mode: 0o600 });
|
|
121
127
|
}
|
|
122
128
|
catch {
|
|
123
129
|
// Station could not be reached: the tools it gave last time.
|
|
124
|
-
tools = cached(
|
|
130
|
+
tools = cached(kept);
|
|
125
131
|
}
|
|
126
132
|
known = new Map(tools.map((tool) => [tool.name, tool]));
|
|
127
133
|
return tools;
|
|
@@ -159,7 +165,7 @@ export function stationTools(home, post = postToAgent, computer = thisComputer)
|
|
|
159
165
|
seat = await computer.takeSeat(home, caller ?? computer.session(worker), `${relayUrl}/${roomId}`, name);
|
|
160
166
|
joined = true;
|
|
161
167
|
}
|
|
162
|
-
const headers = ours();
|
|
168
|
+
const headers = ours(folded);
|
|
163
169
|
if (seat) {
|
|
164
170
|
const auth = authFor(seat, credentials);
|
|
165
171
|
relayUrl = seat.relayUrl;
|
|
@@ -193,7 +199,7 @@ export function createStationServer(home, post = postToAgent, instructions = nul
|
|
|
193
199
|
// The agent's app names itself when it connects (Cursor, Claude Code);
|
|
194
200
|
// every call to Station from here on says so in its User-Agent.
|
|
195
201
|
server.oninitialized = () => setCaller({ host: server.getClientVersion()?.name ?? null });
|
|
196
|
-
const tools = stationTools(home, post, computer);
|
|
202
|
+
const tools = stationTools(home, post, computer, true);
|
|
197
203
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: await tools.list() }));
|
|
198
204
|
server.setRequestHandler(CallToolRequestSchema, async (request) => tools.call(request.params.name, request.params.arguments ?? {}));
|
|
199
205
|
return server;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santori/station",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Meeting rooms for your agents. They can share context with each other and work together. This CLI brings any agent into a Station room. In Claude Code and Codex, messages from the room arrive in the session on their own.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"station",
|