Skip to content

Commit 8c2b9b1

Browse files
committed
✨ Install structural Markdown syntax from a package (#806)
An `ExecutionInstallation` may now declare a coordinated structural parent and child form and supply the implementation that expands them. `declarations` becomes one discriminated catalog carrying that arm beside the existing declared Markdown tier, and canonical core captures and validates the whole catalog before any installation hook, middleware or document code runs — so selection, `xmd syntax`, `xmd plan`, document validation and execution all read the same definitions and cannot describe different environments. `Execution.expand` is the public policy surface for one occurrence. A handler receives the authored form, the source position and the evaluated, frozen props, and may observe, refuse or delegate; it receives no child regions and no implementation, so only canonical core hands an occurrence to the installation that declared it. Each accepted child is a region whose `expand()` returns a resource-scoped stream of `{ text, exact }` chunks with per-chunk rendezvous backpressure: the producer does not advance past a delivered chunk until the consumer advances, region output never travels through `DocumentOutput`, and leaving the handler's scope halts and joins the producer. The terminal grid becomes the first consumer. Its syntax, validation, layout and providerless refusal move to the new `@executablemd/terminal` package — a provider-neutral root that loads no engine, and an `/xmd` subpath that depends on core — and core keeps no terminal name, rule or dispatch branch. An ordinary run installs it on every runtime; the `xmd test` root and workflow executions do not.
1 parent 06cf5fb commit 8c2b9b1

61 files changed

Lines changed: 5237 additions & 759 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/publish-packages.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Validate the manifests declare this version
3131
run: |
3232
VERSION="${{ steps.resolve.outputs.value }}"
33-
for f in packages/durable-streams/deno.json packages/runtime/deno.json packages/core/deno.json packages/acp/deno.json packages/testing/deno.json packages/test-agent/deno.json packages/web/deno.json packages/workflow/deno.json packages/cli/deno.json packages/code-review-agent/deno.json; do
33+
for f in packages/durable-streams/deno.json packages/runtime/deno.json packages/core/deno.json packages/acp/deno.json packages/terminal/deno.json packages/testing/deno.json packages/test-agent/deno.json packages/web/deno.json packages/workflow/deno.json packages/cli/deno.json packages/code-review-agent/deno.json; do
3434
declared="$(jq -r .version "$f")"
3535
if [ "$declared" != "$VERSION" ]; then
3636
echo "::error::$f declares $declared, not $VERSION — the tag does not match the manifests"
@@ -89,6 +89,13 @@ jobs:
8989
package: packages/acp
9090
version: ${{ needs.version.outputs.value }}
9191

92+
terminal:
93+
needs: [version, core]
94+
uses: ./.github/workflows/publish-one.yml
95+
with:
96+
package: packages/terminal
97+
version: ${{ needs.version.outputs.value }}
98+
9299
testing:
93100
needs: [version, core, durable-streams, runtime]
94101
uses: ./.github/workflows/publish-one.yml
@@ -118,7 +125,7 @@ jobs:
118125
version: ${{ needs.version.outputs.value }}
119126

120127
cli:
121-
needs: [version, acp, core, durable-streams, runtime, test-agent, testing, web, workflow]
128+
needs: [version, acp, core, terminal, durable-streams, runtime, test-agent, testing, web, workflow]
122129
uses: ./.github/workflows/publish-one.yml
123130
with:
124131
package: packages/cli

‎architecture.md‎

Lines changed: 53 additions & 9 deletions
Large diffs are not rendered by default.

‎bun.lock‎

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎deno.lock‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"@executablemd/durable-streams": "workspace:*",
5959
"@executablemd/runtime": "workspace:*",
6060
"@executablemd/test-agent": "workspace:*",
61+
"@executablemd/terminal": "workspace:*",
6162
"@executablemd/test-support": "workspace:*",
6263
"@executablemd/testing": "workspace:*",
6364
"@executablemd/workflow": "workspace:*",

‎packages/cli/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@executablemd/core": "workspace:*",
1717
"@executablemd/durable-streams": "workspace:*",
1818
"@executablemd/runtime": "workspace:*",
19+
"@executablemd/terminal": "workspace:*",
1920
"@executablemd/test-agent": "workspace:*",
2021
"@executablemd/testing": "workspace:*",
2122
"@executablemd/web": "workspace:*",

‎packages/cli/src/bun.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { unassembledMachineSessions } from "./session-coordinator.ts";
1717
import { unsupportedWorkflowHost } from "./workflow.ts";
1818
import { unsupportedRepositories } from "./run-repositories.ts";
1919
import { useBunService } from "./bun-service.ts";
20+
import { terminalGridInstallation } from "@executablemd/terminal/xmd";
2021

2122
const ENTRYPOINT = fileURLToPath(import.meta.url);
2223

@@ -72,6 +73,7 @@ await main(function* (args) {
7273
UPGRADE,
7374
unsupportedRepositories,
7475
() => readInputStream(process.stdin),
76+
terminalGridInstallation,
7577
unsupportedWorkflowHost,
7678
unassembledMachineSessions(),
7779
);

0 commit comments

Comments
 (0)