Files
devplacepy/devplacepy/static/js/codemirrorModes.js
T
retoor 31841fece4 chore: add agents/reports to gitignore and update agent infrastructure with timestamp streaming, write budget, and codename generation
- Add `agents/reports/` to `.gitignore` to prevent generated agent report files from being tracked
- Implement `_TimestampStream` class and `install_timestamps()` function in `agents/agent.py` for prefixing stdout/stderr with timestamps and elapsed time
- Export `install_timestamps`, `set_write_budget`, `clear_write_budget`, and `set_shell_restricted` from `agents/base.py`; add `_RUN_LOCK`, `AGENT_ICONS` dictionary, and `WRITE_BUDGET = 20` constant
- Add `report_codename()` function and `CODENAME_ADJECTIVES`/`CODENAME_ANIMALS` tuples to `agents/core/__init__.py` for generating random agent report codenames
- Expand `WRITE_TOOLS` tuple in `agents/core/__init__.py` to include `replace_lines`, `insert_lines`, and `delete_lines`; remove `SWARM_TOOLS` from `payloads_for` exclusion list
- Update `CLAUDE.md` and `AGENTS.md` documentation with dataset column initialization rules and new agent infrastructure details
- Reorder route table in `README.md` to list `/uploads` before `/messages` and document Swagger/ReDoc/OpenAPI schema endpoints
2026-06-12 03:37:12 +00:00

62 lines
2.0 KiB
JavaScript

// retoor <retoor@molodetz.nl>
export class CodeMirrorModes {
static LANGUAGE_MODES = {
"c": "text/x-csrc",
"cpp": "text/x-c++src",
"java": "text/x-java",
"bash": "text/x-sh",
"ruby": "text/x-ruby",
"php": "text/x-php",
"perl": "text/x-perl",
"haskell": "text/x-haskell",
"lua": "text/x-lua",
"elixir": "text/x-elixir",
"dart": "text/x-dart",
"r": "text/x-rsrc",
"scala": "text/x-scala",
};
static EXTENSION_MODES = {
"py": "python",
"js": "javascript", "mjs": "javascript", "cjs": "javascript", "jsx": "javascript",
"ts": "text/typescript", "tsx": "text/typescript",
"json": "application/json", "jsonc": "application/json",
"c": "text/x-csrc", "h": "text/x-csrc",
"cpp": "text/x-c++src", "cc": "text/x-c++src", "hpp": "text/x-c++src", "hh": "text/x-c++src",
"cs": "text/x-csharp",
"java": "text/x-java",
"go": "go",
"rb": "text/x-ruby",
"php": "text/x-php",
"pl": "text/x-perl", "pm": "text/x-perl",
"lua": "text/x-lua",
"r": "text/x-rsrc",
"dart": "text/x-dart",
"swift": "swift",
"hs": "text/x-haskell",
"sql": "sql",
"sh": "text/x-sh", "bash": "text/x-sh", "zsh": "text/x-sh",
"yaml": "yaml", "yml": "yaml",
"md": "markdown", "markdown": "markdown",
"html": "htmlmixed", "htm": "htmlmixed",
"xml": "xml", "svg": "xml",
"css": "css", "scss": "css", "sass": "css", "less": "css",
};
static FILENAME_MODES = {
"dockerfile": "text/x-sh",
"makefile": "text/x-sh",
".gitignore": "text/plain",
".env": "text/plain",
};
static modeForFilename(name) {
const lower = (name || "").toLowerCase();
if (this.FILENAME_MODES[lower]) return this.FILENAME_MODES[lower];
const dot = lower.lastIndexOf(".");
const ext = dot >= 0 ? lower.slice(dot + 1) : "";
return this.EXTENSION_MODES[ext] || "plaintext";
}
}