@thenavidm/slipway 0.1.8 → 0.1.9
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 +5 -0
- package/README.md +1 -0
- package/dist/app.d.ts +6 -0
- package/dist/cli/help.js +15 -4
- package/dist/server.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in Slipway, newest first.
|
|
4
4
|
|
|
5
|
+
## 0.1.9, 2026-10-05: what Substack needed
|
|
6
|
+
|
|
7
|
+
- **A resource can wait for an account.** `listed(env)` leaves a resource out until it returns true. Substack 2.2.3 offered its two resources only once a publication was connected; on Slipway they were always offered, and Claude Code then adds its own two resource tools to every message: 40 tokens in tool search, for reads that could only fail.
|
|
8
|
+
- **The general help keeps its columns narrow.** Commands and settings each line up on their own, and an entry longer than 40 characters puts its help on the next line instead of pushing every other row out to its width. Substack's `login [<publication>] [--paste | --playwriter | --playwright]` started every description in the help at column 80, past the edge of a standard terminal; they now start at 34.
|
|
9
|
+
|
|
5
10
|
## 0.1.8, 2026-10-05: what Midjourney and Substack needed
|
|
6
11
|
|
|
7
12
|
- **HTTP checks Origin.** A request whose `Origin` is another site is refused unless `<PREFIX>_HTTP_ALLOWED_ORIGINS` lists it, as the MCP transport spec asks: a page in a browser can send a request to a localhost server, and only that header says where it came from. Clients that are not browsers send none and are unaffected. Substack's own server did this before it moved.
|
package/README.md
CHANGED
|
@@ -574,6 +574,7 @@ See [CHANGELOG.md](CHANGELOG.md).
|
|
|
574
574
|
| --- | --- | --- |
|
|
575
575
|
| [Bluesky](https://github.com/thenavidm/bluesky-mcp-cli) | [`@thenavidm/bluesky-mcp-cli`](https://www.npmjs.com/package/@thenavidm/bluesky-mcp-cli) 2.0.0 | Posting, threads, replies, the timeline, search, feeds, lists, notifications and the social graph |
|
|
576
576
|
| [Mastodon](https://github.com/thenavidm/mastodon-mcp-cli) | [`@thenavidm/mastodon-mcp-cli`](https://www.npmjs.com/package/@thenavidm/mastodon-mcp-cli) 2.0.0 | Posting, editing, threads, timelines, search, lists, notifications and following, on any instance |
|
|
577
|
+
| [Midjourney](https://github.com/thenavidm/midjourney-mcp-cli) | [`@thenavidm/midjourney-mcp-cli`](https://www.npmjs.com/package/@thenavidm/midjourney-mcp-cli) 2.0.0 | Generating images and video, following jobs, downloads, moodboards, the account's library and the explore feeds, through a signed-in browser |
|
|
577
578
|
| [Teachable](https://github.com/thenavidm/teachable-mcp-cli) | [`@thenavidm/teachable-mcp-cli`](https://www.npmjs.com/package/@thenavidm/teachable-mcp-cli) 3.0.0 | Courses, users, enrollments, pricing, coupons and transactions |
|
|
578
579
|
| [Threads](https://github.com/thenavidm/threads-mcp-cli) | [`@thenavidm/threads-mcp-cli`](https://www.npmjs.com/package/@thenavidm/threads-mcp-cli) 2.0.0 | Posting, threads, carousels, replies and reply approvals, insights and keyword search |
|
|
579
580
|
| [ThriveCart](https://github.com/thenavidm/thrivecart-mcp-cli) | [`@thenavidm/thrivecart-mcp-cli`](https://www.npmjs.com/package/@thenavidm/thrivecart-mcp-cli) 3.0.0 | Products and pricing, transactions and revenue, customers, subscriptions and affiliates, across several carts |
|
package/dist/app.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export type ResourceDefinition<Ctx> = {
|
|
|
23
23
|
mimeType?: string;
|
|
24
24
|
/** A string is sent as text; anything else as JSON. */
|
|
25
25
|
read: (ctx: Ctx) => unknown | Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* False leaves the resource out of the list, such as one that reads an account
|
|
28
|
+
* nobody has connected yet. A client that sees a resource may list it to the
|
|
29
|
+
* model on every message, so one that can only fail costs tokens for nothing.
|
|
30
|
+
*/
|
|
31
|
+
listed?: (env: NodeJS.ProcessEnv) => boolean;
|
|
26
32
|
};
|
|
27
33
|
export type PromptDefinition<Ctx> = {
|
|
28
34
|
name: string;
|
package/dist/cli/help.js
CHANGED
|
@@ -9,6 +9,8 @@ import { policyEnvNames, riskMark, visibility } from "../policy.js";
|
|
|
9
9
|
import { firstSentence } from "../search.js";
|
|
10
10
|
import { flagsFor } from "./flags.js";
|
|
11
11
|
const COLUMN = 30;
|
|
12
|
+
/** The widest entry the general help aligns the others to. */
|
|
13
|
+
const WIDE = 40;
|
|
12
14
|
/** The words the CLI owns, which no tool command may take. */
|
|
13
15
|
export const BUILTINS = ["help", "tools", "schema", "agent-context", "which", "doctor", "login", "completion", "version", "data", "install"];
|
|
14
16
|
export const GLOBAL_FLAGS = [
|
|
@@ -187,6 +189,15 @@ export function renderToolHelp(tool, bin, aliases = {}) {
|
|
|
187
189
|
lines.push(``, `Risk: ${riskWords(tool)}`, ``);
|
|
188
190
|
return lines.join("\n");
|
|
189
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Two aligned columns. An entry longer than WIDE, such as a login that takes three
|
|
194
|
+
* flags, puts its help on the next line instead of padding every other row out to
|
|
195
|
+
* its width: on Substack that padding was a third of the general help's tokens.
|
|
196
|
+
*/
|
|
197
|
+
function table(rows) {
|
|
198
|
+
const width = Math.max(0, ...rows.map(([left]) => left.length).filter((length) => length <= WIDE)) + 3;
|
|
199
|
+
return ([left, help]) => (left.length <= WIDE ? ` ${left.padEnd(width)}${help}` : ` ${left}\n ${" ".repeat(width)}${help}`);
|
|
200
|
+
}
|
|
190
201
|
export function renderGeneralHelp(app, bin) {
|
|
191
202
|
const names = policyEnvNames(app.envPrefix);
|
|
192
203
|
const cache = app.allTools.some((tool) => tool.cache);
|
|
@@ -233,19 +244,19 @@ export function renderGeneralHelp(app, bin) {
|
|
|
233
244
|
];
|
|
234
245
|
// Flags that cannot apply here (jobs, the cache) are left out; agent-context lists every one.
|
|
235
246
|
const flags = GLOBAL_FLAGS.map(([flag]) => flag).filter((flag) => flag !== "--agent" && (flag !== "--wait" || jobs) && (flag !== "--refresh" || cache));
|
|
236
|
-
const
|
|
237
|
-
const
|
|
247
|
+
const commandRow = table(commands);
|
|
248
|
+
const settingRow = table(settings);
|
|
238
249
|
const lines = [
|
|
239
250
|
``,
|
|
240
251
|
`${app.title} ${app.version}`,
|
|
241
252
|
``,
|
|
242
|
-
...commands.map(
|
|
253
|
+
...commands.map(commandRow),
|
|
243
254
|
` Also: schema <command>, agent-context [--brief] (all of this as JSON), completion <shell>.`,
|
|
244
255
|
``,
|
|
245
256
|
`Flags: ${flags.join(", ")}, and --agent: compact JSON, no prompts, never confirms a write.`,
|
|
246
257
|
``,
|
|
247
258
|
`Settings:`,
|
|
248
|
-
...settings.map(
|
|
259
|
+
...settings.map(settingRow),
|
|
249
260
|
...(tuning.length ? [` Also: ${tuning.join(", ")}, described in agent-context.`] : []),
|
|
250
261
|
``,
|
|
251
262
|
`Exit codes: ${EXIT.ok} ok, ${EXIT.error} unexpected, ${EXIT.usage} usage or refused, ${EXIT.notFound} not found, ${EXIT.auth} auth, ${EXIT.api} API, ${EXIT.rateLimited} rate limited, ${EXIT.notConfigured} not configured`,
|
package/dist/server.js
CHANGED
|
@@ -69,7 +69,8 @@ export function buildServer(app, env) {
|
|
|
69
69
|
for (const tool of app.tools(env))
|
|
70
70
|
registerTool(server, app, tool, env, policy);
|
|
71
71
|
for (const resource of app.definition.resources ?? [])
|
|
72
|
-
|
|
72
|
+
if (resource.listed?.(env) ?? true)
|
|
73
|
+
registerResource(server, app, resource, env);
|
|
73
74
|
for (const prompt of app.definition.prompts ?? [])
|
|
74
75
|
registerPrompt(server, app, prompt, env);
|
|
75
76
|
return server;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thenavidm/slipway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Slipway, the TypeScript framework for MCP servers and agent-native CLIs. One tool definition ships an MCP server and a CLI, with write safety, typed results and release checks built in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|