pi-minimal 0.1.0 → 0.2.2

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.
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -1,29 +1,193 @@
1
1
  name: Publish
2
2
 
3
+ # Publishes automatically when the version in package.json changes on main:
4
+ # verifies the build, tags vX.Y.Z, creates a GitHub Release (CHANGELOG section +
5
+ # auto-generated notes), records a deployment to the "npm" environment, and
6
+ # publishes to npm via trusted publishing (OIDC; no token). Pushes that do not
7
+ # change the version are a no-op.
8
+ #
9
+ # This file name is registered with npm as the trusted publisher for pi-minimal.
10
+ # Renaming it breaks publishing until npm's trusted-publisher config is updated.
11
+
3
12
  on:
4
- release:
5
- types: [published]
13
+ push:
14
+ branches: [main]
15
+ workflow_dispatch:
16
+
17
+ concurrency:
18
+ group: publish
19
+ cancel-in-progress: false
6
20
 
7
21
  permissions:
8
- contents: read
22
+ contents: write
23
+ deployments: write
9
24
  id-token: write
25
+ pull-requests: read
10
26
 
11
27
  jobs:
12
- publish:
28
+ detect:
29
+ name: Detect version change
13
30
  runs-on: ubuntu-latest
14
- environment: npm
31
+ outputs:
32
+ publish: ${{ steps.check.outputs.publish }}
33
+ tag_exists: ${{ steps.check.outputs.tag_exists }}
34
+ version: ${{ steps.check.outputs.version }}
35
+ tag: ${{ steps.check.outputs.tag }}
36
+ previous_tag: ${{ steps.check.outputs.previous_tag }}
15
37
  steps:
16
38
  - uses: actions/checkout@v4
39
+ with:
40
+ fetch-depth: 0
17
41
  - uses: actions/setup-node@v4
18
42
  with:
19
43
  node-version: 22.19.0
20
- registry-url: https://registry.npmjs.org
21
- cache: npm
22
- - run: npm ci
23
- - run: npm run lint
24
- - run: npm test
25
- - run: npm run build
26
- - run: git diff --exit-code -- dist
27
- - run: npm publish --access public
44
+ - id: check
28
45
  env:
29
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46
+ GH_TOKEN: ${{ github.token }}
47
+ run: |
48
+ set -euo pipefail
49
+ name=$(node -p "require('./package.json').name")
50
+ version=$(node -p "require('./package.json').version")
51
+ tag="v$version"
52
+ echo "version=$version" >> "$GITHUB_OUTPUT"
53
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
54
+ previous_tag=$(git tag --list 'v*' --sort=-v:refname | grep -vx "$tag" | head -n1 || true)
55
+ echo "previous_tag=$previous_tag" >> "$GITHUB_OUTPUT"
56
+
57
+ tag_exists=false
58
+ if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then tag_exists=true; fi
59
+ echo "tag_exists=$tag_exists" >> "$GITHUB_OUTPUT"
60
+
61
+ if npm view "$name@$version" version >/dev/null 2>&1; then
62
+ echo "::notice::$name@$version is already on npm; nothing to publish."
63
+ echo "publish=false" >> "$GITHUB_OUTPUT"; exit 0
64
+ fi
65
+ echo "publish=true" >> "$GITHUB_OUTPUT"
66
+ if [ "$tag_exists" = true ]; then
67
+ echo "::notice::$tag exists but $name@$version is not on npm; publishing (re-run)."
68
+ else
69
+ echo "::notice::New version $version detected (previous tag: ${previous_tag:-none})."
70
+ fi
71
+
72
+ release:
73
+ name: Tag, release, publish ${{ needs.detect.outputs.tag }}
74
+ needs: detect
75
+ if: needs.detect.outputs.publish == 'true'
76
+ runs-on: ubuntu-latest
77
+ environment:
78
+ name: npm
79
+ url: https://www.npmjs.com/package/pi-minimal/v/${{ needs.detect.outputs.version }}
80
+ env:
81
+ VERSION: ${{ needs.detect.outputs.version }}
82
+ TAG: ${{ needs.detect.outputs.tag }}
83
+ PREVIOUS_TAG: ${{ needs.detect.outputs.previous_tag }}
84
+ GH_TOKEN: ${{ github.token }}
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+ with:
88
+ fetch-depth: 0
89
+ # No registry-url here: setup-node would write an .npmrc with a placeholder
90
+ # NODE_AUTH_TOKEN, and npm then sends that instead of exchanging the OIDC
91
+ # token, which the registry rejects with a 404. Trusted publishing needs
92
+ # no token configured at all.
93
+ - uses: actions/setup-node@v4
94
+ with:
95
+ node-version: 22.19.0
96
+ cache: npm
97
+
98
+ - name: Verify
99
+ run: |
100
+ npm ci
101
+ npm run lint
102
+ npm run typecheck
103
+ npm test
104
+ npm run build
105
+ git diff --exit-code -- dist
106
+
107
+ - name: Compose release notes
108
+ id: notes
109
+ run: |
110
+ set -euo pipefail
111
+ notes=release-notes.md
112
+ : > "$notes"
113
+
114
+ # 1. Hand-written section from CHANGELOG.md, if present ("## [X.Y.Z] ..." until next "## ").
115
+ if [ -f CHANGELOG.md ]; then
116
+ section=$(awk -v v="$VERSION" '
117
+ /^## \[/ { if (found) exit; found = index($0, "[" v "]") > 0; next }
118
+ found && /^\[[^]]+\]: / { exit }
119
+ found { print }' CHANGELOG.md | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}')
120
+ if [ -n "$section" ]; then
121
+ printf '%s\n\n' "$section" >> "$notes"
122
+ else
123
+ echo "::warning::CHANGELOG.md has no section for [$VERSION]; using generated notes only."
124
+ fi
125
+ fi
126
+
127
+ # 2. GitHub-generated notes (merged PRs / commits since the previous tag).
128
+ body=$(gh api -X POST "repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
129
+ -f tag_name="$TAG" -f target_commitish="$GITHUB_SHA" \
130
+ ${PREVIOUS_TAG:+-f previous_tag_name="$PREVIOUS_TAG"} --jq .body)
131
+ printf '%s\n\n' "$body" >> "$notes"
132
+
133
+ # 3. Install footer.
134
+ cat >> "$notes" <<EOF
135
+ ---
136
+ **Install / upgrade**
137
+ \`\`\`bash
138
+ pi install npm:pi-minimal@$VERSION # or: pi update --extensions
139
+ \`\`\`
140
+ EOF
141
+ echo "file=$notes" >> "$GITHUB_OUTPUT"
142
+ echo "### Release notes for $TAG" >> "$GITHUB_STEP_SUMMARY"
143
+ cat "$notes" >> "$GITHUB_STEP_SUMMARY"
144
+
145
+ - name: Create tag and GitHub Release
146
+ run: |
147
+ set -euo pipefail
148
+ if [ "${{ needs.detect.outputs.tag_exists }}" != true ]; then
149
+ git config user.name "github-actions[bot]"
150
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
151
+ git tag -a "$TAG" -m "pi-minimal $VERSION" "$GITHUB_SHA"
152
+ git push origin "refs/tags/$TAG"
153
+ else
154
+ echo "Tag $TAG already exists; not re-tagging."
155
+ fi
156
+ if gh release view "$TAG" >/dev/null 2>&1; then
157
+ echo "Release $TAG already exists; updating notes."
158
+ gh release edit "$TAG" --notes-file "${{ steps.notes.outputs.file }}"
159
+ else
160
+ gh release create "$TAG" \
161
+ --target "$GITHUB_SHA" \
162
+ --title "pi-minimal $VERSION" \
163
+ --notes-file "${{ steps.notes.outputs.file }}" \
164
+ --verify-tag
165
+ fi
166
+
167
+ - name: Upgrade npm for trusted publishing
168
+ # Node 22 bundles npm 10.x; OIDC trusted publishing needs npm >= 11.5.1.
169
+ # npm 12 requires Node >= 22.22.2, so stay on the 11.x line for Node 22.19.
170
+ run: |
171
+ npm install -g npm@11
172
+ npm --version
173
+
174
+ - name: Publish to npm (trusted publishing)
175
+ # No NODE_AUTH_TOKEN: npm authenticates with the job's OIDC token and
176
+ # generates provenance automatically.
177
+ run: |
178
+ npm config get registry
179
+ npm whoami 2>/dev/null || echo "no token configured (expected for OIDC)"
180
+ npm publish --access public
181
+
182
+ - name: Attach package tarball to release
183
+ run: |
184
+ npm pack --silent
185
+ gh release upload "$TAG" ./pi-minimal-"$VERSION".tgz --clobber
186
+
187
+ - name: Summary
188
+ run: |
189
+ {
190
+ echo "### Published"
191
+ echo "- Release: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/$TAG"
192
+ echo "- npm: https://www.npmjs.com/package/pi-minimal/v/$VERSION"
193
+ } >> "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,42 @@
1
+ name: Release (manual fallback)
2
+
3
+ # Normal releases are fully automatic: bump the version in package.json on main
4
+ # and .github/workflows/publish.yml tags, releases, and publishes via trusted
5
+ # publishing. Use this only to re-run the npm publish for an existing release
6
+ # when the automated path fails; it authenticates with the NPM_TOKEN secret.
7
+
8
+ on:
9
+ workflow_dispatch:
10
+ inputs:
11
+ tag:
12
+ description: "Existing release tag to publish (e.g. v0.2.0)"
13
+ required: true
14
+
15
+ permissions:
16
+ contents: read
17
+ id-token: write
18
+
19
+ jobs:
20
+ publish:
21
+ runs-on: ubuntu-latest
22
+ environment:
23
+ name: npm
24
+ url: https://www.npmjs.com/package/pi-minimal
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ with:
28
+ ref: ${{ inputs.tag }}
29
+ - uses: actions/setup-node@v4
30
+ with:
31
+ node-version: 22.19.0
32
+ registry-url: https://registry.npmjs.org
33
+ cache: npm
34
+ - run: npm ci
35
+ - run: npm run lint
36
+ - run: npm test
37
+ - run: npm run build
38
+ - run: git diff --exit-code -- dist
39
+ - run: npm install -g npm@11
40
+ - run: npm publish --access public --provenance
41
+ env:
42
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,81 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ Releases are cut automatically: when the `version` in `package.json` changes on
8
+ `main`, the Publish workflow tags it, publishes to npm, and uses the matching
9
+ `## [x.y.z]` section below as the top of the release notes.
10
+
11
+ ## [Unreleased]
12
+
13
+ ## [0.2.2] - 2026-10-22
14
+
15
+ ### Added
16
+ - Fenced code renders as a closed box (`╭─ lang ─╮` / `│ code │` / `╰───╯`)
17
+ instead of literal ``` lines, keeping syntax highlighting; long lines wrap
18
+ inside the box. pi-tui exposes no hook for this, so pi-minimal post-processes
19
+ the code token's rendered lines.
20
+
21
+ ### Changed
22
+ - Chrome margin (status line, footer, turn rule, tool rows) follows pi's
23
+ `outputPad` setting so it lines up with transcript text. Set
24
+ `editorPaddingX` to the same value for a flush left edge.
25
+ - Chrome modules tolerate a stale `chrome` module after `/reload`, which
26
+ previously could crash the renderer when the package was updated in place.
27
+ - `mdCodeBlockBorder` in `minimal-dark` is a faint grey again (it frames the
28
+ box now) instead of background-coloured.
29
+
30
+ ## [0.2.1] - 2026-10-22
31
+
32
+ ### Added
33
+ - Automated releases: when `version` in `package.json` changes on `main`, the
34
+ Publish workflow verifies the build, tags `vX.Y.Z`, creates a GitHub Release
35
+ (CHANGELOG section + generated notes + package tarball), records a deployment
36
+ to the `npm` environment, and publishes to npm via OIDC trusted publishing.
37
+ - `CHANGELOG.md` and a "Releasing" section in the README.
38
+ - The Publish workflow upgrades npm to >= 11.5.1 (required for OIDC trusted
39
+ publishing) and is re-runnable: an existing tag whose version is missing
40
+ from npm is published without re-tagging.
41
+ - `repository`, `homepage`, and `bugs` fields in `package.json`, required for
42
+ npm provenance verification.
43
+
44
+ ### Changed
45
+ - The release-triggered publish workflow is now a manual, token-based fallback
46
+ (`release.yml`) for re-publishing an existing tag.
47
+
48
+ ## [0.2.0] - 2026-10-22
49
+
50
+ ### Added
51
+ - One-line tool rows for the built-in tools with a status glyph (`◐` running,
52
+ `✓` ok, `✗` failed), a fixed verb column, and a right-aligned outcome
53
+ (`34 lines · 1.0s`, `exit 1`, `+3 −1`, `4 matches`, `2.1 KB`).
54
+ - Failed rows show the first line of output underneath; `ctrl+o` expands the
55
+ full output as a `│`-ruled block.
56
+ - A dim turn rule (`── 15:51 · 12s · 4 tools ──`) after every agent run,
57
+ stored as a custom entry that never enters model context.
58
+ - `┊` gutter on thinking paragraphs.
59
+ - Status line shows the git branch and dirty count (`⎇ main ±1`) and colours
60
+ the context meter amber at 70 % and red at 90 %.
61
+ - Footer key hints appear only when idle with an empty editor; `/compact` is
62
+ suggested under context pressure.
63
+ - `minimal-dark` theme shipped with the package.
64
+
65
+ ### Changed
66
+ - Tool renderers are attached with `registerToolRenderer` at extension load
67
+ instead of re-registering the built-in tools in `session_start`, so resumed
68
+ transcripts render the same way as new messages.
69
+ - Requires pi `>=1.4.0`.
70
+
71
+ ## [0.1.0] - 2026-09-23
72
+
73
+ ### Added
74
+ - Initial release: header/footer chrome, compact tool activity rows, working
75
+ status line, Herdr sibling status, Gauntlet widget hiding.
76
+
77
+ [Unreleased]: https://github.com/raviy06/pi-minimal/compare/v0.2.2...HEAD
78
+ [0.2.2]: https://github.com/raviy06/pi-minimal/compare/v0.2.1...v0.2.2
79
+ [0.2.1]: https://github.com/raviy06/pi-minimal/compare/v0.2.0...v0.2.1
80
+ [0.2.0]: https://github.com/raviy06/pi-minimal/compare/v0.1.0...v0.2.0
81
+ [0.1.0]: https://github.com/raviy06/pi-minimal/releases/tag/v0.1.0
package/README.md CHANGED
@@ -5,7 +5,7 @@ A Pi coding-agent package.
5
5
  ## Requirements
6
6
 
7
7
  - Node.js `>=22.19.0`
8
- - Pi `>=0.84.4`
8
+ - Pi `>=1.4.0` (uses `registerToolRenderer`, `registerEntryRenderer`, `registerMarkdownTransformer`)
9
9
 
10
10
  No other Pi extension is required. Pi supplies the peer packages used by this extension.
11
11
 
@@ -16,12 +16,29 @@ Optional integrations:
16
16
 
17
17
  ## Installation
18
18
 
19
+ ```bash
20
+ pi install npm:pi-minimal
21
+ ```
22
+
23
+ Git installation also works:
24
+
19
25
  ```bash
20
26
  pi install git:github.com/raviy06/pi-minimal
21
27
  ```
22
28
 
23
29
  Do not load this package beside the live `grok-chrome` extension. Disable or remove `grok-chrome` before enabling `pi-minimal`.
24
30
 
31
+ ## What it changes
32
+
33
+ - **Tool rows** – every built-in tool call (`bash`, `read`, `edit`, `write`, `grep`, `find`, `ls`) renders as one line: status glyph (`◐` running, `✓` ok, `✗` failed), verb, item, and a right-aligned outcome (`34 lines · 1.0s`, `exit 1`, `+3 −1`, `4 matches`). Failed rows show the first line of output underneath; `ctrl+o` expands full output in a `│`-ruled block.
34
+ - **Turn rule** – after each agent run a dim `── 15:51 · 12s · 4 tools ──` separator is appended (stored as a custom entry; never sent to the model).
35
+ - **Thinking gutter** – thinking paragraphs are prefixed with `┊` so they read as secondary.
36
+ - **Status line** – one line above the editor: model · thinking level · context meter (amber at 70 %, red at 90 %) · cwd · `⎇ branch ±dirty` · Herdr siblings.
37
+ - **Footer** – key hints appear only when the agent is idle and the editor is empty; `/compact` is suggested under context pressure.
38
+ - **Code blocks** – fenced code renders as a closed box with the language as its title, keeping syntax highlighting, instead of literal ``` lines; long lines wrap inside the box.
39
+ - **Alignment** – chrome follows pi's `outputPad` setting. Pi's editor uses the separate `editorPaddingX` setting (default `0`); set `"editorPaddingX": 1` for a flush left edge with the transcript.
40
+ - **Theme** – ships `minimal-dark`: neutral tool backgrounds, visible user-message tint, dimmer thinking text, violet headings (yellow is reserved for warnings), and faint code-block frames. Select it in `/settings` → Theme, or set `"theme": "minimal-dark"`.
41
+
25
42
  ## Configuration
26
43
 
27
44
  The package loads JSON in this order:
@@ -37,3 +54,13 @@ The only supported key is `hideGauntletWidgets`. It defaults to `true`.
37
54
  ```json
38
55
  { "hideGauntletWidgets": true }
39
56
  ```
57
+
58
+ ## Releasing
59
+
60
+ Releases are automatic. To ship a version:
61
+
62
+ 1. Add a `## [x.y.z] - YYYY-MM-DD` section to `CHANGELOG.md`.
63
+ 2. Bump `version` in `package.json` (and the expectation in `test/package.test.ts`), run `npm run build`, commit `dist/`.
64
+ 3. Merge to `main`.
65
+
66
+ The Publish workflow (`.github/workflows/publish.yml`, npm's registered trusted publisher) detects the new version, verifies lint/typecheck/tests/build, tags `vx.y.z`, creates a GitHub Release (CHANGELOG section + auto-generated notes + package tarball), records a deployment to the `npm` environment, and publishes to npm via OIDC trusted publishing (provenance included). Pushes that do not change the version do nothing. `Release (manual fallback)` re-publishes an existing tag with the `NPM_TOKEN` secret if the automated path ever fails.
package/SECURITY.md ADDED
@@ -0,0 +1,21 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Use this section to tell people about which versions of your project are
6
+ currently being supported with security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 5.1.x | :white_check_mark: |
11
+ | 5.0.x | :x: |
12
+ | 4.0.x | :white_check_mark: |
13
+ | < 4.0 | :x: |
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Use this section to tell people how to report a vulnerability.
18
+
19
+ Tell them where to go, how often they can expect to get an update on a
20
+ reported vulnerability, what to expect if the vulnerability is accepted or
21
+ declined, etc.
package/dist/activity.js CHANGED
@@ -7,6 +7,3 @@ export function rowIsRunning(context) {
7
7
  return false;
8
8
  return true;
9
9
  }
10
- export function activityBullet(running, frame) {
11
- return running && frame === 1 ? "◇" : "◆";
12
- }
package/dist/chrome.js CHANGED
@@ -1 +1,16 @@
1
+ /**
2
+ * Horizontal margin for pi-minimal's chrome (status line, footer, turn rule, tool rows).
3
+ * Follows pi's `outputPad` setting so chrome lines up with transcript text. Pi's editor uses
4
+ * the separate `editorPaddingX` setting (default 0); set it to the same value for a flush
5
+ * left edge.
6
+ */
7
+ const KEY = Symbol.for("pi-minimal.chrome-margin");
8
+ const store = globalThis;
9
+ /** Kept for modules linked against an older copy of this file across a hot reload. */
1
10
  export const CHROME_MARGIN = 1;
11
+ export function chromeMargin() {
12
+ return store[KEY] ?? CHROME_MARGIN;
13
+ }
14
+ export function setChromeMargin(value) {
15
+ store[KEY] = value === 0 ? 0 : 1;
16
+ }
@@ -0,0 +1,69 @@
1
+ import { Markdown, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
2
+ const PATCHED = Symbol.for("pi-minimal.code-box");
3
+ /** Current framing implementation. Lives on globalThis so a /reload swaps the behaviour of the
4
+ * wrapper that an earlier load already installed on pi-tui's shared Markdown prototype. */
5
+ const FRAME_SLOT = Symbol.for("pi-minimal.code-box.frame");
6
+ const slots = globalThis;
7
+ export function frameCodeLines(lines, lang, width, theme) {
8
+ if (lines.length < 2)
9
+ return lines;
10
+ // Trailing spacer ("" after the closing fence) is preserved as-is.
11
+ let end = lines.length;
12
+ while (end > 0 && lines[end - 1] === "")
13
+ end -= 1;
14
+ if (end < 2)
15
+ return lines;
16
+ const trailer = lines.slice(end);
17
+ const body = lines.slice(1, end - 1);
18
+ const indent = theme.codeBlockIndent ?? " ";
19
+ const outer = Math.max(6, width);
20
+ // "│ " + content + " │"
21
+ const innerWidth = outer - 4;
22
+ const label = lang ? ` ${lang} ` : "";
23
+ const topRule = "─".repeat(Math.max(1, outer - 3 - visibleWidth(label)));
24
+ const top = theme.codeBlockBorder(`╭─${label}${topRule}╮`);
25
+ const bottom = theme.codeBlockBorder(`╰${"─".repeat(outer - 2)}╯`);
26
+ const edge = theme.codeBlockBorder("│");
27
+ const framed = [];
28
+ for (const line of body) {
29
+ const content = line.startsWith(indent) ? line.slice(indent.length) : line;
30
+ for (const piece of wrapTextWithAnsi(content, innerWidth)) {
31
+ const pad = Math.max(0, innerWidth - visibleWidth(piece));
32
+ framed.push(`${edge} ${piece}${" ".repeat(pad)} ${edge}`);
33
+ }
34
+ }
35
+ if (framed.length === 0)
36
+ framed.push(`${edge} ${" ".repeat(innerWidth)} ${edge}`);
37
+ return [top, ...framed, bottom, ...trailer];
38
+ }
39
+ /**
40
+ * Patch pi-tui's Markdown renderer. The prototype wrapper is installed once per process; every
41
+ * call (including after /reload) points it at this module's `frameCodeLines`.
42
+ * Returns false when the renderer is not patchable.
43
+ */
44
+ export function installCodeBox() {
45
+ slots[FRAME_SLOT] = frameCodeLines;
46
+ const proto = Markdown.prototype;
47
+ if (proto[PATCHED])
48
+ return true;
49
+ const original = proto.renderToken;
50
+ if (typeof original !== "function")
51
+ return false;
52
+ const originalRender = original;
53
+ proto.renderToken = function (token, width, next, style) {
54
+ const lines = originalRender.call(this, token, width, next, style);
55
+ if (token?.type !== "code" || !this.theme?.codeBlockBorder)
56
+ return lines;
57
+ const frame = slots[FRAME_SLOT];
58
+ if (!frame)
59
+ return lines;
60
+ try {
61
+ return frame(lines, token.lang, width, this.theme);
62
+ }
63
+ catch {
64
+ return lines;
65
+ }
66
+ };
67
+ proto[PATCHED] = true;
68
+ return true;
69
+ }