cencori 1.16.0 → 1.16.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/agents/index.d.mts +5 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.js +9 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/index.mjs +9 -2
- package/dist/agents/index.mjs.map +1 -1
- package/dist/ai/index.d.mts +14 -1
- package/dist/ai/index.d.ts +14 -1
- package/dist/ai/index.js +67 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +67 -0
- package/dist/ai/index.mjs.map +1 -1
- package/dist/compute/index.d.mts +1 -1
- package/dist/compute/index.d.ts +1 -1
- package/dist/documents/index.d.mts +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -0
- package/dist/index.mjs.map +1 -1
- package/dist/judgment/index.d.mts +1 -1
- package/dist/judgment/index.d.ts +1 -1
- package/dist/memory/index.d.mts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-D91o22Gb.d.mts → types-DTuTt7AY.d.mts} +88 -1
- package/dist/{types-D91o22Gb.d.ts → types-DTuTt7AY.d.ts} +88 -1
- package/dist/vision/index.d.mts +1 -1
- package/dist/vision/index.d.ts +1 -1
- package/dist/voice/index.d.mts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/web/index.d.mts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/workflow/index.d.mts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/agents/index.d.mts
CHANGED
|
@@ -280,6 +280,11 @@ interface PausedAction {
|
|
|
280
280
|
tool: string;
|
|
281
281
|
arguments: string;
|
|
282
282
|
needs_approval?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* 'cencori': a tool Cencori runs itself, held for approval. Approve and it
|
|
285
|
+
* runs there; no result is sent for it. Otherwise the tool runs here.
|
|
286
|
+
*/
|
|
287
|
+
runs_on?: 'cencori' | 'client';
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
interface RunOptions<Ctx = unknown> extends TransportOptions {
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -280,6 +280,11 @@ interface PausedAction {
|
|
|
280
280
|
tool: string;
|
|
281
281
|
arguments: string;
|
|
282
282
|
needs_approval?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* 'cencori': a tool Cencori runs itself, held for approval. Approve and it
|
|
285
|
+
* runs there; no result is sent for it. Otherwise the tool runs here.
|
|
286
|
+
*/
|
|
287
|
+
runs_on?: 'cencori' | 'client';
|
|
283
288
|
}
|
|
284
289
|
|
|
285
290
|
interface RunOptions<Ctx = unknown> extends TransportOptions {
|
package/dist/agents/index.js
CHANGED
|
@@ -1492,6 +1492,12 @@ async function* runLoop(startAgent, input, options) {
|
|
|
1492
1492
|
const handoffsByName = new Map(agent.handoffs.map((a) => [Agent.handoffToolName(a), a]));
|
|
1493
1493
|
const interruptions = [];
|
|
1494
1494
|
for (const action of pending.actions) {
|
|
1495
|
+
if (action.runs_on === "cencori") {
|
|
1496
|
+
if (!resumedState?.decision(action.action_id)) {
|
|
1497
|
+
interruptions.push({ type: "tool_approval", callId: action.action_id, toolName: action.tool, arguments: action.arguments, agentName: agent.name });
|
|
1498
|
+
}
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1495
1501
|
const t = toolsByName.get(action.tool);
|
|
1496
1502
|
if (!t || resumedState?.decision(action.action_id)) continue;
|
|
1497
1503
|
let needs = action.needs_approval === true || t.needsApproval === true;
|
|
@@ -1526,13 +1532,14 @@ async function* runLoop(startAgent, input, options) {
|
|
|
1526
1532
|
if (decision && !decision.approved) {
|
|
1527
1533
|
return { action, output: `The user rejected this call${decision.message ? `: ${decision.message}` : "."} Don't retry it.` };
|
|
1528
1534
|
}
|
|
1535
|
+
if (action.runs_on === "cencori") return { action, output: "", ranOnCencori: true };
|
|
1529
1536
|
const t = toolsByName.get(action.tool);
|
|
1530
1537
|
if (!t) return { action, output: `Error: there is no tool named ${action.tool}.` };
|
|
1531
1538
|
return { action, output: await t.invoke(runContext, action.arguments, action.action_id) };
|
|
1532
1539
|
}));
|
|
1533
1540
|
for (const result of results) {
|
|
1534
1541
|
const { action } = result;
|
|
1535
|
-
if (handoffsByName.has(action.tool)) continue;
|
|
1542
|
+
if (handoffsByName.has(action.tool) || result.ranOnCencori) continue;
|
|
1536
1543
|
const shown = toolWidget(result.output);
|
|
1537
1544
|
if (shown) {
|
|
1538
1545
|
result.output = shown.modelOutput;
|
|
@@ -1565,7 +1572,7 @@ async function* runLoop(startAgent, input, options) {
|
|
|
1565
1572
|
response = await transport.resume(
|
|
1566
1573
|
sessionId,
|
|
1567
1574
|
pending.actionId,
|
|
1568
|
-
results.map(({ action, output }) => ({ action_id: action.action_id, output })),
|
|
1575
|
+
results.filter((r) => !r.ranOnCencori).map(({ action, output }) => ({ action_id: action.action_id, output })),
|
|
1569
1576
|
next
|
|
1570
1577
|
);
|
|
1571
1578
|
pending = void 0;
|