@personaai/runtime 0.8.0 → 0.9.0
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/index.cjs +30 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -254,6 +254,26 @@ var restToolsManifestRoute = async (request, ctx) => {
|
|
|
254
254
|
return json(200, { tools: manifest.tools });
|
|
255
255
|
};
|
|
256
256
|
|
|
257
|
+
// src/routes/rcpManifest.ts
|
|
258
|
+
var rcpManifestRoute = async (request, ctx) => {
|
|
259
|
+
const manifest = ctx.rcpManifest;
|
|
260
|
+
if (!manifest) {
|
|
261
|
+
throw new RuntimeHttpError(404, "NOT_FOUND", "No RCP manifest is configured.");
|
|
262
|
+
}
|
|
263
|
+
if (manifest.authToken) {
|
|
264
|
+
const header = request.headers.authorization;
|
|
265
|
+
const expected = `Bearer ${manifest.authToken}`;
|
|
266
|
+
if (header !== expected) {
|
|
267
|
+
throw new RuntimeHttpError(401, "UNAUTHORIZED", "Invalid or missing manifest bearer token.");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return json(200, {
|
|
271
|
+
rcpVersion: "0.1",
|
|
272
|
+
auth: manifest.authToken ? { type: "header", header: "Authorization", scheme: "Bearer" } : { type: "none" },
|
|
273
|
+
tools: manifest.tools
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
|
|
257
277
|
// src/runDriver.ts
|
|
258
278
|
var import_sdk3 = require("@personaai/sdk");
|
|
259
279
|
function formatSseFrame(event) {
|
|
@@ -1487,6 +1507,14 @@ function createRuntime(options) {
|
|
|
1487
1507
|
requiresAuth: false
|
|
1488
1508
|
});
|
|
1489
1509
|
}
|
|
1510
|
+
if (options.rcpManifest) {
|
|
1511
|
+
routes.push({
|
|
1512
|
+
method: "GET",
|
|
1513
|
+
pattern: ["rcp", "manifest"],
|
|
1514
|
+
handler: rcpManifestRoute,
|
|
1515
|
+
requiresAuth: false
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1490
1518
|
const mode = resolveMode(options);
|
|
1491
1519
|
const heartbeatIntervalMs = options.heartbeatIntervalMs ?? 15e3;
|
|
1492
1520
|
const runGraceMs = options.runGraceMs ?? DEFAULT_RUN_GRACE_MS;
|
|
@@ -1653,7 +1681,8 @@ function createRuntime(options) {
|
|
|
1653
1681
|
runs,
|
|
1654
1682
|
capabilities,
|
|
1655
1683
|
logger: routeLogger,
|
|
1656
|
-
restToolsManifest: options.restToolsManifest
|
|
1684
|
+
restToolsManifest: options.restToolsManifest,
|
|
1685
|
+
rcpManifest: options.rcpManifest
|
|
1657
1686
|
});
|
|
1658
1687
|
const durationMs = Date.now() - startMs;
|
|
1659
1688
|
logger.info("handle succeeded", {
|