@divergeai/cli 0.1.25 → 0.1.26
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/diverge.mjs +18 -6
- package/package.json +1 -1
package/dist/diverge.mjs
CHANGED
|
@@ -7556,7 +7556,7 @@ function tokenSource(env, baseUrl) {
|
|
|
7556
7556
|
}
|
|
7557
7557
|
|
|
7558
7558
|
// src/version.ts
|
|
7559
|
-
var VERSION = true ? "0.1.
|
|
7559
|
+
var VERSION = true ? "0.1.26" : "dev";
|
|
7560
7560
|
var USER_AGENT = `diverge/${VERSION}`;
|
|
7561
7561
|
|
|
7562
7562
|
// src/http.ts
|
|
@@ -9584,6 +9584,11 @@ var MAX_PENDING_EVENTS = 2e4;
|
|
|
9584
9584
|
var DEFAULT_POLL_MS = 2e3;
|
|
9585
9585
|
var LAUNCH_SLACK_MS = 5e3;
|
|
9586
9586
|
var STALLED_TICKS = 30;
|
|
9587
|
+
var CAPTURE_NOTICES = {
|
|
9588
|
+
off: "This organization does not record agent sessions (Forge installation config agentSessions.capture is off); nothing is sent.",
|
|
9589
|
+
metadata: "Recorded: metadata only \u2014 which tools ran and how many failed, tokens, models and timing; no prompt, reply, tool argument or result.",
|
|
9590
|
+
conversation: "Recorded: the whole conversation \u2014 every prompt, reply, tool call and its result. Yours to read; anyone else in the organization needs the Agent conversations role, and every such read is recorded on the session."
|
|
9591
|
+
};
|
|
9587
9592
|
function eventBytes(event) {
|
|
9588
9593
|
return Buffer.byteLength(JSON.stringify(event), "utf8");
|
|
9589
9594
|
}
|
|
@@ -9612,6 +9617,8 @@ var DshSessionPublisher = class {
|
|
|
9612
9617
|
loop = null;
|
|
9613
9618
|
/** The organization does not record: nothing more is read or sent. */
|
|
9614
9619
|
disabled = false;
|
|
9620
|
+
/** The level the person was last told. */
|
|
9621
|
+
announced = null;
|
|
9615
9622
|
ticking = null;
|
|
9616
9623
|
/** The directory dsh writes this launch's sessions under. */
|
|
9617
9624
|
get projectDir() {
|
|
@@ -9781,9 +9788,12 @@ var DshSessionPublisher = class {
|
|
|
9781
9788
|
return;
|
|
9782
9789
|
}
|
|
9783
9790
|
session.reportedFailure = null;
|
|
9784
|
-
if (
|
|
9791
|
+
if (result.capture !== this.announced) {
|
|
9792
|
+
this.announced = result.capture;
|
|
9793
|
+
this.deps.report(CAPTURE_NOTICES[result.capture]);
|
|
9794
|
+
}
|
|
9795
|
+
if (result.capture === "off") {
|
|
9785
9796
|
this.disabled = true;
|
|
9786
|
-
this.deps.report("This organization does not record agent sessions (Forge installation config agentSessions.recording is off); nothing is sent.");
|
|
9787
9797
|
return;
|
|
9788
9798
|
}
|
|
9789
9799
|
session.opened = true;
|
|
@@ -10033,7 +10043,7 @@ async function run(args, io) {
|
|
|
10033
10043
|
const source = tokenSource(io.env, apiUrl);
|
|
10034
10044
|
const organizationId = tokenClaims(token.access_token).organizationId ?? values["organization-id"];
|
|
10035
10045
|
if (!organizationId) throw new CliError("the gateway token names no organization; pass --organization-id");
|
|
10036
|
-
io.stderr(`This session is
|
|
10046
|
+
io.stderr(`This session is organization ${organizationId}'s own record at the level its administrators set \u2014 off, metadata (tools, tokens, models; no content) or the whole conversation \u2014 named once its record opens. Yours to read: diverge tools call ${AGENT_SESSION_LIST_TOOL} (ADR 0121).`);
|
|
10037
10047
|
const tools = new ToolsClient({ apiUrl, organizationId, mode: "operator", clientId: clientId(io.env) }, io.env);
|
|
10038
10048
|
const publisher = new DshSessionPublisher({
|
|
10039
10049
|
sessionsRoot: path14.join(home, "sessions"),
|
|
@@ -10076,8 +10086,10 @@ async function appendSession(tools, input) {
|
|
|
10076
10086
|
if (response.success === false || response.error) throw new CliError(response.error ?? "the platform refused the append");
|
|
10077
10087
|
if (isPending(response.result)) throw new CliError("the append was raised for a decision, which an inert record never needs");
|
|
10078
10088
|
const result = response.result;
|
|
10079
|
-
if (!result ||
|
|
10080
|
-
|
|
10089
|
+
if (!result || !(result.capture === "off" || result.capture === "metadata" || result.capture === "conversation")) {
|
|
10090
|
+
throw new CliError("the platform answered the append without the level it records");
|
|
10091
|
+
}
|
|
10092
|
+
return { capture: result.capture, sessionId: result.sessionId ?? null, stored: result.stored ?? 0, skipped: result.skipped ?? 0, lastSeq: typeof result.lastSeq === "number" ? result.lastSeq : -1 };
|
|
10081
10093
|
}
|
|
10082
10094
|
async function status(args, io) {
|
|
10083
10095
|
const { values } = parseArgs3({ args, options: { "organization-id": { type: "string" } }, strict: true });
|
package/package.json
CHANGED