nolo-cli 0.231.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.
Files changed (190) hide show
  1. package/{_executeModel-7V3NSK4W.js → _executeModel-5NA4USGG.js} +56 -51
  2. package/{action-GDZDXPMB.js → action-X75O3XPH.js} +7 -4
  3. package/{addContentAction-7RO4AMRI.js → addContentAction-GVC77QSN.js} +9 -8
  4. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-KKDVAMW3.js} +12 -11
  5. package/{agentDeleteCommand-MD76OMLN.js → agentDeleteCommand-2RFGKFAB.js} +77 -69
  6. package/{agentEmailCommands-T4TW4IBX.js → agentEmailCommands-GQCQKKOR.js} +84 -72
  7. package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
  8. package/{agentMachineCommands-LSDGA5WR.js → agentMachineCommands-BISF6PVV.js} +26 -22
  9. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-O3Q25PKU.js} +2 -2
  10. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-G6U2LHMW.js} +1 -1
  11. package/{agentRecordCommands-7TEX2B7Y.js → agentRecordCommands-AOXPGYAJ.js} +79 -67
  12. package/{agentRunCommand-23SMDVDW.js → agentRunCommand-YTZJCRAL.js} +85 -72
  13. package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
  14. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
  15. package/{agentSlice-AATYVDP6.js → agentSlice-XJNKE3PG.js} +10 -9
  16. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-LURUSPY7.js} +27 -23
  17. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-SMEW4AK2.js} +27 -23
  18. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-VYPJTBJK.js} +27 -23
  19. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-N4NI5GGJ.js} +27 -23
  20. package/{appListCommands-CUCPRUXW.js → appListCommands-5C6ONN3Z.js} +27 -23
  21. package/{authCommand-3SUYUNQV.js → authCommand-4CVBDADE.js} +15 -13
  22. package/{authCommands-BLE7ETZH.js → authCommands-EHU2BHOX.js} +7 -5
  23. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-AYWYQVA4.js} +3 -3
  24. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-CSDG2HYN.js} +1 -1
  25. package/{chunk-HHFGE2WF.js → chunk-2574ANSV.js} +1 -1
  26. package/chunk-2SXN7LAY.js +15 -0
  27. package/{chunk-S6FDXXZV.js → chunk-3EMIEC27.js} +1 -1
  28. package/{chunk-EXNV7CCV.js → chunk-3FBAVU2Y.js} +11 -9
  29. package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
  30. package/{chunk-U4FF7LRY.js → chunk-4IQVE43Z.js} +30 -26
  31. package/{chunk-VQ5N5GSV.js → chunk-4Q6HQORG.js} +1 -1
  32. package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
  33. package/chunk-4ZCTKB27.js +31 -0
  34. package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
  35. package/{chunk-QYB23WUH.js → chunk-5QZSEQSK.js} +1 -1
  36. package/{chunk-7JGMNKKG.js → chunk-6CKUO32A.js} +8 -0
  37. package/chunk-6D25V6CB.js +133 -0
  38. package/{chunk-LHN7NIQZ.js → chunk-6WOLPIPY.js} +93 -90
  39. package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
  40. package/{chunk-NVEYEKN3.js → chunk-7AJRJGSQ.js} +254 -359
  41. package/chunk-7NIBQ4HY.js +138 -0
  42. package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
  43. package/{chunk-GXZ5LB7H.js → chunk-A3LUWRQK.js} +4 -4
  44. package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
  45. package/{chunk-3ING4D5X.js → chunk-AEQMKYZN.js} +4 -4
  46. package/{chunk-FFSPUVL5.js → chunk-AH5R7BYW.js} +6 -166
  47. package/{chunk-7FEP5USX.js → chunk-ANJRDS6U.js} +3 -3
  48. package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
  49. package/{chunk-HYLRQDEE.js → chunk-B5SV4H3J.js} +6 -6
  50. package/{chunk-KUOMUZH6.js → chunk-B7DE5XJW.js} +137 -290
  51. package/chunk-BEM6LPD2.js +734 -0
  52. package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
  53. package/{chunk-YCFP57LH.js → chunk-BGGV6B5O.js} +408 -230
  54. package/{chunk-BP5ZJ6B4.js → chunk-BIABIPGW.js} +1 -1
  55. package/{chunk-TQEKUOTI.js → chunk-BXSMFPTG.js} +4 -4
  56. package/{chunk-RG2DGNL6.js → chunk-CKZPMJNU.js} +3 -3
  57. package/{chunk-WU443D7A.js → chunk-CVJRVBJL.js} +2 -2
  58. package/{chunk-BIWI5M4E.js → chunk-D374I563.js} +1 -1
  59. package/{chunk-QRGDJA4B.js → chunk-DNZ4JJ7C.js} +1 -1
  60. package/chunk-DVYAFH2Q.js +103 -0
  61. package/{chunk-FTMFO6LI.js → chunk-DXW5WDHZ.js} +4 -4
  62. package/{chunk-ZTR65O4L.js → chunk-E5KJOZWY.js} +3 -3
  63. package/{chunk-57TLKTVZ.js → chunk-E5KY7RAY.js} +565 -103
  64. package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
  65. package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
  66. package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
  67. package/{chunk-PR2LAQAC.js → chunk-FFYE5ATM.js} +4 -4
  68. package/{chunk-6NNDUDAZ.js → chunk-FZKA3XFA.js} +11 -11
  69. package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
  70. package/{chunk-6OQMSPB7.js → chunk-GDUC4VS2.js} +7 -7
  71. package/{chunk-R6Z5S5GA.js → chunk-GXXY2NL3.js} +16 -14
  72. package/{chunk-U2HBB7RS.js → chunk-H7ZYKHAZ.js} +27 -7
  73. package/{chunk-3U44JB3O.js → chunk-HCNOO374.js} +1 -1
  74. package/{chunk-HSSBDZLD.js → chunk-HOM6LTEW.js} +1 -1
  75. package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
  76. package/{chunk-TPG2DPN2.js → chunk-IJTXNLQE.js} +9 -9
  77. package/{chunk-ALAES342.js → chunk-IUMS6F53.js} +2 -2
  78. package/{chunk-547ENH5T.js → chunk-IUTUWIKE.js} +2 -2
  79. package/{chunk-S6K5F3KP.js → chunk-JBWXPACD.js} +1 -1
  80. package/{chunk-XAG3FWBE.js → chunk-KZPEGO6D.js} +1 -1
  81. package/{chunk-RBPUNSG5.js → chunk-LYDEFPQP.js} +18 -108
  82. package/{chunk-OWKNSIXL.js → chunk-MECDGHLK.js} +271 -66
  83. package/{chunk-FJSNBZXR.js → chunk-MM73SP4K.js} +1 -1
  84. package/{chunk-XSW4EXQV.js → chunk-MYOSN6BT.js} +2 -2
  85. package/{chunk-ZEVQHCLM.js → chunk-MYPKBJJO.js} +2 -2
  86. package/{chunk-DBUR22G5.js → chunk-N2JROHD3.js} +4 -4
  87. package/{chunk-ATEKLSLR.js → chunk-O6IPRAVV.js} +14 -9
  88. package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
  89. package/{chunk-WFVASLQT.js → chunk-P3IZUMIC.js} +1 -1
  90. package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
  91. package/{chunk-IONGMVPY.js → chunk-PRMEU7BT.js} +229 -7
  92. package/{chunk-OJ45MEEI.js → chunk-PROOOQZ3.js} +1 -1
  93. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  94. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  95. package/chunk-RETQOQ4D.js +33394 -0
  96. package/{chunk-CMMI3DAT.js → chunk-RM4UMFY4.js} +33 -26
  97. package/{chunk-262R3XNN.js → chunk-S2MHR4PU.js} +151 -5
  98. package/{chunk-DEA37IUY.js → chunk-T6VROBY7.js} +2 -2
  99. package/{chunk-M4SFKP5L.js → chunk-TEMLHVGX.js} +1 -1
  100. package/{chunk-3QIYD3VM.js → chunk-TRHJ4NJB.js} +61 -792
  101. package/{chunk-OBIC6EG7.js → chunk-TWTJV35S.js} +1 -1
  102. package/{chunk-TCZ2VJZQ.js → chunk-U3G7RRXJ.js} +5 -5
  103. package/{chunk-F6Z6ZCUV.js → chunk-UFC4J7OY.js} +3 -3
  104. package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
  105. package/{chunk-4N6G2CKP.js → chunk-ULLHVDTZ.js} +46 -1
  106. package/{chunk-XFXFPUO7.js → chunk-VM72HKW2.js} +7 -7
  107. package/{chunk-MHHLABT3.js → chunk-VREG6ANQ.js} +102 -99
  108. package/chunk-VSRISJXZ.js +107 -0
  109. package/chunk-WDWZPASX.js +29 -0
  110. package/{chunk-ILHQ2AXT.js → chunk-WRKMXMU7.js} +2 -0
  111. package/chunk-X7IA2B7R.js +166 -0
  112. package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
  113. package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
  114. package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
  115. package/{chunk-KUDCKVYQ.js → chunk-Y5OWZQMJ.js} +28 -19
  116. package/{chunk-TI2EPRHE.js → chunk-YGCOJNFZ.js} +3 -3
  117. package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
  118. package/{chunk-X7QAIY5B.js → chunk-Z2WZAE4P.js} +128 -150
  119. package/chunk-Z6YTCDU4.js +24 -0
  120. package/{chunk-RRDRQOEC.js → chunk-ZEKUFJLW.js} +81 -66
  121. package/{chunk-EVGU5P4U.js → chunk-ZVOL2MAJ.js} +1 -1
  122. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-U5OAVAKQ.js} +2 -2
  123. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
  124. package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-HVZAQCUD.js} +29 -25
  125. package/{commandRegistry-35EMLPIZ.js → commandRegistry-FIXBZJHE.js} +89 -85
  126. package/{contentThunks-BCNMGA5J.js → contentThunks-U6OC4R2N.js} +23 -22
  127. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
  128. package/{createAgentAutomationAction-HEU4KOYF.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
  129. package/{createDialogAction-5DSL5ESZ.js → createDialogAction-IAGQJ3LH.js} +24 -23
  130. package/{createPageAction-BBZ25AFI.js → createPageAction-AZ3UIFKA.js} +24 -23
  131. package/{dbSlice-XRUZOGSU.js → dbSlice-DKKMJJYY.js} +8 -7
  132. package/{deleteFile-6URDHYRB.js → deleteFile-TQSONMVU.js} +7 -4
  133. package/{dialogCommands-6SZD4TYP.js → dialogCommands-PCDRMBWG.js} +30 -26
  134. package/dialogMessageRecord-OAV77LT7.js +7 -0
  135. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-O35MWMOS.js} +3 -3
  136. package/{dialogSlice-QJ5PQOM3.js → dialogSlice-QAKYN4DE.js} +22 -21
  137. package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-2SSLTXKO.js} +2 -2
  138. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-CFQFZOAD.js} +26 -22
  139. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-5CPNTIIS.js} +27 -23
  140. package/{docReadCommands-JY2E5XEN.js → docReadCommands-XQILYSAJ.js} +26 -22
  141. package/{docStore-XJ4UMU3C.js → docStore-GIVRT7TQ.js} +10 -9
  142. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
  143. package/{handleSendMessageAction-YHAOXARI.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
  144. package/{hostCredentialCreate-62AWCBQC.js → hostCredentialCreate-6VDJFNDO.js} +81 -68
  145. package/index.js +8 -8
  146. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  147. package/{localRuntimeAdapter-KNQNNHUM.js → localRuntimeAdapter-BQ4F5PZV.js} +81 -69
  148. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
  149. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
  150. package/{machineCommands-X2FMPSV4.js → machineCommands-K6XIGOAD.js} +77 -65
  151. package/{machineWsRunDispatch-XHTPOYVJ.js → machineWsRunDispatch-4OO7Z6UM.js} +77 -65
  152. package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
  153. package/{memberThunks-7Y3OYSJQ.js → memberThunks-PBJPZ2JU.js} +15 -10
  154. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  155. package/package.json +1 -1
  156. package/{projectArchive-NPQ3YOAV.js → projectArchive-G7AOQPRW.js} +24 -23
  157. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-OPBCAONX.js} +1 -1
  158. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-J2HCVTHE.js} +1 -1
  159. package/{read-TYMBGEXO.js → read-JEGPITEW.js} +6 -5
  160. package/{readDocTool-SKQVHBLO.js → readDocTool-TE3XIU4Y.js} +1 -1
  161. package/{readlineWorkspace-77PILYDH.js → readlineWorkspace-XMPGXR77.js} +2935 -2376
  162. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
  163. package/{runAgentClientLoop-XNKAXUKU.js → runAgentClientLoop-HQJPDFGQ.js} +65 -45
  164. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-GUH2YGMH.js} +3 -3
  165. package/{secretCommands-KZWBZIYS.js → secretCommands-NJXFVHZU.js} +2 -2
  166. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +11 -10
  167. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +14 -13
  168. package/{settingThunks-ZRGWVGZD.js → settingThunks-AY76OHYX.js} +176 -57
  169. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
  170. package/{spaceCommands-TOGSGCPS.js → spaceCommands-G63QGYQO.js} +25 -21
  171. package/{streamAgentChatTurn-IARUEZPU.js → streamAgentChatTurn-E3XH2KFD.js} +127 -85
  172. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-G6EZRKCQ.js} +12 -11
  173. package/{tableCommands-FTAOCBTX.js → tableCommands-JI75ZHDI.js} +4 -1
  174. package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
  175. package/{tools-5UWS65PB.js → tools-7RSX22FT.js} +41 -37
  176. package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
  177. package/{tuiSummaryLlmCaller-R4H3ZZ52.js → tuiSummaryLlmCaller-BVNHMWLR.js} +5 -5
  178. package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
  179. package/{updateDialogTitleAction-G6C6XVNV.js → updateDialogTitleAction-SEWV252V.js} +23 -22
  180. package/{usageCommand-2BF74MKF.js → usageCommand-JVT5J3DC.js} +2 -2
  181. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-IZYYUTEW.js} +3 -3
  182. package/webapi-24RZDIIQ.js +2488 -0
  183. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
  184. package/workContext-MM3P5GP5.js +13 -0
  185. package/workContextAccess-UZHDLBUR.js +11 -0
  186. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  187. package/chunk-ZXF6D3I6.js +0 -359
  188. package/{accountResolver-QETKNC7T.js → accountResolver-EK2S4PWF.js} +3 -3
  189. package/{localDialogRead-CCOCVGAP.js → localDialogRead-AV2VKKPG.js} +0 -0
  190. 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/storeShared.ts
26
- var retrievalCountOf = (item) => item.activationCount ?? 0;
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/remember.ts
305
- var RESIDENT_MAX_CONTENT_CHARS = 240;
306
-
307
- // packages/ai/memory/vnext/pureVNextRuntime.ts
308
- function deriveStateResident(state, ownerType) {
309
- if (ownerType !== "user") return false;
310
- if (state.text.trim().length > RESIDENT_MAX_CONTENT_CHARS) return false;
311
- return state.facet === "preference" || state.facet === "style";
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
- var buildSynthesizedStateItem = (state, entity, ownerType, ownerId) => ({
314
- id: `vnext-state-${state.id}`,
315
- ownerType,
316
- ownerId,
317
- visibility: "private",
318
- subjectType: "user",
319
- subjectId: ownerId,
320
- kind: "semantic",
321
- content: state.text.trim(),
322
- createdAt: state.createdAt,
323
- lastActivatedAt: state.createdAt,
324
- activationCount: 1,
325
- importance: 0.9,
326
- confidence: 0.9,
327
- resident: deriveStateResident(state, ownerType)
328
- });
329
- async function resolvePureVNextRuntime(input) {
330
- const { db, owners, userInput } = input;
331
- if (owners.length === 0 || !userInput.trim()) {
332
- return { selectedItems: [], promptBlock: buildMemoryOverlay([], { injectionEmit: input.injectionEmit }), recalledStateCount: 0 };
333
- }
334
- const ownerIds = owners.map((o) => `${o.ownerType}:${encodeURIComponent(o.ownerId)}`);
335
- const catalogs = await Promise.all(
336
- ownerIds.map((ownerId) => loadMemoryVNextCatalog(db, ownerId))
337
- );
338
- const selectedItems = [];
339
- const seenStateKeys = /* @__PURE__ */ new Set();
340
- for (let i = 0; i < owners.length; i++) {
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
- const promptBlock = buildMemoryOverlay(selectedItems, {
360
- sources: new Map(selectedItems.map((item) => [item, "vnext"])),
361
- injectionEmit: input.injectionEmit,
362
- maxTokens: input.maxTokens ?? DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET
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
- selectedItems,
366
- promptBlock,
367
- recalledStateCount: selectedItems.length
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
- deriveStateResident,
375
- resolvePureVNextRuntime
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-547ENH5T.js";
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
- } from "./chunk-4N6G2CKP.js";
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"