@office-kit/pptx-dev 0.2.4 → 0.4.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 +66 -3
- package/dist/cli.mjs +510 -7
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/terminal-client.css +285 -0
- package/dist/terminal-client.js +53 -0
- package/dist/worker.mjs +2 -1
- package/dist/worker.mjs.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npm run dev
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Open the local URL printed by the server. Save a slide file, `theme.ts` or `deck.tsx` to rebuild. The viewer
|
|
20
|
-
has a vertical thumbnail strip
|
|
20
|
+
has a vertical thumbnail strip, a large slide canvas and an AI chat panel on the right. Click a thumbnail or use
|
|
21
21
|
arrow keys, Page Up/Down, Home/End to navigate. Fit/zoom and Present (Escape to
|
|
22
22
|
exit) are viewing controls; the canvas has no editing, dragging or resize handles.
|
|
23
23
|
Changes are made only in TSX, including when an AI agent edits the presentation.
|
|
@@ -43,7 +43,70 @@ The generated `CLAUDE.md` explains authoring conventions. VSCode picks up the
|
|
|
43
43
|
included `tsconfig.json` for completion and diagnostics. Start the **Preview
|
|
44
44
|
presentation** task, then use **Simple Browser: Show** with the printed URL and
|
|
45
45
|
move it to a side editor group. No custom editor extension is needed for this
|
|
46
|
-
workflow.
|
|
46
|
+
workflow. Clicking a slide supplies chat context; opening its exact TSX location is not implemented.
|
|
47
|
+
|
|
48
|
+
## Chat in the preview
|
|
49
|
+
|
|
50
|
+
The right panel defaults to **Claude Code**. Click **Start** to open the locally
|
|
51
|
+
installed `claude` CLI in an interactive terminal. Install and sign in to Claude
|
|
52
|
+
Code first. Use a current version with HTTP `UserPromptSubmit` hook support.
|
|
53
|
+
The session runs in the deck entry's directory and uses your normal account,
|
|
54
|
+
user/project settings, CLAUDE.md, plugins, skills, MCP servers and hooks.
|
|
55
|
+
|
|
56
|
+
Type `/model` to choose a model, `/config` to change settings, or `/` to browse
|
|
57
|
+
available commands and skills. Bash and other tools are available according to
|
|
58
|
+
Claude Code's own configuration, and permission prompts are answered directly in
|
|
59
|
+
the panel. The preview does not force `acceptEdits`, restrict the tool list or
|
|
60
|
+
bypass permissions. Installation and account setup use the CLI's usual flow.
|
|
61
|
+
Markdown responses are displayed by Claude Code's terminal renderer; its native
|
|
62
|
+
formatting may differ from a web Markdown page. OS-specific actions such as
|
|
63
|
+
opening an external editor still use your local environment.
|
|
64
|
+
|
|
65
|
+
Each submitted Claude prompt receives the focused slide's **1-based number,
|
|
66
|
+
text, slide count, preview revision, deck entry and source dependency paths**,
|
|
67
|
+
plus any build error, through a session-scoped `UserPromptSubmit` HTTP hook.
|
|
68
|
+
The preview captures context with terminal input before forwarding it to the
|
|
69
|
+
CLI. Navigation while Claude is replying does not change that turn's context.
|
|
70
|
+
Stale input is rejected with a retry message. If your Claude settings or managed
|
|
71
|
+
policy disable hooks, automatic context attachment is unavailable; enable the
|
|
72
|
+
preview hook in Claude Code to use it. No project settings file is rewritten.
|
|
73
|
+
Dependency paths are source candidates, not an exact slide-to-file mapping.
|
|
74
|
+
“This slide” requests a focused patch; requests about another slide or the
|
|
75
|
+
whole deck can edit other files or shared styling.
|
|
76
|
+
|
|
77
|
+
Reloading the browser reconnects to the same process and replays its recent
|
|
78
|
+
terminal output (up to 2 MB). One browser tab controls the session; other tabs
|
|
79
|
+
can view it. Keep the owning tab open, or end the session there before moving to
|
|
80
|
+
another tab. **End session** stops the process; saved edits remain. Start opens
|
|
81
|
+
a new session, and Claude's `/resume` command can restore an earlier conversation.
|
|
82
|
+
Stopping the dev server also stops the embedded session. This is independent of
|
|
83
|
+
the Claude Code conversation that may have launched your dev server.
|
|
84
|
+
|
|
85
|
+
Select **Codex** while Claude Code is stopped to use the existing message-based
|
|
86
|
+
chat. Codex replies render Markdown (including lists, code blocks and tables);
|
|
87
|
+
raw HTML, unsafe links and remote images are not rendered. Codex still uses
|
|
88
|
+
`exec --json` with the `workspace-write` sandbox and its installed CLI login.
|
|
89
|
+
Operations requiring interactive approval are not supported in this adapter.
|
|
90
|
+
The most recent 12 messages (bounded text) and the focused slide are sent with
|
|
91
|
+
each request. The dev server retains up to 100 messages until it exits.
|
|
92
|
+
**New chat** clears this history; **Stop** cancels the running edit. Ctrl/Cmd+Enter
|
|
93
|
+
sends a message. Model/settings menus in the embedded terminal are currently
|
|
94
|
+
specific to Claude Code.
|
|
95
|
+
|
|
96
|
+
Use **Chat** in the header to hide/show the panel. On narrow screens the panel
|
|
97
|
+
moves below the preview. Presentation mode hides it without ending the session.
|
|
98
|
+
Both providers save TSX directly, which triggers the usual automatic rebuild.
|
|
99
|
+
The server binds to loopback and requires same-origin JSON for terminal control;
|
|
100
|
+
the local context hook uses a separate per-server token.
|
|
101
|
+
|
|
102
|
+
The terminal uses `node-pty` and xterm.js. Linux systems without a matching PTY
|
|
103
|
+
prebuild need the native build prerequisites documented by
|
|
104
|
+
[node-pty](https://github.com/microsoft/node-pty). With pnpm, allow `node-pty`'s
|
|
105
|
+
install script (`pnpm approve-builds`) if your project blocks dependency scripts.
|
|
106
|
+
|
|
107
|
+
References: [Claude Code commands](https://code.claude.com/docs/en/commands),
|
|
108
|
+
[Claude Code hooks](https://code.claude.com/docs/en/hooks), and
|
|
109
|
+
[Codex non-interactive mode](https://developers.openai.com/codex/noninteractive).
|
|
47
110
|
|
|
48
111
|
## Edit only what changed
|
|
49
112
|
|
|
@@ -86,7 +149,7 @@ preview server binds to `127.0.0.1` and rejects unexpected Host headers.
|
|
|
86
149
|
|
|
87
150
|
Programmatic exports: `buildDeck`, `exportDeck`, `initProject`, `inspectTemplate`.
|
|
88
151
|
`buildDeck` returns PPTX bytes, SVG slides, aspect ratio, module dependencies and
|
|
89
|
-
core validation diagnostics. Browser APIs and DOM globals are not available in
|
|
152
|
+
slide text and core validation diagnostics. Browser APIs and DOM globals are not available in
|
|
90
153
|
TSX evaluation.
|
|
91
154
|
|
|
92
155
|
## Developing in this monorepo
|