Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions pkgs/mcpx/docs/compendium.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,90 @@
"role": "not-compendium",
"lines": 5,
"note": "a five-line scratch list, not a chapter"
},
{
"path": "docs/binary.md",
"chapter": "build-and-packaging",
"role": "chapter-source",
"lines": 114,
"note": "the binary: what it is, how it is built and shipped"
},
{
"path": "docs/cli.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 191,
"note": "the command-line surface: commands, flags, and output shapes"
},
{
"path": "docs/compare/chapter.md",
"chapter": "comparisons-and-history",
"role": "chapter-source",
"lines": 147,
"note": "the comparison chapter's own framing: what is compared and why"
},
{
"path": "docs/compare/history.md",
"chapter": "comparisons-and-history",
"role": "chapter-source",
"lines": 215,
"note": "how the comparison repo reached its current state"
},
{
"path": "docs/examples.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 148,
"note": "worked examples of recipes and calls, companion to the design pages"
},
{
"path": "docs/faq.md",
"chapter": null,
"role": "included",
"lines": 85,
"note": "questions users actually ask; the book links to it rather than excerpting it"
},
{
"path": "docs/interfaces.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 187,
"note": "the interfaces a program or client codes against"
},
{
"path": "docs/level-2-page-map.md",
"chapter": "maintaining-these-docs",
"role": "chapter-source",
"lines": 152,
"note": "the map of level-2 guide pages (#146-#148): which page covers what"
},
{
"path": "docs/opencode-plugin-v2.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 161,
"note": "the opencode v2 plugin: verified API facts and implementation map"
},
{
"path": "docs/plugins.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 335,
"note": "plugins: what they are, how they are written and loaded"
},
{
"path": "docs/remote.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 132,
"note": "reaching a daemon on another machine: transports, addressing, trust"
},
{
"path": "docs/scripts.md",
"chapter": "designs",
"role": "chapter-source",
"lines": 155,
"note": "scripts: the unit of work mcpx runs, their shape and lifecycle"
}
]
}
23 changes: 23 additions & 0 deletions pkgs/mcpx/internal/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,9 @@ func TestPermissionsDefaultWideOpen(t *testing.T) {
}

func TestPermissionsCanBeNarrowed(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
e := newEnv(t, oneServer)
out := e.run("exec", "--permissions", "strict",
`try { await Deno.readTextFile("/etc/hosts"); console.log("ALLOWED"); }
Expand Down Expand Up @@ -1652,6 +1655,9 @@ func TestConsoleTraceCapturesFrames(t *testing.T) {
}

func TestCaptureFramesIsAvailableToScripts(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
e := newEnv(t, oneServer)
out := e.run("exec", "--format", "bare",
`function a() { return captureFrames(0, 4); }
Expand All @@ -1663,6 +1669,9 @@ func TestCaptureFramesIsAvailableToScripts(t *testing.T) {
}

func TestEveryConsoleMethodIsCoveredAndNameIsKept(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
e := newEnv(t, oneServer)
// Deno ships 25 console members. Anything mcpx replaces must keep its
// name, because losing it breaks introspection for no gain, and anything
Expand Down Expand Up @@ -1697,6 +1706,9 @@ func TestEveryConsoleMethodIsCoveredAndNameIsKept(t *testing.T) {
}

func TestConsoleInfoFormatsLikeTheRuntimeNotLikeJSON(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
e := newEnv(t, oneServer)
// A caller who writes console.info({a:1}) expects to read what the
// runtime would have printed. The structured copy is already in args, so
Expand Down Expand Up @@ -1842,6 +1854,9 @@ func TestAPhaseCanBeAFileInsteadOfAString(t *testing.T) {
// change what the script sees or produces? Every line is compared against the
// same script run with no launcher at all.
func TestCapturedConsoleMatchesTheRuntimeExactly(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
e := newEnv(t, oneServer)
dir := t.TempDir()
script := filepath.Join(dir, "fmt.ts")
Expand Down Expand Up @@ -2855,6 +2870,9 @@ func TestResolveTellsAPluginWhichDaemonServesADirectory(t *testing.T) {
}

func TestTypeCheckCatchesAnUnknownNamespaceBeforeAnythingRuns(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
// Three separate faults let a typo'd namespace run half a script:
// preflight ignores unknown namespaces on purpose, --typecheck was
// silently dropped on the exec path, and when it did run it failed on
Expand Down Expand Up @@ -3058,6 +3076,11 @@ func TestEveryExecFlagChangesSomething(t *testing.T) {
for _, where := range []string{"local", "remote"} {
for _, c := range rows {
t.Run(where+"/"+c.flag, func(t *testing.T) {
if c.flag == "--typecheck" {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
}
lead := []string{"exec"}
if where == "remote" {
lead = append(lead, "--remote")
Expand Down
4 changes: 4 additions & 0 deletions pkgs/mcpx/internal/e2e/envsettings_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package e2e_test

import (
"os/exec"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -69,6 +70,9 @@ func TestLoggingTraceIsReachableFromEverySurface(t *testing.T) {
// script.permissions key were parsed, reported by `mcpx settings`, and
// ignored.
func TestScriptPermissionsIsReachableFromEverySurface(t *testing.T) {
if _, err := exec.LookPath("deno"); err != nil {
t.Skipf("type checking is only available under Deno")
}
const probe = `try { await Deno.readTextFile("/etc/hosts"); console.log("ALLOWED"); }
catch (err) { console.log("denied:", (err as Error).name); }`
base := newEnv(t, oneServer)
Expand Down