@able-autonomy/able 0.0.3 → 0.0.4
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/package.json +1 -1
- package/src/workspaces/index.ts +1 -1
- package/src/workspaces/ls.ts +6 -1
package/package.json
CHANGED
package/src/workspaces/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// able ws: the Workspaces module (knowledge/modules/workspaces.md).
|
|
2
2
|
//
|
|
3
3
|
// able ws new <slug> [--no-fetch] a worktree on feat/<slug> from the trunk, with the host's copy and onCreate
|
|
4
|
-
// able ws ls
|
|
4
|
+
// able ws ls [--json] every checkout: offset, services, tree, resources held
|
|
5
5
|
// able ws current [--json] the checkout this runs in: slug, branch, path, port offset, main checkout
|
|
6
6
|
// able ws refresh merges the trunk into this workspace
|
|
7
7
|
// able ws merge ["message"] [--yes] lands this workspace on the trunk as `Land feat/<slug>`
|
package/src/workspaces/ls.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
// able ws ls: the main checkout and every workspace, read live: offset, services, tree, shared resources held.
|
|
2
|
+
// With --json, only the workspaces (slug, branch, path, portOffset, createdAt), for a host's own tools (84).
|
|
2
3
|
|
|
3
4
|
import { existsSync } from 'node:fs'
|
|
4
5
|
import { dirtyCount, mainRoot, unpushedCount } from '../git.ts'
|
|
5
6
|
import { bold, dim, yellow } from '../ui.ts'
|
|
6
|
-
import { checkouts, holderOf, readState, running } from './state.ts'
|
|
7
|
+
import { checkouts, holderOf, readState, running, workspaces } from './state.ts'
|
|
7
8
|
|
|
8
9
|
const main = mainRoot()
|
|
9
10
|
const state = await readState(main)
|
|
11
|
+
if (process.argv.includes('--json')) {
|
|
12
|
+
console.log(JSON.stringify(await workspaces(main, state)))
|
|
13
|
+
process.exit(0)
|
|
14
|
+
}
|
|
10
15
|
const rows = await checkouts(main, state)
|
|
11
16
|
|
|
12
17
|
console.log(`\n${bold(' CHECKOUT OFFSET SERVICES TREE')}`)
|