bazilion 0.58.2 → 0.60.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/cli.js +16 -1
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +391 -114
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-PK8ZRkVP.js +1 -0
- package/dist/web/client/assets/{AgentTemplateParts-BaeuW_3n.js → AgentTemplateParts-DXqswWc_.js} +1 -1
- package/dist/web/client/assets/{ConfirmDialog-D8f2wI5x.js → ConfirmDialog-C7Id43en.js} +1 -1
- package/dist/web/client/assets/{ConnectionsView-BUZcfBHw.js → ConnectionsView-sCcb1DqZ.js} +1 -1
- package/dist/web/client/assets/{SkillsParts-jMYdOiWh.js → SkillsParts-ClIFyTi8.js} +1 -1
- package/dist/web/client/assets/{SpawnTeamModal-Dq7D3Zlc.js → SpawnTeamModal-BxRg6e3v.js} +1 -1
- package/dist/web/client/assets/{TeamForm-Crz3mvXu.js → TeamForm-e_yDks2o.js} +1 -1
- package/dist/web/client/assets/{TeamThread-qTkvxv27.js → TeamThread-BFz7jkrt.js} +1 -1
- package/dist/web/client/assets/{UnsavedChangesGuard-DGzP-x1t.js → UnsavedChangesGuard-Cgc9WraN.js} +1 -1
- package/dist/web/client/assets/{_id-DsZBpW5G.js → _id-C24VHwwo.js} +1 -1
- package/dist/web/client/assets/{_id-CiqTBi2Q.js → _id-DeCenuG4.js} +1 -1
- package/dist/web/client/assets/{access-ssWsYTEU.js → access-Dh3w6dHo.js} +1 -1
- package/dist/web/client/assets/{agents-BmkaQvWh.js → agents-CUQ-DKWA.js} +1 -1
- package/dist/web/client/assets/{agents-D3tZ58Dh.js → agents-DHTN7twQ.js} +1 -1
- package/dist/web/client/assets/{attention-ChHdu7E8.js → attention-pzVO90iq.js} +1 -1
- package/dist/web/client/assets/{config-DPsq6Zy9.js → config-B29EfkVV.js} +1 -1
- package/dist/web/client/assets/{index-CVVVmIFC.js → index-B8Bft71n.js} +3 -3
- package/dist/web/client/assets/{login-B-Kpyw9o.js → login-CUACsY1J.js} +1 -1
- package/dist/web/client/assets/{manage-Dwe9yQl9.js → manage-DrwsI5ur.js} +1 -1
- package/dist/web/client/assets/{mcp-73AMOCv3.js → mcp-DFBkafUW.js} +1 -1
- package/dist/web/client/assets/routes-DPz6Wrxz.js +85 -0
- package/dist/web/client/assets/{skills-DmYDuDbl.js → skills-B0khtQXg.js} +1 -1
- package/dist/web/client/assets/{style-B9Vy-99n.js → style-BEcLEdJR.js} +1 -1
- package/dist/web/client/assets/styles-B-X0olFi.css +2 -0
- package/dist/web/client/assets/{system-t9hcqYBg.js → system-DexaXrV1.js} +1 -1
- package/dist/web/client/assets/{teams-5B2cyDin.js → teams-CUgnrqA5.js} +1 -1
- package/dist/web/client/assets/{teams-Nk_bHpr0.js → teams-DC-abyJ_.js} +1 -1
- package/dist/web/client/assets/telegram-DlnKiJP1.js +1 -0
- package/dist/web/client/assets/{tools-mdAuMsYJ.js → tools-BefW81ig.js} +1 -1
- package/dist/web/client/assets/{usage-CWu7R8ZD.js → usage-oJ-ACG85.js} +1 -1
- package/dist/web/client/assets/{welcome-BuRNFxpc.js → welcome-BzesXAyM.js} +1 -1
- package/dist/web/server/assets/{AddProviderDialog-Bqsz5NaL.js → AddProviderDialog-CxwjFPVY.js} +3 -3
- package/dist/web/server/assets/{AgentTemplateParts-D97gKNdN.js → AgentTemplateParts-CDDoX_bG.js} +5 -5
- package/dist/web/server/assets/{ConfigPage-CrxctbtN.js → ConfigPage-DwbP35aS.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-CuD5HXTw.js → ConfirmDialog-CR_DTRpW.js} +1 -1
- package/dist/web/server/assets/{ConnectionsView-CSf83J-v.js → ConnectionsView-HoyHjzrZ.js} +6 -6
- package/dist/web/server/assets/{Dialog-CwAfaXpM.js → Dialog-B2ZAk0JC.js} +1 -1
- package/dist/web/server/assets/{ManagePage-DGYNJ6XG.js → ManagePage-DSzEP6tP.js} +2 -2
- package/dist/web/server/assets/{ModelMenu-DEJoYASj.js → ModelMenu-BgIvpkO0.js} +1 -1
- package/dist/web/server/assets/{SectionTabs--vMBvaUz.js → SectionTabs-B56iIxRj.js} +1 -1
- package/dist/web/server/assets/{SkillsParts-hjS9a_Ht.js → SkillsParts-Bf5aGuER.js} +5 -5
- package/dist/web/server/assets/{SpawnDialog-BjVZl7xK.js → SpawnDialog-Fsdom-ur.js} +4 -4
- package/dist/web/server/assets/{SpawnTeamModal-BmBXqfFi.js → SpawnTeamModal-Zz03rkBZ.js} +4 -4
- package/dist/web/server/assets/{TeamForm-B4702hBg.js → TeamForm-DwXwjZWb.js} +4 -4
- package/dist/web/server/assets/{TeamThread-BGl5z8_I.js → TeamThread-Be_seq83.js} +1 -1
- package/dist/web/server/assets/{UnsavedChangesGuard-Be8EqfV_.js → UnsavedChangesGuard-BEtAdwza.js} +1 -1
- package/dist/web/server/assets/{_id-VqiN2zRR.js → _id-D1USZSkO.js} +9 -9
- package/dist/web/server/assets/{_id-BWtcQovD.js → _id-Dkx7QsM_.js} +1 -1
- package/dist/web/server/assets/{_id-DBhvSxVl.js → _id-R5F7ISnu.js} +1 -1
- package/dist/web/server/assets/{_id-TT_ZsaSc.js → _id-gh-ba9YO.js} +10 -10
- package/dist/web/server/assets/{_id-CKBQM7LH.js → _id-sS3ozDuV.js} +1 -1
- package/dist/web/server/assets/{_tanstack-start-manifest_v-gHDkHqeS.js → _tanstack-start-manifest_v-CEGe-Ovy.js} +57 -57
- package/dist/web/server/assets/{access-Bog7dbtP.js → access-BcKK4G_w.js} +1 -1
- package/dist/web/server/assets/{access-C5lXP5JS.js → access-CftAsKX6.js} +5 -5
- package/dist/web/server/assets/{activity-Czfq-5_F.js → activity-Dy1HUqjo.js} +13 -0
- package/dist/web/server/assets/{agents-DDUHE3eY.js → agents-BAlP1gc_.js} +8 -8
- package/dist/web/server/assets/{agents-8XZAjHh0.js → agents-BBQyhQz7.js} +7 -7
- package/dist/web/server/assets/{agents-Co6S2Ml9.js → agents-Bgo3LnIL.js} +1 -1
- package/dist/web/server/assets/{agents-BepbikC0.js → agents-CSMQtQCr.js} +1 -1
- package/dist/web/server/assets/{agents-DnUK-7qJ.js → agents-CvU8ljqt.js} +1 -1
- package/dist/web/server/assets/{agents-CKkMouJX.js → agents-DlxkPC-q.js} +1 -1
- package/dist/web/server/assets/{attention-n8edCJBL.js → attention-CHqUjESP.js} +5 -5
- package/dist/web/server/assets/{attention--1dBWt0c.js → attention-rfqLfyDE.js} +1 -1
- package/dist/web/server/assets/{config-BpwsF11b.js → config-CraGjaZB.js} +1 -1
- package/dist/web/server/assets/{config-UHRqSrh4.js → config-DSBJKiDX.js} +7 -7
- package/dist/web/server/assets/{form-Bwsyt9OY.js → form-BGif16IN.js} +2 -2
- package/dist/web/server/assets/{manage-C7ss0xG5.js → manage-CfDQUV7j.js} +1 -1
- package/dist/web/server/assets/{mcp-CUoF4jIO.js → mcp-RKq9Cj-h.js} +6 -6
- package/dist/web/server/assets/{mcp-COn047tO.js → mcp-VCW2SGMk.js} +1 -1
- package/dist/web/server/assets/{parts-B0wbj_yK.js → parts-BpwHijPN.js} +1 -1
- package/dist/web/server/assets/{router-yEsciAts.js → router-CE6lnn8Z.js} +22 -22
- package/dist/web/server/assets/{routes-CjtC0rDs.js → routes-B0oBIDOC.js} +1 -1
- package/dist/web/server/assets/{routes-BgjikzXy.js → routes-BYmi9O0B.js} +2 -0
- package/dist/web/server/assets/{routes-Bfkccvfb.js → routes-Ci6C5w_N.js} +240 -93
- package/dist/web/server/assets/{skills-D5oN5ehC.js → skills-DM_Qcvqk.js} +7 -7
- package/dist/web/server/assets/{skills-DouMCq_2.js → skills-DZI56DdW.js} +1 -1
- package/dist/web/server/assets/{style-BgFXDhAR.js → style-DuiMhwn4.js} +1 -1
- package/dist/web/server/assets/{system-4WV2pOS4.js → system-Bx-_Vfss.js} +1 -1
- package/dist/web/server/assets/{system-DtGHi7X7.js → system-C_kmuned.js} +3 -3
- package/dist/web/server/assets/{teams-BnsbH4YW.js → teams-BL_lLFPd.js} +8 -8
- package/dist/web/server/assets/{teams-Blfyu8ej.js → teams-Bd6J6rHj.js} +1 -1
- package/dist/web/server/assets/{teams-QVxXJfo7.js → teams-CRGLRUp9.js} +1 -1
- package/dist/web/server/assets/{teams-gzY3tOtu.js → teams-fQEKru2G.js} +7 -7
- package/dist/web/server/assets/{telegram-CIbuQ5-U.js → telegram-CpHjomwG.js} +1 -1
- package/dist/web/server/assets/{telegram-Ctj5dqvs.js → telegram-Do0oUOXQ.js} +6 -6
- package/dist/web/server/assets/{tools-x_DQTQtE.js → tools-CMXn8htp.js} +5 -5
- package/dist/web/server/assets/{tools-Dn6RnOFu.js → tools-Ctckgev8.js} +1 -1
- package/dist/web/server/assets/{usage-CeiyPffw.js → usage-DaV-iwEz.js} +1 -1
- package/dist/web/server/assets/{usage-Dsi2V9Wh.js → usage-sZ4SFz36.js} +3 -3
- package/dist/web/server/assets/{welcome-C71pZOQ9.js → welcome-BhfLQBOr.js} +1 -1
- package/dist/web/server/assets/{welcome-A2Koo4HI.js → welcome-Dz5zfvV2.js} +3 -3
- package/dist/web/server/server.js +6 -6
- package/dist/worker.js +224 -26
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/AddProviderDialog-BsUXLr-m.js +0 -1
- package/dist/web/client/assets/routes-Lj8n-RF7.js +0 -85
- package/dist/web/client/assets/styles-DyFDuWBI.css +0 -2
- package/dist/web/client/assets/telegram-BWfL_OIt.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as api } from "./live-DbJeq6KP.js";
|
|
2
|
-
import { C as teamRemoveBlocker, D as MODE_NAME, O as MODE_SENTENCE, s as count } from "./manage-
|
|
2
|
+
import { C as teamRemoveBlocker, D as MODE_NAME, O as MODE_SENTENCE, s as count } from "./manage-CfDQUV7j.js";
|
|
3
3
|
import { t as AgentAvatar } from "./AgentAvatar-8gTAy_tP.js";
|
|
4
4
|
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
5
|
-
import { t as Dialog } from "./Dialog-
|
|
6
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-
|
|
7
|
-
import { _ as RowMenu, d as Chip, h as ListRow, i as CardEmpty, o as CardList, y as SetupCard } from "./parts-
|
|
8
|
-
import { t as Route } from "./teams-
|
|
9
|
-
import { t as ManagePage } from "./ManagePage-
|
|
10
|
-
import { t as TeamForm } from "./TeamForm-
|
|
5
|
+
import { t as Dialog } from "./Dialog-B2ZAk0JC.js";
|
|
6
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-CR_DTRpW.js";
|
|
7
|
+
import { _ as RowMenu, d as Chip, h as ListRow, i as CardEmpty, o as CardList, y as SetupCard } from "./parts-BpwHijPN.js";
|
|
8
|
+
import { t as Route } from "./teams-CRGLRUp9.js";
|
|
9
|
+
import { t as ManagePage } from "./ManagePage-DSzEP6tP.js";
|
|
10
|
+
import { t as TeamForm } from "./TeamForm-DwXwjZWb.js";
|
|
11
11
|
import { useState } from "react";
|
|
12
12
|
import { Link, useNavigate, useRouter } from "@tanstack/react-router";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -2,7 +2,7 @@ import { n as createServerFn } from "../server.js";
|
|
|
2
2
|
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/config/telegram.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./telegram-
|
|
5
|
+
var $$splitComponentImporter = () => import("./telegram-Do0oUOXQ.js");
|
|
6
6
|
var fetchTelegramConfig = createServerFn({ method: "GET" }).handler(createSsrRpc("9252e07d6f45cb1c4543c2ca6f1b0c4c7697c249f3e6c94fda53b8a603929a92"));
|
|
7
7
|
var Route = createFileRoute("/config/telegram")({
|
|
8
8
|
loader: () => fetchTelegramConfig(),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
2
|
import { r as useResource } from "./use-resource-BjN1uJoL.js";
|
|
3
3
|
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
4
|
-
import { r as ago } from "./ModelMenu-
|
|
5
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-
|
|
6
|
-
import { a as CardForm, d as Chip, f as Fact, g as Notice, h as ListRow, l as CheckItem, o as CardList, p as Facts, r as CardBody, s as CardRow, t as Banner, u as CheckList, x as Waiting, y as SetupCard } from "./parts-
|
|
7
|
-
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, o as SecretField, t as CheckboxRow } from "./form-
|
|
8
|
-
import { t as Route } from "./telegram-
|
|
9
|
-
import { t as ConfigPage } from "./ConfigPage-
|
|
4
|
+
import { r as ago } from "./ModelMenu-BgIvpkO0.js";
|
|
5
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-CR_DTRpW.js";
|
|
6
|
+
import { a as CardForm, d as Chip, f as Fact, g as Notice, h as ListRow, l as CheckItem, o as CardList, p as Facts, r as CardBody, s as CardRow, t as Banner, u as CheckList, x as Waiting, y as SetupCard } from "./parts-BpwHijPN.js";
|
|
7
|
+
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, o as SecretField, t as CheckboxRow } from "./form-BGif16IN.js";
|
|
8
|
+
import { t as Route } from "./telegram-CpHjomwG.js";
|
|
9
|
+
import { t as ConfigPage } from "./ConfigPage-DwbP35aS.js";
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
11
|
import { useRouter } from "@tanstack/react-router";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as api, o as errorMessage, r as ApiError } from "./live-DbJeq6KP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as CardForm, d as Chip, g as Notice, y as SetupCard } from "./parts-
|
|
4
|
-
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, n as ChoiceCards, o as SecretField } from "./form-
|
|
5
|
-
import { t as Route } from "./tools-
|
|
6
|
-
import { t as ConfigPage } from "./ConfigPage-
|
|
2
|
+
import { m as cn } from "./ModelMenu-BgIvpkO0.js";
|
|
3
|
+
import { a as CardForm, d as Chip, g as Notice, y as SetupCard } from "./parts-BpwHijPN.js";
|
|
4
|
+
import { a as SaveBar, d as TextField, f as saveStatus, i as Problem, l as SwitchRow, n as ChoiceCards, o as SecretField } from "./form-BGif16IN.js";
|
|
5
|
+
import { t as Route } from "./tools-Ctckgev8.js";
|
|
6
|
+
import { t as ConfigPage } from "./ConfigPage-DwbP35aS.js";
|
|
7
7
|
import { useId, useState } from "react";
|
|
8
8
|
import { useRouter } from "@tanstack/react-router";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -2,7 +2,7 @@ import { n as createServerFn } from "../server.js";
|
|
|
2
2
|
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/config/tools.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./tools-
|
|
5
|
+
var $$splitComponentImporter = () => import("./tools-CMXn8htp.js");
|
|
6
6
|
var fetchTools = createServerFn({ method: "GET" }).handler(createSsrRpc("946c6cbff3f55931c3fb28c971d20b18b4b8a9f25417a5d1afc0550d7afa393b"));
|
|
7
7
|
var Route = createFileRoute("/config/tools")({
|
|
8
8
|
loader: () => fetchTools(),
|
|
@@ -30,7 +30,7 @@ function parseDays(value) {
|
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/routes/usage/index.tsx
|
|
33
|
-
var $$splitComponentImporter = () => import("./usage-
|
|
33
|
+
var $$splitComponentImporter = () => import("./usage-sZ4SFz36.js");
|
|
34
34
|
var text = (value) => typeof value === "string" && value ? value : void 0;
|
|
35
35
|
/** The address's period: `?days=7` reads as the number 7, `?days=all` as text. */
|
|
36
36
|
var Route = createFileRoute("/usage/")({
|
|
@@ -2,9 +2,9 @@ import { i as api } from "./live-DbJeq6KP.js";
|
|
|
2
2
|
import { n as formatTokens, r as usageSummary, t as formatCost } from "./src-ErO6nYmi.js";
|
|
3
3
|
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
4
4
|
import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
|
|
5
|
-
import { d as Chip, g as Notice, h as ListRow, i as CardEmpty, o as CardList, r as CardBody, t as Banner, y as SetupCard } from "./parts-
|
|
6
|
-
import { n as PERIODS, r as parseDays, t as Route } from "./usage-
|
|
7
|
-
import { t as ManagePage } from "./ManagePage-
|
|
5
|
+
import { d as Chip, g as Notice, h as ListRow, i as CardEmpty, o as CardList, r as CardBody, t as Banner, y as SetupCard } from "./parts-BpwHijPN.js";
|
|
6
|
+
import { n as PERIODS, r as parseDays, t as Route } from "./usage-DaV-iwEz.js";
|
|
7
|
+
import { t as ManagePage } from "./ManagePage-DSzEP6tP.js";
|
|
8
8
|
import { useEffect, useId, useState } from "react";
|
|
9
9
|
import { Link, useNavigate } from "@tanstack/react-router";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +11,7 @@ function isSetupOpen(path) {
|
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/routes/welcome.tsx
|
|
14
|
-
var $$splitComponentImporter = () => import("./welcome-
|
|
14
|
+
var $$splitComponentImporter = () => import("./welcome-Dz5zfvV2.js");
|
|
15
15
|
var fetchProviders = createServerFn({ method: "GET" }).handler(createSsrRpc("818bf71baeed233268a5ad1a4be5a77e488be79b79ad1bd739463445a7be4d58"));
|
|
16
16
|
var Route = createFileRoute("/welcome")({
|
|
17
17
|
beforeLoad: async () => {
|
|
@@ -3,9 +3,9 @@ import { u as DEFAULT_PROFILE_ID } from "./src-ErO6nYmi.js";
|
|
|
3
3
|
import { r as useResource } from "./use-resource-BjN1uJoL.js";
|
|
4
4
|
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
5
5
|
import { n as usePageTitle } from "./page-title-PTpFHXWo.js";
|
|
6
|
-
import { C as PageShell } from "./parts-
|
|
7
|
-
import { t as Route } from "./welcome-
|
|
8
|
-
import { a as ProviderConnect, c as ProviderAvatar, i as hostOf, n as ConnectedSummary, r as ProviderChooser } from "./AddProviderDialog-
|
|
6
|
+
import { C as PageShell } from "./parts-BpwHijPN.js";
|
|
7
|
+
import { t as Route } from "./welcome-BhfLQBOr.js";
|
|
8
|
+
import { a as ProviderConnect, c as ProviderAvatar, i as hostOf, n as ConnectedSummary, r as ProviderChooser } from "./AddProviderDialog-CxwjFPVY.js";
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { useNavigate } from "@tanstack/react-router";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3558,7 +3558,7 @@ var defaultSerovalPlugins = [
|
|
|
3558
3558
|
* the dev styles URL for route-scoped CSS collection.
|
|
3559
3559
|
*/
|
|
3560
3560
|
async function getStartManifest(matchedRoutes) {
|
|
3561
|
-
const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-
|
|
3561
|
+
const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-CEGe-Ovy.js");
|
|
3562
3562
|
const startManifest = tsrStartManifest();
|
|
3563
3563
|
let routes = startManifest.routes;
|
|
3564
3564
|
routes[rootRouteId];
|
|
@@ -3586,7 +3586,7 @@ var manifest = {
|
|
|
3586
3586
|
},
|
|
3587
3587
|
"22325942f341b7af6fb13fa5fde2b06e1d7d91f9178205ef3eb9e5ba3c9ef2fe": {
|
|
3588
3588
|
functionName: "fetchWorkspace_createServerFn_handler",
|
|
3589
|
-
importer: () => import("./assets/routes-
|
|
3589
|
+
importer: () => import("./assets/routes-BYmi9O0B.js")
|
|
3590
3590
|
},
|
|
3591
3591
|
"278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7": {
|
|
3592
3592
|
functionName: "fetchServers_createServerFn_handler",
|
|
@@ -3602,7 +3602,7 @@ var manifest = {
|
|
|
3602
3602
|
},
|
|
3603
3603
|
"7bc7f3b145d10e7a733fbe068ce367dda04ec2f1cdb53f0d6dcba3838eb2deeb": {
|
|
3604
3604
|
functionName: "fetchTemplates_createServerFn_handler",
|
|
3605
|
-
importer: () => import("./assets/agents-
|
|
3605
|
+
importer: () => import("./assets/agents-CSMQtQCr.js")
|
|
3606
3606
|
},
|
|
3607
3607
|
"818bf71baeed233268a5ad1a4be5a77e488be79b79ad1bd739463445a7be4d58": {
|
|
3608
3608
|
functionName: "fetchProviders_createServerFn_handler",
|
|
@@ -3622,7 +3622,7 @@ var manifest = {
|
|
|
3622
3622
|
},
|
|
3623
3623
|
"a3ce4c3b27c4c69828cf8a81d1f5312a9f8e2c82de6c7e6e2846eb5c2fc322ea": {
|
|
3624
3624
|
functionName: "fetchTemplate_createServerFn_handler",
|
|
3625
|
-
importer: () => import("./assets/_id-
|
|
3625
|
+
importer: () => import("./assets/_id-Dkx7QsM_.js")
|
|
3626
3626
|
},
|
|
3627
3627
|
"a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2": {
|
|
3628
3628
|
functionName: "fetchAuthState_createServerFn_handler",
|
|
@@ -3642,7 +3642,7 @@ var manifest = {
|
|
|
3642
3642
|
},
|
|
3643
3643
|
"f715bab0037380aa3db7e237e7cf1e74168c363f48a960bb1ddfa5560de3a74e": {
|
|
3644
3644
|
functionName: "fetchAgents_createServerFn_handler",
|
|
3645
|
-
importer: () => import("./assets/agents-
|
|
3645
|
+
importer: () => import("./assets/agents-Bgo3LnIL.js")
|
|
3646
3646
|
},
|
|
3647
3647
|
"fda651b73911d8ef30f3a6b58894b5d853fdc4997acaf1793c76c06680504b82": {
|
|
3648
3648
|
functionName: "fetchTeams_createServerFn_handler",
|
|
@@ -5524,7 +5524,7 @@ var getBaseManifest = getProdBaseManifest;
|
|
|
5524
5524
|
var createEarlyHintsForRequest = createEarlyHintsCollector;
|
|
5525
5525
|
async function loadEntries() {
|
|
5526
5526
|
const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
|
|
5527
|
-
import("./assets/router-
|
|
5527
|
+
import("./assets/router-CE6lnn8Z.js"),
|
|
5528
5528
|
import("./assets/start-D4sx5Ovq.js"),
|
|
5529
5529
|
import("./assets/empty-plugin-adapters-Cq4--YW-.js")
|
|
5530
5530
|
]);
|
package/dist/worker.js
CHANGED
|
@@ -1294,6 +1294,17 @@ var PROGRESS_TAIL_CHARS = 8 * 1024;
|
|
|
1294
1294
|
var PROGRESS_INTERVAL_MS = 250;
|
|
1295
1295
|
function translatePiEvent(e, secrets = []) {
|
|
1296
1296
|
switch (e.type) {
|
|
1297
|
+
case "compaction_start":
|
|
1298
|
+
return [{ type: "compaction", state: "running" }];
|
|
1299
|
+
case "compaction_end":
|
|
1300
|
+
if (e.aborted) return [];
|
|
1301
|
+
return e.result ? [{ type: "compaction", state: "done" }] : [
|
|
1302
|
+
{
|
|
1303
|
+
type: "compaction",
|
|
1304
|
+
state: "failed",
|
|
1305
|
+
error: redactExactValues(e.errorMessage ?? "no summary came back", secrets)
|
|
1306
|
+
}
|
|
1307
|
+
];
|
|
1297
1308
|
case "message_start": {
|
|
1298
1309
|
if (e.message.role === "user") {
|
|
1299
1310
|
return [{ type: "user_message", text: stringifyContent(e.message.content) }];
|
|
@@ -1499,7 +1510,8 @@ function piMessagesToProviderView(messages, secrets = []) {
|
|
|
1499
1510
|
toolCallId: tr.toolCallId,
|
|
1500
1511
|
toolName: tr.toolName,
|
|
1501
1512
|
results: extractResultReferences(m),
|
|
1502
|
-
...images.length > 0 ? { images } : {}
|
|
1513
|
+
...images.length > 0 ? { images } : {},
|
|
1514
|
+
...tr.isError ? { isError: true } : {}
|
|
1503
1515
|
});
|
|
1504
1516
|
break;
|
|
1505
1517
|
}
|
|
@@ -1519,6 +1531,34 @@ function extractResultReferences(value) {
|
|
|
1519
1531
|
});
|
|
1520
1532
|
}
|
|
1521
1533
|
|
|
1534
|
+
// ../daemon/src/runtime/pi/history.ts
|
|
1535
|
+
import {
|
|
1536
|
+
calculateContextTokens
|
|
1537
|
+
} from "@earendil-works/pi-coding-agent";
|
|
1538
|
+
function conversationHistory(branch) {
|
|
1539
|
+
const messages = [];
|
|
1540
|
+
const position = /* @__PURE__ */ new Map();
|
|
1541
|
+
const compactions = [];
|
|
1542
|
+
for (const entry of branch) {
|
|
1543
|
+
position.set(entry.id, messages.length);
|
|
1544
|
+
if (entry.type === "message" && entry.message.role !== "system") {
|
|
1545
|
+
const message = entry.message;
|
|
1546
|
+
messages.push(
|
|
1547
|
+
"content" in message && message.content == null ? { ...message, content: [] } : message
|
|
1548
|
+
);
|
|
1549
|
+
} else if (entry.type === "compaction") {
|
|
1550
|
+
compactions.push({
|
|
1551
|
+
// The part kept verbatim starts at firstKeptEntryId; the summary stands for what precedes.
|
|
1552
|
+
index: position.get(entry.firstKeptEntryId) ?? messages.length,
|
|
1553
|
+
summary: entry.summary,
|
|
1554
|
+
tokensBefore: entry.tokensBefore,
|
|
1555
|
+
at: Date.parse(entry.timestamp) || 0
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
return { messages, compactions };
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1522
1562
|
// ../daemon/src/runtime/pi/session.ts
|
|
1523
1563
|
import { existsSync as existsSync4, mkdirSync as mkdirSync4, statSync as statSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
1524
1564
|
import { basename as basename3, join as join8 } from "node:path";
|
|
@@ -1565,6 +1605,13 @@ function resolveBrowserConfig(env) {
|
|
|
1565
1605
|
// ../daemon/src/runtime/providers/pi-runtime.ts
|
|
1566
1606
|
import { InMemoryCredentialStore } from "@earendil-works/pi-ai";
|
|
1567
1607
|
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
1608
|
+
|
|
1609
|
+
// ../daemon/src/runtime/providers/catalog.ts
|
|
1610
|
+
import { getBuiltinModels } from "@earendil-works/pi-ai/providers/all";
|
|
1611
|
+
import { fetch as undiciFetch } from "undici";
|
|
1612
|
+
|
|
1613
|
+
// ../daemon/src/runtime/providers/pi-runtime.ts
|
|
1614
|
+
var ENDPOINT_CONTEXT_WINDOW = 32768;
|
|
1568
1615
|
function endpointModel(providerName, modelId, baseUrl) {
|
|
1569
1616
|
return {
|
|
1570
1617
|
id: modelId,
|
|
@@ -1575,7 +1622,7 @@ function endpointModel(providerName, modelId, baseUrl) {
|
|
|
1575
1622
|
reasoning: false,
|
|
1576
1623
|
input: ["text"],
|
|
1577
1624
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
1578
|
-
contextWindow:
|
|
1625
|
+
contextWindow: ENDPOINT_CONTEXT_WINDOW,
|
|
1579
1626
|
maxTokens: 4096
|
|
1580
1627
|
};
|
|
1581
1628
|
}
|
|
@@ -1774,7 +1821,7 @@ function loadPromptSkills(skillsDir, attachedNames) {
|
|
|
1774
1821
|
var CONTEXT_FILE_ORDER = ["AGENTS.md", "SOUL.md", "TOOLS.md", "IDENTITY.md"];
|
|
1775
1822
|
function loadHomeDocuments(agentDir) {
|
|
1776
1823
|
const root = resolveRealDirectory(agentDir);
|
|
1777
|
-
const
|
|
1824
|
+
const read2 = (file) => {
|
|
1778
1825
|
try {
|
|
1779
1826
|
return readRegularFileNoFollow(join3(root, file));
|
|
1780
1827
|
} catch (error) {
|
|
@@ -1783,11 +1830,11 @@ function loadHomeDocuments(agentDir) {
|
|
|
1783
1830
|
}
|
|
1784
1831
|
};
|
|
1785
1832
|
return {
|
|
1786
|
-
"AGENTS.md":
|
|
1787
|
-
"SOUL.md":
|
|
1788
|
-
"TOOLS.md":
|
|
1789
|
-
"IDENTITY.md":
|
|
1790
|
-
"BOOTSTRAP.md":
|
|
1833
|
+
"AGENTS.md": read2("AGENTS.md"),
|
|
1834
|
+
"SOUL.md": read2("SOUL.md"),
|
|
1835
|
+
"TOOLS.md": read2("TOOLS.md"),
|
|
1836
|
+
"IDENTITY.md": read2("IDENTITY.md"),
|
|
1837
|
+
"BOOTSTRAP.md": read2("BOOTSTRAP.md")
|
|
1791
1838
|
};
|
|
1792
1839
|
}
|
|
1793
1840
|
function buildSystemPrompt(agent, options = {}) {
|
|
@@ -1939,7 +1986,7 @@ ${reviewedLessons.map((lesson) => `- ${lesson}`).join("\n")}`
|
|
|
1939
1986
|
}
|
|
1940
1987
|
parts.push({
|
|
1941
1988
|
id: "memory",
|
|
1942
|
-
text: "# Memory\n\nYou share a persistent memory backend with every other agent in this team. Use `memory_write` to remember things across sessions, and `memory_search` / `memory_read` / `memory_list` to recall them. This memory is for project knowledge \u2014 codebase notes, decisions, things the user told you about the work. For personal notes about yourself (preferences, persona quirks), use `home_write` on IDENTITY.md instead. Always check memory at the start of a session: another agent in the team may have already learned something useful. **Do NOT send peer messages announcing memory writes \u2014 every agent has access to the same store via `memory_search` and will find your note when they need it
|
|
1989
|
+
text: "# Memory\n\nYou share a persistent memory backend with every other agent in this team. Use `memory_write` to remember things across sessions, and `memory_search` / `memory_read` / `memory_list` to recall them. This memory is for project knowledge \u2014 codebase notes, decisions, things the user told you about the work. For personal notes about yourself (preferences, persona quirks), use `home_write` on IDENTITY.md instead. Always check memory at the start of a session: another agent in the team may have already learned something useful. **Do NOT send peer messages announcing memory writes \u2014 every agent has access to the same store via `memory_search` and will find your note when they need it.**\n\nWhen a conversation grows long, its older messages are replaced by a summary. They stay saved: when the summary leaves out a detail you need, find it with `recall` instead of guessing or asking again."
|
|
1943
1990
|
});
|
|
1944
1991
|
return parts;
|
|
1945
1992
|
}
|
|
@@ -3169,6 +3216,143 @@ function messagingTools(host, fromAgentId) {
|
|
|
3169
3216
|
];
|
|
3170
3217
|
}
|
|
3171
3218
|
|
|
3219
|
+
// ../daemon/src/runtime/tools/recall.ts
|
|
3220
|
+
var MAX_WORDS = 8;
|
|
3221
|
+
var MAX_HITS = 12;
|
|
3222
|
+
var READ_COUNT = 5;
|
|
3223
|
+
var MAX_READ = 20;
|
|
3224
|
+
var BUDGET = 2e4;
|
|
3225
|
+
var MIN_SHARE = 2e3;
|
|
3226
|
+
var BEFORE = 60;
|
|
3227
|
+
var AFTER = 200;
|
|
3228
|
+
var NOTHING_SUMMARIZED = "Nothing in this conversation has been summarized: every message is still in your context.";
|
|
3229
|
+
function recallTool(source) {
|
|
3230
|
+
return {
|
|
3231
|
+
def: {
|
|
3232
|
+
name: "recall",
|
|
3233
|
+
description: "Search or read this conversation's older messages that were summarized to make room. When a conversation fills your context, its older messages are replaced by a summary, but they stay saved. When the summary leaves out something you need (an exact value, a link, a file name, the user's own words, what a tool returned), find it here rather than guessing or asking again. Give `query` to list the summarized messages that hold every word, with their numbers; give `from` (a number from a search, or 1 for the start) to read messages in full.",
|
|
3234
|
+
parameters: {
|
|
3235
|
+
type: "object",
|
|
3236
|
+
properties: {
|
|
3237
|
+
query: {
|
|
3238
|
+
type: "string",
|
|
3239
|
+
description: "words that must all appear in a message (case is ignored)"
|
|
3240
|
+
},
|
|
3241
|
+
from: {
|
|
3242
|
+
type: "integer",
|
|
3243
|
+
minimum: 1,
|
|
3244
|
+
description: "the number of the first message to read"
|
|
3245
|
+
},
|
|
3246
|
+
count: {
|
|
3247
|
+
type: "integer",
|
|
3248
|
+
minimum: 1,
|
|
3249
|
+
maximum: MAX_READ,
|
|
3250
|
+
description: `how many messages to read from \`from\` (default ${READ_COUNT}); long messages are cut, less so when you read fewer`
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
},
|
|
3255
|
+
async invoke(args) {
|
|
3256
|
+
const summarized = summarizedMessages(source);
|
|
3257
|
+
if (summarized.length === 0) return NOTHING_SUMMARIZED;
|
|
3258
|
+
if (args.from !== void 0) return read(summarized, Number(args.from), args.count);
|
|
3259
|
+
if (typeof args.query === "string") return search(summarized, args.query);
|
|
3260
|
+
throw new Error("recall: give `query` to search or `from` to read");
|
|
3261
|
+
}
|
|
3262
|
+
};
|
|
3263
|
+
}
|
|
3264
|
+
function summarizedMessages(source) {
|
|
3265
|
+
const { messages, compactions } = conversationHistory(source.branch());
|
|
3266
|
+
const end = compactions.at(-1)?.index ?? 0;
|
|
3267
|
+
return messages.slice(0, end).flatMap((message, index) => {
|
|
3268
|
+
const [shown] = piMessagesToProviderView([message], source.secrets);
|
|
3269
|
+
if (!shown) return [];
|
|
3270
|
+
const at = message.timestamp;
|
|
3271
|
+
const when = typeof at === "number" && Number.isFinite(at) ? ` \xB7 ${new Date(at).toISOString().slice(0, 16).replace("T", " ")} UTC` : "";
|
|
3272
|
+
return [
|
|
3273
|
+
{
|
|
3274
|
+
number: index + 1,
|
|
3275
|
+
heading: `#${index + 1} \xB7 ${speaker(shown)}${when}`,
|
|
3276
|
+
text: redactExactValues(textOf(shown), source.secrets)
|
|
3277
|
+
}
|
|
3278
|
+
];
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
function speaker(message) {
|
|
3282
|
+
if (message.role === "tool") {
|
|
3283
|
+
return `result of ${message.toolName ?? "a tool"}${message.isError ? ", failed" : ""}`;
|
|
3284
|
+
}
|
|
3285
|
+
return message.role;
|
|
3286
|
+
}
|
|
3287
|
+
function textOf(message) {
|
|
3288
|
+
const parts = message.content ? [message.content] : [];
|
|
3289
|
+
for (const call of message.toolCalls ?? []) parts.push(`[called ${call.name} ${call.arguments}]`);
|
|
3290
|
+
const images = message.images?.length ?? 0;
|
|
3291
|
+
if (images > 0) parts.push(`[${images === 1 ? "an image" : `${images} images`}]`);
|
|
3292
|
+
if (message.stopped) parts.push(`[${message.stopped}]`);
|
|
3293
|
+
return parts.join("\n");
|
|
3294
|
+
}
|
|
3295
|
+
function search(summarized, query) {
|
|
3296
|
+
const words = [...new Set(query.toLowerCase().split(/\s+/).filter(Boolean))];
|
|
3297
|
+
if (words.join("").length < 2) throw new Error("recall: search for at least two characters");
|
|
3298
|
+
if (words.length > MAX_WORDS) throw new Error(`recall: search for at most ${MAX_WORDS} words`);
|
|
3299
|
+
const hits = summarized.filter((message) => {
|
|
3300
|
+
const lower = message.text.toLowerCase();
|
|
3301
|
+
return words.every((word) => lower.includes(word));
|
|
3302
|
+
});
|
|
3303
|
+
const of = `of the ${summarized.length} summarized messages`;
|
|
3304
|
+
if (hits.length === 0) {
|
|
3305
|
+
return `None ${of} holds every word of "${query}". Search for fewer or other words, or read from 1.`;
|
|
3306
|
+
}
|
|
3307
|
+
const shown = hits.slice(-MAX_HITS);
|
|
3308
|
+
const lines = shown.map((hit) => `${hit.heading}: ${snippetOf(hit.text, words)}`);
|
|
3309
|
+
const earlier = hits.length - shown.length;
|
|
3310
|
+
return [
|
|
3311
|
+
`${hits.length} ${of} ${hits.length === 1 ? "holds" : "hold"} every word of "${query}"${earlier > 0 ? `; the latest ${shown.length}` : ""}:`,
|
|
3312
|
+
...lines,
|
|
3313
|
+
...earlier > 0 ? [`${earlier} earlier ones are not listed: add a word to narrow the search.`] : [],
|
|
3314
|
+
"Read one in full with `from` and its number."
|
|
3315
|
+
].join("\n");
|
|
3316
|
+
}
|
|
3317
|
+
function snippetOf(text, words) {
|
|
3318
|
+
const flat = text.replace(/\s+/g, " ").trim();
|
|
3319
|
+
const lower = flat.toLowerCase();
|
|
3320
|
+
const at = Math.min(...words.map((word) => lower.indexOf(word)).filter((index) => index >= 0));
|
|
3321
|
+
const start = Math.max(0, at - BEFORE);
|
|
3322
|
+
const end = Math.min(flat.length, at + AFTER);
|
|
3323
|
+
return `${start > 0 ? "\u2026" : ""}${flat.slice(start, end).trim()}${end < flat.length ? "\u2026" : ""}`;
|
|
3324
|
+
}
|
|
3325
|
+
function read(summarized, from, rawCount) {
|
|
3326
|
+
const total = summarized.at(-1)?.number ?? 0;
|
|
3327
|
+
if (!Number.isInteger(from) || from < 1) throw new Error("recall: `from` is a message number");
|
|
3328
|
+
if (from > total) {
|
|
3329
|
+
return `Only messages 1 to ${total} were summarized; the later ones are in your context.`;
|
|
3330
|
+
}
|
|
3331
|
+
const count = rawCount === void 0 ? READ_COUNT : Number(rawCount);
|
|
3332
|
+
if (!Number.isInteger(count) || count < 1 || count > MAX_READ) {
|
|
3333
|
+
throw new Error(`recall: \`count\` is from 1 to ${MAX_READ}`);
|
|
3334
|
+
}
|
|
3335
|
+
const share = Math.max(MIN_SHARE, Math.floor(BUDGET / count));
|
|
3336
|
+
const blocks = [];
|
|
3337
|
+
let used = 0;
|
|
3338
|
+
let next = null;
|
|
3339
|
+
for (const message of summarized) {
|
|
3340
|
+
if (message.number < from) continue;
|
|
3341
|
+
if (blocks.length === count || blocks.length > 0 && used >= BUDGET) {
|
|
3342
|
+
next = message.number;
|
|
3343
|
+
break;
|
|
3344
|
+
}
|
|
3345
|
+
const cut = message.text.length > share;
|
|
3346
|
+
const body = cut ? `${message.text.slice(0, share)}\u2026 [${(message.text.length - share).toLocaleString("en-US")} more characters cut${count > 1 ? "; read this message alone to see more" : ""}]` : message.text;
|
|
3347
|
+
blocks.push(`${message.heading}
|
|
3348
|
+
${body}`);
|
|
3349
|
+
used += body.length;
|
|
3350
|
+
}
|
|
3351
|
+
const last = next === null ? total : next - 1;
|
|
3352
|
+
const head = `Messages ${from} to ${last} of the ${total} summarized${next === null ? "" : `; read on from ${next}`}:`;
|
|
3353
|
+
return [head, ...blocks].join("\n\n");
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3172
3356
|
// ../daemon/src/runtime/tools/team.ts
|
|
3173
3357
|
function agentCreateTool(host) {
|
|
3174
3358
|
return {
|
|
@@ -3270,7 +3454,7 @@ etag: ${etag}`;
|
|
|
3270
3454
|
}
|
|
3271
3455
|
|
|
3272
3456
|
// ../daemon/src/runtime/tools/web.ts
|
|
3273
|
-
import { fetch as
|
|
3457
|
+
import { fetch as undiciFetch3 } from "undici";
|
|
3274
3458
|
|
|
3275
3459
|
// ../daemon/src/runtime/tools/web-extract.ts
|
|
3276
3460
|
import { Readability } from "@mozilla/readability";
|
|
@@ -3353,7 +3537,7 @@ function extractReadable(html, url, mode2) {
|
|
|
3353
3537
|
import { lookup as dnsLookupCb } from "node:dns";
|
|
3354
3538
|
import { lookup as dnsLookup } from "node:dns/promises";
|
|
3355
3539
|
import { isIP } from "node:net";
|
|
3356
|
-
import { Agent, fetch as
|
|
3540
|
+
import { Agent, fetch as undiciFetch2 } from "undici";
|
|
3357
3541
|
var SsrFBlockedError = class extends Error {
|
|
3358
3542
|
constructor(message) {
|
|
3359
3543
|
super(message);
|
|
@@ -3507,7 +3691,7 @@ async function closeDispatcher(d) {
|
|
|
3507
3691
|
}
|
|
3508
3692
|
}
|
|
3509
3693
|
async function guardedFetch(opts) {
|
|
3510
|
-
const fetcher = opts.fetchImpl ??
|
|
3694
|
+
const fetcher = opts.fetchImpl ?? undiciFetch2;
|
|
3511
3695
|
const maxRedirects = opts.maxRedirects ?? 3;
|
|
3512
3696
|
const abortController = new AbortController();
|
|
3513
3697
|
const timeoutId = opts.timeoutMs ? setTimeout(() => abortController.abort(new Error("timeout")), opts.timeoutMs) : null;
|
|
@@ -3764,7 +3948,7 @@ function webSearchTool(host) {
|
|
|
3764
3948
|
};
|
|
3765
3949
|
}
|
|
3766
3950
|
function webFetchTool(opts) {
|
|
3767
|
-
const fetchFn = opts?.fetchImpl ??
|
|
3951
|
+
const fetchFn = opts?.fetchImpl ?? undiciFetch3;
|
|
3768
3952
|
const env = opts?.env ?? process.env;
|
|
3769
3953
|
const allowPrivate = opts?.allowPrivate ?? false;
|
|
3770
3954
|
const cacheTtlMs = opts?.cacheTtlMs ?? DEFAULT_CACHE_TTL_MS;
|
|
@@ -3900,6 +4084,7 @@ function toPiPart(part) {
|
|
|
3900
4084
|
function createBazilionCustomTools(opts) {
|
|
3901
4085
|
const handlers = [
|
|
3902
4086
|
...memoryTools(opts.memory),
|
|
4087
|
+
recallTool(opts.recall),
|
|
3903
4088
|
...homeTools(opts.agent.agent.dir),
|
|
3904
4089
|
bootstrapTool(opts.agent.agent.dir),
|
|
3905
4090
|
webFetchTool({ env: opts.env }),
|
|
@@ -3928,10 +4113,11 @@ function createBazilionCustomTools(opts) {
|
|
|
3928
4113
|
async function openPiSession(spec) {
|
|
3929
4114
|
const { runtime: modelRuntime, model } = await createPiModel(spec.model);
|
|
3930
4115
|
const settingsManager = SettingsManager.inMemory({
|
|
3931
|
-
// Provider requests happen only for turns: no cache warming
|
|
3932
|
-
//
|
|
4116
|
+
// Provider requests happen only for turns: no cache warming. A turn compacts the
|
|
4117
|
+
// conversation when it nears the model's window (Pi's defaults: within 16,384 tokens of it,
|
|
4118
|
+
// keeping the last 20,000 verbatim), and redoes a reply the full window cut short.
|
|
3933
4119
|
cacheWarming: "off",
|
|
3934
|
-
compaction: { enabled:
|
|
4120
|
+
compaction: { enabled: true },
|
|
3935
4121
|
retry: {
|
|
3936
4122
|
enabled: true,
|
|
3937
4123
|
maxRetries: 2,
|
|
@@ -3981,7 +4167,7 @@ async function openPiSession(spec) {
|
|
|
3981
4167
|
}
|
|
3982
4168
|
return { session, redactionSecrets, dispose: () => session.dispose() };
|
|
3983
4169
|
}
|
|
3984
|
-
function turnSurface(opts) {
|
|
4170
|
+
function turnSurface(opts, recall) {
|
|
3985
4171
|
const { agent, paths, env } = opts;
|
|
3986
4172
|
const cwd = agent.team.path;
|
|
3987
4173
|
const promptSkills = loadPromptSkills(paths.skillsDir, agent.skills);
|
|
@@ -3996,6 +4182,7 @@ function turnSurface(opts) {
|
|
|
3996
4182
|
const customTools = createBazilionCustomTools({
|
|
3997
4183
|
agent,
|
|
3998
4184
|
memory: opts.memory,
|
|
4185
|
+
recall,
|
|
3999
4186
|
messagingHost: opts.messagingHost,
|
|
4000
4187
|
userMdHost: opts.userMdHost,
|
|
4001
4188
|
browserHost: opts.browserHost,
|
|
@@ -4035,7 +4222,11 @@ async function createBazilionSession(opts) {
|
|
|
4035
4222
|
if (!existsSync4(agent.team.path)) mkdirSync4(agent.team.path, { recursive: true });
|
|
4036
4223
|
mkdirSync4(join8(paths.agentDir(agent.agent.id), "sessions"), { recursive: true });
|
|
4037
4224
|
const sessionManager = openConversation(agent, paths, opts.conversation);
|
|
4038
|
-
const
|
|
4225
|
+
const redactionSecrets = [...new Set(envSecretValues(opts.env).filter(Boolean))];
|
|
4226
|
+
const turn = turnSurface(opts, {
|
|
4227
|
+
branch: () => sessionManager.getBranch(),
|
|
4228
|
+
secrets: redactionSecrets
|
|
4229
|
+
});
|
|
4039
4230
|
return openPiSession({
|
|
4040
4231
|
model: {
|
|
4041
4232
|
providerName,
|
|
@@ -4054,7 +4245,7 @@ async function createBazilionSession(opts) {
|
|
|
4054
4245
|
})),
|
|
4055
4246
|
tools: turn.tools,
|
|
4056
4247
|
hostToolNames: turn.hostToolNames,
|
|
4057
|
-
redactionSecrets
|
|
4248
|
+
redactionSecrets,
|
|
4058
4249
|
refreshApiKey: opts.refreshApiKey
|
|
4059
4250
|
});
|
|
4060
4251
|
}
|
|
@@ -4487,13 +4678,7 @@ async function main() {
|
|
|
4487
4678
|
await session.prompt(text, images ? { images } : void 0);
|
|
4488
4679
|
await session.agent.waitForIdle();
|
|
4489
4680
|
emit(
|
|
4490
|
-
review ? { kind: "review_result", proposals: review.result() } :
|
|
4491
|
-
kind: "done",
|
|
4492
|
-
messages: piMessagesToProviderView(
|
|
4493
|
-
session.agent.state.messages,
|
|
4494
|
-
handle.redactionSecrets
|
|
4495
|
-
)
|
|
4496
|
-
}
|
|
4681
|
+
review ? { kind: "review_result", proposals: review.result() } : finishedFrame(session, handle.redactionSecrets)
|
|
4497
4682
|
);
|
|
4498
4683
|
} catch (error) {
|
|
4499
4684
|
const message = workerFailureMessage(
|
|
@@ -4521,4 +4706,17 @@ main().catch(async (error) => {
|
|
|
4521
4706
|
emit({ kind: "fatal", error: error instanceof Error ? error.message : String(error) });
|
|
4522
4707
|
await exitWorker(1);
|
|
4523
4708
|
});
|
|
4709
|
+
function finishedFrame(session, secrets) {
|
|
4710
|
+
const { messages, compactions } = conversationHistory(session.sessionManager.getBranch());
|
|
4711
|
+
const usage = session.getContextUsage();
|
|
4712
|
+
return {
|
|
4713
|
+
kind: "done",
|
|
4714
|
+
messages: piMessagesToProviderView(messages, secrets),
|
|
4715
|
+
compactions,
|
|
4716
|
+
context: {
|
|
4717
|
+
tokens: usage?.tokens ?? null,
|
|
4718
|
+
window: usage && usage.contextWindow > 0 ? usage.contextWindow : null
|
|
4719
|
+
}
|
|
4720
|
+
};
|
|
4721
|
+
}
|
|
4524
4722
|
//# sourceMappingURL=worker.js.map
|