nolo-cli 0.229.0-alpha.1 → 0.240.0-alpha.2
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/{_executeModel-VYCHHZVT.js → _executeModel-5NA4USGG.js} +56 -51
- package/{action-GDZDXPMB.js → action-X75O3XPH.js} +7 -4
- package/{addContentAction-7RO4AMRI.js → addContentAction-GVC77QSN.js} +9 -8
- package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-KKDVAMW3.js} +12 -11
- package/{agentDeleteCommand-QWQKT54A.js → agentDeleteCommand-2RFGKFAB.js} +78 -70
- package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-GQCQKKOR.js} +85 -73
- package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
- package/{agentMachineCommands-DC6NKWTU.js → agentMachineCommands-BISF6PVV.js} +26 -22
- package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-O3Q25PKU.js} +2 -2
- package/{agentPullCommand-KHV4EELF.js → agentPullCommand-G6U2LHMW.js} +1 -1
- package/{agentRecordCommands-IZYUVHME.js → agentRecordCommands-AOXPGYAJ.js} +80 -68
- package/{agentRunCommand-QM7ETUTX.js → agentRunCommand-YTZJCRAL.js} +86 -73
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
- package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
- package/{agentSlice-UG76KEBH.js → agentSlice-XJNKE3PG.js} +10 -9
- package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-LURUSPY7.js} +27 -23
- package/{appDeployCommands-AU4IUN33.js → appDeployCommands-SMEW4AK2.js} +27 -23
- package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-VYPJTBJK.js} +27 -23
- package/{appGetCommands-BGTLIQ4K.js → appGetCommands-N4NI5GGJ.js} +27 -23
- package/{appListCommands-CUCPRUXW.js → appListCommands-5C6ONN3Z.js} +27 -23
- package/{authCommand-OZ2KTP4Z.js → authCommand-4CVBDADE.js} +15 -13
- package/{authCommands-55OGQGCR.js → authCommands-EHU2BHOX.js} +7 -5
- package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-AYWYQVA4.js} +3 -3
- package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-CSDG2HYN.js} +1 -1
- package/{chunk-HHFGE2WF.js → chunk-2574ANSV.js} +1 -1
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-S6FDXXZV.js → chunk-3EMIEC27.js} +1 -1
- package/{chunk-XTJKU3Z4.js → chunk-3FBAVU2Y.js} +11 -9
- package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
- package/{chunk-MJI3UAXN.js → chunk-4IQVE43Z.js} +30 -26
- package/{chunk-VQ5N5GSV.js → chunk-4Q6HQORG.js} +1 -1
- package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
- package/chunk-4ZCTKB27.js +31 -0
- package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-QYB23WUH.js → chunk-5QZSEQSK.js} +1 -1
- package/{chunk-7JGMNKKG.js → chunk-6CKUO32A.js} +8 -0
- package/chunk-6D25V6CB.js +133 -0
- package/{chunk-ZOHO6MOF.js → chunk-6WOLPIPY.js} +93 -90
- package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
- package/{chunk-DLXMMTGM.js → chunk-7AJRJGSQ.js} +260 -359
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
- package/{chunk-CNMY2XM6.js → chunk-A3LUWRQK.js} +4 -4
- package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
- package/{chunk-YVFH2MFB.js → chunk-AEQMKYZN.js} +4 -4
- package/{chunk-YKY4OVOX.js → chunk-AH5R7BYW.js} +13 -167
- package/{chunk-7FEP5USX.js → chunk-ANJRDS6U.js} +3 -3
- package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
- package/{chunk-HYLRQDEE.js → chunk-B5SV4H3J.js} +6 -6
- package/{chunk-7BCG67EI.js → chunk-B7DE5XJW.js} +137 -290
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
- package/{chunk-GAYNXB6T.js → chunk-BGGV6B5O.js} +416 -232
- package/{chunk-BP5ZJ6B4.js → chunk-BIABIPGW.js} +1 -1
- package/{chunk-TQEKUOTI.js → chunk-BXSMFPTG.js} +4 -4
- package/{chunk-RG2DGNL6.js → chunk-CKZPMJNU.js} +3 -3
- package/{chunk-OTKSESZR.js → chunk-CVJRVBJL.js} +2 -2
- package/{chunk-BIWI5M4E.js → chunk-D374I563.js} +1 -1
- package/{chunk-QRGDJA4B.js → chunk-DNZ4JJ7C.js} +1 -1
- package/chunk-DVYAFH2Q.js +103 -0
- package/{chunk-LYD6C7OU.js → chunk-DXW5WDHZ.js} +4 -4
- package/{chunk-MZG5CETE.js → chunk-E5KJOZWY.js} +3 -3
- package/{chunk-45CAVC35.js → chunk-E5KY7RAY.js} +565 -103
- package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
- package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
- package/{chunk-3VZLEKV2.js → chunk-FFYE5ATM.js} +4 -4
- package/{chunk-HXB4VDGK.js → chunk-FZKA3XFA.js} +11 -11
- package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
- package/{chunk-WFDNADFX.js → chunk-GDUC4VS2.js} +7 -7
- package/{chunk-R6Z5S5GA.js → chunk-GXXY2NL3.js} +16 -14
- package/{chunk-U2HBB7RS.js → chunk-H7ZYKHAZ.js} +27 -7
- package/{chunk-3U44JB3O.js → chunk-HCNOO374.js} +1 -1
- package/{chunk-HSSBDZLD.js → chunk-HOM6LTEW.js} +1 -1
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-WCFFRBL5.js → chunk-IJTXNLQE.js} +9 -9
- package/{chunk-ALAES342.js → chunk-IUMS6F53.js} +2 -2
- package/{chunk-547ENH5T.js → chunk-IUTUWIKE.js} +2 -2
- package/{chunk-S6K5F3KP.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-XAG3FWBE.js → chunk-KZPEGO6D.js} +1 -1
- package/{chunk-RBPUNSG5.js → chunk-LYDEFPQP.js} +18 -108
- package/{chunk-OWKNSIXL.js → chunk-MECDGHLK.js} +271 -66
- package/{chunk-FJSNBZXR.js → chunk-MM73SP4K.js} +1 -1
- package/{chunk-XSW4EXQV.js → chunk-MYOSN6BT.js} +2 -2
- package/{chunk-ZEVQHCLM.js → chunk-MYPKBJJO.js} +2 -2
- package/{chunk-DBUR22G5.js → chunk-N2JROHD3.js} +4 -4
- package/{chunk-ATEKLSLR.js → chunk-O6IPRAVV.js} +14 -9
- package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
- package/{chunk-TSPMLCWI.js → chunk-P3IZUMIC.js} +2 -2
- package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
- package/{chunk-4QYJPWHH.js → chunk-PRMEU7BT.js} +229 -7
- package/{chunk-OJ45MEEI.js → chunk-PROOOQZ3.js} +1 -1
- package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/chunk-RETQOQ4D.js +33394 -0
- package/{chunk-CMMI3DAT.js → chunk-RM4UMFY4.js} +33 -26
- package/{chunk-262R3XNN.js → chunk-S2MHR4PU.js} +151 -5
- package/{chunk-DEA37IUY.js → chunk-T6VROBY7.js} +2 -2
- package/{chunk-M4SFKP5L.js → chunk-TEMLHVGX.js} +1 -1
- package/{chunk-3QIYD3VM.js → chunk-TRHJ4NJB.js} +61 -792
- package/{chunk-OBIC6EG7.js → chunk-TWTJV35S.js} +1 -1
- package/{chunk-TCZ2VJZQ.js → chunk-U3G7RRXJ.js} +5 -5
- package/{chunk-F6Z6ZCUV.js → chunk-UFC4J7OY.js} +3 -3
- package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-4N6G2CKP.js → chunk-ULLHVDTZ.js} +46 -1
- package/{chunk-XFXFPUO7.js → chunk-VM72HKW2.js} +7 -7
- package/{chunk-HF7BLF3F.js → chunk-VREG6ANQ.js} +102 -99
- package/chunk-VSRISJXZ.js +107 -0
- package/chunk-WDWZPASX.js +29 -0
- package/{chunk-ILHQ2AXT.js → chunk-WRKMXMU7.js} +2 -0
- package/chunk-X7IA2B7R.js +166 -0
- package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
- package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
- package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
- package/{chunk-EGHP7KOY.js → chunk-Y5OWZQMJ.js} +28 -19
- package/{chunk-TI2EPRHE.js → chunk-YGCOJNFZ.js} +3 -3
- package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
- package/{chunk-X3E6EHJW.js → chunk-Z2WZAE4P.js} +128 -150
- package/chunk-Z6YTCDU4.js +24 -0
- package/{chunk-RRDRQOEC.js → chunk-ZEKUFJLW.js} +81 -66
- package/{chunk-EVGU5P4U.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-U5OAVAKQ.js} +2 -2
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
- package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-HVZAQCUD.js} +29 -25
- package/{commandRegistry-FVYPE2IN.js → commandRegistry-FIXBZJHE.js} +89 -85
- package/{contentThunks-GNFPG32S.js → contentThunks-U6OC4R2N.js} +23 -22
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
- package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
- package/{createDialogAction-EVTOPY7A.js → createDialogAction-IAGQJ3LH.js} +24 -23
- package/{createPageAction-2UYF2IDZ.js → createPageAction-AZ3UIFKA.js} +24 -23
- package/{dbSlice-XRUZOGSU.js → dbSlice-DKKMJJYY.js} +8 -7
- package/{deleteFile-6URDHYRB.js → deleteFile-TQSONMVU.js} +7 -4
- package/{dialogCommands-6SZD4TYP.js → dialogCommands-PCDRMBWG.js} +30 -26
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-O35MWMOS.js} +3 -3
- package/{dialogSlice-5EQ2A6LY.js → dialogSlice-QAKYN4DE.js} +22 -21
- package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-2SSLTXKO.js} +2 -2
- package/{docCreateCommands-25E6PGN3.js → docCreateCommands-CFQFZOAD.js} +26 -22
- package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-5CPNTIIS.js} +27 -23
- package/{docReadCommands-JY2E5XEN.js → docReadCommands-XQILYSAJ.js} +26 -22
- package/{docStore-OKKIKLT3.js → docStore-GIVRT7TQ.js} +10 -9
- package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
- package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
- package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-6VDJFNDO.js} +82 -69
- package/index.js +8 -8
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localRuntimeAdapter-IBSTMSX7.js → localRuntimeAdapter-BQ4F5PZV.js} +81 -69
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
- package/{machineCommands-HSQHDHOT.js → machineCommands-K6XIGOAD.js} +78 -66
- package/{machineWsRunDispatch-L6H7J66T.js → machineWsRunDispatch-4OO7Z6UM.js} +78 -66
- package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
- package/{memberThunks-7Y3OYSJQ.js → memberThunks-PBJPZ2JU.js} +15 -10
- package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
- package/package.json +1 -1
- package/{projectArchive-FQO654Z3.js → projectArchive-G7AOQPRW.js} +24 -23
- package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-OPBCAONX.js} +1 -1
- package/{providerRegistry-ZI2KORJ7.js → providerRegistry-J2HCVTHE.js} +1 -1
- package/{read-TYMBGEXO.js → read-JEGPITEW.js} +6 -5
- package/{readDocTool-SKQVHBLO.js → readDocTool-TE3XIU4Y.js} +1 -1
- package/{readlineWorkspace-7U272DSA.js → readlineWorkspace-XMPGXR77.js} +2946 -2367
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
- package/{runAgentClientLoop-AF4JQIJ7.js → runAgentClientLoop-HQJPDFGQ.js} +65 -45
- package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-GUH2YGMH.js} +3 -3
- package/{secretCommands-KZWBZIYS.js → secretCommands-NJXFVHZU.js} +2 -2
- package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +11 -10
- package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +14 -13
- package/{settingThunks-ZRGWVGZD.js → settingThunks-AY76OHYX.js} +176 -57
- package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-5VNWMDBE.js → spaceCommands-G63QGYQO.js} +26 -22
- package/{streamAgentChatTurn-YSPEFY4K.js → streamAgentChatTurn-E3XH2KFD.js} +127 -85
- package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-G6EZRKCQ.js} +12 -11
- package/{tableCommands-FTAOCBTX.js → tableCommands-JI75ZHDI.js} +4 -1
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
- package/{tools-M35PTIFB.js → tools-7RSX22FT.js} +41 -37
- package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
- package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-BVNHMWLR.js} +6 -6
- package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
- package/{updateDialogTitleAction-IMIRJRQQ.js → updateDialogTitleAction-SEWV252V.js} +23 -22
- package/{usageCommand-2BF74MKF.js → usageCommand-JVT5J3DC.js} +2 -2
- package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-IZYYUTEW.js} +3 -3
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
- package/workContext-MM3P5GP5.js +13 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/chunk-ZXF6D3I6.js +0 -359
- package/{accountResolver-QETKNC7T.js → accountResolver-EK2S4PWF.js} +3 -3
- package/{localDialogRead-CCOCVGAP.js → localDialogRead-AV2VKKPG.js} +0 -0
- package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-YIZ7KLUP.js} +5 -5
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAccountOnDemandWorkflowSkill,
|
|
3
|
+
resolveUserEnabledSkills
|
|
4
|
+
} from "./chunk-DVYAFH2Q.js";
|
|
5
|
+
import {
|
|
6
|
+
collectAgentSkillConfigIssues,
|
|
7
|
+
describeAgentSkillModeValue,
|
|
8
|
+
isAgentSkillDisabled,
|
|
9
|
+
resolveAgentSkillConfig
|
|
10
|
+
} from "./chunk-MM73SP4K.js";
|
|
11
|
+
import {
|
|
12
|
+
dedupeSkillPromptPatches,
|
|
13
|
+
resolveBuiltinSkillEntry,
|
|
14
|
+
resolveBuiltinSkillPage,
|
|
15
|
+
resolveSkillGraphFromRoots
|
|
16
|
+
} from "./chunk-EBKHA63G.js";
|
|
17
|
+
import {
|
|
18
|
+
parseSkillDocProtocol
|
|
19
|
+
} from "./chunk-W6RFEDN4.js";
|
|
20
|
+
|
|
21
|
+
// packages/ai/skills/agentSkillPreferenceDiagnostics.ts
|
|
22
|
+
var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
23
|
+
var resolveAgentSkillPreferenceSource = (preferences) => {
|
|
24
|
+
if (!preferences || typeof preferences !== "object") {
|
|
25
|
+
return { source: "empty", field: null };
|
|
26
|
+
}
|
|
27
|
+
if (hasOwn(preferences, "enabledSkills")) {
|
|
28
|
+
return { source: "settings-record", field: "enabledSkills" };
|
|
29
|
+
}
|
|
30
|
+
if (hasOwn(preferences, "enabledPromptSkills")) {
|
|
31
|
+
return { source: "legacy-field", field: "enabledPromptSkills" };
|
|
32
|
+
}
|
|
33
|
+
return { source: "empty", field: null };
|
|
34
|
+
};
|
|
35
|
+
var buildAgentSkillPreferenceDiagnostic = (input) => {
|
|
36
|
+
const { source, field } = resolveAgentSkillPreferenceSource(input.preferences);
|
|
37
|
+
const config = resolveAgentSkillConfig(input.agentConfig);
|
|
38
|
+
const agentSkillModes = {};
|
|
39
|
+
for (const slug of Object.keys(config).sort()) {
|
|
40
|
+
agentSkillModes[slug] = config[slug];
|
|
41
|
+
}
|
|
42
|
+
const discardedSkills = collectAgentSkillConfigIssues(input.agentConfig).map(
|
|
43
|
+
(issue) => ({
|
|
44
|
+
slug: issue.slug,
|
|
45
|
+
value: describeAgentSkillModeValue(issue.value),
|
|
46
|
+
reason: issue.reason
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
return {
|
|
50
|
+
event: "agent_skill_preference_resolved",
|
|
51
|
+
preferenceSource: source,
|
|
52
|
+
preferenceField: field,
|
|
53
|
+
enabledSkills: [...input.enabledSkills],
|
|
54
|
+
enabledSkillCount: input.enabledSkills.length,
|
|
55
|
+
agentSkillModes,
|
|
56
|
+
agentSkillCount: Object.keys(agentSkillModes).length,
|
|
57
|
+
discardedSkills,
|
|
58
|
+
discardedSkillCount: discardedSkills.length
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
var DIAGNOSTIC_PREFIX = "[nolo.skill.diagnostics] ";
|
|
62
|
+
var seenSignatures = /* @__PURE__ */ new Set();
|
|
63
|
+
function skillDiagnosticsEnabled(env = typeof process === "undefined" ? {} : process.env ?? {}) {
|
|
64
|
+
const flag = env.NOLO_SKILL_DIAGNOSTICS?.trim();
|
|
65
|
+
return flag === "1" || flag === "true";
|
|
66
|
+
}
|
|
67
|
+
var reportAgentSkillPreferenceDiagnostic = (diagnostic, sink) => {
|
|
68
|
+
if (!sink && !skillDiagnosticsEnabled()) return false;
|
|
69
|
+
const stderr = typeof process === "undefined" ? void 0 : process.stderr;
|
|
70
|
+
const write = sink ?? (typeof stderr?.write === "function" ? (line) => {
|
|
71
|
+
stderr.write(line);
|
|
72
|
+
} : void 0);
|
|
73
|
+
if (!write) return false;
|
|
74
|
+
const signature = JSON.stringify(diagnostic);
|
|
75
|
+
if (seenSignatures.has(signature)) return false;
|
|
76
|
+
seenSignatures.add(signature);
|
|
77
|
+
write(`${DIAGNOSTIC_PREFIX}${signature}
|
|
78
|
+
`);
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// packages/ai/skills/userSkillRuntime.ts
|
|
83
|
+
async function resolveUserSkillRuntime(agentConfig, preferences) {
|
|
84
|
+
const effectiveConfig = agentConfig && typeof agentConfig === "object" ? "rawRecord" in agentConfig && agentConfig.rawRecord && typeof agentConfig.rawRecord === "object" ? agentConfig.rawRecord : agentConfig : null;
|
|
85
|
+
const disabledSlugs = /* @__PURE__ */ new Set();
|
|
86
|
+
const requiredSlugs = /* @__PURE__ */ new Set();
|
|
87
|
+
for (const [identifier, mode] of Object.entries(resolveAgentSkillConfig(effectiveConfig))) {
|
|
88
|
+
const entry = resolveBuiltinSkillEntry(identifier);
|
|
89
|
+
if (!entry) continue;
|
|
90
|
+
if (mode === "disabled") disabledSlugs.add(entry.slug);
|
|
91
|
+
if (mode === "required") requiredSlugs.add(entry.slug);
|
|
92
|
+
}
|
|
93
|
+
const enabledSkills = resolveUserEnabledSkills(preferences);
|
|
94
|
+
reportAgentSkillPreferenceDiagnostic(
|
|
95
|
+
buildAgentSkillPreferenceDiagnostic({
|
|
96
|
+
agentConfig: effectiveConfig,
|
|
97
|
+
preferences,
|
|
98
|
+
enabledSkills
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
const graph = await resolveSkillGraphFromRoots({
|
|
102
|
+
roots: enabledSkills.map((identifier) => ({
|
|
103
|
+
identifier,
|
|
104
|
+
mode: isAccountOnDemandWorkflowSkill(identifier) && !requiredSlugs.has(identifier) ? "recommended" : "required"
|
|
105
|
+
})),
|
|
106
|
+
loadPage: async (identifier) => {
|
|
107
|
+
const entry = resolveBuiltinSkillEntry(identifier);
|
|
108
|
+
return entry ? resolveBuiltinSkillPage(entry.skillId) : null;
|
|
109
|
+
},
|
|
110
|
+
strictRequiredDependencies: true,
|
|
111
|
+
admitSkill: (page, canonicalIdentifier) => {
|
|
112
|
+
const entry = resolveBuiltinSkillEntry(canonicalIdentifier) ?? resolveBuiltinSkillEntry(page?.dbKey);
|
|
113
|
+
return !!entry && !disabledSlugs.has(entry.slug) && !isAgentSkillDisabled(effectiveConfig, entry.slug);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const admittedKeys = new Set(graph.visits.map((visit) => visit.dbKey));
|
|
117
|
+
const contentByKey = new Map(
|
|
118
|
+
[...graph.contentByKey].filter(([, page]) => page?.dbKey && admittedKeys.has(page.dbKey))
|
|
119
|
+
);
|
|
120
|
+
const skillPromptContributions = dedupeSkillPromptPatches(graph.visits.flatMap((visit) => {
|
|
121
|
+
const entry = resolveBuiltinSkillEntry(visit.meta?.skillConfig?.id) ?? resolveBuiltinSkillEntry(visit.dbKey);
|
|
122
|
+
if (visit.mode !== "required" || !entry) return [];
|
|
123
|
+
const page = contentByKey.get(visit.dbKey);
|
|
124
|
+
const content = (visit.meta?.skillConfig?.promptPatch || parseSkillDocProtocol(page?.content ?? "", visit.meta).content).trim();
|
|
125
|
+
return content ? [{ skillId: entry.skillId, content }] : [];
|
|
126
|
+
}));
|
|
127
|
+
const skillPromptPatches = skillPromptContributions.map(({ content }) => content);
|
|
128
|
+
return { ...graph, contentByKey, skillPromptPatches, skillPromptContributions };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
resolveUserSkillRuntime
|
|
133
|
+
};
|
|
@@ -11,32 +11,9 @@ import {
|
|
|
11
11
|
listMemoryStatesForEntityVNext,
|
|
12
12
|
loadMemoryVNextCatalog
|
|
13
13
|
} from "./chunk-324FWHUA.js";
|
|
14
|
-
import {
|
|
15
|
-
recallMemoryVNextLocal
|
|
16
|
-
} from "./chunk-4D4QD7FT.js";
|
|
17
|
-
import {
|
|
18
|
-
DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET,
|
|
19
|
-
buildMemoryOverlay
|
|
20
|
-
} from "./chunk-4I2MXV5Q.js";
|
|
21
|
-
import {
|
|
22
|
-
createMemoryKey
|
|
23
|
-
} from "./chunk-SYTHYBMI.js";
|
|
24
14
|
|
|
25
|
-
// packages/ai/memory/
|
|
26
|
-
|
|
27
|
-
var touchMemoryItemsInDb = async (db, items, now = (/* @__PURE__ */ new Date()).toISOString()) => {
|
|
28
|
-
if (items.length === 0) return;
|
|
29
|
-
const batch = db.batch();
|
|
30
|
-
for (const item of items) {
|
|
31
|
-
batch.put(createMemoryKey(item.ownerType, item.ownerId, item.id), {
|
|
32
|
-
...item,
|
|
33
|
-
// retrieval bookkeeping on legacy storage names — see doc comment above
|
|
34
|
-
lastActivatedAt: now,
|
|
35
|
-
activationCount: retrievalCountOf(item) + 1
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
await batch.write();
|
|
39
|
-
};
|
|
15
|
+
// packages/ai/memory/vnext/workContext.ts
|
|
16
|
+
import { createHash } from "crypto";
|
|
40
17
|
|
|
41
18
|
// packages/ai/memory/vnext/applyMutation.ts
|
|
42
19
|
async function validateMutation(db, ownerId, mutation) {
|
|
@@ -301,76 +278,102 @@ var applyMemoryInterpreterMutation = async (db, ownerId, mutation) => {
|
|
|
301
278
|
}
|
|
302
279
|
};
|
|
303
280
|
|
|
304
|
-
// packages/ai/memory/
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
281
|
+
// packages/ai/memory/vnext/workContext.ts
|
|
282
|
+
var facet = "work-context";
|
|
283
|
+
var statuses = ["active", "paused", "completed", "cancelled"];
|
|
284
|
+
var hash = (v) => createHash("sha256").update(JSON.stringify(v)).digest("hex");
|
|
285
|
+
var isWorkContextState = (state) => state.facet === facet;
|
|
286
|
+
var bounded = (s, max) => typeof s === "string" && s.trim().length > 0 && s.length <= max;
|
|
287
|
+
var list = (x, maxCount, maxLength) => Array.isArray(x) && x.length <= maxCount && x.every((v) => bounded(v, maxLength));
|
|
288
|
+
var object = (x) => !!x && typeof x === "object" && !Array.isArray(x);
|
|
289
|
+
var validScope = (s) => {
|
|
290
|
+
if (!s || !bounded(s.ownerId, 256) || !bounded(s.dialogId, 512) || !(s.spaceId === null || bounded(s.spaceId, 256))) throw new Error("invalid authorized scope");
|
|
291
|
+
};
|
|
292
|
+
function validValue(v) {
|
|
293
|
+
return object(v) && v.version === 1 && Number.isSafeInteger(v.revision) && v.revision > 0 && statuses.includes(v.status) && bounded(v.goal, 4096) && list(v.constraints, 50, 2048) && list(v.openItems, 50, 2048) && (v.nextStep === void 0 || typeof v.nextStep === "string" && v.nextStep.length <= 4096) && list(v.latestSourceRefs, 20, 2048) && v.latestSourceRefs.length > 0 && (v.spaceId === null || bounded(v.spaceId, 256)) && list(v.dialogIds, 100, 512) && v.dialogIds.length > 0;
|
|
312
294
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const owner = owners[i];
|
|
342
|
-
const catalog = catalogs[i];
|
|
343
|
-
const currentStates = catalog.states.filter((s) => !s.retiredAt && s.text.trim());
|
|
344
|
-
const hits = recallMemoryVNextLocal({
|
|
345
|
-
query: userInput,
|
|
346
|
-
entities: catalog.entities,
|
|
347
|
-
states: currentStates
|
|
348
|
-
});
|
|
349
|
-
const entityById = new Map(catalog.entities.map((e) => [e.id, e]));
|
|
350
|
-
for (const hit of hits) {
|
|
351
|
-
const stateKey = `${hit.state.ownerId}\0${hit.state.id}`;
|
|
352
|
-
if (seenStateKeys.has(stateKey)) continue;
|
|
353
|
-
seenStateKeys.add(stateKey);
|
|
354
|
-
selectedItems.push(
|
|
355
|
-
buildSynthesizedStateItem(hit.state, entityById.get(hit.state.entityId), owner.ownerType, owner.ownerId)
|
|
356
|
-
);
|
|
295
|
+
function validPatch(p) {
|
|
296
|
+
if (!object(p) || Object.keys(p).some((k) => !["status", "goal", "constraints", "openItems", "nextStep"].includes(k))) throw new Error("invalid patch");
|
|
297
|
+
if (p.status !== void 0 && !statuses.includes(p.status)) throw new Error("invalid status");
|
|
298
|
+
if (p.goal !== void 0 && !bounded(p.goal, 4096)) throw new Error("invalid goal");
|
|
299
|
+
if (p.nextStep !== void 0 && (typeof p.nextStep !== "string" || p.nextStep.length > 4096)) throw new Error("invalid nextStep");
|
|
300
|
+
for (const a of [p.constraints, p.openItems]) if (a !== void 0 && !list(a, 50, 2048)) throw new Error("invalid list");
|
|
301
|
+
}
|
|
302
|
+
async function updateWorkContext(db, scope, input) {
|
|
303
|
+
validScope(scope);
|
|
304
|
+
if (!object(input) || Object.keys(input).some((k) => !["activityId", "expectedRevision", "itemKey", "originRef", "changeId", "sourceRefs", "patch"].includes(k))) throw new Error("invalid input");
|
|
305
|
+
validPatch(input.patch);
|
|
306
|
+
if (!bounded(input.changeId, 256) || !list(input.sourceRefs, 20, 2048) || !input.sourceRefs.length) throw new Error("source and changeId required");
|
|
307
|
+
const creating = input.activityId === void 0;
|
|
308
|
+
if (creating && (!bounded(input.itemKey, 256) || !bounded(input.originRef, 2048) || input.expectedRevision !== void 0)) throw new Error("origin and itemKey required");
|
|
309
|
+
if (!creating && (!bounded(input.activityId, 256) || !Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 1 || input.itemKey !== void 0 || input.originRef !== void 0)) throw new Error("activityId and revision required");
|
|
310
|
+
const activityId = creating ? `work-${hash([scope.ownerId, scope.spaceId, input.originRef, input.itemKey])}` : input.activityId;
|
|
311
|
+
const evidenceId = `work-change-${hash([activityId, input.changeId])}`;
|
|
312
|
+
const fingerprint = hash([scope.spaceId, scope.dialogId, input]);
|
|
313
|
+
let result;
|
|
314
|
+
await applyMemoryInterpreterMutation(db, scope.ownerId, async () => {
|
|
315
|
+
const states = (await listMemoryStatesForEntityVNext(db, scope.ownerId, activityId)).filter(isWorkContextState);
|
|
316
|
+
const currents = states.filter((s) => !s.retiredAt);
|
|
317
|
+
if (currents.length > 1 || currents[0] && !validValue(currents[0].value)) throw new Error("invalid work context state");
|
|
318
|
+
const current = currents[0];
|
|
319
|
+
const old = current?.value;
|
|
320
|
+
if (old && old.spaceId !== scope.spaceId) {
|
|
321
|
+
result = { activityId, revision: 0, outcome: "conflict" };
|
|
322
|
+
return { action: "no_op", reason: "scope mismatch" };
|
|
357
323
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
324
|
+
const receipt = await getMemoryEvidenceVNextStrict(db, scope.ownerId, evidenceId);
|
|
325
|
+
if (receipt) {
|
|
326
|
+
const matching = states.find((s) => s.evidenceIds.includes(evidenceId));
|
|
327
|
+
const savedValue = matching && validValue(matching.value) ? matching.value : void 0;
|
|
328
|
+
const match = receipt.text === fingerprint && !!savedValue;
|
|
329
|
+
result = { activityId, revision: match ? savedValue.revision : old?.revision ?? 0, outcome: match ? savedValue.revision === 1 ? "created" : "updated" : "conflict" };
|
|
330
|
+
return { action: "no_op", reason: "duplicate change" };
|
|
331
|
+
}
|
|
332
|
+
if (creating && current || !creating && (!old || old.revision !== input.expectedRevision)) {
|
|
333
|
+
result = { activityId, revision: old?.revision ?? 0, outcome: "conflict" };
|
|
334
|
+
return { action: "no_op", reason: "revision conflict" };
|
|
335
|
+
}
|
|
336
|
+
if (!old && !input.patch.goal) throw new Error("goal required");
|
|
337
|
+
const status = input.patch.status ?? old?.status ?? "active";
|
|
338
|
+
const dialogIds = [.../* @__PURE__ */ new Set([...old?.dialogIds ?? [], scope.dialogId])];
|
|
339
|
+
if (dialogIds.length > 100) throw new Error("dialog association limit exceeded");
|
|
340
|
+
const value = { version: 1, revision: (old?.revision ?? 0) + 1, status, goal: input.patch.goal ?? old.goal, constraints: input.patch.constraints ?? old?.constraints ?? [], openItems: input.patch.openItems ?? old?.openItems ?? [], nextStep: input.patch.nextStep ?? old?.nextStep, latestSourceRefs: input.sourceRefs, spaceId: scope.spaceId, dialogIds };
|
|
341
|
+
const unchanged = !!old && JSON.stringify([old.status, old.goal, old.constraints, old.openItems, old.nextStep]) === JSON.stringify([value.status, value.goal, value.constraints, value.openItems, value.nextStep]);
|
|
342
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
343
|
+
result = { activityId, revision: unchanged ? old.revision : value.revision, outcome: unchanged ? "unchanged" : old ? "updated" : "created" };
|
|
344
|
+
if (unchanged) return { action: "no_op", reason: "unchanged" };
|
|
345
|
+
const evidence = { id: evidenceId, ownerId: scope.ownerId, text: fingerprint, sourceRef: input.sourceRefs[0], confidence: 1, createdAt: now };
|
|
346
|
+
return { action: old ? "update" : "create", reason: "work context", entities: old ? [] : [{ id: activityId, ownerId: scope.ownerId, type: "activity", subtype: facet, name: value.goal, createdAt: now, updatedAt: now }], evidence: [evidence], states: [{ id: `work-state-${hash([activityId, value.revision])}`, ownerId: scope.ownerId, entityId: activityId, facet, value, text: value.goal, evidenceIds: [evidenceId], createdAt: now, updatedAt: now }], supersededStateIds: current ? [current.id] : [] };
|
|
363
347
|
});
|
|
364
|
-
return
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
348
|
+
return result;
|
|
349
|
+
}
|
|
350
|
+
async function readWorkContexts(db, scope, query = {}) {
|
|
351
|
+
validScope(scope);
|
|
352
|
+
if (!object(query) || Object.keys(query).some((k) => !["activityId", "status", "query", "limit", "discovery"].includes(k))) throw new Error("invalid query");
|
|
353
|
+
const limit = query.limit ?? 20;
|
|
354
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be 1..100");
|
|
355
|
+
if (query.status !== void 0 && query.status !== "all" && !statuses.some((status) => status === query.status)) throw new Error("invalid status");
|
|
356
|
+
if (query.discovery !== void 0 && query.discovery !== "dialog" && query.discovery !== "scope") throw new Error("invalid discovery");
|
|
357
|
+
if (query.activityId !== void 0 && !bounded(query.activityId, 256)) throw new Error("invalid activityId");
|
|
358
|
+
if (query.query !== void 0 && !bounded(query.query, 512)) throw new Error("invalid query text");
|
|
359
|
+
const states = query.activityId ? await listMemoryStatesForEntityVNext(db, scope.ownerId, query.activityId) : (await loadMemoryVNextCatalog(db, scope.ownerId)).states;
|
|
360
|
+
const items = [];
|
|
361
|
+
for (const state of states) {
|
|
362
|
+
if (!isWorkContextState(state) || state.retiredAt) continue;
|
|
363
|
+
if (!validValue(state.value) || !bounded(state.entityId, 256) || !bounded(state.updatedAt, 128)) throw new Error("invalid work context state");
|
|
364
|
+
const value = state.value;
|
|
365
|
+
if (value.spaceId !== scope.spaceId || !query.activityId && query.discovery !== "scope" && !value.dialogIds.includes(scope.dialogId)) continue;
|
|
366
|
+
if (query.status !== "all" && value.status !== (query.status ?? (query.activityId ? value.status : "active"))) continue;
|
|
367
|
+
if (query.query && !JSON.stringify([value.goal, value.constraints, value.openItems, value.nextStep]).toLowerCase().includes(query.query.toLowerCase())) continue;
|
|
368
|
+
items.push({ activityId: state.entityId, value, updatedAt: state.updatedAt });
|
|
369
|
+
}
|
|
370
|
+
items.sort((a, b) => Number(b.value.dialogIds.includes(scope.dialogId)) - Number(a.value.dialogIds.includes(scope.dialogId)) || b.updatedAt.localeCompare(a.updatedAt) || a.activityId.localeCompare(b.activityId));
|
|
371
|
+
return { items: items.slice(0, limit), hasMore: items.length > limit };
|
|
369
372
|
}
|
|
370
373
|
|
|
371
374
|
export {
|
|
372
|
-
touchMemoryItemsInDb,
|
|
373
375
|
applyMemoryInterpreterMutation,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
+
isWorkContextState,
|
|
377
|
+
updateWorkContext,
|
|
378
|
+
readWorkContexts
|
|
376
379
|
};
|
|
@@ -2,15 +2,18 @@ import {
|
|
|
2
2
|
getCurrentSpaceIdRaw,
|
|
3
3
|
setCurrentSpaceBoth,
|
|
4
4
|
setSpaceInitialized
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IUTUWIKE.js";
|
|
6
6
|
import {
|
|
7
7
|
createSpaceKey,
|
|
8
8
|
normalizeSpaceId
|
|
9
9
|
} from "./chunk-UAD2WT54.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchFromServer,
|
|
12
|
-
getAllServers
|
|
13
|
-
|
|
12
|
+
getAllServers,
|
|
13
|
+
googleSessionRequestToken,
|
|
14
|
+
isGoogleAuthoritySession,
|
|
15
|
+
scopeGoogleSessionServers
|
|
16
|
+
} from "./chunk-ULLHVDTZ.js";
|
|
14
17
|
import {
|
|
15
18
|
selectIdentityToken,
|
|
16
19
|
selectIdentityUserId
|
|
@@ -23,7 +26,7 @@ import {
|
|
|
23
26
|
var resolveSpaceRemoteServers = (state) => {
|
|
24
27
|
const currentServer = typeof state?.settings?.currentServer === "string" ? state.settings.currentServer : void 0;
|
|
25
28
|
const syncServers = Array.isArray(state?.settings?.syncServers) ? state.settings.syncServers : void 0;
|
|
26
|
-
return getAllServers(currentServer, syncServers);
|
|
29
|
+
return scopeGoogleSessionServers(selectIdentityToken(state), currentServer, getAllServers(currentServer, syncServers));
|
|
27
30
|
};
|
|
28
31
|
var selectSpaceRemoteAuth = (state) => ({
|
|
29
32
|
token: selectIdentityToken(state) ?? null,
|
|
@@ -40,11 +43,13 @@ var membershipFetchCache = /* @__PURE__ */ new Map();
|
|
|
40
43
|
var MEMBERSHIP_FETCH_CACHE_TTL_MS = 3e4;
|
|
41
44
|
async function fetchMembershipsFromServer(server, token, userId, timeoutMs) {
|
|
42
45
|
if (!token) return { ok: false, memberships: [] };
|
|
46
|
+
googleSessionRequestToken(token, server);
|
|
43
47
|
const controller = new AbortController();
|
|
44
48
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
45
49
|
try {
|
|
46
50
|
const response = await fetch(`${server}/rpc/getUserSpaceMemberships`, {
|
|
47
51
|
method: "POST",
|
|
52
|
+
...isGoogleAuthoritySession(token) ? { redirect: "error", credentials: "omit" } : {},
|
|
48
53
|
headers: {
|
|
49
54
|
Authorization: `Bearer ${token}`,
|
|
50
55
|
"Content-Type": "application/json"
|