@bivy/bivy 0.10.1-staging.313 → 0.10.1-staging.314
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Generated from certification/agents.json by scripts/certification.mjs. Do not edit.
|
|
3
|
+
export const CERTIFICATION_MATRIX = {
|
|
4
|
+
schemaVersion: 1,
|
|
5
|
+
agents: [
|
|
6
|
+
{ id: "claude-code-sdk", status: "active", executionMode: "protocol", pinnedVersion: "0.3.220", capabilities: ["toolInterception", "modelSelection", "resume"] },
|
|
7
|
+
{ id: "codex-approvals", status: "active", executionMode: "protocol", pinnedVersion: "0.147.0", capabilities: ["toolInterception", "modelSelection", "resume"] },
|
|
8
|
+
{ id: "pi", status: "active", executionMode: "protocol", pinnedVersion: "0.83.0", capabilities: ["toolInterception", "modelSelection", "resume"] },
|
|
9
|
+
{ id: "opencode", status: "active", executionMode: "protocol", pinnedVersion: "1.18.13", capabilities: ["toolInterception", "modelSelection", "resume"] },
|
|
10
|
+
]
|
|
11
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class CertificationHarness {
|
|
2
|
+
fixture;
|
|
3
|
+
constructor(fixture) {
|
|
4
|
+
this.fixture = fixture;
|
|
5
|
+
}
|
|
6
|
+
async run(scenario, signal) {
|
|
7
|
+
const events = this.fixture.scenarios[scenario];
|
|
8
|
+
if (!events)
|
|
9
|
+
throw new Error(`Missing certification scenario ${scenario} for ${this.fixture.agentId}`);
|
|
10
|
+
if (signal?.aborted)
|
|
11
|
+
throw signal.reason ?? new Error("Certification run cancelled");
|
|
12
|
+
// Yield once so callers can exercise independent adapters concurrently and
|
|
13
|
+
// cancellation can race deterministically without subprocess timing flakes.
|
|
14
|
+
await Promise.resolve();
|
|
15
|
+
if (signal?.aborted)
|
|
16
|
+
throw signal.reason ?? new Error("Certification run cancelled");
|
|
17
|
+
const transcript = JSON.stringify(events);
|
|
18
|
+
if (transcript.includes(this.fixture.secretSentinel)) {
|
|
19
|
+
throw new Error(`Secret leakage detected in ${this.fixture.agentId}/${scenario}`);
|
|
20
|
+
}
|
|
21
|
+
this.assertScenario(scenario, events);
|
|
22
|
+
return { scenario, events: structuredClone(events), transcript };
|
|
23
|
+
}
|
|
24
|
+
assertScenario(scenario, events) {
|
|
25
|
+
const has = (type, predicate = () => true) => events.some((event) => event.type === type && predicate(event));
|
|
26
|
+
const valid = scenario === "probe-install" ? has("probe.result", (event) => event.ok === true)
|
|
27
|
+
: scenario === "auth-handoff" ? has("auth.ready", (event) => event.environment === "<redacted>")
|
|
28
|
+
: scenario === "first-turn" ? has("session.started") && has("message.delta") && has("session.done")
|
|
29
|
+
: scenario === "structured-streaming" ? events.filter((event) => event.type === "message.delta").length >= 2 && has("session.done")
|
|
30
|
+
: scenario === "approval" ? has("tool.decision", (event) => event.decision === "allow") && has("tool.result", (event) => event.status === "ok")
|
|
31
|
+
: scenario === "denial" ? has("tool.decision", (event) => event.decision === "deny") && has("tool.result", (event) => event.status === "denied")
|
|
32
|
+
: scenario === "cancellation" ? has("session.cancelled")
|
|
33
|
+
: scenario === "resume" ? has("session.resumed") && has("session.done")
|
|
34
|
+
: scenario === "attachments" ? has("prompt.received", (event) => Array.isArray(event.attachments) && event.attachments.length > 0)
|
|
35
|
+
: scenario === "token-refresh" ? has("auth.refresh", (event) => event.token === "<redacted>") && has("auth.ready")
|
|
36
|
+
: scenario === "malformed-output" ? has("protocol.error", (event) => event.code === "malformed_output")
|
|
37
|
+
: scenario === "version-drift" ? has("probe.result", (event) => event.ok === false && event.code === "unsupported_version")
|
|
38
|
+
: false;
|
|
39
|
+
if (!valid)
|
|
40
|
+
throw new Error(`Certification scenario ${scenario} did not satisfy its contract for ${this.fixture.agentId}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Copies only an explicit allowlist and never logs or returns secret values. */
|
|
44
|
+
export function prepareAuthHandoff(source, allowed) {
|
|
45
|
+
const environment = {};
|
|
46
|
+
const redactedAudit = {};
|
|
47
|
+
for (const name of allowed) {
|
|
48
|
+
if (source[name] === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
environment[name] = source[name];
|
|
51
|
+
redactedAudit[name] = "<redacted>";
|
|
52
|
+
}
|
|
53
|
+
return { environment, redactedAudit };
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CERTIFICATION_MATRIX } from "./generated.js";
|
|
2
|
+
export function certificationEntry(id) {
|
|
3
|
+
return CERTIFICATION_MATRIX.agents.find((entry) => entry.id === id);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The paid Supported promise is derived from certification, never merely copied
|
|
7
|
+
* from a profile. A suspended/missing entry, wrong adapter mode, stale pin, or
|
|
8
|
+
* missing required runtime capability is downgraded to Beta in the picker.
|
|
9
|
+
*/
|
|
10
|
+
export function applyCertification(runtime) {
|
|
11
|
+
if (runtime.supportTier !== "supported")
|
|
12
|
+
return runtime;
|
|
13
|
+
const entry = certificationEntry(runtime.id);
|
|
14
|
+
const eligible = entry?.status === "active"
|
|
15
|
+
&& runtime.executionMode === entry.executionMode
|
|
16
|
+
&& runtime.testedVersion === entry.pinnedVersion
|
|
17
|
+
&& entry.capabilities.every((capability) => runtime.capabilities[capability] === true);
|
|
18
|
+
if (!eligible) {
|
|
19
|
+
return {
|
|
20
|
+
...runtime,
|
|
21
|
+
supportTier: "beta",
|
|
22
|
+
certification: "adapter-tested",
|
|
23
|
+
notes: `${runtime.notes ? `${runtime.notes} ` : ""}This configured path is not the release-certified execution mode.`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return { ...runtime, certification: "release-tested", testedVersion: entry.pinnedVersion };
|
|
27
|
+
}
|
package/dist/runtime/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { deleteOpenCodeSession, loadOpenCodeTranscript, writeOpenCodeHistory } f
|
|
|
15
15
|
import { discoverNativeGrokSessions, listGrokSessions } from "./grok-sessions.js";
|
|
16
16
|
import { createCredentialStore } from "./credentials.js";
|
|
17
17
|
import { AgentRegistry } from "../agents/registry.js";
|
|
18
|
+
import { applyCertification } from "../certification/index.js";
|
|
18
19
|
import { AGENT_PROFILES, AGENT_PROFILE_IDS, isAgentProfileId, } from "../agents/profiles.js";
|
|
19
20
|
// Args that continue an existing Codex session each prompt. Codex assigns its own
|
|
20
21
|
// session id (no launch-time pin), so a resumed run threads it via `exec resume`.
|
|
@@ -975,7 +976,7 @@ function agentRegistry(pluginDataDir) {
|
|
|
975
976
|
}
|
|
976
977
|
/** All registered contributions, including hidden/planned rows, for diagnostics. */
|
|
977
978
|
export function listRegisteredAgents() {
|
|
978
|
-
return agentRegistry().list().map((entry) => entry.describe());
|
|
979
|
+
return agentRegistry().list().map((entry) => applyCertification(entry.describe()));
|
|
979
980
|
}
|
|
980
981
|
/** Resolve an id or historical alias through the authoritative registry. */
|
|
981
982
|
export function canonicalAgentId(id) {
|
|
@@ -986,6 +987,11 @@ export function agentInstallSpec(id, prefix) {
|
|
|
986
987
|
return agentRegistry().get(id.toLowerCase())?.install?.(prefix);
|
|
987
988
|
}
|
|
988
989
|
function runtimeCertification(runtime) {
|
|
990
|
+
if (runtime.certification)
|
|
991
|
+
return {
|
|
992
|
+
certification: runtime.certification,
|
|
993
|
+
...(runtime.testedVersion ? { testedVersion: runtime.testedVersion } : {}),
|
|
994
|
+
};
|
|
989
995
|
if (runtime.testedVersion)
|
|
990
996
|
return { certification: "release-tested", testedVersion: runtime.testedVersion };
|
|
991
997
|
return { certification: runtime.supportTier === "beta" ? "adapter-tested" : "unverified" };
|
|
@@ -1025,7 +1031,7 @@ export function listRuntimes(currentId) {
|
|
|
1025
1031
|
// Keep the current runtime visible even if hidden, so a session pinned to a
|
|
1026
1032
|
// hidden contribution still renders its selection instead of an empty picker.
|
|
1027
1033
|
.filter((entry) => entry.visible || entry.id === selected)
|
|
1028
|
-
.map((entry) => entry.describe())
|
|
1034
|
+
.map((entry) => applyCertification(entry.describe()))
|
|
1029
1035
|
.map((runtime) => ({
|
|
1030
1036
|
...runtime,
|
|
1031
1037
|
...runtimeProtection(runtime),
|
package/package.json
CHANGED