peerband 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/dist/peerband.mjs +14 -5
- package/herdr-plugin.toml +1 -1
- package/package.json +1 -1
- package/protocol/README.md +2 -0
package/dist/peerband.mjs
CHANGED
|
@@ -12044,7 +12044,7 @@ var ConnectorCore = class {
|
|
|
12044
12044
|
}
|
|
12045
12045
|
const result = await this.adapter.readOutput(agent.id, options);
|
|
12046
12046
|
const safe = sanitizeOutput(result.text, options);
|
|
12047
|
-
return { ...safe, observedAt: result.observedAt, truncated: safe.truncated || result.truncated, ...result.nextCursor ? { nextCursor: result.nextCursor } : {} };
|
|
12047
|
+
return { ...safe, ...result.source === "visible" ? { source: result.source } : {}, observedAt: result.observedAt, truncated: safe.truncated || result.truncated, ...result.nextCursor ? { nextCursor: result.nextCursor } : {} };
|
|
12048
12048
|
}
|
|
12049
12049
|
async sendMessage(args, principal) {
|
|
12050
12050
|
assertKeys(args, ["agentId", "message", "idempotencyKey"]);
|
|
@@ -14820,17 +14820,26 @@ var HerdrAdapter = class {
|
|
|
14820
14820
|
if (!live) throw new ConnectError("stale_target", "This Herdr agent handle is no longer current.", "Refresh the agent list and select its current occupant.");
|
|
14821
14821
|
const lines = clampInteger(options.lines, 80, 1, 500);
|
|
14822
14822
|
const { client } = await this.initialize();
|
|
14823
|
-
const
|
|
14823
|
+
const params = {
|
|
14824
14824
|
target: live.agent.pane_id,
|
|
14825
14825
|
source: "recent",
|
|
14826
14826
|
format: "text",
|
|
14827
14827
|
lines,
|
|
14828
14828
|
strip_ansi: true
|
|
14829
|
-
}
|
|
14829
|
+
};
|
|
14830
|
+
let result;
|
|
14831
|
+
let visibleOnly = false;
|
|
14832
|
+
try {
|
|
14833
|
+
result = asObject(await client.request("agent.read", params));
|
|
14834
|
+
} catch (error) {
|
|
14835
|
+
if (!(error instanceof ConnectError) || error.code !== "agent_not_idle") throw error;
|
|
14836
|
+
result = asObject(await client.request("agent.read", { ...params, source: "visible" }));
|
|
14837
|
+
visibleOnly = true;
|
|
14838
|
+
}
|
|
14830
14839
|
if (result.type !== "pane_read" || !result.read || typeof result.read !== "object" || typeof result.read.text !== "string") throw this.schemaMismatch("agent.read returned an unexpected result type");
|
|
14831
14840
|
const output = sanitizeOutput(result.read.text, { ...options, lines, bytes: clampInteger(options.bytes, 16384, 1, 32768) });
|
|
14832
14841
|
await this.getAgent(id);
|
|
14833
|
-
return { ...output, truncated: output.truncated || result.read.truncated === true, observedAt: (/* @__PURE__ */ new Date()).toISOString(), untrusted: true };
|
|
14842
|
+
return { ...output, ...visibleOnly ? { source: "visible" } : {}, truncated: visibleOnly || output.truncated || result.read.truncated === true, observedAt: (/* @__PURE__ */ new Date()).toISOString(), untrusted: true };
|
|
14834
14843
|
}
|
|
14835
14844
|
async sendMessage(id, message) {
|
|
14836
14845
|
if (typeof message !== "string" || message.length === 0 || Buffer.byteLength(message, "utf8") > 16384) {
|
|
@@ -16844,7 +16853,7 @@ function herdrGroupHelp(s) {
|
|
|
16844
16853
|
}
|
|
16845
16854
|
|
|
16846
16855
|
// src/cli/cli.ts
|
|
16847
|
-
var VERSION = true ? "0.2.
|
|
16856
|
+
var VERSION = true ? "0.2.1" : "0.0.0-dev";
|
|
16848
16857
|
function createContext(overrides = {}) {
|
|
16849
16858
|
const env = overrides.env ?? process.env;
|
|
16850
16859
|
const stdout = overrides.stdout ?? process.stdout;
|
package/herdr-plugin.toml
CHANGED
package/package.json
CHANGED
package/protocol/README.md
CHANGED
|
@@ -34,6 +34,8 @@ The grant flow (`enrollment-redeem.schema.json`) remains available for headless
|
|
|
34
34
|
|
|
35
35
|
The client only reports metadata (tool, target id, outcome, latency) to its local activity log; message bodies and agent output are never logged.
|
|
36
36
|
|
|
37
|
+
`get_agent_output` normally reads recent terminal history. If Herdr rejects that read with `agent_not_idle`, the client retries once using the current visible screen without scrolling. That result includes the optional field `source: "visible"` and `truncated: true`, so consumers can explain that older history is unavailable in this excerpt. Output limits, sanitization and occupant checks still apply. Other read errors are returned without this retry.
|
|
38
|
+
|
|
37
39
|
## Versioning
|
|
38
40
|
|
|
39
41
|
The protocol has no explicit version field today. Changes are additive: new optional fields, new `tool` values and new frame types may appear, so implementations must ignore unknown fields and unknown frame types on received messages. The `event` frame is such an addition: servers that do not know it ignore it, and the `x-peerband-features` upgrade header tells servers that do which clients emit events. A breaking change would use a new endpoint path or a `hello` negotiation message and be documented here with a bump of the schema `$id`. Schemas are published with each client release in `protocol/`.
|