@mobcomputing/mob 0.2.0 → 0.2.1
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/bin/mob.mjs +8 -2
- package/package.json +1 -1
package/bin/mob.mjs
CHANGED
|
@@ -18,6 +18,12 @@ import { sandboxProblem } from '../src/sandbox.mjs'
|
|
|
18
18
|
const SRC = path.join(path.dirname(fileURLToPath(import.meta.url)), '../src')
|
|
19
19
|
const SELF = fileURLToPath(import.meta.url)
|
|
20
20
|
const say = (...xs) => console.log(...xs)
|
|
21
|
+
// The Mob mark, for people at a terminal only: agents and pipes get plain text.
|
|
22
|
+
const showMark = process.stdout.isTTY && !process.env.NO_COLOR && process.env.TERM !== 'dumb'
|
|
23
|
+
const mark = (beside = '') => {
|
|
24
|
+
const m = (t) => `\x1b[38;5;190m${t}\x1b[0m`
|
|
25
|
+
return [m('██▀▀██▀▀████'), m('██ ▀▀ ████') + (beside && ` \x1b[1m${m(beside)}`), m('██ ████')].join('\n')
|
|
26
|
+
}
|
|
21
27
|
const fail = (message) => { console.error(`mob: ${message}`); process.exit(1) }
|
|
22
28
|
const flag = (name, fallback) => {
|
|
23
29
|
const hit = process.argv.find((a) => a === `--${name}` || a.startsWith(`--${name}=`))
|
|
@@ -193,7 +199,7 @@ Next:
|
|
|
193
199
|
appendLog(p, { event: 'init', sha: head, inputs: meta.inputs, throws: recorded.throws, goal, noise, selftest: selftest && { planted: selftest.planted, caught: selftest.caught, exposed: selftest.exposed.length, unresolved: selftest.unresolved.length, fixed: selftest.fixed ?? null, neverRun: selftest.neverRun.length } })
|
|
194
200
|
const agentsNote = writeAgentsSection(root, goal) ? '\n AGENTS.md: added the Mob section; commit it and land it through the gate (git push mob HEAD:main) so agents see it' : ''
|
|
195
201
|
say(`
|
|
196
|
-
Mob
|
|
202
|
+
${showMark ? mark("Let's Mob.") : "Let's Mob."}
|
|
197
203
|
recorded: ${meta.inputs} inputs (${recorded.throws} of them throw, which is recorded too)
|
|
198
204
|
goal: ${goal === 'faster' ? 'identical outputs, measurably faster' : 'identical outputs'}${noise ? `\n timing: one pass ${noise.msPerPass.toFixed(0)} ms; main vs itself ${noise.speedup.toFixed(3)}× (should be close to 1)` : ''}
|
|
199
205
|
gate: git push mob HEAD:main (agents: see the Mob section in AGENTS.md)
|
|
@@ -338,4 +344,4 @@ else if (command === 'status') status()
|
|
|
338
344
|
else if (command === 'check') await check()
|
|
339
345
|
else if (command === 'hook' && rest[0] === 'pre-receive') await preReceive(rest[1])
|
|
340
346
|
else if (command === 'hook' && rest[0] === 'post-receive') postReceive(rest[1])
|
|
341
|
-
else { say(HELP); if (command && !['help', '--help', '-h'].includes(command)) process.exitCode = 1 }
|
|
347
|
+
else { say((showMark ? mark() + '\n' : '') + HELP); if (command && !['help', '--help', '-h'].includes(command)) process.exitCode = 1 }
|
package/package.json
CHANGED