slidemind 0.3.13 → 0.3.14
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +86 -21
- package/README.md +14 -17
- package/bin/slidemind.mjs +65 -4969
- package/package.json +1 -1
- package/skills/create-slides/SKILL.md +113 -74
- package/skills/search/SKILL.md +25 -7
- package/src/bridge/build-and-push.mjs +108 -15
- package/src/bridge/bundle.mjs +69 -0
- package/src/bridge/capture.mjs +19 -0
- package/src/bridge/client/brands.mjs +622 -0
- package/src/bridge/client/engine-routing.mjs +237 -0
- package/src/bridge/client/engine-search.mjs +310 -0
- package/src/bridge/client/engine-slides.mjs +435 -0
- package/src/bridge/client/pane-ops.mjs +335 -0
- package/src/bridge/client/presentations.mjs +587 -0
- package/src/bridge/client/render.mjs +317 -0
- package/src/bridge/client/transport.mjs +695 -0
- package/src/bridge/client.mjs +80 -3452
- package/src/bridge/config.mjs +1 -1
- package/src/bridge/engine-download.mjs +15 -2
- package/src/builders/build.mjs +11 -804
- package/src/builders/draft-check.mjs +376 -0
- package/src/builders/lint.mjs +38 -2
- package/src/builders/preview.html +799 -0
- package/src/builders/review.mjs +23 -4
- package/src/builders/visual-families.mjs +6 -8
- package/src/cli/common.mjs +179 -0
- package/src/cli/concepts.mjs +310 -0
- package/src/cli/connection.mjs +147 -0
- package/src/cli/deck.mjs +608 -0
- package/src/cli/designs.mjs +113 -0
- package/src/cli/diagnose.mjs +141 -0
- package/src/cli/download-bundle.mjs +144 -0
- package/src/cli/engine-helpers.mjs +429 -0
- package/src/cli/engine-results.mjs +320 -0
- package/src/cli/help.mjs +201 -0
- package/src/cli/install.mjs +257 -0
- package/src/cli/read.mjs +120 -0
- package/src/cli/ready.mjs +805 -0
- package/src/cli/search.mjs +608 -0
- package/src/cli/session.mjs +177 -0
- package/src/cli/setup.mjs +282 -0
- package/src/cli/slide-reuse.mjs +334 -0
- package/src/cli/status.mjs +118 -0
- package/src/cli/workspace.mjs +302 -0
- package/src/installers/codex.mjs +1 -1
- package/src/update-check.mjs +231 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { isClaudePluginInstall, updateCliInstruction } from "../install-channel.mjs";
|
|
2
|
+
|
|
3
|
+
export function publicConnectionStatus(status, client) {
|
|
4
|
+
return {
|
|
5
|
+
paired: status.paired,
|
|
6
|
+
backendCount: status.backendCount,
|
|
7
|
+
backends: (status.backends ?? []).map((b) => ({
|
|
8
|
+
env: b.env,
|
|
9
|
+
ok: b.ok,
|
|
10
|
+
readinessV1: b.readinessV1 === true,
|
|
11
|
+
capabilities: b.capabilities ?? null,
|
|
12
|
+
minCliVersion: b.minCliVersion ?? null,
|
|
13
|
+
cliUpdateRequired: b.cliUpdateRequired === true,
|
|
14
|
+
error: b.error,
|
|
15
|
+
code: b.code ?? null,
|
|
16
|
+
status: b.status ?? null,
|
|
17
|
+
summary: b.summary ?? null,
|
|
18
|
+
presentations: (b.presentations ?? []).map(client.toPublicPresentation),
|
|
19
|
+
})),
|
|
20
|
+
presentations: (status.presentations ?? []).map(client.toPublicPresentation),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// The readiness ladder splits in two, because the two halves fail
|
|
25
|
+
// independently: BACKEND AUTHORING readiness (a session, a reachable add-in
|
|
26
|
+
// backend, a supported CLI — everything render, bundle and the pane-free engine
|
|
27
|
+
// routes need) and LIVE POWERPOINT readiness (a registered window, render-ready
|
|
28
|
+
// metadata, an awake pane — what push/insert-slide and reading an open deck
|
|
29
|
+
// need). Keeping them apart is the whole point of doc 13: a dead pane is no
|
|
30
|
+
// longer "cannot work", it only defers the last mile.
|
|
31
|
+
//
|
|
32
|
+
// Each rung is a STRUCTURED blocker: `code` is the machine-copeable reason an
|
|
33
|
+
// agent switches on; `actor` says who can clear it — only `cli_update_required`
|
|
34
|
+
// is the AGENT's to fix (it can run `slidemind update`), every other rung needs
|
|
35
|
+
// a human at the add-in. The one exception is a plugin-installed CLI:
|
|
36
|
+
// `/plugin` is the only updater that replaces the binary on the session's PATH,
|
|
37
|
+
// and the agent cannot drive it, so that rung hands back to the user (see
|
|
38
|
+
// src/install-channel.mjs).
|
|
39
|
+
export function backendBlocker(pub) {
|
|
40
|
+
if (!pub.paired) {
|
|
41
|
+
return {
|
|
42
|
+
code: "not_paired",
|
|
43
|
+
actor: "user",
|
|
44
|
+
message:
|
|
45
|
+
"Not connected. In PowerPoint open slidemind → Settings → General → Connect CLI, press the link button, and run the command it shows.",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if ((pub.backends ?? []).every((b) => !b.ok)) {
|
|
49
|
+
// Something answered 503 (already retried by the probe): the add-in whose
|
|
50
|
+
// session store did not answer (code `backend_unavailable`), or a proxy in
|
|
51
|
+
// front of it with no machine code at all. The session is intact, so the
|
|
52
|
+
// remedy is to wait — never to re-pair, which is what the generic wording
|
|
53
|
+
// below invites. Same predicate as the probe's retry.
|
|
54
|
+
const unavailable = (b) =>
|
|
55
|
+
b.code === "backend_unavailable" || (b.status === 503 && b.code !== "pane_suspended");
|
|
56
|
+
if ((pub.backends ?? []).every(unavailable)) {
|
|
57
|
+
return {
|
|
58
|
+
code: "backend_unavailable",
|
|
59
|
+
actor: "agent",
|
|
60
|
+
message:
|
|
61
|
+
"The add-in backend is temporarily unavailable (its session store did not answer). " +
|
|
62
|
+
"Wait a minute and run `slidemind ready` again; the CLI session itself is fine, do not reconnect.",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
code: "all_unreachable",
|
|
67
|
+
actor: "user",
|
|
68
|
+
message:
|
|
69
|
+
"Every paired backend is unreachable. Check network/VPN/backend status, or re-pair if the environment moved.",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Version skew explains most downstream failures — surface it before pane
|
|
73
|
+
// readiness so the user fixes the right thing first.
|
|
74
|
+
const outdated = (pub.backends ?? []).find((b) => b.cliUpdateRequired);
|
|
75
|
+
if (outdated) {
|
|
76
|
+
return {
|
|
77
|
+
code: "cli_update_required",
|
|
78
|
+
actor: isClaudePluginInstall() ? "user" : "agent",
|
|
79
|
+
message:
|
|
80
|
+
`This CLI is older than the minimum the '${outdated.env}' add-in supports` +
|
|
81
|
+
`${outdated.minCliVersion ? ` (${outdated.minCliVersion})` : ""}. ` +
|
|
82
|
+
updateCliInstruction(),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// The live-PowerPoint half. Never gates render, bundle or the pane-free engine
|
|
89
|
+
// routes — it only says whether the ops that genuinely type into an open deck
|
|
90
|
+
// (push's insert, insert-slide, reading an unsaved presentation) can run now.
|
|
91
|
+
// The `message` strings are BYTE-IDENTICAL to the pre-split ladder so the
|
|
92
|
+
// diagnostic's
|
|
93
|
+
// printed output never churns.
|
|
94
|
+
export function paneBlocker(pub) {
|
|
95
|
+
if ((pub.presentations ?? []).length === 0) {
|
|
96
|
+
return {
|
|
97
|
+
code: "no_window",
|
|
98
|
+
actor: "user",
|
|
99
|
+
message:
|
|
100
|
+
"No PowerPoint window is registered. If PowerPoint is already open with the slidemind pane, bring it to the foreground (click the pane) and re-run. Otherwise open PowerPoint, load the slidemind add-in, and activate or create a corporate design.",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const renderReady = pub.presentations.some(
|
|
104
|
+
(p) =>
|
|
105
|
+
p.capabilities?.render === true ||
|
|
106
|
+
(!p.connectionState && p.connected !== false) ||
|
|
107
|
+
p.designState === "ready",
|
|
108
|
+
);
|
|
109
|
+
if (!renderReady) {
|
|
110
|
+
return {
|
|
111
|
+
code: "not_render_ready",
|
|
112
|
+
actor: "user",
|
|
113
|
+
message:
|
|
114
|
+
"PowerPoint is connected, but no window is render-ready. Wait for corporate design matching or activate/create a corporate design.",
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const paneReady = pub.presentations.some(
|
|
118
|
+
(p) =>
|
|
119
|
+
p.capabilities?.paneOps === true ||
|
|
120
|
+
((!p.connectionState || p.connectionState === "connected") &&
|
|
121
|
+
p.connected !== false &&
|
|
122
|
+
!p.suspendedAt),
|
|
123
|
+
);
|
|
124
|
+
if (!paneReady) {
|
|
125
|
+
return {
|
|
126
|
+
code: "pane_suspended",
|
|
127
|
+
actor: "user",
|
|
128
|
+
message:
|
|
129
|
+
"Rendering is available, but pane operations are suspended. Bring PowerPoint forward and click/reopen the slidemind pane before push, insert-slide, or reading this window.",
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// The two ladders end-to-end, in the order a user hits them: nothing about a
|
|
136
|
+
// window matters while the backend half is unmet. `slidemind ready` layers
|
|
137
|
+
// `ambiguous_design` on top and treats `pane_suspended` as non-blocking (a
|
|
138
|
+
// render-ready-but-suspended window is still a design source).
|
|
139
|
+
export function connectionBlocker(pub) {
|
|
140
|
+
return backendBlocker(pub) ?? paneBlocker(pub);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Back-compat projection for the diagnostic: just the blocker's message, or "Ready."
|
|
144
|
+
// when the ladder is clear. Keeps the ladder authored in ONE place.
|
|
145
|
+
export function connectionNextAction(pub) {
|
|
146
|
+
return connectionBlocker(pub)?.message ?? "Ready.";
|
|
147
|
+
}
|