Go to file
2026-05-05 11:43:40 +08:00
.github/workflows Skip already published npm versions 2026-05-05 11:19:32 +08:00
dist Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
src Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
.gitignore Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
index.test.ts Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
index.ts Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
openclaw.plugin.json Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
package.json Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
pnpm-lock.yaml Initial OpenClaw XWorkmate artifacts plugin 2026-05-05 11:08:01 +08:00
README.md Add artifact list and read plugin methods 2026-05-05 11:43:40 +08:00
tsconfig.build.json Ship compiled npm plugin package 2026-05-05 11:21:54 +08:00
tsconfig.json Initial OpenClaw XWorkmate artifacts plugin 2026-05-05 11:08:01 +08:00

xworkmate-artifacts

OpenClaw Gateway plugin that exports structured workspace artifact manifests for XWorkmate.

Why

XWorkmate talks to OpenClaw through xworkmate-bridge using the existing /gateway/openclaw task contract. The bridge sends chat.send, waits for agent.wait, then asks this plugin for a structured artifact manifest. The APP can then sync generated files into its local thread workspace without changing the UI or adding provider-specific routes.

It registers three Gateway methods:

xworkmate.artifacts.export
xworkmate.artifacts.list
xworkmate.artifacts.read

The method scans the resolved OpenClaw workspace after a run finishes and returns safe, relative artifact entries that XWorkmate Bridge can normalize into the APP artifacts[] contract.

Install

Install from the npm package through OpenClaw:

openclaw plugins install xworkmate-artifacts
openclaw plugins enable xworkmate-artifacts

Or install from a Git checkout for development:

git clone https://github.com/x-evor/xworkmate-artifacts.git
openclaw plugins install --link ./xworkmate-artifacts
openclaw plugins enable xworkmate-artifacts

Equivalent config shape for a linked checkout:

{
  "plugins": {
    "load": {
      "paths": [
        "/path/to/xworkmate-artifacts"
      ]
    },
    "entries": {
      "xworkmate-artifacts": {
        "enabled": true
      }
    }
  }
}

Contract

Request params:

{
  "sessionKey": "thread-main",
  "runId": "turn-1",
  "sinceUnixMs": 1770000000000,
  "maxFiles": 64,
  "maxInlineBytes": 10485760
}

Response payload:

{
  "runId": "turn-1",
  "sessionKey": "thread-main",
  "remoteWorkingDirectory": "/home/user/.openclaw/workspace",
  "remoteWorkspaceRefKind": "remotePath",
  "artifacts": [
    {
      "relativePath": "reports/final.md",
      "label": "final.md",
      "contentType": "text/markdown",
      "sizeBytes": 1234,
      "sha256": "..."
    }
  ],
  "warnings": []
}

Files at or below maxInlineBytes also include encoding: "base64" and content.

View And Download

After installation, enable the optional agent tool if you want OpenClaw chat to show a quick artifact table:

{
  "agents": {
    "list": [
      {
        "id": "main",
        "tools": {
          "allow": ["xworkmate_artifacts"]
        }
      }
    ]
  }
}

Then ask OpenClaw to list artifacts in the current workspace. The tool returns a Markdown table with the workspace path, relative file paths, content types, file sizes, and hash prefixes. Files are still stored in the OpenClaw workspace, so local users can open or download them directly from that workspace path.

Gateway clients can use:

  • xworkmate.artifacts.list for a metadata-only manifest and Markdown table.
  • xworkmate.artifacts.read with relativePath for one inline base64 file.
  • xworkmate.artifacts.export after agent.wait for the XWorkmate APP sync path.

Large files are intentionally metadata-only in v1. XWorkmate Bridge can add a hosted artifact cache/download endpoint later if remote APP clients need direct links for large PPT/PDF/DOCX files.

Limits

  • Only files inside the resolved OpenClaw workspace are exported.
  • .git, .openclaw, .pi, build outputs, and dependency folders are skipped.
  • Symlinks are skipped to avoid workspace escape.
  • Files larger than maxInlineBytes are listed with metadata and a warning, but are not inlined.

Development

pnpm install
pnpm test
pnpm typecheck
pnpm pack:check