@awebai/oats 0.52.0 → 0.54.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 +2 -1
- package/bin/oats.mjs +314 -92
- package/docs/capabilities.md +66 -4
- package/docs/configuration.md +66 -3
- package/docs/design/2026-09-23-workspace-module-contracts.md +3 -0
- package/docs/desktop-cli-api.md +696 -60
- package/docs/desktop-instance-start.md +25 -12
- package/docs/execution-targets.md +1 -0
- package/docs/implementation.md +184 -12
- package/docs/integrations.md +6 -3
- package/docs/knowledge.md +2 -2
- package/docs/macos-test-runs.md +246 -0
- package/docs/official-catalog.md +5 -5
- package/docs/packages.md +14 -14
- package/docs/release-lane.md +210 -6
- package/docs/release-notes/v0.53.0.md +1288 -0
- package/docs/release-notes/v0.54.0.md +142 -0
- package/docs/schedules.md +7 -1
- package/docs/souls-and-instances.md +239 -16
- package/docs/tui.md +453 -21
- package/docs/upgrading.md +310 -0
- package/docs/workspaces.md +123 -3
- package/lib/automations.mjs +22 -22
- package/lib/claim.mjs +93 -4
- package/lib/config-data.mjs +4 -1
- package/lib/core.mjs +569 -121
- package/lib/instance-events.mjs +19 -1
- package/lib/instance-git.mjs +39 -3
- package/lib/instance-inspect.mjs +5 -6
- package/lib/instance-lifecycle.mjs +145 -18
- package/lib/instance-resolution.mjs +59 -6
- package/lib/launch-preference.mjs +226 -15
- package/lib/local-edit.mjs +118 -0
- package/lib/packages.mjs +18 -5
- package/lib/pi-bridge.mjs +308 -0
- package/lib/refused-text.mjs +11 -0
- package/lib/remote.mjs +404 -60
- package/lib/resolve.mjs +2 -1
- package/lib/retained-after-retire.mjs +2 -2
- package/lib/retire-output.mjs +12 -1
- package/lib/schedule-host.mjs +6 -35
- package/lib/shell-word.mjs +13 -0
- package/lib/soul-launch-verbs.mjs +153 -0
- package/lib/stable-node.mjs +62 -0
- package/lib/teams-verbs.mjs +18 -46
- package/lib/workspace.mjs +75 -27
- package/package-catalog.json +4 -4
- package/package.json +2 -1
- package/packages/client/attach-exit.mjs +25 -0
- package/packages/client/cli-adapter.mjs +16 -3
- package/packages/client/cli-locator.mjs +2 -2
- package/packages/client/deployment-contract.mjs +4 -0
- package/packages/client/deployment-facts.mjs +71 -10
- package/packages/client/deployment-panel.mjs +49 -11
- package/packages/client/deployment-read-cli.mjs +7 -3
- package/packages/client/display-text.mjs +8 -2
- package/packages/client/instance-acts.mjs +46 -10
- package/packages/client/instance-events-contract.mjs +4 -2
- package/packages/client/instance-presentation.mjs +66 -2
- package/packages/client/instance-tree.mjs +23 -14
- package/packages/client/kernel-lines.mjs +31 -0
- package/packages/client/kernel-made.mjs +23 -0
- package/packages/client/launch-prompt-outcome.mjs +51 -16
- package/packages/client/lifecycle-contract.mjs +45 -4
- package/packages/client/liveness.mjs +14 -1
- package/packages/client/own-codes.mjs +31 -0
- package/packages/client/panel-views.mjs +18 -11
- package/packages/client/readiness-contract.mjs +3 -1
- package/packages/client/remote-address.mjs +34 -9
- package/packages/client/remote-identity-memory.mjs +94 -0
- package/packages/client/remote-roster.mjs +92 -6
- package/packages/client/session-attach.mjs +175 -0
- package/packages/client/spawn-apply-contract.mjs +16 -4
- package/packages/client/spawn-messages.mjs +26 -3
- package/packages/client/spawn-preview-cli.mjs +8 -2
- package/packages/client/spawn-preview-contract.mjs +5 -1
- package/packages/client/terminal-exec.mjs +21 -0
- package/packages/client/workspace-choices.mjs +95 -0
- package/packages/client/workspace-views.mjs +39 -3
- package/packages/record/README.md +21 -0
- package/packages/record/bin/setup.mjs +108 -15
- package/packages/tui/README.md +30 -12
- package/packages/tui/lib/actions.mjs +16 -1
- package/packages/tui/lib/client.mjs +32 -1
- package/packages/tui/lib/config.mjs +151 -0
- package/packages/tui/lib/main.mjs +117 -46
- package/packages/tui/lib/model.mjs +392 -0
- package/packages/tui/lib/read.mjs +473 -0
- package/packages/tui/lib/store.mjs +364 -0
- package/packages/tui/lib/term/keys.mjs +44 -0
- package/packages/tui/lib/term/screen.mjs +16 -4
- package/packages/tui/lib/term/text.mjs +60 -0
- package/packages/tui/lib/term/tty.mjs +13 -3
- package/packages/tui/lib/views/detail.mjs +46 -0
- package/packages/tui/lib/views/frame.mjs +230 -36
- package/packages/tui/lib/views/help.mjs +125 -13
- package/packages/tui/lib/views/instances.mjs +137 -0
- package/packages/tui/lib/views/scroll.mjs +19 -0
- package/packages/tui/lib/views/switcher.mjs +97 -0
- package/skills/oats-getting-started/SKILL.md +8 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// The switcher of workspaces: (model, area) -> rows of spans. Pure: no IO, no clock, no escape
|
|
2
|
+
// byte. It takes the whole body of the frame. A workspace's name, its machines and how many of
|
|
3
|
+
// its deployments are not live are the shared home's words and go through shown(), as does a
|
|
4
|
+
// folder's name and path; the marks, the headings of its own and its few sentences are the TUI's.
|
|
5
|
+
// Nothing is told by colour alone: the selected row carries `>` as well as reverse video, and
|
|
6
|
+
// the workspace that is open carries `*`.
|
|
7
|
+
import { lit, shown } from "../term/text.mjs";
|
|
8
|
+
import { style } from "../term/style.mjs";
|
|
9
|
+
import { cutNote, measured } from "./instances.mjs";
|
|
10
|
+
|
|
11
|
+
/** The mark of the workspace that is open (the help view lists it from here). */
|
|
12
|
+
export const OPEN_MARK = "*";
|
|
13
|
+
/** The switcher's own sentences. `none`: its second sentence ends in a command, which is a piece
|
|
14
|
+
* of its own so that a narrow row moves it whole to the next one and never cuts it. */
|
|
15
|
+
export const SWITCHER_TEXT = Object.freeze({
|
|
16
|
+
none: Object.freeze(["No workspace to show.", "Start it in a deployment, or name one:", "oats tui --dir <path>"]),
|
|
17
|
+
nomatch: "No workspace matches the filter.",
|
|
18
|
+
gone: "That workspace is no longer listed.",
|
|
19
|
+
refused: "Not an OATS deployment any more.",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** The columns of a choice: the selection mark in the first cell, the open mark, then the label.
|
|
23
|
+
* A heading and every line that is not a choice start two cells before the labels. */
|
|
24
|
+
const OPEN = 2, LABEL = 4, ASIDE = LABEL - 2;
|
|
25
|
+
/** One cell of margin at the right edge, as the header and the footer keep. */
|
|
26
|
+
const MARGIN = 1;
|
|
27
|
+
/** The cells between two columns. */
|
|
28
|
+
const GAP = 2;
|
|
29
|
+
/** The labels' column is a third of the width, within these bounds: a column of a fixed width
|
|
30
|
+
* does not move while the list scrolls, and at the smallest width the frame is drawn at it
|
|
31
|
+
* leaves the second column the cells of the longest line of the TUI's own that stands there. */
|
|
32
|
+
const LABEL_MIN = 20, LABEL_MAX = 40;
|
|
33
|
+
|
|
34
|
+
const PLAIN = style();
|
|
35
|
+
const DIM = style({ dim: true });
|
|
36
|
+
const SELECTED = style({ reverse: true });
|
|
37
|
+
|
|
38
|
+
/** One choice in an area `cols` wide: a workspace, or a folder that is not opened yet. What a
|
|
39
|
+
* workspace says of its deployments that are not live stands whole at the right edge; when the
|
|
40
|
+
* row is too narrow the place is cut first, then the label. */
|
|
41
|
+
function choiceRow(item, cols) {
|
|
42
|
+
const look = (own) => (item.selected ? SELECTED : own);
|
|
43
|
+
const edge = cols - MARGIN;
|
|
44
|
+
const labelCols = Math.min(Math.max(Math.floor(cols / 3), LABEL_MIN), LABEL_MAX), placeCol = LABEL + labelCols + GAP;
|
|
45
|
+
const spans = [];
|
|
46
|
+
if (item.selected) spans.push({ col: 0, width: cols, style: SELECTED }, { col: 0, text: lit(">"), style: SELECTED, width: 1 });
|
|
47
|
+
if (item.open) spans.push({ col: OPEN, text: lit(OPEN_MARK), style: look(PLAIN), width: 1 });
|
|
48
|
+
const live = measured(item.notLiveText);
|
|
49
|
+
const liveCol = Math.max(LABEL, edge - live.width);
|
|
50
|
+
// Where the label and the place end: at the edge, or two cells before what stands there.
|
|
51
|
+
const limit = live.width ? liveCol - GAP : edge;
|
|
52
|
+
// A folder that turned out not to be a deployment says so where its path stood.
|
|
53
|
+
const place = item.refused ? { text: lit(SWITCHER_TEXT.refused), width: SWITCHER_TEXT.refused.length } : measured(item.place);
|
|
54
|
+
// With no place to show, the label has the row.
|
|
55
|
+
const labelWidth = Math.max(0, Math.min(place.width ? labelCols : limit - LABEL, limit - LABEL));
|
|
56
|
+
if (labelWidth) spans.push({ col: LABEL, text: shown(item.label), style: look(PLAIN), width: labelWidth });
|
|
57
|
+
if (place.width && limit > placeCol) spans.push({ col: placeCol, text: place.text, style: look(item.refused ? PLAIN : DIM), width: limit - placeCol });
|
|
58
|
+
if (live.width) spans.push({ col: liveCol, text: live.text, style: look(PLAIN), width: Math.max(0, Math.min(live.width, edge - liveCol)) });
|
|
59
|
+
return spans.filter((span) => span.width > 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The lines above the choices, top to bottom, for an area `cols` wide: that the workspace which
|
|
63
|
+
* was open is no longer listed (something that happened, so not dim), and why no workspace is
|
|
64
|
+
* listed (dim, as the list's own empty line is). */
|
|
65
|
+
function leadLines(s, cols) {
|
|
66
|
+
const lines = [];
|
|
67
|
+
if (s.said === "gone") lines.push({ text: SWITCHER_TEXT.gone, style: PLAIN });
|
|
68
|
+
if (s.empty === "nomatch") lines.push({ text: SWITCHER_TEXT.nomatch, style: DIM });
|
|
69
|
+
if (s.empty === "none") {
|
|
70
|
+
const [first, second, command] = SWITCHER_TEXT.none, whole = `${second} ${command}`;
|
|
71
|
+
for (const text of [first, ...(ASIDE + whole.length <= cols - MARGIN ? [whole] : [second, command])]) lines.push({ text, style: DIM });
|
|
72
|
+
}
|
|
73
|
+
return lines;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** `size.rows` rows for an area `size.cols` wide: the lines above, the model's window of the
|
|
77
|
+
* switcher's rows, one item per row, and on the last row what is cut off above and below.
|
|
78
|
+
* The model's window is as tall as the area, so a line above takes its row only while the rows
|
|
79
|
+
* given leave one: a choice is never hidden for it. */
|
|
80
|
+
export function switcher(m, size) {
|
|
81
|
+
const rows = Array.from({ length: size.rows }, () => []);
|
|
82
|
+
const s = m.switcher;
|
|
83
|
+
if (!s || size.rows < 1) return rows;
|
|
84
|
+
const { cols } = size, aside = Math.max(0, cols - ASIDE - MARGIN);
|
|
85
|
+
const note = cutNote(s.above, s.below);
|
|
86
|
+
const lead = leadLines(s, cols).slice(0, Math.max(0, size.rows - s.rows.length - (note ? 1 : 0)));
|
|
87
|
+
lead.forEach((line, i) => { rows[i] = [{ col: ASIDE, text: lit(line.text), style: line.style, width: aside }]; });
|
|
88
|
+
s.rows.forEach((item, i) => {
|
|
89
|
+
const at = lead.length + i;
|
|
90
|
+
if (at >= size.rows) return;
|
|
91
|
+
if (item.heading !== undefined) rows[at] = [{ col: ASIDE, text: item.shared ? shown(item.heading) : lit(item.heading), style: DIM, width: aside }];
|
|
92
|
+
else if (item.own !== undefined) rows[at] = [{ col: LABEL, text: lit(item.own), style: DIM, width: Math.max(0, cols - LABEL - MARGIN) }];
|
|
93
|
+
else rows[at] = choiceRow(item, cols);
|
|
94
|
+
});
|
|
95
|
+
if (note) rows[size.rows - 1] = [{ col: ASIDE, text: lit(note), style: DIM, width: aside }];
|
|
96
|
+
return rows;
|
|
97
|
+
}
|
|
@@ -60,8 +60,8 @@ members:
|
|
|
60
60
|
- git:github.com/acme/agents # the host is a member too
|
|
61
61
|
- git:github.com/acme/platform
|
|
62
62
|
packages:
|
|
63
|
-
oats.framework: v1.
|
|
64
|
-
oats.okf:
|
|
63
|
+
oats.framework: v1.10.0 # bare versions resolve through the official catalog
|
|
64
|
+
oats.okf: v5.0.3
|
|
65
65
|
defaults:
|
|
66
66
|
capabilities: { oats.core: { from: package } }
|
|
67
67
|
knowledge: { oats.okf: { from: package } }
|
|
@@ -171,6 +171,12 @@ oats spawn backend-expert --task "First concrete task"
|
|
|
171
171
|
oats status
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
+
Read the diagnostics below the `oats souls` table before choosing a soul.
|
|
175
|
+
Both `oats souls` and `oats capabilities` print all catalog problems there,
|
|
176
|
+
on stdout, while partial listings still exit 0. `--json` carries the same
|
|
177
|
+
ordered `problems` rows with their owner and path fields (`repoKey`,
|
|
178
|
+
`package`, `source`, `path`); a problem does not always mean an item is absent.
|
|
179
|
+
|
|
174
180
|
OATS confirms Claude's development-channel prompt by itself whenever it
|
|
175
181
|
launches Claude with `--dangerously-load-development-channels
|
|
176
182
|
plugin:aweb-channel@awebai-marketplace` (the default `delivery: channel`,
|