function11 1.0.0

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.
@@ -0,0 +1,15 @@
1
+ export const meta = {
2
+ name: "loglevel",
3
+ writable: true
4
+ };
5
+
6
+ let level = "info";
7
+
8
+ export async function read(ctx) {
9
+ ctx.stdout.write(level + "\n");
10
+ }
11
+
12
+ export async function write(ctx, data) {
13
+ level = data.trim();
14
+ ctx.stdout.write(`loglevel set to ${level}\n`);
15
+ }
@@ -0,0 +1,5 @@
1
+ export async function read(ctx) {
2
+ for (const s of ctx.kernel.sessions.values()) {
3
+ ctx.stdout.write(`session ${s.id} alive=${s.alive}\n`);
4
+ }
5
+ }
@@ -0,0 +1,11 @@
1
+ const start = Date.now();
2
+
3
+ export const meta = {
4
+ name: "uptime",
5
+ writable: false
6
+ };
7
+
8
+ export async function read(ctx) {
9
+ const secs = Math.floor((Date.now() - start) / 1000);
10
+ ctx.stdout.write(`${secs}s\n`);
11
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "function11",
3
+ "version": "1.0.0",
4
+ "description": "minimalist operating shell and control system designed for human–AI collaboration",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "type": "module"
13
+ }