pageship 0.4.0 → 0.4.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/dist/cli.mjs +42 -5
- package/dist/skills/pageship/SKILL.md +2 -2
- package/dist/skills/pageship-chart/SKILL.md +1 -1
- package/dist/skills/pageship-code-block/SKILL.md +1 -1
- package/dist/skills/pageship-decision-record/SKILL.md +1 -1
- package/dist/skills/pageship-diagram/SKILL.md +1 -1
- package/dist/skills/pageship-docs/SKILL.md +1 -1
- package/dist/skills/pageship-explainer/SKILL.md +1 -1
- package/dist/skills/pageship-interaction/SKILL.md +1 -1
- package/dist/skills/pageship-key-figures/SKILL.md +1 -1
- package/dist/skills/pageship-media/SKILL.md +1 -1
- package/dist/skills/pageship-motion/SKILL.md +1 -1
- package/dist/skills/pageship-plan/SKILL.md +1 -1
- package/dist/skills/pageship-report/SKILL.md +1 -1
- package/dist/skills/pageship-review-report/SKILL.md +1 -1
- package/dist/skills/pageship-slide-deck/SKILL.md +1 -1
- package/dist/skills/pageship-spec/SKILL.md +1 -1
- package/dist/skills/pageship-table/SKILL.md +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1422,7 +1422,7 @@ function commandLine(command, args) {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
//#endregion
|
|
1424
1424
|
//#region package.json
|
|
1425
|
-
var version = "0.4.
|
|
1425
|
+
var version = "0.4.1";
|
|
1426
1426
|
//#endregion
|
|
1427
1427
|
//#region src/publish.ts
|
|
1428
1428
|
const execute = promisify(execFile);
|
|
@@ -2368,6 +2368,16 @@ const nodeOnPath = () => new Promise((resolve) => {
|
|
|
2368
2368
|
windowsHide: true
|
|
2369
2369
|
}, (error, stdout) => resolve(error ? void 0 : stdout.trim()));
|
|
2370
2370
|
});
|
|
2371
|
+
const Published = Schema.Struct({ version: Schema.String });
|
|
2372
|
+
const decodePublished = Schema.decodeUnknownOption(Published);
|
|
2373
|
+
/** The latest version on npm, read with a short timeout. Any failure means unknown. */
|
|
2374
|
+
const npmLatest = (signal) => fetch("https://registry.npmjs.org/pageship/latest", {
|
|
2375
|
+
headers: { Accept: "application/json" },
|
|
2376
|
+
signal: AbortSignal.any([signal, AbortSignal.timeout(5e3)])
|
|
2377
|
+
}).then((response) => response.ok ? response.json() : void 0).then((body) => Option.match(decodePublished(body), {
|
|
2378
|
+
onNone: () => void 0,
|
|
2379
|
+
onSome: ({ version }) => /^\d+\.\d+\.\d+/u.test(version) ? version : void 0
|
|
2380
|
+
})).catch(() => void 0);
|
|
2371
2381
|
const Entry = Schema.Union([Schema.Struct({
|
|
2372
2382
|
version: Schema.String,
|
|
2373
2383
|
hash: Schema.String
|
|
@@ -2444,6 +2454,23 @@ const older = (installed, cli) => {
|
|
|
2444
2454
|
}
|
|
2445
2455
|
return false;
|
|
2446
2456
|
};
|
|
2457
|
+
/**
|
|
2458
|
+
* Whether npm publishes a newer CLI than this one. `cli` is absent when the registry did not
|
|
2459
|
+
* answer, so an offline status still succeeds. Only reads.
|
|
2460
|
+
*/
|
|
2461
|
+
async function inspectCli(environment, signal) {
|
|
2462
|
+
const latest = await environment.publishedVersion(signal);
|
|
2463
|
+
if (latest === void 0) return {};
|
|
2464
|
+
if (!older(environment.version, latest)) return {
|
|
2465
|
+
cli: "current",
|
|
2466
|
+
latest
|
|
2467
|
+
};
|
|
2468
|
+
return {
|
|
2469
|
+
cli: "older",
|
|
2470
|
+
latest,
|
|
2471
|
+
message: `A newer Pageship CLI is published (${latest}; this is ${environment.version}). Update it with the package manager that installed it, then run ${commandLine(installNext.command, installNext.args)}.`
|
|
2472
|
+
};
|
|
2473
|
+
}
|
|
2447
2474
|
/** The recommended skills and Node that the CLI could not find. It installs none of them. */
|
|
2448
2475
|
async function findMissing(environment) {
|
|
2449
2476
|
const { home } = environment;
|
|
@@ -2612,12 +2639,21 @@ async function installSkills(environment, { force, signal }) {
|
|
|
2612
2639
|
* directory, including creating it.
|
|
2613
2640
|
*/
|
|
2614
2641
|
async function checkStatus(serverValue, signal, skillsEnvironment) {
|
|
2615
|
-
const [readiness, { message, ...skills }] = await Promise.all([
|
|
2616
|
-
|
|
2642
|
+
const [readiness, { message, ...skills }, { message: cliMessage, ...cli }] = await Promise.all([
|
|
2643
|
+
checkReadiness(serverValue, signal),
|
|
2644
|
+
inspectSkills(skillsEnvironment),
|
|
2645
|
+
inspectCli(skillsEnvironment, signal)
|
|
2646
|
+
]);
|
|
2647
|
+
const install = readiness.status === "admitted" && !readiness.next && skills.skills !== "current" && cli.cli !== "older";
|
|
2617
2648
|
return {
|
|
2618
2649
|
...readiness,
|
|
2619
2650
|
...skills,
|
|
2620
|
-
|
|
2651
|
+
...cli,
|
|
2652
|
+
message: [
|
|
2653
|
+
readiness.message,
|
|
2654
|
+
cliMessage,
|
|
2655
|
+
message
|
|
2656
|
+
].filter(Boolean).join("\n"),
|
|
2621
2657
|
...install ? { next: installNext } : {}
|
|
2622
2658
|
};
|
|
2623
2659
|
}
|
|
@@ -2774,7 +2810,8 @@ const skillsEnvironment = {
|
|
|
2774
2810
|
version,
|
|
2775
2811
|
home: homedir(),
|
|
2776
2812
|
platform: process.platform,
|
|
2777
|
-
nodeVersion: nodeOnPath
|
|
2813
|
+
nodeVersion: nodeOnPath,
|
|
2814
|
+
publishedVersion: npmLatest
|
|
2778
2815
|
};
|
|
2779
2816
|
const status = Command.make("status", { server: serverFlag }, ({ server }) => authCommand("status", (signal) => checkStatus(Option.getOrUndefined(server), signal, skillsEnvironment))).pipe(Command.withDescription("Check the service, sign-in, personal workspace, address and Pageship skills without changing anything."));
|
|
2780
2817
|
const skills = Command.make("skills").pipe(Command.withDescription("Manage the Pageship skills that ship with this CLI."), Command.withSubcommands([Command.make("install", { force: Flag.boolean("force").pipe(Flag.withDefault(false), Flag.withDescription("Replace Pageship skill folders that were changed or not installed by this CLI.")) }, ({ force }) => authCommand("skills", (signal) => installSkills(skillsEnvironment, {
|
|
@@ -3,7 +3,7 @@ name: pageship
|
|
|
3
3
|
description: Publish an HTML file to Pageship and manage what is published. Use when the user asks to publish, share or get a link to a document, update its published copy, change its visibility, list, inspect history, download or restore published documents, or sign in to Pageship. To write, edit, rename or move a document, load pageship-docs instead.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Pageship
|
|
@@ -50,7 +50,7 @@ pageship --json status
|
|
|
50
50
|
|
|
51
51
|
Status only reads; it never signs in, claims an address or uploads. On `admitted`, sign-in and the workspace address are set, unless `next` is a `login`: that comes from an older server that does not report the address, and running it confirms the address. A `next` of `skills install` on `admitted` is about the skills, below. On `signed_out` or `address_required`, sign in as described below. On `uninvited`, report the `message`: the user must ask the server owner for an invitation, or sign in with another account using `login --restart`. On `unreachable`, `client_too_old`, `server_too_old`, `unsupported` or `configuration_unreadable`, report the `message`; signing in does not fix these. A ready status does not prove that a publish will succeed.
|
|
52
52
|
|
|
53
|
-
Status also reports the Pageship skills in `skills`: `missing`, `current` or `older` than the CLI. They never block publishing, and a status that is otherwise ready still succeeds. When `skills` is `missing` or `older`, tell the user, and install them as below only if they agree. Never run a `skills install` from `next` without asking.
|
|
53
|
+
Status also reports the Pageship skills in `skills`: `missing`, `current` or `older` than the CLI. They never block publishing, and a status that is otherwise ready still succeeds. When `skills` is `missing` or `older`, tell the user, and install them as below only if they agree. Never run a `skills install` from `next` without asking. When `cli` is `older`, a newer CLI is published: tell the user, and offer to update it with the package manager that installed it before installing the skills.
|
|
54
54
|
|
|
55
55
|
## Install the Pageship skills
|
|
56
56
|
|
|
@@ -3,7 +3,7 @@ name: pageship-chart
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for charts in a Pageship HTML document, loaded by a pageship- kind skill before it draws a chart.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Chart
|
|
@@ -3,7 +3,7 @@ name: pageship-code-block
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for code in a Pageship HTML document, such as source code, commands, configuration or logs, loaded by a pageship- kind skill before the first code block.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Code block
|
|
@@ -3,7 +3,7 @@ name: pageship-decision-record
|
|
|
3
3
|
description: HTML decision records, as the second step of pageship-docs. For any request to record, write, regenerate, edit or move a decision, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Decision record
|
|
@@ -3,7 +3,7 @@ name: pageship-diagram
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for diagrams in a Pageship HTML document, such as a process, a timeline, a system map or states, loaded by a pageship- kind skill before it draws a diagram.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Diagram
|
|
@@ -3,7 +3,7 @@ name: pageship-docs
|
|
|
3
3
|
description: First step for any document people read, such as a report, plan, spec, explainer, review, decision record or slide deck, in HTML or Markdown. Load it before any other pageship- skill. Use when the user asks for one of these documents, asks to regenerate, redesign, edit, rename, move or copy an HTML source file, or asks to record whether they want HTML or Markdown.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Pageship documents
|
|
@@ -3,7 +3,7 @@ name: pageship-explainer
|
|
|
3
3
|
description: HTML explainers, as the second step of pageship-docs. For any request to explain how something works, or to write, regenerate, edit or move an explainer, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Explainer
|
|
@@ -3,7 +3,7 @@ name: pageship-interaction
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for controls in a Pageship HTML document, such as stepping through stages, tracing a path, tabs, filters, revealing detail and pointer states on charts and diagrams, loaded by a pageship- kind skill before it adds any control.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Interaction
|
|
@@ -3,7 +3,7 @@ name: pageship-key-figures
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for the few numbers and callouts a Pageship HTML document opens with, loaded by a pageship- kind skill before it writes key figures.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Key figures
|
|
@@ -3,7 +3,7 @@ name: pageship-media
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for images, video and audio in a Pageship HTML document, loaded by a pageship- kind skill before it shows media.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Media
|
|
@@ -3,7 +3,7 @@ name: pageship-motion
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for animation and transitions in a Pageship HTML document, such as a chart that grows into view, a sequence that plays through a diagram, or a marker moving along a path, loaded by a pageship- kind skill before it draws a chart, a graphic or a sequence, or before anything else on the page moves.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Motion
|
|
@@ -3,7 +3,7 @@ name: pageship-plan
|
|
|
3
3
|
description: HTML plans, as the second step of pageship-docs. For any request to write, regenerate, edit or move a plan, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Plan
|
|
@@ -3,7 +3,7 @@ name: pageship-report
|
|
|
3
3
|
description: HTML reports, as the second step of pageship-docs. For any request to write, regenerate, edit or move a report, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Report
|
|
@@ -3,7 +3,7 @@ name: pageship-review-report
|
|
|
3
3
|
description: HTML review reports, as the second step of pageship-docs. For any request to review a change or a plan and write up the findings, or to write, regenerate, edit or move a review report, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Review report
|
|
@@ -3,7 +3,7 @@ name: pageship-slide-deck
|
|
|
3
3
|
description: HTML slide decks, as the second step of pageship-docs. For any request to make slides or a presentation, or to regenerate, edit or move a deck, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Slide deck
|
|
@@ -3,7 +3,7 @@ name: pageship-spec
|
|
|
3
3
|
description: HTML specs, as the second step of pageship-docs. For any request to write, regenerate, edit or move a spec, load pageship-docs first; load this skill first only when the user names it.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Spec
|
|
@@ -3,7 +3,7 @@ name: pageship-table
|
|
|
3
3
|
description: Later step of pageship-docs: for a request to write or edit a document, load pageship-docs first; load this skill first only when the user names it. Pattern for tables in a Pageship HTML document, loaded by a pageship- kind skill before it writes a table.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.4.
|
|
6
|
+
version: "0.4.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Table
|