Skip to content
Merged
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
20 changes: 2 additions & 18 deletions .mise/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,6 @@ gh_http = "--http-url https://github.com --progress --ignore-existing"
o2_image = "openobserve/openobserve:v0.70.3"
# OpenTelemetry Collector image for the o2-hostmetrics / o2-macmon / o2-nvidia / o2-winmetrics tasks.
otelcol_image = "otel/opentelemetry-collector-contrib:0.156.0"
# pywasm1's own module version, templated into the pkg/package.json its build task emits.
pywasm1_pkg_version = "0.1.0"
rp_wasm_dir = '''{% if os() == "windows" -%}
{%- set base = (env?.LOCALAPPDATA or "") | replace(from="\\", to="/") -%}
{{- base -}}/mise/installs/http-rp-wasm/{{- vars.a_rp_wasm_short -}}
Expand Down Expand Up @@ -1487,6 +1485,7 @@ shell = "bash -euo pipefail -c"
# like every other module task -- using the prebuilt tarball from the rp-v<N> release rather than
# recompiling RustPython keeps the cost at one ~10 MB download, not a multi-minute upstream wasm-pack build.
[tasks.build-ws-pywasm1-module]
depends = ["build-et-cli"]
description = "Build the pywasm1 module (fetched rustpython_wasm + main.py)"
dir = "services/ws-modules/pywasm1"
run = """
Expand All @@ -1497,22 +1496,7 @@ coreutils cp "$rp_pkg"/rustpython_wasm.js "$rp_pkg"/rustpython_wasm.d.ts pkg/
coreutils cp "$rp_pkg"/rustpython_wasm_bg.wasm "$rp_pkg"/rustpython_wasm_bg.wasm.d.ts pkg/
coreutils cp -R "$rp_pkg/snippets" pkg/
coreutils cp index.js main.py pkg/
coreutils cat > pkg/package.json <<'PKG_JSON'
{
"name": "et-ws-pywasm1",
"type": "module",
"version": "{{ vars.pywasm1_pkg_version }}",
"main": "index.js",
"files": [
"index.js",
"main.py",
"rustpython_wasm.js",
"rustpython_wasm.d.ts",
"rustpython_wasm_bg.wasm",
"rustpython_wasm_bg.wasm.d.ts"
]
}
PKG_JSON
{{ vars.et_cli }} module-package-json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Quote the et-cli executable path.

vars.et_cli expands to an absolute path based on config_root_fwd. If the checkout path contains spaces, Bash splits the path and the task fails before module-package-json runs.

Proposed fix
-{{ vars.et_cli }} module-package-json
+"{{ vars.et_cli }}" module-package-json

As per coding guidelines, Windows is a first-tier supported platform.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{ vars.et_cli }} module-package-json
"{{ vars.et_cli }}" module-package-json
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.mise/config.toml at line 1499, Quote the vars.et_cli expansion in the
module-package-json command so paths containing spaces remain a single
executable argument. Preserve the existing command and subcommand while ensuring
Bash receives the full et-cli path on all supported platforms.

Source: Coding guidelines

"""
shell = "bash -euo pipefail -c"

Expand Down
23 changes: 23 additions & 0 deletions config/semgrep/module-description-length.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
rules:
- id: module-description-length
languages: [generic]
paths:
include:
- "services/ws-modules/*/Cargo.toml"
- "services/ws-modules/*/pyproject.toml"
- "services/ws-modules/*/build.zig.zon"
- "services/ws-modules/*/pkg/package.json"
# Enforce ws-module description length at the source manifests, not by trimming labels in the browser.
# A ws-module description is the module-dropdown label on the ws-server index page. Two regex alternatives
# cover the syntaxes the description travels through: `description = "..."` (Cargo.toml / pyproject.toml,
# and build.zig.zon's `.description = "..."` which the same pattern matches) and `"description": "..."`
# (the hand-committed pkg/package.json files of the dart / dotnet / java / R modules). The generated
# pkg/package.json files are gitignored and semgrep scans only tracked files, so the manifest patterns are
# the ones that matter for generated modules.
pattern-either:
- pattern-regex: 'description = "[^"]{41,}"'
- pattern-regex: '"description": "[^"]{41,}"'
message: >-
A ws-module description is the module-dropdown label on the ws-server index page; keep it at most 40
characters so the dropdown stays readable.
severity: ERROR
2 changes: 1 addition & 1 deletion services/ws-modules/pyeye1/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
dependencies = ["et-ws"]
description = "Python eye detection (MediaPipe FaceLandmarker -> eye bounding boxes)"
description = "Python eye detection (MediaPipe)"
license = "Apache-2.0 OR MIT"
name = "et-ws-pyeye1"
requires-python = ">=3.10"
Expand Down
13 changes: 13 additions & 0 deletions services/ws-modules/pywasm1/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
description = "Python smoke test (RustPython WASM)"
license = "Apache-2.0 OR MIT"
name = "et-ws-pywasm1"
requires-python = ">=3.10"
version = "0.1.0"

# No [build-system]: nothing is wheel-built here.
# The module ships main.py verbatim next to the prebuilt rustpython_wasm artifacts its build task copies into
# pkg/; this manifest exists so `et-cli module-package-json` derives pkg/package.json from statically
# checkable input like every other module.
[tool.ws-module]
main = "index.js"
2 changes: 1 addition & 1 deletion services/ws-modules/wasi-comm1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "et-ws-wasi-comm1"
description = "WASI Preview 2 port of the comm1 module -- list-agents + broadcast + direct message"
description = "WASI Preview 2 port of comm1"
version = "0.1.0"
edition.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion services/ws-modules/wasi-data1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "et-ws-wasi-data1"
description = "WASI Preview 2 port of the data1 module -- keyvalue store roundtrip"
description = "WASI Preview 2 port of data1"
version = "0.1.0"
edition.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion services/ws-modules/wasi-graphics-info/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
dependencies = []
description = "Python graphics-info WASI component via componentize-py"
description = "Python WASI graphics-info component"
license = "Apache-2.0 OR MIT"
name = "et-ws-wasi-graphics-info"
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion services/ws-modules/zig-data1/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = .et_ws_zig_data1,
.version = "0.1.0",
.description = "zig data 1",
.description = "Zig + C/C++ data 1",
.license = "Apache-2.0 or MIT",
.main = "et_ws_zig_data1.js",
.fingerprint = 0x8c5646f08b8cd4b1,
Expand Down
2 changes: 1 addition & 1 deletion services/ws-modules/zig-except1/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = .et_ws_zig_except1,
.version = "0.1.0",
.description = "zig exception handling demo 1",
.description = "Zig + C++ exception handling demo 1",
.license = "Apache-2.0 or MIT",
.main = "et_ws_zig_except1.js",
.fingerprint = 0x7e0344ac53a4bcec,
Expand Down
10 changes: 7 additions & 3 deletions services/ws-server/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ const populateModuleDropdown = async () => {
append(`Skipping ${name}: already loaded as the main WASM agent module`);
continue;
}
if (name === "onnxruntime-web" || name === "pyodide") {
append(`Skipping ${name}: already loaded as a dependency`);
if (!name.startsWith("et-ws-")) {
append(`Skipping ${name}: not an et-ws-* workflow module`);
continue;
}
const pkgResp = await fetch(`/modules/${name}/package.json`);
if (name.startsWith("et-ws-wasi-")) {
append(`Skipping ${name}: WASI module, runs in et-ws-wasi-runner rather than the browser`);
continue;
}
const pkgResp = await fetch(`/modules/${name}/package.json`, { cache: "no-cache" });
if (!pkgResp.ok) {
append(`Skipping ${name}: no package.json (${pkgResp.status})`);
continue;
Expand Down
Loading