@idleware/ringi 0.0.0 → 0.1.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.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/package.json +8 -6
  3. package/target/esm/app/agent.js +1 -0
  4. package/target/esm/app/budget.js +1 -0
  5. package/target/esm/app/context.js +1 -0
  6. package/target/esm/app/hubs.js +1 -0
  7. package/target/esm/app/overview.js +1 -0
  8. package/target/esm/app/room.js +1 -0
  9. package/target/esm/app/rooms.js +1 -0
  10. package/target/esm/app/session.js +1 -0
  11. package/target/esm/app/view.js +1 -0
  12. package/target/esm/cli/agent.js +1 -0
  13. package/target/esm/cli/args.js +1 -0
  14. package/target/esm/cli/context.js +1 -0
  15. package/target/esm/cli/index.js +1 -0
  16. package/target/esm/cli/operator.js +1 -0
  17. package/target/esm/cli/session.js +1 -0
  18. package/target/esm/cli/shared.js +1 -0
  19. package/target/esm/cli/skill.js +1 -0
  20. package/target/esm/cli.js +1 -0
  21. package/target/esm/domain/decisions.js +1 -0
  22. package/target/esm/domain/index.js +1 -0
  23. package/target/esm/domain/profiles.js +1 -0
  24. package/target/esm/domain/signals.js +1 -0
  25. package/target/esm/home/index.js +1 -0
  26. package/target/esm/hub/index.js +1 -0
  27. package/target/esm/hub/signals.js +1 -0
  28. package/target/esm/index.js +1 -0
  29. package/target/esm/lib/index.js +1 -0
  30. package/target/esm/protocol/files.js +1 -0
  31. package/target/esm/protocol/index.js +1 -0
  32. package/target/esm/runtime/reader.js +1 -0
  33. package/target/esm/runtime/session.js +1 -0
  34. package/target/esm/runtime/watch.js +1 -0
  35. package/target/esm/store/git/index.js +1 -0
  36. package/target/esm/store/git/remote.js +1 -0
  37. package/target/esm/store/index.js +1 -0
  38. package/target/esm/store/kafka/index.js +1 -0
  39. package/target/esm/store/temporal/index.js +1 -0
package/README.md CHANGED
@@ -17,7 +17,7 @@ npm i -g @idleware/ringi
17
17
  ringi skill install
18
18
  ```
19
19
 
20
- Node.js 24 or later.
20
+ Node.js 16 or later.
21
21
 
22
22
  ## Local: one machine, several agents
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idleware/ringi",
3
- "version": "0.0.0",
3
+ "version": "0.1.0",
4
4
  "description": "Distributed agent coordinator",
5
5
  "keywords": [
6
6
  "agents",
@@ -31,6 +31,7 @@
31
31
  "types": "target/dts/index.d.ts",
32
32
  "files": [
33
33
  "target/esm",
34
+ "!target/esm/**/*.map",
34
35
  "target/dts",
35
36
  "src/main/resources"
36
37
  ],
@@ -38,13 +39,14 @@
38
39
  "build": "tsc -p tsconfig.json && node -e \"require('fs').chmodSync('target/esm/cli.js', 0o755)\"",
39
40
  "test": "npm run build && tsc -p tsconfig.test.json && node --test --test-reporter=spec src/test/ts/*.test.ts",
40
41
  "test:conformance": "node --test --test-reporter=spec src/test/ts/ringi.test.ts src/test/ts/model.test.ts src/test/ts/flow.test.ts",
41
- "commands": "node target/esm/cli.js help --md > COMMANDS.md"
42
- },
43
- "engines": {
44
- "node": ">=24"
42
+ "commands": "node target/esm/cli.js help --md > COMMANDS.md",
43
+ "release": "npx --yes zx-semrel@1.25.1",
44
+ "test:coverage": "npm run build && tsc -p tsconfig.test.json && c8 --reporter=lcov --reporter=text-summary --report-dir=target/coverage --exclude-after-remap --include='src/main/ts/**' node --test src/test/ts/*.test.ts",
45
+ "test:smoke": "node --test --test-reporter=spec src/test/ts/flow.test.ts"
45
46
  },
46
47
  "devDependencies": {
47
- "@types/node": "24.19.2",
48
+ "@types/node": "26.6.3",
49
+ "c8": "12.0.0",
48
50
  "typescript": "7.0.2"
49
51
  },
50
52
  "publishConfig": {
@@ -81,3 +81,4 @@ export const wait = async (a, { max = 120, ...options } = {}) => {
81
81
  await sleep(Math.min(1000, max * 1000 - (now - start)));
82
82
  }
83
83
  };
84
+ //# sourceMappingURL=agent.js.map
@@ -92,3 +92,4 @@ export const grants = ({ R, me }) => {
92
92
  return D.proposals(all, R.authorityAt).filter(x => x.grant).map(x => grantView(x, D.usageOf(all, x.grant)));
93
93
  };
94
94
  export { DECISIONS, STAMPS, budgetText } from '../domain/decisions.js';
95
+ //# sourceMappingURL=budget.js.map
@@ -13,3 +13,4 @@ export const operator = ({ hub, room } = {}) => {
13
13
  export const agent = () => bound();
14
14
  export const about = () => ({ version: VERSION, home: HOME, resources: RESOURCES, contract: `${HUB_MAJOR}.x`, capabilities: [...CAPS] });
15
15
  export { config };
16
+ //# sourceMappingURL=context.js.map
@@ -73,3 +73,4 @@ export const amend = (H, x) => {
73
73
  H.store.amendContract(OPERATOR, compose(x.text, [['To', '*'], ['Kind', 'hub']]), files);
74
74
  return { version: String(contract.version) };
75
75
  };
76
+ //# sourceMappingURL=hubs.js.map
@@ -36,3 +36,4 @@ export const forgetSession = (handle) => locked('sessions', () => {
36
36
  fail(`no session ${handle}`);
37
37
  dropSession(handle);
38
38
  });
39
+ //# sourceMappingURL=overview.js.map
@@ -124,3 +124,4 @@ export const signals = ({ R, me }, { repair = false } = {}) => readerLock(R, me,
124
124
  // What interfaces need to show and store a message's files: their sizes, and a path safe to write under.
125
125
  export { withSizes } from '../hub/index.js';
126
126
  export { checkPath } from '../protocol/files.js';
127
+ //# sourceMappingURL=room.js.map
@@ -117,3 +117,4 @@ export const forgetLog = (H, R, id) => {
117
117
  }
118
118
  return n;
119
119
  };
120
+ //# sourceMappingURL=rooms.js.map
@@ -94,3 +94,4 @@ export const leave = () => locked('sessions', () => {
94
94
  dropSession(s.handle);
95
95
  return s;
96
96
  });
97
+ //# sourceMappingURL=session.js.map
@@ -49,3 +49,4 @@ export const proposalView = (x) => ({ id: x.proposal.id, subject: x.proposal.sub
49
49
  decider: x.decider, state: x.state, budget: x.budget, stamps: x.stamps, missing: x.missing });
50
50
  export const grantView = (x, usage) => ({ grant: x.grant.id, proposal: x.proposal.id,
51
51
  subject: x.proposal.subject, budget: x.grant.budget, revoked: x.grant.revoked, usage });
52
+ //# sourceMappingURL=view.js.map
@@ -37,3 +37,4 @@ export const wait = async (a, o) => {
37
37
  out(`wait: nothing for ${a.me} in ${Math.round(r.seconds)}s`);
38
38
  process.exitCode = 3;
39
39
  };
40
+ //# sourceMappingURL=agent.js.map
@@ -58,3 +58,4 @@ export const attachments = (spec) => {
58
58
  return [{ path: dest, file: src, mode: mode(src) }];
59
59
  return walk(src).map(f => ({ path: checkPath(`${dest}/${path.relative(src, f).split(path.sep).join('/')}`), file: f, mode: mode(f) }));
60
60
  };
61
+ //# sourceMappingURL=args.js.map
@@ -5,3 +5,4 @@ import { opt } from './args.js';
5
5
  export { isRef } from '../app/room.js';
6
6
  export const parseTo = (v) => [...new Set(words(v))];
7
7
  export const operatorCtx = (o) => Context.operator({ hub: opt(o, 'hub'), room: opt(o, 'room') });
8
+ //# sourceMappingURL=context.js.map
@@ -122,3 +122,4 @@ export const main = async (argv = process.argv.slice(2)) => {
122
122
  fail(`${cmd} is an agent command: ringi agent ${cmd}`);
123
123
  fail(`unknown command ${cmd}; see ringi help`);
124
124
  };
125
+ //# sourceMappingURL=index.js.map
@@ -144,3 +144,4 @@ export const roomCmd = (o) => {
144
144
  }
145
145
  fail(`unknown: room ${sub}`);
146
146
  };
147
+ //# sourceMappingURL=operator.js.map
@@ -36,3 +36,4 @@ export const leave = () => {
36
36
  const s = Session.leave();
37
37
  out(`left ${s.hub}/${s.room}: the seat of ${s.agent} is free; ${s.agent} stays a member until the operator removes it`);
38
38
  };
39
+ //# sourceMappingURL=session.js.map
@@ -140,3 +140,4 @@ export const grants = (a, o) => {
140
140
  out(`${short(g.grant)} ${g.revoked ? 'revoked ' : u.left ? 'active ' : 'spent '} runs ${u.runs}/${g.budget.runs}, open ${u.open}${u.uncertain ? `, uncertain ${u.uncertain}` : ''}, ${u.seconds}s used, ≤${g.budget['run-seconds']}s a run, concurrency ${g.budget.concurrency} ${g.subject}`);
141
141
  }
142
142
  };
143
+ //# sourceMappingURL=shared.js.map
@@ -51,3 +51,4 @@ in ~/.codex/config.toml. Otherwise agents re-run ringi commands with sandbox esc
51
51
  return void process.stdout.write(fs.readFileSync(path.join(SKILL, 'SKILL.md'), 'utf8'));
52
52
  fail('usage: ringi skill install [--project] | uninstall [--project] | status | show');
53
53
  };
54
+ //# sourceMappingURL=skill.js.map
package/target/esm/cli.js CHANGED
@@ -11,3 +11,4 @@ if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import
11
11
  process.exitCode = 1;
12
12
  });
13
13
  }
14
+ //# sourceMappingURL=cli.js.map
@@ -175,3 +175,4 @@ export const usageOf = (all, grant, now = Date.now() / 1000) => {
175
175
  const open = unsettled.filter(m => now - m.time <= grant.budget['run-seconds'] + 60);
176
176
  return { runs: reserves.length, open: open.length, uncertain: unsettled.length - open.length, seconds, left: Math.max(0, grant.budget.runs - reserves.length) };
177
177
  };
178
+ //# sourceMappingURL=decisions.js.map
@@ -13,3 +13,4 @@ export const unenforceable = (ids) => {
13
13
  const unknown = ids.filter(id => !CAPABILITIES[id]);
14
14
  return unknown.length ? `requires ${unknown.join(', ')}` : null;
15
15
  };
16
+ //# sourceMappingURL=index.js.map
@@ -93,3 +93,4 @@ export const taskOf = (all, root, profile) => {
93
93
  };
94
94
  export const tasksIn = (all, profile) => [...all.values()].filter(m => m.kind === profile.opens && !m.bad).map(r => taskOf(all, r, profile));
95
95
  export const isOpen = (t, profile) => !profile.terminal.includes(t.state);
96
+ //# sourceMappingURL=profiles.js.map
@@ -126,3 +126,4 @@ export const pins = (records, checked, accepted = {}) => {
126
126
  next[keyOf(c.ref)] = now.get(keyOf(c.ref)).object;
127
127
  return { accepted: next, alarms };
128
128
  };
129
+ //# sourceMappingURL=signals.js.map
@@ -85,3 +85,4 @@ export const locked = (name, fn) => {
85
85
  export const configFile = () => path.join(HOME, 'config.json');
86
86
  export const config = () => ({ hub: 'local', room: null, ...readJson(configFile(), {}) });
87
87
  export const setConfig = (patch) => writeJson(configFile(), { ...config(), ...patch });
88
+ //# sourceMappingURL=index.js.map
@@ -209,3 +209,4 @@ export const withSizes = (R, m) => {
209
209
  };
210
210
  export const pongText = (me, m, what) => compose(`pong: ${me} ${what}`, [['To', m.from], ['Re', m.id], ['Kind', 'pong'], ['Hop', String(m.hopEff + 1)]]);
211
211
  export { OPERATOR, HIDDEN };
212
+ //# sourceMappingURL=index.js.map
@@ -24,3 +24,4 @@ export const emit = (R, who, all, m) => {
24
24
  }
25
25
  return n;
26
26
  };
27
+ //# sourceMappingURL=signals.js.map
@@ -6,3 +6,4 @@ export * as decide from './domain/decisions.js';
6
6
  export * as signals from './domain/signals.js';
7
7
  export { STORES } from './store/index.js';
8
8
  export { openHub, openRoom, createHub, contractAt } from './hub/index.js';
9
+ //# sourceMappingURL=index.js.map
@@ -199,3 +199,4 @@ export const guardWrite = (where, fn) => {
199
199
  }
200
200
  };
201
201
  export const mkdirIn = (where, d) => { guardWrite(where, () => fs.mkdirSync(d, { recursive: true, mode: 0o700 })); };
202
+ //# sourceMappingURL=index.js.map
@@ -16,3 +16,4 @@ export const checkCollisions = (paths) => {
16
16
  seen.set(k, p);
17
17
  }
18
18
  };
19
+ //# sourceMappingURL=files.js.map
@@ -214,3 +214,4 @@ export const unread = (logs, id, cursors, limit = Infinity, hidden) => {
214
214
  }
215
215
  return { msgs: shown, rest: queue.length - shown.length, cursors: next };
216
216
  };
217
+ //# sourceMappingURL=index.js.map
@@ -61,3 +61,4 @@ export const linked = (R, reader) => {
61
61
  const { logs } = loadRoom(R, reader);
62
62
  return { logs, all: link(logs) };
63
63
  };
64
+ //# sourceMappingURL=reader.js.map
@@ -109,3 +109,4 @@ export const parseSelector = (sel) => {
109
109
  const m = /^(?:([a-z0-9._-]+):)?([^/]+)\/([^/]+)$/.exec(sel ?? '');
110
110
  return m ? { hub: m[1] ?? null, room: m[2], agent: m[3] } : fail('a session is named <room>/<agent> or <hub>:<room>/<agent>');
111
111
  };
112
+ //# sourceMappingURL=session.js.map
@@ -301,3 +301,4 @@ export const watch = async (w, log = note) => {
301
301
  await sleep(interval);
302
302
  }
303
303
  };
304
+ //# sourceMappingURL=watch.js.map
@@ -343,3 +343,4 @@ export class GitStore {
343
343
  rootKey() { return this.d.root ?? fail(`hub ${this.d.name} has no pinned root`); }
344
344
  rootRoster() { return Remote.rootRoster(this.h); }
345
345
  }
346
+ //# sourceMappingURL=index.js.map
@@ -697,3 +697,4 @@ export const forget = (H, R, who) => {
697
697
  delete H.remoteAlarms[ref];
698
698
  });
699
699
  };
700
+ //# sourceMappingURL=remote.js.map
@@ -12,3 +12,4 @@ import { kafka } from './kafka/index.js';
12
12
  import { temporal } from './temporal/index.js';
13
13
  // The store types this ringi knows. Another type is a directory here implementing Store, and an entry below.
14
14
  export const STORES = { git: (dir, d, home) => new GitStore(dir, d, home), kafka, temporal };
15
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  import { fail } from '../../lib/index.js';
2
2
  export const kafka = (_dir, d) => fail(`hub ${d.name}: the kafka store is planned and not implemented in this ringi`);
3
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  import { fail } from '../../lib/index.js';
2
2
  export const temporal = (_dir, d) => fail(`hub ${d.name}: the temporal store is planned and not implemented in this ringi`);
3
+ //# sourceMappingURL=index.js.map