@locusai/server 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +46 -0
- package/package.json +1 -1
- package/src/controllers/doc.controller.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @locusai/server
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - Fixed the cli throwing error after init
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @locusai/shared@0.1.3
|
|
10
|
+
|
|
11
|
+
## 0.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Fix the documents cannot be created in a nested way inside categories
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @locusai/shared@0.1.2
|
|
18
|
+
|
|
3
19
|
## 0.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/asgarovf/locusai/refs/heads/master/assets/logo.png" alt="Locus" width="150" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@locusai/server"><img src="https://img.shields.io/npm/v/@locusai/server?color=blue" alt="npm version" /></a>
|
|
7
|
+
<a href="https://github.com/asgarovf/locusai/blob/master/LICENSE"><img src="https://img.shields.io/github/license/asgarovf/locusai?color=blue" alt="License" /></a>
|
|
8
|
+
<a href="https://github.com/asgarovf/locusai"><img src="https://img.shields.io/github/stars/asgarovf/locusai?style=flat&color=blue" alt="GitHub Stars" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# @locusai/server
|
|
12
|
+
|
|
13
|
+
The backend API server for **Locus** — a local-first AI development platform.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **RESTful API** for task management, documents, and CI runs
|
|
18
|
+
- **SQLite database** for local-first data storage
|
|
19
|
+
- **Real-time events** for live updates
|
|
20
|
+
- **CI execution** with allowlisted commands
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
This package is bundled with `@locusai/cli`. You typically don't need to install it directly.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Start via CLI (recommended)
|
|
28
|
+
npx @locusai/cli dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API Endpoints
|
|
32
|
+
|
|
33
|
+
| Endpoint | Description |
|
|
34
|
+
|----------|-------------|
|
|
35
|
+
| `GET /api/tasks` | List all tasks |
|
|
36
|
+
| `POST /api/tasks` | Create a new task |
|
|
37
|
+
| `GET /api/docs/tree` | Get documentation structure |
|
|
38
|
+
| `POST /api/ci/run` | Execute a CI preset |
|
|
39
|
+
|
|
40
|
+
## Part of Locus
|
|
41
|
+
|
|
42
|
+
This package is part of the [Locus](https://github.com/asgarovf/locusai) platform.
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
[MIT](https://github.com/asgarovf/locusai/blob/master/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
existsSync,
|
|
3
|
+
mkdirSync,
|
|
3
4
|
readdirSync,
|
|
4
5
|
readFileSync,
|
|
5
6
|
statSync,
|
|
6
7
|
writeFileSync,
|
|
7
8
|
} from "node:fs";
|
|
8
|
-
import { join } from "node:path";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
9
10
|
import type { NextFunction, Request, Response } from "express";
|
|
10
11
|
|
|
11
12
|
export interface DocNode {
|
|
@@ -77,6 +78,8 @@ export class DocController {
|
|
|
77
78
|
return res.status(403).json({ error: { message: "Invalid path" } });
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
// Ensure parent directory exists
|
|
82
|
+
mkdirSync(dirname(fullPath), { recursive: true });
|
|
80
83
|
writeFileSync(fullPath, content, "utf-8");
|
|
81
84
|
res.json({ ok: true });
|
|
82
85
|
} catch (err) {
|