nolo-cli 0.8.0-alpha.2 → 0.8.0-alpha.21
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/README.md +1 -1
- package/_executeModel-42U3VOVZ.js +205 -0
- package/action-TLI3V62L.js +28 -0
- package/addContentAction-57RSIIMR.js +26 -0
- package/addDialogAgentAction-G3VWEA6E.js +68 -0
- package/agentDeleteCommand-5DD2IM3J.js +327 -0
- package/agentEmailCommands-6FACJBU4.js +628 -0
- package/agentListCommands-I6KZYCIG.js +223 -0
- package/agentMachineCommands-VKLIGMZA.js +425 -0
- package/agentPullCommand-O2MTUAFR.js +122 -0
- package/agentRecordCommands-7TZICYDT.js +96 -0
- package/agentRunCommand-L4OM23KV.js +114 -0
- package/agentRunControl-K4VKNEHF.js +57 -0
- package/agentRuntimeLocal-ZYEIPTY4.js +104 -0
- package/agentSlice-BX7GXSNO.js +42 -0
- package/authCommand-EB5JSOX5.js +581 -0
- package/authCommands-XPEHTKSM.js +35 -0
- package/chunk-25LCXTML.js +175 -0
- package/chunk-2ECQG4YX.js +22296 -0
- package/chunk-2FTTDCD4.js +675 -0
- package/chunk-2JCXITPK.js +1078 -0
- package/chunk-3ASDTTEI.js +1774 -0
- package/chunk-3EUW3WEO.js +8 -0
- package/chunk-3LY4F7SV.js +9293 -0
- package/chunk-4CQLVGRV.js +50 -0
- package/chunk-4IJYA27C.js +342 -0
- package/chunk-4O3CARJ4.js +231 -0
- package/chunk-4QEWT7KD.js +933 -0
- package/chunk-4SN6J65J.js +38 -0
- package/chunk-4VNS5WPM.js +42 -0
- package/chunk-4XENYTF5.js +222 -0
- package/chunk-4ZDM73SD.js +34 -0
- package/chunk-5CS33IBL.js +301 -0
- package/chunk-5EFXE3O7.js +138 -0
- package/chunk-5KLGBAAR.js +386 -0
- package/chunk-5MIDPSSK.js +206 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/chunk-63W5N6P3.js +150 -0
- package/chunk-6HYVJV7B.js +102 -0
- package/chunk-6KHNO3SK.js +1948 -0
- package/chunk-6WD3OOJS.js +20 -0
- package/chunk-7DAJ4AI4.js +191 -0
- package/chunk-7GNGZRLZ.js +1939 -0
- package/chunk-7KCUSYT2.js +354 -0
- package/chunk-7U44LYTR.js +238 -0
- package/chunk-AFON4QUU.js +112 -0
- package/chunk-AGFH73SK.js +239 -0
- package/chunk-AL2KDGR2.js +27339 -0
- package/chunk-AS4PVWA4.js +221 -0
- package/chunk-ATNTHIZI.js +13 -0
- package/chunk-AVMKZHBC.js +85 -0
- package/chunk-AZPCASRE.js +36 -0
- package/chunk-BBYVOSU2.js +792 -0
- package/chunk-C3RUNRHT.js +51 -0
- package/chunk-C4FTUXVF.js +146 -0
- package/chunk-CF2WZF4N.js +134 -0
- package/chunk-CF7PE763.js +10 -0
- package/chunk-CKOJQDKR.js +198 -0
- package/chunk-CMKUBIGW.js +1550 -0
- package/chunk-CWMSB67P.js +34 -0
- package/chunk-DCOA4QSN.js +105 -0
- package/chunk-DFFIZ25G.js +30 -0
- package/chunk-DSZUWUYB.js +478 -0
- package/chunk-DWLEOOGR.js +8 -0
- package/chunk-DZ3XJVET.js +231 -0
- package/chunk-EHLHSX7R.js +1433 -0
- package/chunk-ENOG22KJ.js +939 -0
- package/chunk-FSO5B7GH.js +171 -0
- package/chunk-FVYY6MCS.js +1447 -0
- package/chunk-G3SUCT4W.js +8 -0
- package/chunk-GAKEBQD6.js +30 -0
- package/chunk-GBRG75BQ.js +86 -0
- package/chunk-GU3PEVGZ.js +4723 -0
- package/chunk-H33743XH.js +25 -0
- package/chunk-HNMXYYJR.js +12 -0
- package/chunk-HNW7IJSK.js +71 -0
- package/chunk-I42VC5KR.js +15 -0
- package/chunk-I6XMPTMR.js +113 -0
- package/chunk-IDZTNRP2.js +85 -0
- package/chunk-ISNCLGUZ.js +146 -0
- package/chunk-IWX4UW2E.js +548 -0
- package/chunk-JBTJAPUF.js +35 -0
- package/chunk-JEXVIMYZ.js +55 -0
- package/chunk-JRKKFRAV.js +537 -0
- package/chunk-JZPBVBIY.js +94 -0
- package/chunk-KKY4B2Q2.js +21 -0
- package/chunk-KQHGZWSV.js +63 -0
- package/chunk-KUG52IAP.js +8 -0
- package/chunk-KX6YBIHG.js +8 -0
- package/chunk-LCBAMY2M.js +60 -0
- package/chunk-LM6IYQ3F.js +16 -0
- package/chunk-LTRXGFMS.js +83 -0
- package/chunk-M76ECQRD.js +13658 -0
- package/chunk-MRC4Q34M.js +188 -0
- package/chunk-MTU75CZ2.js +91 -0
- package/chunk-N54XAP77.js +19 -0
- package/chunk-O2ZNTTET.js +3272 -0
- package/chunk-O4BU24WZ.js +3212 -0
- package/chunk-OLZBQWZU.js +6 -0
- package/chunk-OOSFSFMA.js +271 -0
- package/chunk-OPZYGHUC.js +89 -0
- package/chunk-OWOHNGCN.js +50 -0
- package/chunk-P3PKED2I.js +962 -0
- package/chunk-QSJ3HFEF.js +8 -0
- package/chunk-RCSJFQPB.js +9036 -0
- package/chunk-RL776AGR.js +190 -0
- package/chunk-ROWQEJRP.js +139 -0
- package/chunk-S7Z2HMCN.js +25 -0
- package/chunk-SDJDLO5W.js +628 -0
- package/chunk-SOTZ6RDN.js +69 -0
- package/chunk-TILFE6LV.js +381 -0
- package/chunk-U4TRT5V4.js +246 -0
- package/chunk-U6VC4MU4.js +8 -0
- package/chunk-UAD2WT54.js +64 -0
- package/chunk-UB6SN4NJ.js +421 -0
- package/chunk-URUUZLPA.js +807 -0
- package/chunk-UTLZINAP.js +3066 -0
- package/chunk-VC6OZXO5.js +298 -0
- package/chunk-VF4K2QE6.js +21 -0
- package/chunk-VHBWHNVT.js +59 -0
- package/chunk-VIDPVFP3.js +20 -0
- package/chunk-VP4WJWKW.js +8882 -0
- package/chunk-VUW5FBDB.js +573 -0
- package/chunk-VVX233PH.js +482 -0
- package/chunk-VX3SXJ3N.js +2052 -0
- package/chunk-W4NVOSFF.js +37 -0
- package/chunk-WWC7I6TA.js +8 -0
- package/chunk-WZSRQNQG.js +2587 -0
- package/chunk-XBUBEFNX.js +34 -0
- package/chunk-XENYHRUE.js +104 -0
- package/chunk-Y5GCAMGP.js +9 -0
- package/chunk-YPRZSPF3.js +148 -0
- package/chunk-Z4NR32XR.js +50 -0
- package/chunk-ZNFJWEN4.js +56 -0
- package/cliExecutor-K3F7DMRO.js +36 -0
- package/clipboardy-BVE3LVEH.js +12001 -0
- package/createAgentAutomationAction-RJF3N2QY.js +866 -0
- package/createDialogAction-DRSPS6CE.js +55 -0
- package/createPageAction-6B2WMNO3.js +172 -0
- package/db-HCJ5PRB5.js +271 -0
- package/dbSlice-Q3TM2FJV.js +60 -0
- package/deleteFile-OW53A6BX.js +41 -0
- package/dialogCommands-4IX4XIZE.js +63 -0
- package/dialogSlice-3M7KX2TX.js +148 -0
- package/docCreateCommands-SIL3NPGT.js +220 -0
- package/docDeleteCommands-7IOMLUS4.js +181 -0
- package/docReadCommands-FNFXUA5L.js +134 -0
- package/docStore-SV7E34D4.js +98 -0
- package/docUpdateCommands-X2HNDVUC.js +318 -0
- package/fetchMessages-KTNM7QAR.js +17 -0
- package/getPricing-3E6UNPKL.js +30 -0
- package/handleSendMessageAction-JYETO5RZ.js +185 -0
- package/index.js +188 -112958
- package/lib-FYYBQIXS.js +19839 -0
- package/localDialogRead-2VRI24F4.js +26 -0
- package/localFirstLog-DHNOY2NA.js +19 -0
- package/localRuntimeAuthority-TEGCOWX4.js +471 -0
- package/localRuntimeDb-LGDF6FQP.js +12 -0
- package/machineCommands-RIO3RP5Q.js +781 -0
- package/machineInfo-M6KB6HZN.js +10 -0
- package/machineWsRunDispatch-W7UYLGB5.js +112 -0
- package/memoryCommands-O4MIPIWQ.js +476 -0
- package/models-4OPOOLFS.js +9 -0
- package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
- package/package.json +4 -24
- package/read-GW7ZEI23.js +17 -0
- package/readDocTool-HUFU6OCT.js +16 -0
- package/readlineWorkspace-27JR7WPW.js +5682 -0
- package/removeDialogAgentAction-CXKR4NJI.js +73 -0
- package/runAgentClientLoop-HZFAPJHS.js +293 -0
- package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
- package/setDialogExtraReferencesAction-6RKUSXHX.js +60 -0
- package/setPrimaryDialogAgentAction-T3UTBEFG.js +80 -0
- package/settingSlice-IVKXJXMG.js +199 -0
- package/skillDiscovery-UGSQGX2U.js +16 -0
- package/skillSummaryMarker-42HKSXYY.js +9 -0
- package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
- package/slateUtils-2M7MUTWX.js +19 -0
- package/spaceCommands-E7VOF4LO.js +450 -0
- package/spaceSlice-TSVROA5U.js +149 -0
- package/streamAgentChatTurn-3C5RQZJF.js +4510 -0
- package/tableCommands-O7O2LBEG.js +1286 -0
- package/toolApiClient-QI3YBNWB.js +26 -0
- package/tools-EQDEKR6N.js +87 -0
- package/tuiSummaryLlmCaller-RV3THLZF.js +78 -0
- package/understanding-3CUQQ6SV.js +271 -0
- package/updateCommands-VOSPKXFF.js +31 -0
- package/updateDialogTitleAction-3XV7VWSZ.js +188 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// packages/cli/levelLazyShim.mjs
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
var _require = createRequire(import.meta.url);
|
|
4
|
+
var _RealLevel;
|
|
5
|
+
function ensureLevel() {
|
|
6
|
+
if (!_RealLevel) {
|
|
7
|
+
_RealLevel = _require("level").Level;
|
|
8
|
+
}
|
|
9
|
+
return _RealLevel;
|
|
10
|
+
}
|
|
11
|
+
var Level = class {
|
|
12
|
+
constructor(...args) {
|
|
13
|
+
const RealLevel = ensureLevel();
|
|
14
|
+
return new RealLevel(...args);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
Level
|
|
20
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listUserRecordsFromServers,
|
|
3
|
+
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
+
} from "./chunk-RL776AGR.js";
|
|
5
|
+
import {
|
|
6
|
+
agentRecordHasConfiguredCredential
|
|
7
|
+
} from "./chunk-SDJDLO5W.js";
|
|
8
|
+
|
|
9
|
+
// packages/cli/agentListHelpers.ts
|
|
10
|
+
function parseAgentRecordId(privateKey, explicitId) {
|
|
11
|
+
if (explicitId) return explicitId;
|
|
12
|
+
const agentMatch = privateKey.match(/^agent-[^-]+-(.+)$/i);
|
|
13
|
+
return agentMatch?.[1] ?? "";
|
|
14
|
+
}
|
|
15
|
+
function buildCompanionKeys(rawId, userId) {
|
|
16
|
+
return {
|
|
17
|
+
privateKey: `agent-${userId}-${rawId}`,
|
|
18
|
+
publicKey: `agent-pub-${rawId}`
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function normalizeListedAgent(record) {
|
|
22
|
+
const privateKey = typeof record?.dbKey === "string" ? record.dbKey : "";
|
|
23
|
+
const explicitId = typeof record?.id === "string" && record.id ? record.id : void 0;
|
|
24
|
+
const ownerUserId = typeof record?.userId === "string" ? record.userId : "";
|
|
25
|
+
const rawId = explicitId || (ownerUserId && privateKey.startsWith(`agent-${ownerUserId}-`) ? privateKey.slice(`agent-${ownerUserId}-`.length) : parseAgentRecordId(privateKey, explicitId));
|
|
26
|
+
if (!privateKey || !rawId || !ownerUserId) return null;
|
|
27
|
+
const keys = buildCompanionKeys(rawId, ownerUserId);
|
|
28
|
+
const credentialConfigured = agentRecordHasConfiguredCredential(record);
|
|
29
|
+
const credentialRef = typeof record?.credentialRef === "string" && record.credentialRef ? record.credentialRef : void 0;
|
|
30
|
+
const apiKeyRef = typeof record?.apiKeyRef === "string" && record.apiKeyRef ? record.apiKeyRef : void 0;
|
|
31
|
+
return {
|
|
32
|
+
id: rawId,
|
|
33
|
+
privateKey,
|
|
34
|
+
publicKey: keys.publicKey,
|
|
35
|
+
name: typeof record?.name === "string" && record.name ? record.name : "(unnamed)",
|
|
36
|
+
model: typeof record?.model === "string" && record.model ? record.model : "-",
|
|
37
|
+
updatedAt: typeof record?.updatedAt === "string" || typeof record?.updatedAt === "number" ? record.updatedAt : typeof record?.createdAt === "string" || typeof record?.createdAt === "number" ? record.createdAt : typeof record?.created === "string" || typeof record?.created === "number" ? record.created : null,
|
|
38
|
+
isPublicFlag: !!record?.isPublic,
|
|
39
|
+
publicRecordExists: false,
|
|
40
|
+
type: typeof record?.type === "string" ? record.type : null,
|
|
41
|
+
tools: Array.isArray(record?.tools) ? record.tools.filter((tool) => typeof tool === "string") : [],
|
|
42
|
+
credentialConfigured,
|
|
43
|
+
credentialRef,
|
|
44
|
+
apiKeyRef,
|
|
45
|
+
...typeof record?.apiSource === "string" && record.apiSource ? { apiSource: record.apiSource } : {},
|
|
46
|
+
...typeof record?.cliProvider === "string" && record.cliProvider ? { cliProvider: record.cliProvider } : {}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function sortListedAgents(agents) {
|
|
50
|
+
agents.sort((a, b) => {
|
|
51
|
+
const ta = a.updatedAt == null ? 0 : new Date(a.updatedAt).getTime();
|
|
52
|
+
const tb = b.updatedAt == null ? 0 : new Date(b.updatedAt).getTime();
|
|
53
|
+
return tb - ta;
|
|
54
|
+
});
|
|
55
|
+
return agents;
|
|
56
|
+
}
|
|
57
|
+
function parseAgentListArgs(args) {
|
|
58
|
+
return {
|
|
59
|
+
wantJson: args.includes("--json"),
|
|
60
|
+
publicOnly: args.includes("--public-only"),
|
|
61
|
+
idsOnly: args.includes("--ids-only")
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function listLocalCachedAgents(args) {
|
|
65
|
+
const privateRecords = /* @__PURE__ */ new Map();
|
|
66
|
+
const publicKeys = /* @__PURE__ */ new Set();
|
|
67
|
+
for await (const [key, value] of args.db.iterator({ gte: "", lte: "\uFFFF" })) {
|
|
68
|
+
if (typeof key !== "string" || !value || typeof value !== "object") continue;
|
|
69
|
+
if (key.startsWith(`agent-${args.userId}-`)) {
|
|
70
|
+
privateRecords.set(key, { ...value, dbKey: key });
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (key.startsWith("agent-pub-")) {
|
|
74
|
+
publicKeys.add(key);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const agents = sortListedAgents(
|
|
78
|
+
[...privateRecords.values()].map((record) => normalizeListedAgent(record)).filter((agent) => agent != null)
|
|
79
|
+
);
|
|
80
|
+
for (const agent of agents) {
|
|
81
|
+
agent.publicRecordExists = publicKeys.has(agent.publicKey);
|
|
82
|
+
}
|
|
83
|
+
return agents;
|
|
84
|
+
}
|
|
85
|
+
async function hasReadableRecord(args) {
|
|
86
|
+
try {
|
|
87
|
+
await args.readDbRecord(args);
|
|
88
|
+
return true;
|
|
89
|
+
} catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function listRemoteAgents(args) {
|
|
94
|
+
const recordGroups = [await args.queryUserRecords({ ...args, type: "agent" })];
|
|
95
|
+
const agents = sortListedAgents(
|
|
96
|
+
recordGroups.flat().map((record) => normalizeListedAgent(record)).filter((agent) => agent != null)
|
|
97
|
+
);
|
|
98
|
+
await Promise.all(
|
|
99
|
+
agents.map(async (agent) => {
|
|
100
|
+
agent.publicRecordExists = await hasReadableRecord({
|
|
101
|
+
authToken: args.authToken,
|
|
102
|
+
dbKey: agent.publicKey,
|
|
103
|
+
fallbackFetchImpl: args.fallbackFetchImpl,
|
|
104
|
+
fetchImpl: args.fetchImpl,
|
|
105
|
+
serverUrl: args.serverUrl,
|
|
106
|
+
readDbRecord: args.readDbRecord
|
|
107
|
+
});
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
return agents;
|
|
111
|
+
}
|
|
112
|
+
async function listRemoteAgentsAcrossServers(args) {
|
|
113
|
+
const remoteResult = await listUserRecordsFromServers({
|
|
114
|
+
authToken: args.authToken,
|
|
115
|
+
fallbackFetchImpl: args.fallbackFetchImpl,
|
|
116
|
+
fetchImpl: args.fetchImpl,
|
|
117
|
+
label: "agent query",
|
|
118
|
+
serverUrls: args.serverUrls,
|
|
119
|
+
type: "agent",
|
|
120
|
+
userId: args.userId
|
|
121
|
+
});
|
|
122
|
+
const agents = sortListedAgents(
|
|
123
|
+
remoteResult.records.map((record) => normalizeListedAgent(record)).filter((agent) => agent != null)
|
|
124
|
+
);
|
|
125
|
+
return { agents, failures: remoteResult.failures };
|
|
126
|
+
}
|
|
127
|
+
async function listFavoriteAgentIdsAcrossServers(args) {
|
|
128
|
+
const favoritedAtByKey = {};
|
|
129
|
+
await Promise.all(
|
|
130
|
+
args.serverUrls.map(async (serverUrl) => {
|
|
131
|
+
try {
|
|
132
|
+
const res = await args.fetchImpl(`${serverUrl}/rpc/listFavorites`, {
|
|
133
|
+
method: "POST",
|
|
134
|
+
headers: {
|
|
135
|
+
"Content-Type": "application/json",
|
|
136
|
+
Authorization: `Bearer ${args.authToken}`
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({ targetType: "agent" })
|
|
139
|
+
});
|
|
140
|
+
if (!res.ok) return;
|
|
141
|
+
const data = await res.json().catch(() => ({}));
|
|
142
|
+
const items = Array.isArray(data?.items) ? data.items : [];
|
|
143
|
+
for (const item of items) {
|
|
144
|
+
const id = typeof item?.id === "string" ? item.id : "";
|
|
145
|
+
if (!id) continue;
|
|
146
|
+
const at = Number(item?.favoritedAt) || 0;
|
|
147
|
+
favoritedAtByKey[id] = Math.max(
|
|
148
|
+
favoritedAtByKey[id] ?? 0,
|
|
149
|
+
at || Date.now()
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
const ids = Array.isArray(data?.ids) ? data.ids : [];
|
|
153
|
+
for (const id of ids) {
|
|
154
|
+
if (typeof id === "string" && id && !(id in favoritedAtByKey)) {
|
|
155
|
+
favoritedAtByKey[id] = 1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
return favoritedAtByKey;
|
|
163
|
+
}
|
|
164
|
+
async function decorateAgentsWithPublicStatusAcrossServers(args) {
|
|
165
|
+
await Promise.all(
|
|
166
|
+
args.agents.map(async (agent) => {
|
|
167
|
+
try {
|
|
168
|
+
const result = await readLiveDbRecordAfterTombstoneMerge({
|
|
169
|
+
authToken: args.authToken,
|
|
170
|
+
dbKey: agent.publicKey,
|
|
171
|
+
fallbackFetchImpl: args.fallbackFetchImpl,
|
|
172
|
+
fetchImpl: args.fetchImpl,
|
|
173
|
+
serverUrls: args.serverUrls
|
|
174
|
+
});
|
|
175
|
+
agent.publicRecordExists = result.record?.isPublic === true;
|
|
176
|
+
} catch {
|
|
177
|
+
agent.publicRecordExists = false;
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
);
|
|
181
|
+
return args.agents;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
parseAgentListArgs,
|
|
186
|
+
listLocalCachedAgents,
|
|
187
|
+
listRemoteAgents,
|
|
188
|
+
listRemoteAgentsAcrossServers,
|
|
189
|
+
listFavoriteAgentIdsAcrossServers,
|
|
190
|
+
decorateAgentsWithPublicStatusAcrossServers
|
|
191
|
+
};
|