@awebai/oats 0.59.0 → 0.61.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.
- package/README.md +14 -18
- package/bin/oats.mjs +42 -10
- package/docs/configuration.md +9 -0
- package/docs/desktop-cli-api.md +40 -10
- package/docs/desktop.md +7 -0
- package/docs/execution-targets.md +7 -2
- package/docs/first-team.md +8 -0
- package/docs/implementation.md +1 -0
- package/docs/integrations.md +1 -1
- package/docs/official-catalog.md +2 -2
- package/docs/packages.md +7 -7
- package/docs/release-notes/v0.60.0.md +104 -0
- package/docs/release-notes/v0.61.0.md +155 -0
- package/docs/tui.md +133 -19
- package/docs/workspaces.md +1 -1
- package/lib/core.mjs +42 -15
- package/lib/session-input.mjs +45 -28
- package/package-catalog.json +2 -2
- package/package.json +1 -1
- package/packages/client/capability-catalog.mjs +93 -0
- package/packages/client/capability-facts.mjs +59 -0
- package/packages/client/capability-rows.mjs +121 -0
- package/packages/client/catalog-messages.mjs +12 -0
- package/packages/client/cli-locator.mjs +2 -2
- package/packages/client/instance-presentation.mjs +10 -0
- package/packages/client/instance-tree.mjs +48 -6
- package/packages/client/soul-catalog.mjs +8 -0
- package/packages/client/soul-facts.mjs +7 -0
- package/packages/client/spawn-messages.mjs +8 -0
- package/packages/client/subsequence-score.mjs +15 -0
- package/packages/tui/README.md +1 -1
- package/packages/tui/lib/actions.mjs +1 -1
- package/packages/tui/lib/client.mjs +9 -4
- package/packages/tui/lib/main.mjs +58 -9
- package/packages/tui/lib/model.mjs +150 -50
- package/packages/tui/lib/store.mjs +133 -16
- package/packages/tui/lib/views/capabilities.mjs +239 -0
- package/packages/tui/lib/views/frame.mjs +55 -20
- package/packages/tui/lib/views/help.mjs +9 -4
- package/packages/tui/lib/views/palette.mjs +13 -4
- package/packages/tui/lib/views/souls.mjs +6 -4
- package/packages/tui/lib/views/spawn.mjs +5 -3
- package/skills/oats-getting-started/SKILL.md +1 -1
package/docs/tui.md
CHANGED
|
@@ -109,9 +109,9 @@ runs.
|
|
|
109
109
|
open them in the list, and [the leader](#the-leader) then `1`, `2` or `3`
|
|
110
110
|
from anywhere; the leader's hint, [the palette](#the-palette) and the
|
|
111
111
|
help name those keys. [The Souls view](#the-souls-view) lists the open
|
|
112
|
-
workspace's souls
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
workspace's souls, and [the Capabilities view](#the-capabilities-view)
|
|
113
|
+
its capabilities. On the right is the time of the read of this machine
|
|
114
|
+
that the screen shows: it moves with every read.
|
|
115
115
|
- **The footer** is one row of keys from the first column, with no rule
|
|
116
116
|
above it. It names `C-\ commands` first, in every focus: the leader,
|
|
117
117
|
which reaches every action. Then come the actions that apply now, as many
|
|
@@ -145,9 +145,13 @@ runs.
|
|
|
145
145
|
shown in quotation marks, and names nobody. A reason that is withheld is
|
|
146
146
|
`[withheld]` alone. Then it shows what it needs from you with how long
|
|
147
147
|
it has waited and its own message, harness and model, work mode and
|
|
148
|
-
branch, team, parent, when it last started, and its home.
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
branch, team, parent and siblings, when it last started, and its home.
|
|
149
|
+
The siblings are the instances at the other end of an explicit sibling
|
|
150
|
+
link, either way, as the Desktop reads them: `sibling of a`, `sibling of
|
|
151
|
+
a and b`, `sibling of a, b and c`. They are read inside the instance's
|
|
152
|
+
own deployment, and a name that is no instance there, or two of them, is
|
|
153
|
+
not shown. From 80 columns up it stands beside the list; on a narrower
|
|
154
|
+
terminal `Tab` opens it as a page.
|
|
151
155
|
- **Opening an agent.** `Enter` on an instance that runs opens its terminal
|
|
152
156
|
beside the list, where the detail was, as a tab: see
|
|
153
157
|
[Open an agent's terminal](#open-an-agents-terminal) and [Tabs](#tabs).
|
|
@@ -402,7 +406,10 @@ Each terminal open in the panel is a tab, and the panel holds up to four.
|
|
|
402
406
|
it is asked, hold a place among the four. An instance that cannot be
|
|
403
407
|
opened says why, as it does with no tab open.
|
|
404
408
|
- **Switching.** `[` and `]` in the Instances view, from the list or the
|
|
405
|
-
detail, show the tab before or after the shown one
|
|
409
|
+
detail, show the tab before or after the shown one; the footer names them
|
|
410
|
+
(`[/] tab`) after the terminal's keys while two tabs or more are open, and
|
|
411
|
+
gives them up after the acts, `workspaces`, `refresh` and `close`, before
|
|
412
|
+
`detail`. The leader then
|
|
406
413
|
`Left` or `Right` does the same from any focus, and from another view
|
|
407
414
|
goes to the Instances view first.
|
|
408
415
|
- The strip does not wrap: on the first tab `[` does nothing, and on the
|
|
@@ -562,7 +569,9 @@ them, from the same code.
|
|
|
562
569
|
nothing. `Esc` closes the detail, then clears a kept filter, then goes
|
|
563
570
|
back to the instances.
|
|
564
571
|
- **When it reads:** the first time the view is shown, never before: a run
|
|
565
|
-
that never shows it
|
|
572
|
+
that never shows it, nor [the Capabilities
|
|
573
|
+
view](#the-capabilities-view) or [the spawn prompt](#spawning-an-agent),
|
|
574
|
+
which need the souls too, never runs `oats souls`. After that, a read of the
|
|
566
575
|
workspace reads the souls again only when the workspace changed (its
|
|
567
576
|
commit, a member's, its externals), and `r` does. While the first read is
|
|
568
577
|
under way the view says `Reading souls…`. A read that fails says why,
|
|
@@ -577,6 +586,98 @@ them, from the same code.
|
|
|
577
586
|
`n` or `N` spawns an agent of the selected soul: [Spawning an
|
|
578
587
|
agent](#spawning-an-agent).
|
|
579
588
|
|
|
589
|
+
## The Capabilities view
|
|
590
|
+
|
|
591
|
+
`3`, or the leader then `3`, shows the capabilities of the open workspace:
|
|
592
|
+
the ones its repositories and its packages offer, as the OATS Desktop lists
|
|
593
|
+
them, from the same code.
|
|
594
|
+
|
|
595
|
+
```
|
|
596
|
+
acme-platform 3 running
|
|
597
|
+
Instances Souls Capabilities read 14:03:27
|
|
598
|
+
──────────────────────────────────────┬─────────────────────────────────────────
|
|
599
|
+
Workspace owned │ aweb Messaging
|
|
600
|
+
oats · member repo · host │ Messaging over aweb, mail and chat,
|
|
601
|
+
> aweb Messaging │ for every instance of the workspace.
|
|
602
|
+
tools · member repo │
|
|
603
|
+
notes │ Comes from
|
|
604
|
+
Packages │ Repository oats
|
|
605
|
+
oats-okf · package · v1.2.0 │ Latest bbbbbbb
|
|
606
|
+
okf-knowledge Knowledge │ Path capabilities/aweb
|
|
607
|
+
│
|
|
608
|
+
│ Provides
|
|
609
|
+
│ Skills oats-aweb, aweb-messaging
|
|
610
|
+
│ Hooks SessionStart
|
|
611
|
+
│
|
|
612
|
+
│ Used by 2 souls
|
|
613
|
+
│ ■ dev ·2 · 1 on an older version
|
|
614
|
+
│ ■ reviewer ·1
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
- **The list** is in the Desktop's sections: Workspace owned, Repo owned
|
|
618
|
+
and Packages. A section with no capability is not drawn, so Repo owned
|
|
619
|
+
stands only when the workspace has one. Under a section each repository
|
|
620
|
+
or package has a dim heading, its name and a note: `oats · member repo ·
|
|
621
|
+
host` (`-` in ASCII). A row is the capability's name, then its layer's
|
|
622
|
+
label, dim, when it has one: `Knowledge`, `Messaging`, `Tasks`. The list
|
|
623
|
+
keys move among the capabilities and pass over the headings. `/` filters
|
|
624
|
+
by name, and a group or a section the filter leaves empty is hidden. A
|
|
625
|
+
workspace with none says so, and that `oats capabilities` says why.
|
|
626
|
+
- **The detail** beside it, top to bottom:
|
|
627
|
+
- the name, its layer's label and the description;
|
|
628
|
+
- **Comes from**, a label and a value a line: for a repository's
|
|
629
|
+
capability its repository, its latest commit, its path and its
|
|
630
|
+
fingerprint, and for a repo-owned one that it is that repository's
|
|
631
|
+
souls' only; for a package's, the package, the version it is pinned to
|
|
632
|
+
and where that comes from, the commit and the fingerprint;
|
|
633
|
+
- **Provides**: its skills, commands and hooks, each kind the kernel
|
|
634
|
+
reports with its names; a kind it could not list says `Not listable: a
|
|
635
|
+
spawn of it would refuse.`, and one with no name `None`;
|
|
636
|
+
- **Used by**, with the count of souls beside it: one line per soul, its
|
|
637
|
+
colour mark (as in the Souls view), its name, a dim count of its
|
|
638
|
+
instances on this machine that carry the capability, `·2` (`x2` in
|
|
639
|
+
ASCII; `·0` too), and, when some of them are on an older version of
|
|
640
|
+
it, `· 1 on an older version` in the warning style. Eight at most, then
|
|
641
|
+
`+n`. With an OATS that reports what each soul is composed of (the
|
|
642
|
+
`souls-capabilities` feature, 0.45.0), these are the souls that include
|
|
643
|
+
it, and with none it says `No soul here includes it.` With an older
|
|
644
|
+
OATS they are the souls whose instances carry it, and with none it says
|
|
645
|
+
`No instance carries it yet.` A soul the souls catalog does not list is
|
|
646
|
+
drawn uncoloured. With the feature, until the souls are read it says
|
|
647
|
+
`Reading souls…`, and a read of them that fails says why, in the
|
|
648
|
+
warning style.
|
|
649
|
+
- **`Enter`** gives the detail the focus (under 80 columns it takes the
|
|
650
|
+
list's place), with a mark, `>` in reverse video, on the first soul of
|
|
651
|
+
Used by. `Up` and `Down` move the mark among the listed souls, and the
|
|
652
|
+
detail scrolls to keep it in sight. Past the first or the last soul, and
|
|
653
|
+
with the other movement keys, the detail scrolls; with no soul listed
|
|
654
|
+
every movement key scrolls it. `Enter` on the marked soul shows it in
|
|
655
|
+
[the Souls view](#the-souls-view), selected; on a soul the souls catalog
|
|
656
|
+
does not list it does nothing. `Tab` moves between the list and the
|
|
657
|
+
detail.
|
|
658
|
+
- **`r`** reads the capabilities again; while a read is under way it starts
|
|
659
|
+
nothing. `Esc` closes the detail, then clears a kept filter, then goes
|
|
660
|
+
back to the instances.
|
|
661
|
+
- **When it reads:** the first time the view is shown, never before: a run
|
|
662
|
+
that never shows it never runs `oats capabilities`. It reads the souls
|
|
663
|
+
too, for Used by, when they were not read yet. After that, a read of the
|
|
664
|
+
workspace reads the capabilities again only when the workspace changed
|
|
665
|
+
(its commit, a member's, its externals, its packages or its lock), and
|
|
666
|
+
`r` does. While the first read is under way the view says `Reading
|
|
667
|
+
capabilities…`. A read that fails says why, `Couldn't read this
|
|
668
|
+
workspace's capabilities:` and the message, with `r` to try again; one
|
|
669
|
+
that fails after a good one keeps the capabilities it had, under a
|
|
670
|
+
heading that says it failed and when they were read; the selected
|
|
671
|
+
capability's detail says why in full, under its name.
|
|
672
|
+
- **What is kept:** the selected capability and the filter, when the view
|
|
673
|
+
is left and shown again, for the run.
|
|
674
|
+
- **Only this machine's:** the view lists the capabilities of a workspace of
|
|
675
|
+
this machine. With none open it says so.
|
|
676
|
+
|
|
677
|
+
[The palette](#the-palette) lists the capabilities once they are read,
|
|
678
|
+
each with where it comes from; choosing one shows this view with it
|
|
679
|
+
selected.
|
|
680
|
+
|
|
580
681
|
## The switcher
|
|
581
682
|
|
|
582
683
|
`w` opens the switcher: what this run can show, over the whole body of the
|
|
@@ -827,7 +928,7 @@ The line after leaving says so and names `oats status` to see it.
|
|
|
827
928
|
| `r` | read now |
|
|
828
929
|
| `1` | the Instances view |
|
|
829
930
|
| `2` | [the Souls view](#the-souls-view); `Esc` or `1` goes back |
|
|
830
|
-
| `3` | the Capabilities view
|
|
931
|
+
| `3` | [the Capabilities view](#the-capabilities-view); `Esc` or `1` goes back |
|
|
831
932
|
| `w` | opens [the switcher](#the-switcher) |
|
|
832
933
|
| `Enter` | in the list of instances, opens the selected agent's terminal in a new [tab](#tabs) beside the list, or shows its tab when it has one, with the focus in it; in the switcher, opens the selected row; in a confirmation, presses the button with the focus |
|
|
833
934
|
| `z` | gives the shown terminal the focus and the whole body |
|
|
@@ -918,16 +1019,22 @@ is open no terminal is drawn and the TUI reads the keys.
|
|
|
918
1019
|
- **It lists, in this order:** the instances that can be opened, the most
|
|
919
1020
|
recently opened or shown in this run first (when the first is the shown tab's,
|
|
920
1021
|
the second is selected as it opens), then the list's order, each with its
|
|
921
|
-
state mark, its name
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1022
|
+
state mark, its name, for another machine `on <machine>`, and, dim, its
|
|
1023
|
+
siblings as the detail names them (`sibling of <names>`), which are cut
|
|
1024
|
+
first when the row is short and are never matched by a query; the souls
|
|
1025
|
+
of the open workspace, once they were read (by [the Souls
|
|
1026
|
+
view](#the-souls-view), the Capabilities view or a spawn), and choosing
|
|
1027
|
+
one shows the Souls view with it selected; its capabilities, once [the
|
|
1028
|
+
Capabilities view](#the-capabilities-view) has read them, each with where
|
|
1029
|
+
it comes from, dim, and choosing one shows that view with it selected
|
|
1030
|
+
(the palette never reads either); the views, Instances, Souls and
|
|
1031
|
+
Capabilities; the acts the
|
|
925
1032
|
instance offers now (the shown terminal's when the palette was opened from
|
|
926
1033
|
its focus, else the selected one's), with `Spawn another <soul>` once the
|
|
927
1034
|
catalog lists its soul; then Spawn an agent, Workspaces, Refresh and Help, and [the split's](#splits)
|
|
928
1035
|
rows where each applies.
|
|
929
1036
|
Each row says at its right edge what kind it is: `instance`, `soul`,
|
|
930
|
-
`view`, `act` or `command`.
|
|
1037
|
+
`capability`, `view`, `act` or `command`.
|
|
931
1038
|
- **Typing filters it** with the Desktop's subsequence match, a prefix
|
|
932
1039
|
first: each kind keeps the rows that match, the best first.
|
|
933
1040
|
`Backspace` removes a character, and a paste adds its first line.
|
|
@@ -1057,8 +1164,15 @@ with the Desktop (`packages/client/`).
|
|
|
1057
1164
|
look again.
|
|
1058
1165
|
- **The souls are one more read**, `oats souls --json` for the open
|
|
1059
1166
|
workspace, by the same kernel, with 60 seconds and 4 MiB: only once [the
|
|
1060
|
-
Souls view](#the-souls-view)
|
|
1061
|
-
|
|
1167
|
+
Souls view](#the-souls-view), [the Capabilities
|
|
1168
|
+
view](#the-capabilities-view) or [the spawn prompt](#spawning-an-agent)
|
|
1169
|
+
was shown, then only when the workspace changed, and on `r` in the Souls
|
|
1170
|
+
view.
|
|
1171
|
+
- **The capabilities are one more read**, `oats capabilities --json` for
|
|
1172
|
+
the open workspace, read as the souls are: by the same kernel, with 60
|
|
1173
|
+
seconds and 4 MiB, only once [the Capabilities
|
|
1174
|
+
view](#the-capabilities-view) was shown, then only when the workspace
|
|
1175
|
+
changed (its packages and its lock count too), and on `r` there.
|
|
1062
1176
|
- **A spawn's preview is one more read**, `oats spawn <soul> --preview
|
|
1063
1177
|
--json` with the choices shown, by the same kernel, with 30 seconds: only
|
|
1064
1178
|
while [the spawn prompt](#spawning-an-agent) is open, and again when a
|
|
@@ -1226,7 +1340,7 @@ with the Desktop (`packages/client/`).
|
|
|
1226
1340
|
| start an agent with another harness or model | `oats session start --home <home>` with its options |
|
|
1227
1341
|
| spawn an agent on another machine | `oats spawn <soul> --server <id>` |
|
|
1228
1342
|
| spawn an agent with another harness, model or task | `oats spawn <soul>` with its options |
|
|
1229
|
-
| see
|
|
1343
|
+
| see a capability's skills and files | `oats capabilities show <name>` |
|
|
1230
1344
|
| add a machine to this workspace | `oats server connect <id> --ssh <alias>` |
|
|
1231
1345
|
| check a machine | `oats server check <id>` |
|
|
1232
1346
|
| remove a machine | `oats server remove <id>` |
|
|
@@ -1247,8 +1361,8 @@ version:
|
|
|
1247
1361
|
machine's heading when it is not the header's time. A view of one machine
|
|
1248
1362
|
has no heading: there the header names the machine (`on garnet`) and
|
|
1249
1363
|
carries the time.
|
|
1250
|
-
- The Souls
|
|
1251
|
-
|
|
1364
|
+
- The Souls and Capabilities views list a workspace of this machine's
|
|
1365
|
+
souls and capabilities: both are this machine's.
|
|
1252
1366
|
- There is no sorting and no mouse, and a deployment's heading cannot be
|
|
1253
1367
|
folded. An open terminal has no scrollback but the viewer's own.
|
|
1254
1368
|
- Up to four terminals are open at a time, as tabs, in at most two
|
package/docs/workspaces.md
CHANGED
|
@@ -54,7 +54,7 @@ members: # repo refs, NO @revision (E_WORKSPAC
|
|
|
54
54
|
- git:github.com/acme/tools # a member that ALSO publishes a package (see below)
|
|
55
55
|
|
|
56
56
|
packages: # the ONLY versioned things
|
|
57
|
-
oats.framework: v1.
|
|
57
|
+
oats.framework: v1.13.0 # bare version → resolves through the official catalog
|
|
58
58
|
oats.okf: v5.2.1
|
|
59
59
|
acme.tools: git:github.com/acme/tools@v0.4.0 # outside the catalog → git:<repo>@<tag|OID>; still a package
|
|
60
60
|
|
package/lib/core.mjs
CHANGED
|
@@ -46,7 +46,7 @@ import { initializeNativeHistory, prepareNativeStart } from "../packages/record/
|
|
|
46
46
|
import { sameDirectory } from "../packages/record/lib/directory-identity.mjs";
|
|
47
47
|
import { noteRuntimeName } from "./deprecation.mjs";
|
|
48
48
|
import { attachSessionTarget, requireDetachKey } from "./session-viewer.mjs";
|
|
49
|
-
import { inspectSessionTarget, inputSessionTarget } from "./session-input.mjs";
|
|
49
|
+
import { createSessionPaneInspector, inspectSessionTarget, inputSessionTarget } from "./session-input.mjs";
|
|
50
50
|
import { appendEvent, incarnationOf, liveWaiting, recordStartBoundary, retireRefusedReason } from "./instance-events.mjs";
|
|
51
51
|
import { killGroup } from "./process-group.mjs";
|
|
52
52
|
import { interruptExitStatus, isStartToken, originRemoteOf, runWorktreeHooks, selfIdentity, processLiveness, processStartToken, signalGuard, terminateRecordedGroup, treeStillThere, unknownGroupNote, unverifiedGroupWarning, worktreeHooksOf } from "./worktree-hooks.mjs";
|
|
@@ -5170,8 +5170,8 @@ export function servedIdentityLine(identity) {
|
|
|
5170
5170
|
/** The window names of `session` on the tmux server at `socket`: `{ windows }`, empty when the server
|
|
5171
5171
|
* or the session is gone, with `missingSocket` (tmux's words) when the socket file is missing, which
|
|
5172
5172
|
* alone does not say the server is gone (#624); `{ error }` when the server could not be read. */
|
|
5173
|
-
function recordedTmuxWindows(socket, session) {
|
|
5174
|
-
try { return { windows: tmuxOn(socket, ["list-windows", "-t", `=${session}`, "-F", "#{window_name}"]).split("\n").filter(Boolean) }; }
|
|
5173
|
+
function recordedTmuxWindows(socket, session, io) {
|
|
5174
|
+
try { return { windows: tmuxOn(socket, ["list-windows", "-t", `=${session}`, "-F", "#{window_name}"], io).split("\n").filter(Boolean) }; }
|
|
5175
5175
|
catch (e) {
|
|
5176
5176
|
const absence = tmuxServerAbsence(e);
|
|
5177
5177
|
if (absence === "missing-socket") return { windows: [], missingSocket: tmuxFailure(e, "tmux list-windows failed") };
|
|
@@ -5179,20 +5179,46 @@ function recordedTmuxWindows(socket, session) {
|
|
|
5179
5179
|
return { error: String(e.stderr ?? e.message ?? "").trim() || "tmux list-windows failed" };
|
|
5180
5180
|
}
|
|
5181
5181
|
}
|
|
5182
|
-
/** A status row's liveness from its session's
|
|
5182
|
+
/** A status row's harness liveness from its session's panes: unknown (not false) when the server could not
|
|
5183
5183
|
* be read, and, for a row whose server holds its endpoint (`endpoint`), when its socket file is
|
|
5184
5184
|
* missing while a process works in the home or the scan (`scanHome()`, processesInHome's answer for
|
|
5185
5185
|
* it) cannot tell (#624). */
|
|
5186
|
-
function tmuxLiveness({ windows, error, missingSocket }, window, scanHome, endpoint) {
|
|
5186
|
+
function tmuxLiveness({ windows, error, missingSocket, panes }, window, scanHome, endpoint, inspectPanes) {
|
|
5187
5187
|
if (error) return { running: null, runtimeState: "unreachable", runtimeError: error };
|
|
5188
5188
|
const running = windows.includes(window);
|
|
5189
5189
|
const why = !running && missingSocket && endpoint ? missingSocketUnestablished(missingSocket, scanHome()) : null;
|
|
5190
|
-
|
|
5190
|
+
if (why) return { running: null, runtimeState: "unreachable", runtimeError: why };
|
|
5191
|
+
if (!running) return { running: false };
|
|
5192
|
+
try {
|
|
5193
|
+
const observed = inspectPanes(panes.get(window) ?? []);
|
|
5194
|
+
return { running: harnessRunning(observed), ...(observed.state === "shell" ? { runtimeState: "shell" } : {}) };
|
|
5195
|
+
} catch (e) { return { running: null, runtimeState: "unreachable", runtimeError: tmuxFailure(e, "tmux pane inspection failed") }; }
|
|
5196
|
+
}
|
|
5197
|
+
/** One extra read per socket/session, never per row. Keep window discovery's missing-socket
|
|
5198
|
+
* handling; a failed pane read after successful discovery is unknown, not proof of a stop. */
|
|
5199
|
+
function statusTmuxPanes(snapshot, socket, session, io) {
|
|
5200
|
+
if (!snapshot.windows?.length) return snapshot;
|
|
5201
|
+
try {
|
|
5202
|
+
const args = ["list-panes", "-s", "-t", `=${session}`, "-F", "#{window_name}\t#{pane_id}\t#{pane_dead}\t#{pane_current_command}\t#{pane_pid}"];
|
|
5203
|
+
const output = socket ? tmuxOn(socket, args, io) : (io?.exec || execFileSync)("tmux", ["-u", ...args], {
|
|
5204
|
+
encoding: "utf8", timeout: 10000, maxBuffer: 1024 * 1024, stdio: ["ignore", "pipe", "pipe"],
|
|
5205
|
+
});
|
|
5206
|
+
const panes = new Map();
|
|
5207
|
+
for (const line of output.split("\n").filter(Boolean)) {
|
|
5208
|
+
const tab = line.indexOf("\t");
|
|
5209
|
+
if (tab < 0) throw new Error("invalid tmux pane response");
|
|
5210
|
+
const window = line.slice(0, tab);
|
|
5211
|
+
if (!panes.has(window)) panes.set(window, []);
|
|
5212
|
+
panes.get(window).push(line.slice(tab + 1));
|
|
5213
|
+
}
|
|
5214
|
+
return { ...snapshot, panes };
|
|
5215
|
+
} catch (e) { return { error: tmuxFailure(e, "tmux list-panes failed") }; }
|
|
5191
5216
|
}
|
|
5192
5217
|
export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io) {
|
|
5193
5218
|
// Liveness reads each home's RECORDED endpoint (a pre-0.31 home records pi-agents): the recorded
|
|
5194
|
-
// socket, never the ambient $TMUX server
|
|
5195
|
-
//
|
|
5219
|
+
// socket, never the ambient $TMUX server: one window read and one pane read per socket/session,
|
|
5220
|
+
// plus one lazy process scan for shell descendants, independent of the number of homes.
|
|
5221
|
+
// A home without a recorded socket reads the default server.
|
|
5196
5222
|
// A row whose socket file is missing is checked against one process scan of the host, made the
|
|
5197
5223
|
// first time a row needs it and shared by every row (`io` reaches it: processesInHome).
|
|
5198
5224
|
let hostScan;
|
|
@@ -5200,10 +5226,12 @@ export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io) {
|
|
|
5200
5226
|
hostScan ??= hostProcesses(io);
|
|
5201
5227
|
return hostScan.ok ? { ok: true, processes: processesWorkingIn(hostScan.processes, home) } : hostScan;
|
|
5202
5228
|
};
|
|
5229
|
+
const inspectPanes = createSessionPaneInspector(io);
|
|
5203
5230
|
const tmuxByEndpoint = new Map();
|
|
5204
5231
|
const windowsOf = (session, socket) => {
|
|
5205
5232
|
const key = JSON.stringify([socket ?? null, session]);
|
|
5206
|
-
if (!tmuxByEndpoint.has(key)) tmuxByEndpoint.set(key,
|
|
5233
|
+
if (!tmuxByEndpoint.has(key)) tmuxByEndpoint.set(key, statusTmuxPanes(
|
|
5234
|
+
socket ? recordedTmuxWindows(socket, session, io) : defaultTmuxWindows(session), socket, session, io));
|
|
5207
5235
|
return tmuxByEndpoint.get(key);
|
|
5208
5236
|
};
|
|
5209
5237
|
const readInstancesOf = (agentDir) => {
|
|
@@ -5253,7 +5281,7 @@ export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io) {
|
|
|
5253
5281
|
: tmuxLiveness(windowsOf(meta.tmux?.session || tmuxSession, meta.tmux?.socket), meta.tmux?.window || meta.instance || e.name, scanOf(home),
|
|
5254
5282
|
// A home that records no socket and no launch (--no-launch) reads the default server only
|
|
5255
5283
|
// by default: that server's missing socket says nothing about it, and stays "not running".
|
|
5256
|
-
!!meta.tmux?.socket || meta.launched === true);
|
|
5284
|
+
!!meta.tmux?.socket || meta.launched === true, inspectPanes);
|
|
5257
5285
|
const identity = servedIdentityOf(meta);
|
|
5258
5286
|
// Feature desktop-facts: `startedAt` — the last session start or restart (the receipt's restarts[]),
|
|
5259
5287
|
// else the spawn's own launch (createdAt), else null (never launched); `identityAddress` — the
|
|
@@ -5272,13 +5300,12 @@ export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io) {
|
|
|
5272
5300
|
};
|
|
5273
5301
|
// Feature waiting-on-you: a producer's live claim that the instance is
|
|
5274
5302
|
// blocked on a human, read only for a running row (one bounded read of
|
|
5275
|
-
// its home log); null otherwise, and null means unknown.
|
|
5276
|
-
//
|
|
5277
|
-
//
|
|
5278
|
-
// session is observed running a harness, as session inspect reports it.
|
|
5303
|
+
// its home log); null otherwise, and null means unknown. Pane liveness is
|
|
5304
|
+
// already observed in the batch; still require the independent receipt
|
|
5305
|
+
// to agree before showing a claim, just as session inspect does.
|
|
5279
5306
|
let waitingOnYou = liveness.running === true ? liveWaiting(home) : null;
|
|
5280
5307
|
if (waitingOnYou) {
|
|
5281
|
-
try { const s = instanceSessionTarget(home); if (!s.target
|
|
5308
|
+
try { const s = instanceSessionTarget(home); if (!s.target) waitingOnYou = null; }
|
|
5282
5309
|
catch { waitingOnYou = null; }
|
|
5283
5310
|
}
|
|
5284
5311
|
// `retire` is only ever the value read above: a record that carries one (hand-edited, or
|
package/lib/session-input.mjs
CHANGED
|
@@ -28,37 +28,54 @@ export function inspectSessionTarget(target, io, { includeSize = false } = {}) {
|
|
|
28
28
|
if (/can't find (window|session)/i.test(String(e.stderr || ""))) return { backend: "tmux", present: false, state: "stopped" };
|
|
29
29
|
throw e;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
31
|
+
return createSessionPaneInspector(io)(rows, { includeSize });
|
|
32
|
+
}
|
|
33
|
+
/** Interpret one window's panes with the lifecycle's shell/descendant rule. A status read shares
|
|
34
|
+
* one inspector across windows so both successful and failed process scans cost one child. */
|
|
35
|
+
export function createSessionPaneInspector(io) {
|
|
36
|
+
let processRead;
|
|
37
|
+
const readProcesses = () => {
|
|
38
|
+
if (!processRead) {
|
|
39
|
+
try {
|
|
40
|
+
const output = (io?.exec || execFileSync)("ps", ["-axo", "pid=,ppid=,comm="], {
|
|
41
|
+
encoding: "utf8", timeout: 10000, maxBuffer: 4 * 1024 * 1024, stdio: ["ignore", "pipe", "pipe"],
|
|
42
|
+
});
|
|
43
|
+
processRead = { rows: output.split("\n").map(line => line.trim().match(/^(\d+)\s+(\d+)\s+(.+)$/)).filter(Boolean) };
|
|
44
|
+
} catch (error) { processRead = { error }; }
|
|
45
|
+
}
|
|
46
|
+
if (processRead.error) throw processRead.error;
|
|
47
|
+
return processRead.rows;
|
|
48
|
+
};
|
|
49
|
+
return (rows, { includeSize = false } = {}) => {
|
|
50
|
+
if (!rows.length) return { backend: "tmux", present: false, state: "stopped" };
|
|
51
|
+
if (rows.length !== 1) throw new Error("session window has multiple panes; choose an unsplit agent window");
|
|
52
|
+
const [paneId, dead, command, panePid, cols, rowsCount] = rows[0].split("\t");
|
|
53
|
+
if (!/^%\d+$/.test(paneId) || !["0", "1"].includes(dead)) throw new Error("invalid tmux pane response");
|
|
54
|
+
if (includeSize && ![cols, rowsCount].every(value => /^[1-9]\d*$/.test(value) && Number.isSafeInteger(Number(value)))) {
|
|
55
|
+
throw new Error("invalid tmux pane response");
|
|
56
|
+
}
|
|
57
|
+
let state = dead === "1" ? "stopped" : "unknown";
|
|
58
|
+
if (dead === "0" && shells.has(command)) {
|
|
59
|
+
// macOS tmux can report the wrapper shell while the harness is its child.
|
|
60
|
+
// Only a shell with no non-shell descendants is a fallback prompt.
|
|
61
|
+
if (!/^\d+$/.test(panePid)) throw new Error("tmux returned no pane process id");
|
|
62
|
+
const processes = readProcesses();
|
|
63
|
+
const descendants = new Set([panePid]);
|
|
64
|
+
let active = false;
|
|
65
|
+
for (let changed = true; changed;) {
|
|
66
|
+
changed = false;
|
|
67
|
+
for (const [, pid, parent, name] of processes) {
|
|
68
|
+
if (descendants.has(parent) && !descendants.has(pid)) {
|
|
69
|
+
descendants.add(pid); changed = true;
|
|
70
|
+
if (!shells.has(basename(name).replace(/^-/, ""))) active = true;
|
|
71
|
+
}
|
|
55
72
|
}
|
|
56
73
|
}
|
|
74
|
+
state = active ? "unknown" : "shell";
|
|
57
75
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
...(includeSize && dead === "0" ? { size: { cols: Number(cols), rows: Number(rowsCount) } } : {}) };
|
|
76
|
+
return { backend: "tmux", present: dead === "0", state, paneId,
|
|
77
|
+
...(includeSize && dead === "0" ? { size: { cols: Number(cols), rows: Number(rowsCount) } } : {}) };
|
|
78
|
+
};
|
|
62
79
|
}
|
|
63
80
|
// Settling gives a large bracketed paste time before the single Enter. Screen
|
|
64
81
|
// bytes are observations only: neither change nor silence proves acceptance
|
package/package-catalog.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"oats.aweb": {
|
|
10
10
|
"url": "https://github.com/awebai/oats-aweb.git",
|
|
11
|
-
"ref": "v1.
|
|
11
|
+
"ref": "v1.29.0",
|
|
12
12
|
"path": "oats-package"
|
|
13
13
|
},
|
|
14
14
|
"oats.jira": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"oats.framework": {
|
|
45
45
|
"url": "https://github.com/awebai/oats.git",
|
|
46
|
-
"ref": "oats-framework/v1.
|
|
46
|
+
"ref": "oats-framework/v1.13.0",
|
|
47
47
|
"path": "oats-package"
|
|
48
48
|
}
|
|
49
49
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awebai/oats",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "OATS (Open Agent Team Specification) — durable souls, disposable instances, targetable capability packages, and the runtime-neutral oats CLI/kernel.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** The deployment's capability table: `oats capabilities --json`, held per
|
|
2
|
+
* deployment and keyed by the workspace state it describes, so a read costs
|
|
3
|
+
* a kernel run only when that state moved (or the caller forces a live one),
|
|
4
|
+
* never on every poll or view open. The holding rules (one flight per
|
|
5
|
+
* deployment, last good table kept with the failure next to it, retry after
|
|
6
|
+
* RETRY_MS, unbound prefetch bound by the same cycle's settle) are
|
|
7
|
+
* keyed-catalog.mjs's; this module is the kernel read, the key and the shape.
|
|
8
|
+
*
|
|
9
|
+
* A client makes its own catalog and owns it: nothing is held at module level, so two catalogs
|
|
10
|
+
* share no flight and no held entry. It takes the client's terms (client-terms.mjs), which the
|
|
11
|
+
* default kernel read words its refusals with, and an optional `exec` that read runs the CLI
|
|
12
|
+
* through (cli-adapter.mjs `runJson`'s `io.exec`). */
|
|
13
|
+
import { cliWorkspace } from './workspace-cli.mjs';
|
|
14
|
+
import { requireTerms } from './client-terms.mjs';
|
|
15
|
+
import { capabilitiesData, observationData } from './deployment-data.mjs';
|
|
16
|
+
import { soulCatalogKey } from './soul-catalog.mjs';
|
|
17
|
+
import { createKeyedCatalog } from './keyed-catalog.mjs';
|
|
18
|
+
|
|
19
|
+
export const CAPABILITY_CATALOG_RETRY_MS = 60_000;
|
|
20
|
+
/** The client's own transport/probe codes (workspace-cli.mjs); any other code on
|
|
21
|
+
* an ok:false result is the kernel's own refusal, reported verbatim. */
|
|
22
|
+
const LOCAL_CODES = new Set(['E_CLI_UNAVAILABLE', 'E_WORKSPACE_FEATURE', 'E_CLI_FAILED', 'E_CLI_PROTOCOL', 'E_CLI_TIMEOUT', 'E_CLI_OUTPUT_LIMIT']);
|
|
23
|
+
|
|
24
|
+
/** What the catalog table depends on, from `oats workspace status --json` as
|
|
25
|
+
* projected by workspaceStatusData. Member capabilities move with member
|
|
26
|
+
* commits and the workspace commit (the soul key carries those, plus the
|
|
27
|
+
* CLI); package capabilities move with package identity (id/version/commit/
|
|
28
|
+
* integrity, i.e. the lock rows); whether the lock is current moves with
|
|
29
|
+
* declaredPackages/unsynced/stale (oats-local.yaml or the lock changed). The
|
|
30
|
+
* lock fact itself has no hash, so the package rows are its identity and
|
|
31
|
+
* its path/lockfileVersion only mark a different lock file altogether.
|
|
32
|
+
* Names, warnings, problems, defaults and clones are deliberately not here:
|
|
33
|
+
* they change without the table changing. */
|
|
34
|
+
export function capabilityCatalogKey(cli, workspaceStatus) {
|
|
35
|
+
const ws = workspaceStatus || {};
|
|
36
|
+
return JSON.stringify([soulCatalogKey(cli, workspaceStatus),
|
|
37
|
+
(ws.packages || []).map(p => [p.id ?? null, p.version ?? null, p.commit ?? null, p.integrity ?? null]),
|
|
38
|
+
ws.declaredPackages ?? [], ws.unsynced ?? [], ws.stale ?? [],
|
|
39
|
+
ws.lock ? [ws.lock.path ?? null, ws.lock.lockfileVersion ?? null] : null]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function createCapabilityCatalog({ terms, exec, invoke = (cli, options) => exec ? cliWorkspace(cli, options, terms, { exec }) : cliWorkspace(cli, options, terms), now = () => Date.now() } = {}) {
|
|
43
|
+
requireTerms(terms, 'createCapabilityCatalog');
|
|
44
|
+
async function read(deployment, cli, options) {
|
|
45
|
+
let result;
|
|
46
|
+
try { result = await invoke(cli, { action: 'capabilities', context: deployment, ...options }); }
|
|
47
|
+
catch { return { value: null, reason: { code: 'E_CLI_FAILED', message: '', kernel: false } }; }
|
|
48
|
+
if (result?.ok !== true) {
|
|
49
|
+
const code = typeof result?.reason?.code === 'string' ? result.reason.code : 'E_CLI_FAILED';
|
|
50
|
+
return { value: null, reason: { code, message: String(result?.reason?.message || ''), kernel: !LOCAL_CODES.has(code) } };
|
|
51
|
+
}
|
|
52
|
+
try { return { value: capabilitiesData(result.document), observedAt: observationData(result.document).observedAt }; } // a malformed stamp is no stamp; the table stands
|
|
53
|
+
catch { return { value: null, reason: { code: 'E_CLI_PROTOCOL', message: '', kernel: false } }; }
|
|
54
|
+
}
|
|
55
|
+
const catalog = createKeyedCatalog({ read, retryMs: CAPABILITY_CATALOG_RETRY_MS, now });
|
|
56
|
+
const project = (deployment, entry) => entry && { key: entry.key, capabilities: entry.value, reason: entry.reason, at: entry.at, observedAt: entry.observedAt, stale: entry.stale, refreshing: catalog.refreshing(deployment) };
|
|
57
|
+
const key = (cli, workspaceStatus) => capabilityCatalogKey(cli, workspaceStatus);
|
|
58
|
+
/** Synchronous decision for this workspace state, as the soul catalog's: `entry` is what is held now and
|
|
59
|
+
* `pending` the read it started or joined (null when none), both projected. Never awaits. */
|
|
60
|
+
function settle(deployment, cli, workspaceStatus, options = {}) {
|
|
61
|
+
const { entry, pending } = catalog.settle(deployment, cli, key(cli, workspaceStatus), options);
|
|
62
|
+
return { entry: project(deployment, entry), pending: pending && pending.then(landed => project(deployment, landed)) };
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
/** Cold cycle: start the read alongside the roster reads, before the key is known. */
|
|
66
|
+
prefetch(deployment, cli, options = {}) { return catalog.prefetch(deployment, cli, options); },
|
|
67
|
+
/** Bind this cycle's key: a read starts only when the held table is not for this state (or its
|
|
68
|
+
* failure is old enough to retry) and none is in flight. Never awaits. */
|
|
69
|
+
ensure(deployment, cli, workspaceStatus, options = {}) { catalog.settle(deployment, cli, key(cli, workspaceStatus), options); },
|
|
70
|
+
settle,
|
|
71
|
+
/** The held table, immediately, whenever it is a healthy answer — a table past HELD_TTL_MS
|
|
72
|
+
* included: then this request starts (or joins) one re-read behind it and the answer says
|
|
73
|
+
* `refreshing` (stale-while-revalidate, request-driven: a Workspace-tab visit never waits for
|
|
74
|
+
* an `oats capabilities` run while the key is unchanged, and nobody looking costs nothing).
|
|
75
|
+
* Awaited only when nothing healthy is held: a first read, a held failure (table behind it or
|
|
76
|
+
* not — the boundary shows it as a failure and today's Retry is a plain read, so it reads now
|
|
77
|
+
* whatever the retry window says; the window throttles background cycles only), or a forced
|
|
78
|
+
* live read (refresh: true → maxAge 0). */
|
|
79
|
+
async read(deployment, cli, workspaceStatus, { refresh = false, maxAge } = {}) {
|
|
80
|
+
const k = key(cli, workspaceStatus), options = maxAge !== undefined ? { maxAge } : {};
|
|
81
|
+
if (refresh) return project(deployment, await catalog.refresh(deployment, cli, k));
|
|
82
|
+
const { entry } = catalog.settle(deployment, cli, k, options);
|
|
83
|
+
if (!entry?.value || entry.reason) return project(deployment, await catalog.demand(deployment, cli, k, options));
|
|
84
|
+
if (entry.stale) void catalog.revalidate(deployment, cli, k, options)?.catch(() => {});
|
|
85
|
+
return project(deployment, entry);
|
|
86
|
+
},
|
|
87
|
+
/** Read-only view of what is held (tests and diagnostics); nothing reads it on the request path. */
|
|
88
|
+
held(deployment) { return project(deployment, catalog.held(deployment)); },
|
|
89
|
+
refreshing: catalog.refreshing,
|
|
90
|
+
forget: catalog.forget,
|
|
91
|
+
forgetAll: catalog.forgetAll,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** A capability's facts as its page shows them, for any client: the "Comes from" rows and what it
|
|
2
|
+
* provides, projected from the catalog row (`oats capabilities`, or a soul's resolved capability in the
|
|
3
|
+
* same shape) and workspace status. Only reported facts: a fact the kernel did not report is no row, and
|
|
4
|
+
* nothing is invented. The page's own words are CAPABILITY_COPY, so no client writes its own. */
|
|
5
|
+
import { memberNames, capabilitySource } from './capability-rows.mjs';
|
|
6
|
+
|
|
7
|
+
const text = v => typeof v === 'string' && v ? v : null;
|
|
8
|
+
const list = v => Array.isArray(v) ? v : [];
|
|
9
|
+
const short = v => typeof v === 'string' && /^[0-9a-f]{40}$/i.test(v) ? v.slice(0, 7) : v;
|
|
10
|
+
|
|
11
|
+
/** The capability page's own words. `souls(n)` is the "Used by" count; `behind(n)` follows an instance count, joined with ` · `. */
|
|
12
|
+
export const CAPABILITY_COPY = Object.freeze({
|
|
13
|
+
comesFrom: 'Comes from',
|
|
14
|
+
provides: 'Provides',
|
|
15
|
+
usedBy: 'Used by',
|
|
16
|
+
unlistable: 'Not listable: a spawn of it would refuse.',
|
|
17
|
+
none: 'None',
|
|
18
|
+
noSoul: 'No soul here includes it.',
|
|
19
|
+
noInstance: 'No instance carries it yet.',
|
|
20
|
+
souls: n => `${n} soul${n === 1 ? '' : 's'}`,
|
|
21
|
+
behind: n => `${n} on an older version`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
/** Where a package comes from, in workspace status terms: the official catalog or a git source. */
|
|
25
|
+
export function packageOrigin(source) {
|
|
26
|
+
if (!text(source)) return null;
|
|
27
|
+
if (source.startsWith('catalog:')) return 'official catalog';
|
|
28
|
+
const git = /^git:(?:[a-z]+:\/\/)?(?:[^@/]+@)?([^/:@]+)/i.exec(source);
|
|
29
|
+
return git ? `git · ${git[1]}` : source;
|
|
30
|
+
}
|
|
31
|
+
/** sha256-<64 hex> → sha256:9f2c…a71e (the full value stays in the title). */
|
|
32
|
+
export function fingerprint(integrity) {
|
|
33
|
+
const m = /^sha256-([0-9a-f]{64})$/i.exec(integrity || '');
|
|
34
|
+
return m ? `sha256:${m[1].slice(0, 4)}…${m[1].slice(-4)}` : text(integrity);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** One "Comes from" row, [label, value] or [label, value, full], or none when the value is not reported text.
|
|
38
|
+
* `full` (the whole value, where the row shows it shortened) is kept only when it says more than the value. */
|
|
39
|
+
const fact = (label, value, full) => !text(value) ? [] : [text(full) && full !== value ? [label, value, full] : [label, value]];
|
|
40
|
+
|
|
41
|
+
/** `{ origin, provides }`. `origin`: the "Comes from" rows, in order: a package's Package, Pinned (its version
|
|
42
|
+
* and where it comes from), Commit and Fingerprint (the integrity workspace status reports for it, else the
|
|
43
|
+
* resolved capability's); a member or external capability's Repository, Latest, Path, Fingerprint (the Git
|
|
44
|
+
* tree of its directory, kernel #217) and Owned when it is private. `provides`: [label, names] for Skills,
|
|
45
|
+
* Commands and Hooks, each only when the row carries it; names is an array, or null when the kernel could
|
|
46
|
+
* not list them (a spawn of it would refuse). `names`: memberNames(status), when the caller holds it. */
|
|
47
|
+
export function capabilityFacts(row, { status, names = memberNames(status) } = {}) {
|
|
48
|
+
let origin;
|
|
49
|
+
if (row.kind === 'package') {
|
|
50
|
+
const pkg = list(status?.packages).find(p => p.id === row.package), integrity = pkg?.integrity || row.resolved?.from?.integrity;
|
|
51
|
+
origin = [...fact('Package', row.package), ...fact('Pinned', [row.version, packageOrigin(pkg?.source)].filter(Boolean).join(' · ')),
|
|
52
|
+
...fact('Commit', short(row.commit), row.commit), ...fact('Fingerprint', fingerprint(integrity), integrity)];
|
|
53
|
+
} else {
|
|
54
|
+
origin = [...fact('Repository', capabilitySource(row, names).label, row.repoKey), ...fact('Latest', short(row.commit), row.commit), ...fact('Path', row.path),
|
|
55
|
+
...fact('Fingerprint', short(row.tree), row.tree), ...(row.private === true ? fact('Owned', 'this repo\'s souls only') : [])];
|
|
56
|
+
}
|
|
57
|
+
const provides = [['Skills', row.skills], ['Commands', row.commands], ['Hooks', row.hooks]].filter(([, names]) => names !== undefined);
|
|
58
|
+
return { origin, provides };
|
|
59
|
+
}
|