@qlairoslabs/acp-client 0.13.8-e-alpha.1 → 0.13.10-e-alpha.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/CONSUMER_GUIDE.md +78 -10
- package/package.json +1 -1
- package/src/agent/config.ts +2 -0
- package/src/index.ts +2 -1
- package/src/native/errors.ts +1 -1
- package/src/native/host-config.ts +2 -0
- package/src/native/host.ts +6 -1
- package/src/native/inference-relay.ts +91 -26
- package/src/native/recovery.ts +6 -5
- package/src/native-harness/src/capabilities/model/inference-relay.ts +73 -9
- package/src/native-harness/src/capabilities/model/runner.ts +4 -1
- package/src/native-harness/src/capabilities/tools/web/exa-transport.ts +30 -10
- package/src/native-harness/src/capabilities/tools/web/exa.ts +5 -1
- package/src/native-harness/src/capabilities/tools/web/registry.ts +14 -1
- package/src/native-harness/src/capabilities/tools/web/service-egress.ts +80 -0
- package/src/native-harness/src/client.ts +2 -0
- package/src/native-harness/src/contracts/inspector.ts +5 -0
- package/src/native-harness/src/contracts/model-execution.ts +3 -1
- package/src/native-harness/src/contracts/operator-controls.ts +2 -0
- package/src/native-harness/src/contracts/protocol.ts +4 -1
- package/src/native-harness/src/contracts/web.ts +3 -0
- package/src/native-harness/src/interfaces/cli/development.ts +7 -4
- package/src/native-harness/src/interfaces/cli/serve.ts +10 -7
- package/src/native-harness/src/interfaces/inspector/config.ts +17 -0
- package/src/native-harness/src/interfaces/inspector/managed.ts +51 -0
- package/src/native-harness/src/interfaces/inspector/server.ts +13 -8
- package/src/native-harness/src/interfaces/inspector/state.ts +6 -4
- package/src/native-harness/src/interfaces/protocol/server.ts +27 -7
- package/src/native-harness/src/testing.ts +64 -14
- package/src/native-harness/src/util/inference-relay.ts +11 -3
|
@@ -34,13 +34,21 @@ export function resolveInferenceRelayGrant(model: ManagedModel, value: unknown,
|
|
|
34
34
|
}
|
|
35
35
|
if (value === undefined) return failure("is required");
|
|
36
36
|
if (!value || typeof value !== "object" || Array.isArray(value)
|
|
37
|
-
|| Object.keys(value).some(key => !["baseUrl", "bearerToken", "expiresAtMs"].includes(key))) return failure("is invalid");
|
|
38
|
-
const
|
|
37
|
+
|| Object.keys(value).some(key => !["baseUrl", "bearerToken", "expiresAtMs", "lifetime"].includes(key))) return failure("is invalid");
|
|
38
|
+
const record = value as Record<string, unknown>;
|
|
39
|
+
const { baseUrl, bearerToken, expiresAtMs, lifetime } = record;
|
|
39
40
|
if (typeof bearerToken !== "string" || !/^[A-Za-z0-9._~+/-]{1,2048}={0,2}$/.test(bearerToken)
|
|
40
|
-
||
|
|
41
|
+
|| Object.hasOwn(record, "expiresAtMs") === Object.hasOwn(record, "lifetime")) return failure("is invalid");
|
|
42
|
+
const processBound = Object.hasOwn(record, "lifetime");
|
|
43
|
+
if (processBound) {
|
|
44
|
+
if (!lifetime || Array.isArray(lifetime) || typeof lifetime !== "object" || !("mode" in lifetime) || lifetime.mode !== "process" ||
|
|
45
|
+
Object.keys(lifetime).length !== 1 || !Object.hasOwn(lifetime, "mode")) return failure("is invalid");
|
|
46
|
+
} else if (typeof expiresAtMs !== "number" || !Number.isSafeInteger(expiresAtMs)) return failure("is invalid");
|
|
41
47
|
let endpoint: string;
|
|
42
48
|
try { endpoint = canonicalRelayUrl(baseUrl); } catch { return failure("is invalid"); }
|
|
43
49
|
if (endpoint !== model.baseUrl) return failure("does not match the configured endpoint");
|
|
50
|
+
if (processBound) return { baseUrl: endpoint, bearerToken, lifetime: { mode: "process" } };
|
|
51
|
+
if (typeof expiresAtMs !== "number") return failure("is invalid");
|
|
44
52
|
if (expiresAtMs <= now) return failure("has expired");
|
|
45
53
|
return { baseUrl: endpoint, bearerToken, expiresAtMs };
|
|
46
54
|
}
|