@oh-hai/cli 0.4.2 → 0.4.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/CHANGELOG.md +37 -0
- package/dist/commands/fleet.js +91 -35
- package/dist/commands/fleet.js.map +1 -1
- package/dist/commands/messaging/capability.d.ts +0 -1
- package/dist/commands/messaging/capability.js +12 -13
- package/dist/commands/messaging/capability.js.map +1 -1
- package/dist/commands/messaging/sessions-http.d.ts +14 -3
- package/dist/commands/messaging/sessions-http.js +32 -4
- package/dist/commands/messaging/sessions-http.js.map +1 -1
- package/dist/commands/registry.js +10 -2
- package/dist/commands/registry.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,43 @@ Notable changes to the `oh-hai` CLI. Versions follow [semver](https://semver.org
|
|
|
4
4
|
pushing a `cli-vX.Y.Z` tag (runbook: `docs/runbooks/cli-release.md` in the repo), which publishes the
|
|
5
5
|
npm package and attaches the standalone binaries to the GitHub Release.
|
|
6
6
|
|
|
7
|
+
## 0.4.4 — 2026-08-18
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `oh-hai fleet ls` takes its scope from the **`GET /v1/sessions` response** (`scope`) instead of the
|
|
12
|
+
public capability document. The §16.4 grant became per-account on the Hub side, and
|
|
13
|
+
`/.well-known/ma2h` is unauthenticated — it has no caller to answer for — so the endpoint that
|
|
14
|
+
serves the rows is now the one that states what it served. `--json` still reports
|
|
15
|
+
`data.scope` as `account` | `own` | `unknown`, and a Hub that reports no scope is captioned
|
|
16
|
+
`unknown` rather than guessed at or inferred from which rows came back.
|
|
17
|
+
|
|
18
|
+
The `own` caption now names **both** reasons a list can be narrowed — the account has not enabled
|
|
19
|
+
Agent messaging, or the deployment forces own-only — because the CLI cannot tell them apart and
|
|
20
|
+
naming only one sends the user to the wrong lever.
|
|
21
|
+
|
|
22
|
+
The capability document still advertises `sessions.agent_list_visibility`, but per MA2H SCP #62 it
|
|
23
|
+
states the deployment **ceiling** rather than the effective grant, so reading it as the answer
|
|
24
|
+
overstates the case for an account that has not enabled Agent messaging. That is why the scope
|
|
25
|
+
moved to the authenticated response; 0.4.1 through 0.4.3 read the ceiling and can therefore caption
|
|
26
|
+
a narrowed list as account-wide. ([#860](https://github.com/autnmy/oh-hai/issues/860))
|
|
27
|
+
|
|
28
|
+
## 0.4.3 — 2026-08-18
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- `oh-hai fleet ls --kind <k> --project <p> --label <substring>` — selection over the page the Hub
|
|
33
|
+
served, so a coordinator with dozens of live sessions stops grepping the table. `--kind` and
|
|
34
|
+
`--project` are exact; `--label` is a case-insensitive substring. They compose as AND, and with
|
|
35
|
+
`--all`.
|
|
36
|
+
|
|
37
|
+
Applied client-side (the endpoint defines no such parameters), which means a filter can match
|
|
38
|
+
nothing on the current page while matching further back — so an empty filtered result names the
|
|
39
|
+
filter that produced it and still prints the pager hint, rather than reading as "nothing is
|
|
40
|
+
running". Matching is against the raw server strings rather than the terminal-sanitized display
|
|
41
|
+
forms. `--json` gains `data.filters`.
|
|
42
|
+
([#862](https://github.com/autnmy/oh-hai/issues/862))
|
|
43
|
+
|
|
7
44
|
## 0.4.2 — 2026-08-18
|
|
8
45
|
|
|
9
46
|
### Added
|
package/dist/commands/fleet.js
CHANGED
|
@@ -7,19 +7,21 @@
|
|
|
7
7
|
// * An agent ALWAYS sees its own sessions. Unconditional by §16.4, and deliberately so: a
|
|
8
8
|
// restarted or crash-looping agent must be able to find and clear its stale leases before it
|
|
9
9
|
// hits the live-session cap, and gating that read would wedge exactly that agent.
|
|
10
|
-
// * It sees the whole ACCOUNT only
|
|
11
|
-
// §16.4 makes same-account-agent listing an explicit MAY —
|
|
12
|
-
// dashboards, not the required discovery path" —
|
|
10
|
+
// * It sees the whole ACCOUNT only when its account has opted into the §8.0 inter-agent leg and
|
|
11
|
+
// the deployment's ceiling permits it. §16.4 makes same-account-agent listing an explicit MAY —
|
|
12
|
+
// "an optimization for fleet dashboards, not the required discovery path" — and this Hub binds
|
|
13
|
+
// that MAY to the account's own opt-in (issue #860).
|
|
13
14
|
//
|
|
14
15
|
// A list that silently narrowed from "the fleet" to "just me" would be actively misleading: the
|
|
15
|
-
// user would conclude the other agents are gone. So the
|
|
16
|
-
//
|
|
17
|
-
//
|
|
16
|
+
// user would conclude the other agents are gone. So the SERVER states the scope it applied, on the
|
|
17
|
+
// very response that carried the rows, and this command prints that. It does NOT read the
|
|
18
|
+
// capability document: the answer is per-account and that document is public and unauthenticated,
|
|
19
|
+
// so it has no caller to answer for. A Hub that reports no scope is captioned "unknown" — never
|
|
20
|
+
// guessed at, and never inferred from which rows happen to have come back.
|
|
18
21
|
import { buildOk, serializeEnvelope } from "../envelope.js";
|
|
19
22
|
import { sanitizeForTerminal } from "../terminal.js";
|
|
20
23
|
import { parseSubcommandArgs } from "./flags.js";
|
|
21
24
|
import { resolveSubmitIdentity } from "./messaging/identity.js";
|
|
22
|
-
import { fetchCapability } from "./messaging/capability.js";
|
|
23
25
|
import { listSessions } from "./messaging/sessions-http.js";
|
|
24
26
|
import { nonNegativeInt, positiveInt, strictBoolFlag, stringFlag } from "./messaging/shared.js";
|
|
25
27
|
const SUBCOMMANDS = ["ls"];
|
|
@@ -27,6 +29,12 @@ const FLEET_LS_OPTIONS = {
|
|
|
27
29
|
limit: { type: "string" },
|
|
28
30
|
offset: { type: "string" },
|
|
29
31
|
all: { type: "boolean" },
|
|
32
|
+
// Selection over the page the Hub served. CLIENT-SIDE on purpose: `GET /v1/sessions` defines no
|
|
33
|
+
// such query parameters, and inventing them would be a server change this does not need — the
|
|
34
|
+
// existing `--limit`/`--offset` bounds already govern what arrives.
|
|
35
|
+
kind: { type: "string" },
|
|
36
|
+
project: { type: "string" },
|
|
37
|
+
label: { type: "string" },
|
|
30
38
|
};
|
|
31
39
|
/** The Hub's own `SESSION_LIST_MAX` / `SESSION_OFFSET_MAX`, mirrored so the "(more …)" hint is
|
|
32
40
|
* computed against the window the Hub ACTUALLY served — a raw request above the ceiling is
|
|
@@ -47,14 +55,29 @@ export async function fleetCommand(ctx) {
|
|
|
47
55
|
// `strictBoolFlag`, not a lenient truthiness check: `--all=treu` must be a usage error rather than
|
|
48
56
|
// silently showing the narrower list, which reads as "those sessions are gone".
|
|
49
57
|
const includeTerminal = strictBoolFlag(flags.all, "--all");
|
|
58
|
+
// Matched against the RAW server strings, never the terminal-sanitized display forms below: a
|
|
59
|
+
// label carrying a control character still matches what the user typed, and sanitization stays a
|
|
60
|
+
// presentation concern rather than quietly becoming a selection rule.
|
|
61
|
+
const kindFilter = stringFlag(flags.kind);
|
|
62
|
+
const projectFilter = stringFlag(flags.project);
|
|
63
|
+
const labelFilter = stringFlag(flags.label);
|
|
64
|
+
const filtered = kindFilter !== undefined || projectFilter !== undefined || labelFilter !== undefined;
|
|
65
|
+
const matches = (s) => (kindFilter === undefined || s.kind === kindFilter) &&
|
|
66
|
+
(projectFilter === undefined || s.project === projectFilter) &&
|
|
67
|
+
// Substring and case-INSENSITIVE, unlike the two exact matches: `kind` and `project` are chosen
|
|
68
|
+
// from a small vocabulary a caller knows exactly, while `label` is free text a human wrote
|
|
69
|
+
// ("dev-team · issue #612") and is searched, not recalled.
|
|
70
|
+
(labelFilter === undefined || (s.label ?? "").toLowerCase().includes(labelFilter.toLowerCase()));
|
|
50
71
|
const identity = await resolveSubmitIdentity(ctx);
|
|
51
|
-
const rows = await listSessions(ctx, identity.token, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
72
|
+
const { sessions: rows, scope: served } = await listSessions(ctx, identity.token, {
|
|
73
|
+
limit,
|
|
74
|
+
...(offset !== undefined ? { offset } : {}),
|
|
75
|
+
});
|
|
76
|
+
const live = includeTerminal ? rows : rows.filter((s) => s.state === "active");
|
|
77
|
+
const sessions = filtered ? live.filter(matches) : live;
|
|
78
|
+
// `undefined` means the Hub did not say, which is reported as uncertainty rather than guessed
|
|
79
|
+
// either way (see the file header).
|
|
80
|
+
const scope = describeScope(served);
|
|
58
81
|
const effectiveOffset = offset ?? 0;
|
|
59
82
|
const nextOffset = Math.min(effectiveOffset + rows.length, SESSION_OFFSET_MAX);
|
|
60
83
|
const hasMore = rows.length === limit && effectiveOffset < SESSION_OFFSET_MAX;
|
|
@@ -64,8 +87,19 @@ export async function fleetCommand(ctx) {
|
|
|
64
87
|
count: sessions.length,
|
|
65
88
|
// The SCOPE belongs in the machine envelope too, not just the human caption: a script that
|
|
66
89
|
// cannot tell "no other agents are live" from "this Hub won't tell me about them" will
|
|
67
|
-
// reach the wrong conclusion just as readily as a person would.
|
|
68
|
-
|
|
90
|
+
// reach the wrong conclusion just as readily as a person would. Emitted as an EXPLICIT
|
|
91
|
+
// "unknown" string rather than left absent — `buildOk` prunes undefined keys, so a missing
|
|
92
|
+
// scope would vanish from `data` and a script would have to distinguish an absent key from
|
|
93
|
+
// an unknown answer.
|
|
94
|
+
scope: served ?? "unknown",
|
|
95
|
+
// The FILTERS ride in the envelope for the same reason `scope` does: a script that cannot
|
|
96
|
+
// tell "nothing matched" from "nothing is live" reaches the wrong conclusion, and an empty
|
|
97
|
+
// `count` alone cannot distinguish them.
|
|
98
|
+
filters: {
|
|
99
|
+
...(kindFilter !== undefined ? { kind: kindFilter } : {}),
|
|
100
|
+
...(projectFilter !== undefined ? { project: projectFilter } : {}),
|
|
101
|
+
...(labelFilter !== undefined ? { label: labelFilter } : {}),
|
|
102
|
+
},
|
|
69
103
|
has_more: hasMore,
|
|
70
104
|
next_offset: nextOffset,
|
|
71
105
|
})));
|
|
@@ -81,11 +115,19 @@ export async function fleetCommand(ctx) {
|
|
|
81
115
|
ctx.io.err(`(more — re-run with --offset ${nextOffset})`);
|
|
82
116
|
};
|
|
83
117
|
if (sessions.length === 0) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
118
|
+
// A FILTERED empty result has to say the filter is why, and it takes precedence over the
|
|
119
|
+
// live-only wording: "No live sessions" in front of a user who passed `--kind worker` reads as
|
|
120
|
+
// "nothing is running", when the truth may be that plenty is running and none of it is a worker.
|
|
121
|
+
// The filter is applied client-side over ONE page, so it can also match nothing here while
|
|
122
|
+
// matching further back — which is why the pager hint below still fires.
|
|
123
|
+
ctx.io.log(filtered
|
|
124
|
+
? `No ${includeTerminal ? "" : "live "}sessions in this window matched ${describeFilters(kindFilter, projectFilter, labelFilter)}.` +
|
|
125
|
+
(hasMore ? " Keep paging (below) — the filter is applied to one page at a time." : "")
|
|
126
|
+
: includeTerminal
|
|
127
|
+
? "No sessions."
|
|
128
|
+
: hasMore
|
|
129
|
+
? "No live sessions in this window — every row here is closed or expired. Keep paging (below), or --all to include them."
|
|
130
|
+
: "No live sessions. (Add --all to include closed/expired ones.)");
|
|
89
131
|
ctx.io.err(scope);
|
|
90
132
|
more();
|
|
91
133
|
return;
|
|
@@ -104,21 +146,35 @@ export async function fleetCommand(ctx) {
|
|
|
104
146
|
ctx.io.err(scope);
|
|
105
147
|
more();
|
|
106
148
|
}
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
149
|
+
/** Name the filters in effect, so an empty result says WHY it is empty rather than implying the
|
|
150
|
+
* fleet is. Sanitized: these are user-supplied strings echoed back to a terminal. */
|
|
151
|
+
function describeFilters(kind, project, label) {
|
|
152
|
+
const parts = [];
|
|
153
|
+
if (kind !== undefined)
|
|
154
|
+
parts.push(`--kind ${sanitizeForTerminal(kind)}`);
|
|
155
|
+
if (project !== undefined)
|
|
156
|
+
parts.push(`--project ${sanitizeForTerminal(project)}`);
|
|
157
|
+
if (label !== undefined)
|
|
158
|
+
parts.push(`--label ${sanitizeForTerminal(label)}`);
|
|
159
|
+
return parts.join(" ");
|
|
160
|
+
}
|
|
161
|
+
/** Say what this list covers, without overclaiming — reporting what the SERVER stated it served
|
|
162
|
+
* (issue #860) rather than inferring it.
|
|
163
|
+
*
|
|
164
|
+
* The `own` caption names BOTH causes because the CLI genuinely cannot tell them apart from here:
|
|
165
|
+
* the account has not opted into the inter-agent leg, or the deployment's ceiling forces own-only
|
|
166
|
+
* for everyone. Naming only the first would send a user to a Settings toggle that cannot fix an
|
|
167
|
+
* operator's ceiling; naming only the second would send them to an operator when the fix is one
|
|
168
|
+
* click of their own. So both are stated, actionable one first. */
|
|
169
|
+
function describeScope(served) {
|
|
170
|
+
if (served === "account")
|
|
171
|
+
return "scope: every session in this account.";
|
|
172
|
+
if (served === "own") {
|
|
173
|
+
return ("scope: THIS AGENT's sessions only. Either this account has not enabled Agent messaging " +
|
|
174
|
+
"(Settings → Agent messaging — the account owner can turn it on), or this Hub's deployment forces own-only " +
|
|
175
|
+
"for every account. Other agents may well be live; an account human always sees the whole account.");
|
|
120
176
|
}
|
|
121
|
-
return "scope:
|
|
177
|
+
return "scope: this Hub did not report which scope it served, so whether other agents' sessions are listed here is unknown.";
|
|
122
178
|
}
|
|
123
179
|
/** Project one session to terminal-safe, single-line columns.
|
|
124
180
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/commands/fleet.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,oEAAoE;AACpE,EAAE;AACF,kGAAkG;AAClG,sEAAsE;AACtE,EAAE;AACF,4FAA4F;AAC5F,iGAAiG;AACjG,sFAAsF;AACtF,oGAAoG;AACpG,
|
|
1
|
+
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/commands/fleet.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,oEAAoE;AACpE,EAAE;AACF,kGAAkG;AAClG,sEAAsE;AACtE,EAAE;AACF,4FAA4F;AAC5F,iGAAiG;AACjG,sFAAsF;A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ACjC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;IACxD,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,GAAG,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,GAAG,CAAC;IACnC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC;AACtC,CAAC"}
|
|
@@ -75,20 +75,19 @@ export async function fetchCapability(ctx) {
|
|
|
75
75
|
return undefined;
|
|
76
76
|
}
|
|
77
77
|
const doc = body;
|
|
78
|
-
// `
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
// that
|
|
78
|
+
// `sessions` is read for its `enabled` flag (the §8.7.1 session-drain gate below), so a value that
|
|
79
|
+
// is not an object is dropped rather than cast — a non-object would make `sessions?.enabled` throw
|
|
80
|
+
// or silently read undefined off a string.
|
|
81
|
+
//
|
|
82
|
+
// The per-field `agent_list_visibility` sanitizer that used to live here is GONE with #860: it
|
|
83
|
+
// existed only because `fleet ls` ACTED on that field. The Hub still advertises it — it states the
|
|
84
|
+
// deployment ceiling — but it is only half the §16.4 answer, so the CLI reads the authenticated
|
|
85
|
+
// `scope` on `GET /v1/sessions` instead and ignores this field entirely. Nothing here reads it, so
|
|
86
|
+
// there is nothing to sanitize.
|
|
83
87
|
const sessions = doc.sessions;
|
|
84
|
-
if (sessions
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
delete sessions.agent_list_visibility;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (sessions !== undefined) {
|
|
91
|
-
delete doc.sessions;
|
|
88
|
+
if (sessions === null || typeof sessions !== "object" || Array.isArray(sessions)) {
|
|
89
|
+
if (sessions !== undefined)
|
|
90
|
+
delete doc.sessions;
|
|
92
91
|
}
|
|
93
92
|
const capability = doc;
|
|
94
93
|
CACHE.set(key, capability);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../src/commands/messaging/capability.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,0CAA0C;AAC1C,EAAE;AACF,sGAAsG;AACtG,mGAAmG;AACnG,oGAAoG;AACpG,mGAAmG;AACnG,mGAAmG;AACnG,kGAAkG;AAClG,EAAE;AACF,qGAAqG;AACrG,sGAAsG;AACtG,mGAAmG;AACnG,oGAAoG;AACpG,sGAAsG;AACtG,iGAAiG;AACjG,kDAAkD;AAClD,EAAE;AACF,sGAAsG;AACtG,sFAAsF;AAEtF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../src/commands/messaging/capability.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,0CAA0C;AAC1C,EAAE;AACF,sGAAsG;AACtG,mGAAmG;AACnG,oGAAoG;AACpG,mGAAmG;AACnG,mGAAmG;AACnG,kGAAkG;AAClG,EAAE;AACF,qGAAqG;AACrG,sGAAsG;AACtG,mGAAmG;AACnG,oGAAoG;AAC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CAAC;IAC9C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,QAAQ,CAChB,OAAO,EACP,uDAAuD,GAAG,CAAC,MAAM,CAAC,OAAO,2CAA2C;YAClH,oHAAoH;YACpH,oHAAoH;YACpH,iCAAiC,CACpC,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,gBAAgB,EAAE,CAAC;QAC/C,MAAM,IAAI,QAAQ,CAChB,OAAO,EACP,8CAA8C,UAAU,CAAC,YAAY,IAAI,cAAc,4BAA4B;YACjH,gHAAgH;YAChH,sEAAsE,CACzE,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,EAAE,OAAO,KAAK,KAAK,EAAE,CAAC;QAC3C,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,+GAA+G,CAAC,CAAC;IAC/I,CAAC;IACD,IAAI,UAAU,CAAC,OAAO,EAAE,aAAa,KAAK,KAAK,EAAE,CAAC;QAChD,MAAM,IAAI,QAAQ,CAChB,OAAO,EACP,gIAAgI,CACjI,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -4,13 +4,24 @@ import type { Session, SessionRegisterRequest } from "./wire.js";
|
|
|
4
4
|
* id, owns the state, and CLAMPS `ttl_seconds` two-sidedly into its advertised bounds, so the
|
|
5
5
|
* returned `ttl_seconds`/`expires_at` are authoritative and may differ from what was asked. */
|
|
6
6
|
export declare function registerSession(ctx: CommandContext, token: string, request: SessionRegisterRequest): Promise<Session>;
|
|
7
|
+
/** The §16.4 scope a list response applied. `undefined` means the Hub did not say — a pre-#860 Hub
|
|
8
|
+
* omits the field — and every caller must render that as "unknown", never as `account`. */
|
|
9
|
+
export type SessionListScope = "account" | "own";
|
|
7
10
|
/** GET /v1/sessions — list (spec §16.4). Scope depends on the CALLER, not on any parameter: an
|
|
8
|
-
* agent always sees its OWN sessions, and sees the whole account only
|
|
9
|
-
*
|
|
11
|
+
* agent always sees its OWN sessions, and sees the whole account only when its account opted into
|
|
12
|
+
* the §8.0 inter-agent leg under a permitting deployment ceiling.
|
|
13
|
+
*
|
|
14
|
+
* THE HUB REPORTS WHICH IT SERVED, and that is why this returns the scope rather than leaving the
|
|
15
|
+
* caller to infer it (issue #860). The answer is per-account, so the public capability document
|
|
16
|
+
* cannot carry it; the response that served the rows is the only surface that can. A Hub that
|
|
17
|
+
* omits the field yields `undefined` — which the caller must NOT read as `account`. */
|
|
10
18
|
export declare function listSessions(ctx: CommandContext, token: string, page?: {
|
|
11
19
|
limit?: number;
|
|
12
20
|
offset?: number;
|
|
13
|
-
}): Promise<
|
|
21
|
+
}): Promise<{
|
|
22
|
+
sessions: Session[];
|
|
23
|
+
scope: SessionListScope | undefined;
|
|
24
|
+
}>;
|
|
14
25
|
/** GET /v1/sessions/:id — read one (spec §16.4). A TERMINAL session is still 200-with-its-state for
|
|
15
26
|
* the advertised retention window; 404 covers unknown AND foreign alike (deliberately
|
|
16
27
|
* indistinguishable, §9.1). */
|
|
@@ -39,7 +39,24 @@ function isSession(value) {
|
|
|
39
39
|
return false;
|
|
40
40
|
if (typeof state !== "string" || !SESSION_STATES.has(state))
|
|
41
41
|
return false;
|
|
42
|
-
|
|
42
|
+
if (!isIsoTimestamp(createdAt) || !isIsoTimestamp(expiresAt))
|
|
43
|
+
return false;
|
|
44
|
+
// OPTIONAL FREE-TEXT FIELDS ARE TYPE-CHECKED TOO, not just the required ones. The guard's promise
|
|
45
|
+
// is `value is Session`, so leaving these unchecked made the type a lie for every consumer — and
|
|
46
|
+
// #862 turned that from latent into reachable by FILTERING on them: a Hub returning `label: 123`
|
|
47
|
+
// made `--label` call `.toLowerCase()` on a number and die with a generic TypeError instead of
|
|
48
|
+
// this module's "malformed session list" error, while a numeric `kind`/`project` silently became
|
|
49
|
+
// a non-match, which reads as "no such session" rather than "this Hub sent nonsense".
|
|
50
|
+
//
|
|
51
|
+
// `null` is treated as ABSENT rather than rejected: it is what a JSON encoder emits for an unset
|
|
52
|
+
// optional, and the display path already coalesces it. Only a present-but-wrong-TYPE value is a
|
|
53
|
+
// malformed response.
|
|
54
|
+
const { label, kind, project } = value;
|
|
55
|
+
for (const field of [label, kind, project]) {
|
|
56
|
+
if (field !== undefined && field !== null && typeof field !== "string")
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
43
60
|
}
|
|
44
61
|
/** Parse a `{ session: … }` body and redact the bearer from every string in it before any caller
|
|
45
62
|
* can print it (§5.4) — the same JSON round-trip `listMessages` uses, and it fails CLOSED: a
|
|
@@ -103,8 +120,13 @@ export async function registerSession(ctx, token, request) {
|
|
|
103
120
|
return readSession(await sessionRequest(ctx, token, "POST", "/v1/sessions", request), token, "registration");
|
|
104
121
|
}
|
|
105
122
|
/** GET /v1/sessions — list (spec §16.4). Scope depends on the CALLER, not on any parameter: an
|
|
106
|
-
* agent always sees its OWN sessions, and sees the whole account only
|
|
107
|
-
*
|
|
123
|
+
* agent always sees its OWN sessions, and sees the whole account only when its account opted into
|
|
124
|
+
* the §8.0 inter-agent leg under a permitting deployment ceiling.
|
|
125
|
+
*
|
|
126
|
+
* THE HUB REPORTS WHICH IT SERVED, and that is why this returns the scope rather than leaving the
|
|
127
|
+
* caller to infer it (issue #860). The answer is per-account, so the public capability document
|
|
128
|
+
* cannot carry it; the response that served the rows is the only surface that can. A Hub that
|
|
129
|
+
* omits the field yields `undefined` — which the caller must NOT read as `account`. */
|
|
108
130
|
export async function listSessions(ctx, token, page = {}) {
|
|
109
131
|
const query = new URLSearchParams();
|
|
110
132
|
if (page.limit !== undefined)
|
|
@@ -117,7 +139,13 @@ export async function listSessions(ctx, token, page = {}) {
|
|
|
117
139
|
if (!Array.isArray(sessions) || !sessions.every(isSession)) {
|
|
118
140
|
throw new CliError("server", "the Hub returned a malformed session list (expected { sessions: [{ id, agent_id, state, created_at }] }).");
|
|
119
141
|
}
|
|
120
|
-
|
|
142
|
+
// A malformed `scope` is NOT a hard error — the rows are still good and refusing the whole list
|
|
143
|
+
// over a bad caption would be worse than captioning it honestly. It degrades to `undefined`
|
|
144
|
+
// (→ "unknown"), never to a guess, because the one reading that must never happen is claiming
|
|
145
|
+
// the whole account while holding own-only rows.
|
|
146
|
+
const raw = body.scope;
|
|
147
|
+
const scope = raw === "account" || raw === "own" ? raw : undefined;
|
|
148
|
+
return { sessions: redactDeep(sessions, token, "session list"), scope };
|
|
121
149
|
}
|
|
122
150
|
/** GET /v1/sessions/:id — read one (spec §16.4). A TERMINAL session is still 200-with-its-state for
|
|
123
151
|
* the advertised retention window; 404 covers unknown AND foreign alike (deliberately
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions-http.js","sourceRoot":"","sources":["../../../src/commands/messaging/sessions-http.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,mGAAmG;AACnG,mGAAmG;AACnG,gGAAgG;AAChG,uFAAuF;AACvF,EAAE;AACF,iGAAiG;AACjG,8FAA8F;AAC9F,wEAAwE;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG5E,2EAA2E;AAC3E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhE,iGAAiG;AACjG,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SA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IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrG,MAAM,OAAO,GAAG,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACvH,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3G,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -252,11 +252,19 @@ export const COMMANDS = [
|
|
|
252
252
|
help: [
|
|
253
253
|
"oh-hai fleet — discover the sessions this credential can see (cli spec §4.13).",
|
|
254
254
|
"",
|
|
255
|
-
"Usage: oh-hai fleet ls [--all] [--
|
|
255
|
+
"Usage: oh-hai fleet ls [--all] [--kind <k>] [--project <p>] [--label <substring>]",
|
|
256
|
+
" [--limit <n>] [--offset <n>]",
|
|
256
257
|
"",
|
|
257
258
|
"Prints one row per session with the exact ADDRESS to copy into `--to`, plus state, age,",
|
|
258
259
|
"label, kind and project. Live sessions only by default; --all includes closed/expired ones,",
|
|
259
|
-
"which the Hub retains for a window.
|
|
260
|
+
"which the Hub retains for a window.",
|
|
261
|
+
"",
|
|
262
|
+
"--kind and --project match exactly; --label is a case-insensitive SUBSTRING. They compose as",
|
|
263
|
+
"AND, and with --all. Filtering is applied to the page the Hub served, so a filter can match",
|
|
264
|
+
"nothing here while matching further back — an empty filtered result says which filter produced",
|
|
265
|
+
"it and still points at the next window.",
|
|
266
|
+
"",
|
|
267
|
+
"The SCOPE is not a flag — you always see your own",
|
|
260
268
|
"sessions, and other agents' only where the Hub permits same-account listing (§16.4, off by",
|
|
261
269
|
"default). The command says which one it printed rather than letting a narrowed list read as",
|
|
262
270
|
"'nobody else is running'.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,mFAAmF;AACnF,kFAAkF;AAClF,kGAAkG;AAelG,MAAM,CAAC,MAAM,QAAQ,GAA2B;IAC9C;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,gEAAgE;YAChE,EAAE;YACF,qBAAqB;YACrB,EAAE;YACF,mFAAmF;YACnF,oFAAoF;YACpF,sFAAsF;YACtF,uFAAuF;YACvF,mDAAmD;SACpD,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,+CAA+C;QACxD,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,iEAAiE;YACjE,EAAE;YACF,wCAAwC;YACxC,uEAAuE;YACvE,EAAE;YACF,mFAAmF;YACnF,mFAAmF;YACnF,yEAAyE;YACzE,mFAAmF;YACnF,qCAAqC;SACtC,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,yBAAyB;QAClC,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,kFAAkF;YAClF,EAAE;YACF,+CAA+C;YAC/C,EAAE;YACF,6DAA6D;SAC9D,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,+EAA+E;QACxF,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,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E;YACF,yFAAyF;YACzF,uFAAuF;YACvF,yFAAyF;YACzF,4FAA4F;YAC5F,uDAAuD;YACvD,EAAE;YACF,6FAA6F;YAC7F,8FAA8F;YAC9F,EAAE;YACF,8FAA8F;YAC9F,+FAA+F;YAC/F,yEAAyE;YACzE,EAAE;YACF,wFAAwF;YACxF,gGAAgG;YAChG,+FAA+F;YAC/F,4FAA4F;YAC5F,+FAA+F;YAC/F,iFAAiF;SAClF,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,iEAAiE;QAC1E,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;QACzC,IAAI,EAAE;YACJ,mFAAmF;YACnF,EAAE;YACF,iGAAiG;YACjG,+DAA+D;YAC/D,8CAA8C;YAC9C,8CAA8C;YAC9C,EAAE;YACF,8FAA8F;YAC9F,4FAA4F;YAC5F,+FAA+F;YAC/F,6FAA6F;YAC7F,8FAA8F;YAC9F,2FAA2F;YAC3F,yFAAyF;YACzF,gFAAgF;SACjF,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,mDAAmD;QAC5D,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,CAAC,IAAI,CAAC;QACnB,IAAI,EAAE;YACJ,gFAAgF;YAChF,EAAE;YACF,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,mFAAmF;AACnF,kFAAkF;AAClF,kGAAkG;AAelG,MAAM,CAAC,MAAM,QAAQ,GAA2B;IAC9C;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,gEAAgE;YAChE,EAAE;YACF,qBAAqB;YACrB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G,qGAAqG;YACrG,oGAAoG;YACpG,qGAAqG;YACrG,EAAE;YACF,8FAA8F;YAC9F,qGAAqG;YACrG,gGAAgG;YAChG,mGAAmG;YACnG,mGAAmG;YACnG,gGAAgG;SACjG,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,gFAAgF;YAChF,EAAE;YACF,oDAAoD;YACpD,EAAE;YACF,wFAAwF;YACxF,yFAAyF;YACzF,2FAA2F;YAC3F,uFAAuF;YACvF,+FAA+F;YAC/F,uFAAuF;YACvF,4FAA4F;YAC5F,0FAA0F;SAC3F,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,yDAAyD;QAClE,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;QACf,IAAI,EAAE;YACJ,uFAAuF;YACvF,EAAE;YACF,iCAAiC;YACjC,EAAE;YACF,gGAAgG;YAChG,gGAAgG;YAChG,8FAA8F;YAC9F,4FAA4F;YAC5F,+FAA+F;YAC/F,2EAA2E;SAC5E,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;CACF,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-hai/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "OH HAI — the `oh-hai` CLI: reach a human from your agent through an MA2H Hub (notify / ask / task), and reach another agent over the v0.5 inter-agent leg (sessions, addressed sends, bridge, fleet).",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@oh-hai/ma2h-core": "0.2.
|
|
26
|
+
"@oh-hai/ma2h-core": "0.2.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^26.1.0",
|