nolo-cli 0.199.0-alpha.4 → 0.200.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/{_executeModel-KGMFBND7.js → _executeModel-HSRCREYE.js} +15 -15
  2. package/{agentDeleteCommand-ITQN4QLD.js → agentDeleteCommand-WD4L6CHD.js} +14 -15
  3. package/{agentEmailCommands-3LDZFOFC.js → agentEmailCommands-RCRARCX6.js} +16 -17
  4. package/{agentListCommands-SW3QUAOF.js → agentListCommands-AW4KBRKW.js} +3 -3
  5. package/{agentMachineCommands-QH2BUSWC.js → agentMachineCommands-DG75JJMT.js} +2 -2
  6. package/{agentRecordCommands-NE36A7IH.js → agentRecordCommands-DBJ7PFHU.js} +15 -16
  7. package/{agentRunCommand-KNNJSEDV.js → agentRunCommand-LW4STOVS.js} +16 -17
  8. package/{agentRuntimeLocal-FZQTLBN6.js → agentRuntimeLocal-HEDYPH5T.js} +1 -1
  9. package/{agentSlice-CB25SUJB.js → agentSlice-AKONYC2X.js} +1 -1
  10. package/{appDeleteCommands-TUCRDFU2.js → appDeleteCommands-YFJCM52Z.js} +1 -1
  11. package/{appDeployCommands-BQCYEC3R.js → appDeployCommands-2KFLY3FW.js} +1 -1
  12. package/{appDeployStatusCommands-SX26DRSV.js → appDeployStatusCommands-E2AECP3M.js} +1 -1
  13. package/{appGetCommands-CDFTFOOZ.js → appGetCommands-6R3KDUOD.js} +1 -1
  14. package/{appListCommands-7ARRUYU3.js → appListCommands-ULFSD4YR.js} +1 -1
  15. package/{builtinSkillRegistry-36WIAYXB.js → builtinSkillRegistry-7RAJP7FD.js} +1 -1
  16. package/{chunk-KJZFDQF3.js → chunk-26FOK6BM.js} +8 -8
  17. package/{chunk-TS2LLPTD.js → chunk-2SHLT6JB.js} +55 -3
  18. package/{chunk-4G5YV3EG.js → chunk-2WWLRUH6.js} +15 -19
  19. package/{chunk-6YJA5FPA.js → chunk-4JJTTYHM.js} +3 -3
  20. package/{chunk-RMRLWIQS.js → chunk-54CGZKEH.js} +2 -2
  21. package/{chunk-4BBAP7E4.js → chunk-57IPIXV6.js} +1 -1
  22. package/{chunk-RJVYCYLQ.js → chunk-7UVMTDNQ.js} +8 -8
  23. package/{chunk-5TO2R77F.js → chunk-BBGYSMUE.js} +1 -12
  24. package/{chunk-DEOPS4PJ.js → chunk-BUCI6WU4.js} +18 -4
  25. package/{chunk-E7B4CR5M.js → chunk-CJTDTUBE.js} +3 -3
  26. package/{chunk-R33OLTYJ.js → chunk-D3G4IT62.js} +1 -1
  27. package/{chunk-LKZ7FZTI.js → chunk-DDIAU5M2.js} +3 -3
  28. package/{chunk-IYI5Y74S.js → chunk-JXR5T3IY.js} +7 -7
  29. package/{chunk-O2H2Z7U4.js → chunk-O5V7QQAF.js} +74 -26
  30. package/{chunk-GQ3QPQEP.js → chunk-PIIXNP43.js} +2 -2
  31. package/{chunk-MQKPELXS.js → chunk-PMKV3GBE.js} +2 -2
  32. package/{chunk-SYGZQMC2.js → chunk-QHISAEGJ.js} +36 -25
  33. package/{chunk-76OXA55E.js → chunk-QYOB7RVA.js} +80 -2
  34. package/{chunk-EXSYUA2B.js → chunk-RE3B2OCC.js} +1 -1
  35. package/{chunk-TDVJP4KY.js → chunk-SJNMVC4C.js} +1 -1
  36. package/{chunk-RRKJTPWB.js → chunk-WOIO46PT.js} +2 -2
  37. package/{chunk-JNRGTW6S.js → chunk-WOKS3DR3.js} +80 -20
  38. package/{chunk-74YOBGG6.js → chunk-XU3J27U3.js} +3 -3
  39. package/{chunk-C4RTTV4V.js → chunk-XXA3W2BH.js} +1 -1
  40. package/{commandRegistry-5IWG5Y44.js → commandRegistry-4LBX2PFC.js} +40 -40
  41. package/{contentThunks-HLK4P4WY.js → contentThunks-XICRS36V.js} +3 -3
  42. package/{createAgentAutomationAction-PGEMZSPA.js → createAgentAutomationAction-BBUBGJYJ.js} +3 -3
  43. package/{createDialogAction-3YFKJAL3.js → createDialogAction-B2CBYLGL.js} +4 -4
  44. package/{createPageAction-3DYXFT6A.js → createPageAction-QUJICPHK.js} +3 -3
  45. package/{dialogCommands-VPPMDS7O.js → dialogCommands-W5ONKM73.js} +1 -1
  46. package/{dialogSlice-7MTH65XY.js → dialogSlice-UYSJR5HB.js} +2 -2
  47. package/{docCreateCommands-RBSXLMXE.js → docCreateCommands-CALJFHEG.js} +1 -1
  48. package/{docDeleteCommands-KNDHZJ5P.js → docDeleteCommands-BY3XHNKC.js} +1 -1
  49. package/{docReadCommands-WOPIYED3.js → docReadCommands-VCYVD633.js} +1 -1
  50. package/{docStore-GUGX22ZK.js → docStore-3IQO66KQ.js} +1 -1
  51. package/{docUpdateCommands-4QEUPC27.js → docUpdateCommands-7VYCALGI.js} +1 -1
  52. package/{handleSendMessageAction-VNFSQCOL.js → handleSendMessageAction-VYVYTTSM.js} +17 -13
  53. package/index.js +3 -3
  54. package/{localRuntimeAdapter-55YKDA6C.js → localRuntimeAdapter-5PR2IUYX.js} +14 -15
  55. package/{machineCommands-PLM7EYGX.js → machineCommands-5GTYQIF5.js} +15 -16
  56. package/{machineWsRunDispatch-5GAWU7VZ.js → machineWsRunDispatch-R4ECVI3J.js} +15 -16
  57. package/package.json +1 -1
  58. package/{readlineWorkspace-ZQBXJDCB.js → readlineWorkspace-OEMBKJGV.js} +17 -18
  59. package/{runAgentClientLoop-P56EMBCN.js → runAgentClientLoop-DEL7A5UI.js} +13 -13
  60. package/{settingThunks-MH2OF52M.js → settingThunks-YRYNPWJM.js} +17 -5
  61. package/{spaceCommands-E7DW3KLI.js → spaceCommands-QEZXY2QU.js} +1 -1
  62. package/{streamAgentChatTurn-45SHUYWK.js → streamAgentChatTurn-HXJLARMT.js} +28 -22
  63. package/{tools-WFX2BG5Y.js → tools-SHEXSRPR.js} +10 -10
  64. package/{updateDialogTitleAction-3HRLWCWE.js → updateDialogTitleAction-44JI43PI.js} +3 -3
  65. package/chunk-TYQAGKPR.js +0 -57
@@ -55,15 +55,13 @@ import {
55
55
  buildCliPrompt
56
56
  } from "./chunk-ATNTHIZI.js";
57
57
  import {
58
- inferCaptureIntent
59
- } from "./chunk-TS2LLPTD.js";
60
- import {
61
- resolveUserPromptSkillPatches
62
- } from "./chunk-TYQAGKPR.js";
58
+ inferCaptureIntent,
59
+ resolveUserSkillRuntime
60
+ } from "./chunk-2SHLT6JB.js";
63
61
  import {
64
62
  inlineImageUrlsForCustomProvider,
65
63
  prepareTools
66
- } from "./chunk-RMRLWIQS.js";
64
+ } from "./chunk-54CGZKEH.js";
67
65
  import {
68
66
  getServerProviderSecret
69
67
  } from "./chunk-HS7MLR74.js";
@@ -85,7 +83,7 @@ import {
85
83
  resolveCliLocalRuntimeKeyCapability,
86
84
  resolveCliLocalSpawnDispatch,
87
85
  resolveStartAgentRunCwd
88
- } from "./chunk-JNRGTW6S.js";
86
+ } from "./chunk-WOKS3DR3.js";
89
87
  import {
90
88
  fetchWithTransientRetry,
91
89
  isTransientFetchError
@@ -93,10 +91,11 @@ import {
93
91
  import {
94
92
  deriveCredentialGroup,
95
93
  deriveCustomProviderCredentialGroup
96
- } from "./chunk-5TO2R77F.js";
94
+ } from "./chunk-BBGYSMUE.js";
97
95
  import {
98
- resolveAgentRequiredPackIds
99
- } from "./chunk-76OXA55E.js";
96
+ resolveAgentRequiredPackIds,
97
+ resolveUserEnabledSkills
98
+ } from "./chunk-QYOB7RVA.js";
100
99
  import {
101
100
  applyBuiltinAgentRuntimeOverride,
102
101
  applyTokenUsageToDayStats,
@@ -105,14 +104,14 @@ import {
105
104
  resolveBuiltinPlatformAgentConfig,
106
105
  runKeyed,
107
106
  validateAskChoiceInput
108
- } from "./chunk-RJVYCYLQ.js";
107
+ } from "./chunk-7UVMTDNQ.js";
109
108
  import {
110
109
  BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
111
110
  BUILTIN_TITLE_LLM_CONFIG
112
111
  } from "./chunk-523DITKR.js";
113
112
  import {
114
113
  fetchServerSyncedCredential
115
- } from "./chunk-E7B4CR5M.js";
114
+ } from "./chunk-CJTDTUBE.js";
116
115
  import {
117
116
  getDefaultCliLocalRuntimeDb
118
117
  } from "./chunk-P64WRQYV.js";
@@ -172,7 +171,7 @@ import {
172
171
  runExecShellGates,
173
172
  validateConfiguredRootExecutionLease,
174
173
  verifyOwnerRouteAck
175
- } from "./chunk-4BBAP7E4.js";
174
+ } from "./chunk-57IPIXV6.js";
176
175
  import {
177
176
  accumulateGeminiChunks,
178
177
  buildGeminiGenerateContentRequest,
@@ -1107,9 +1106,7 @@ function buildPreparedAgentCacheKey(args) {
1107
1106
  const systemBuiltinSkillsKey = args.systemBuiltinSkills ? JSON.stringify(
1108
1107
  Object.keys(args.systemBuiltinSkills).sort().map((key) => [key, args.systemBuiltinSkills?.[key]])
1109
1108
  ) : "default";
1110
- const promptSkillsKey = JSON.stringify(
1111
- Array.isArray(args.enabledPromptSkills) && args.enabledPromptSkills.includes("ub-mode") ? ["ub-mode"] : []
1112
- );
1109
+ const userSkillsKey = JSON.stringify(resolveUserEnabledSkills(args).sort());
1113
1110
  const wakeKey = args.wake !== void 0 ? args.wake ? "wake:1" : "wake:0" : "";
1114
1111
  const policyKey = JSON.stringify([
1115
1112
  args.env?.NOLO_LOCAL_WORKSPACE_TOOLSET ?? "",
@@ -1119,7 +1116,7 @@ function buildPreparedAgentCacheKey(args) {
1119
1116
  args.env?.NOLO_LOCAL_ALLOWED_TOOLS ?? "",
1120
1117
  args.env?.NOLO_LOCAL_ALLOW_UNDECLARED_TOOLS ?? ""
1121
1118
  ]);
1122
- return `${policyKey}\0${args.userId}\0${args.agentRef}\0${args.cwd}\0${systemBuiltinSkillsKey}\0${promptSkillsKey}${wakeKey ? `\0${wakeKey}` : ""}`;
1119
+ return `${policyKey}\0${args.userId}\0${args.agentRef}\0${args.cwd}\0${systemBuiltinSkillsKey}\0${userSkillsKey}${wakeKey ? `\0${wakeKey}` : ""}`;
1123
1120
  }
1124
1121
  function clearCliLocalRuntimePreparedAgentCache() {
1125
1122
  preparedAgentRuntimeCache.clear();
@@ -12842,7 +12839,7 @@ function createCliLocalRuntimeAdapter(deps) {
12842
12839
  credentialBroker,
12843
12840
  loadAgentConfig: async (agentRef) => {
12844
12841
  let systemBuiltinSkills = null;
12845
- let enabledPromptSkills = [];
12842
+ let skillPreferences = {};
12846
12843
  const sharedStore = await getOrCreateSharedStore(deps);
12847
12844
  if (userId) {
12848
12845
  try {
@@ -12850,17 +12847,23 @@ function createCliLocalRuntimeAdapter(deps) {
12850
12847
  createUserKey.settings(userId),
12851
12848
  { remote: false }
12852
12849
  );
12853
- enabledPromptSkills = settingsRecord && typeof settingsRecord === "object" ? settingsRecord.enabledPromptSkills ?? [] : [];
12850
+ if (settingsRecord && typeof settingsRecord === "object") {
12851
+ skillPreferences = {
12852
+ ...Object.prototype.hasOwnProperty.call(settingsRecord, "enabledSkills") ? { enabledSkills: settingsRecord.enabledSkills } : {},
12853
+ enabledPromptSkills: settingsRecord.enabledPromptSkills
12854
+ };
12855
+ }
12854
12856
  systemBuiltinSkills = settingsRecord && typeof settingsRecord === "object" ? settingsRecord.systemBuiltinSkills ?? null : null;
12855
12857
  } catch {
12856
12858
  }
12857
12859
  }
12860
+ const enabledSkills = resolveUserEnabledSkills(skillPreferences).sort();
12858
12861
  const cacheKey = `${buildPreparedAgentCacheKey({
12859
12862
  userId,
12860
12863
  agentRef,
12861
12864
  cwd: normalizeRuntimeCacheCwd(workspaceRoot),
12862
12865
  systemBuiltinSkills,
12863
- enabledPromptSkills,
12866
+ enabledSkills,
12864
12867
  wake: hasRunWakeChannel(deps.env),
12865
12868
  env: deps.env
12866
12869
  })}:${dockerRuntimeEnabled ? "docker" : instaboxRuntimeEnabled ? "instabox" : "host"}`;
@@ -12877,15 +12880,23 @@ function createCliLocalRuntimeAdapter(deps) {
12877
12880
  userId
12878
12881
  });
12879
12882
  const fallbackLocalCliAgentConfig = storedAgentConfig ? null : resolveBuiltinLocalCliAgentConfig(agentRef, userId);
12883
+ const sourceAgentConfig = storedAgentConfig ?? fallbackLocalCliAgentConfig;
12884
+ const userSkills = await resolveUserSkillRuntime(sourceAgentConfig, {
12885
+ enabledSkills,
12886
+ enabledPromptSkills: skillPreferences.enabledPromptSkills
12887
+ });
12880
12888
  const baseAgentConfig = withResolvedRuntimeToolSurface(
12881
- storedAgentConfig ?? fallbackLocalCliAgentConfig,
12889
+ sourceAgentConfig && {
12890
+ ...sourceAgentConfig,
12891
+ toolNames: [.../* @__PURE__ */ new Set([
12892
+ ...sourceAgentConfig.toolNames ?? [],
12893
+ ...userSkills.requiredTools
12894
+ ])]
12895
+ },
12882
12896
  deps.env
12883
12897
  );
12884
12898
  const packAgentConfig = baseAgentConfig ? withRuntimeEnabledPacksAndPrompt(baseAgentConfig) : baseAgentConfig;
12885
- const userPromptPatches = resolveUserPromptSkillPatches(
12886
- packAgentConfig?.rawRecord ?? packAgentConfig,
12887
- enabledPromptSkills
12888
- );
12899
+ const userPromptPatches = userSkills.skillPromptPatches;
12889
12900
  const agentConfig = packAgentConfig && userPromptPatches.length ? {
12890
12901
  ...packAgentConfig,
12891
12902
  prompt: [
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveBuiltinCapability,
3
3
  resolveBuiltinSkillEntry
4
- } from "./chunk-O2H2Z7U4.js";
4
+ } from "./chunk-O5V7QQAF.js";
5
5
  import {
6
6
  noloAgentId
7
7
  } from "./chunk-Y6ORVLSS.js";
@@ -149,6 +149,80 @@ var defaultSkillTitleLookup = (slug) => {
149
149
  };
150
150
  var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
151
151
 
152
+ // packages/ai/skills/userPromptSkills.ts
153
+ var RECOMMENDED_PROMPT_SKILL_SLUGS = ["ub-mode"];
154
+ var ALLOWED_PROMPT_SKILL_SLUGS = new Set(
155
+ RECOMMENDED_PROMPT_SKILL_SLUGS
156
+ );
157
+ function normalizeEnabledPromptSkills(value) {
158
+ if (!Array.isArray(value)) {
159
+ return [];
160
+ }
161
+ const result = [];
162
+ const seen = /* @__PURE__ */ new Set();
163
+ for (const item of value) {
164
+ if (typeof item !== "string") {
165
+ continue;
166
+ }
167
+ const trimmed = item.trim();
168
+ if (ALLOWED_PROMPT_SKILL_SLUGS.has(trimmed) && !seen.has(trimmed)) {
169
+ seen.add(trimmed);
170
+ result.push(trimmed);
171
+ }
172
+ }
173
+ return result;
174
+ }
175
+
176
+ // packages/ai/skills/userSkills.ts
177
+ var SUPPORTED_USER_SKILL_SLUGS = [
178
+ "ub-mode",
179
+ "auto-review",
180
+ "code-style",
181
+ "worktree-isolation",
182
+ "systematic-investigation",
183
+ "show-me",
184
+ "caveman",
185
+ "secrets-manager",
186
+ "skill-creator",
187
+ "code-planning",
188
+ "coding",
189
+ "coding-review"
190
+ ];
191
+ var SUPPORTED_USER_SKILL_SLUG_SET = new Set(
192
+ SUPPORTED_USER_SKILL_SLUGS
193
+ );
194
+ function normalizeEnabledSkills(value) {
195
+ if (!Array.isArray(value)) {
196
+ return [];
197
+ }
198
+ const result = [];
199
+ const seen = /* @__PURE__ */ new Set();
200
+ for (const item of value) {
201
+ if (typeof item !== "string") {
202
+ continue;
203
+ }
204
+ const trimmed = item.trim();
205
+ if (SUPPORTED_USER_SKILL_SLUG_SET.has(trimmed) && !seen.has(trimmed)) {
206
+ seen.add(trimmed);
207
+ result.push(trimmed);
208
+ }
209
+ }
210
+ return result;
211
+ }
212
+ function resolveUserEnabledSkills(preferences) {
213
+ if (!preferences || typeof preferences !== "object") {
214
+ return [];
215
+ }
216
+ if (Object.prototype.hasOwnProperty.call(preferences, "enabledSkills")) {
217
+ return normalizeEnabledSkills(preferences.enabledSkills);
218
+ }
219
+ if (Object.prototype.hasOwnProperty.call(preferences, "enabledPromptSkills")) {
220
+ const legacy = normalizeEnabledPromptSkills(preferences.enabledPromptSkills);
221
+ return legacy.filter((slug) => SUPPORTED_USER_SKILL_SLUG_SET.has(slug));
222
+ }
223
+ return [];
224
+ }
225
+
152
226
  // packages/ai/policy/selfUpdateFields.ts
153
227
  var AGENT_UPDATE_FIELD_NAMES = [
154
228
  "name",
@@ -193,6 +267,7 @@ var normalizeAgentUpdateFieldList = (value, fallback = DEFAULT_AUTO_APPROVED_SEL
193
267
  };
194
268
 
195
269
  export {
270
+ resolveAgentSkillConfig,
196
271
  resolveAgentRequiredPackIds,
197
272
  resolveAgentRecommendedSkillNames,
198
273
  isAgentSkillDisabled,
@@ -209,5 +284,8 @@ export {
209
284
  normalizePolicyLevelSetting,
210
285
  resolveDefaultAgentIdSetting,
211
286
  omitKeys,
212
- normalizeSystemBuiltinSkills
287
+ normalizeSystemBuiltinSkills,
288
+ normalizeEnabledPromptSkills,
289
+ normalizeEnabledSkills,
290
+ resolveUserEnabledSkills
213
291
  };
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-6WZQGT5X.js";
8
8
  import {
9
9
  deriveCredentialGroup
10
- } from "./chunk-5TO2R77F.js";
10
+ } from "./chunk-BBGYSMUE.js";
11
11
  import {
12
12
  isTombstoneRecord
13
13
  } from "./chunk-D2MDMY2M.js";
@@ -7,7 +7,7 @@ import {
7
7
  deleteDialog,
8
8
  runtime_default,
9
9
  toast
10
- } from "./chunk-RJVYCYLQ.js";
10
+ } from "./chunk-7UVMTDNQ.js";
11
11
  import {
12
12
  UNCATEGORIZED_ID,
13
13
  addContentAction,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-TDVJP4KY.js";
3
+ } from "./chunk-SJNMVC4C.js";
4
4
  import {
5
5
  format,
6
6
  prepareAndPersistMessage,
7
7
  uiAskChoiceFunc,
8
8
  uiAskChoiceFunctionSchema
9
- } from "./chunk-RJVYCYLQ.js";
9
+ } from "./chunk-7UVMTDNQ.js";
10
10
  import {
11
11
  formatISO
12
12
  } from "./chunk-ZRAU6T47.js";
@@ -2,9 +2,10 @@ import {
2
2
  fetchWithTransientRetry
3
3
  } from "./chunk-KFHREHUQ.js";
4
4
  import {
5
- assembleAgentDiscoveryResult,
6
- resolveDiscoveryScope
7
- } from "./chunk-5TO2R77F.js";
5
+ buildAgentDiscoveryResult,
6
+ resolveDiscoveryScope,
7
+ toDiscoverySafeAgentSummary
8
+ } from "./chunk-BBGYSMUE.js";
8
9
  import {
9
10
  getUserDataItemTimestamp,
10
11
  mergeAndDedupUserData
@@ -37,7 +38,7 @@ import {
37
38
  toolRunUpdated,
38
39
  uiCardFallback,
39
40
  waitForAbortableDelay
40
- } from "./chunk-DEOPS4PJ.js";
41
+ } from "./chunk-BUCI6WU4.js";
41
42
  import {
42
43
  isGatewayHttpStatus
43
44
  } from "./chunk-NF64D32W.js";
@@ -52,10 +53,10 @@ import {
52
53
  AGENT_UPDATE_FIELD_NAMES,
53
54
  isAgentSkillDisabled,
54
55
  normalizeAgentUpdateFieldList
55
- } from "./chunk-76OXA55E.js";
56
+ } from "./chunk-QYOB7RVA.js";
56
57
  import {
57
58
  createDocState
58
- } from "./chunk-MQKPELXS.js";
59
+ } from "./chunk-PMKV3GBE.js";
59
60
  import {
60
61
  ToolApiError,
61
62
  buildToolRequestHeaders,
@@ -82,7 +83,7 @@ import {
82
83
  } from "./chunk-63W5N6P3.js";
83
84
  import {
84
85
  createDialogAction
85
- } from "./chunk-RRKJTPWB.js";
86
+ } from "./chunk-WOIO46PT.js";
86
87
  import {
87
88
  DEFAULT_COLLAPSED_CATEGORIES,
88
89
  addContentToSpace,
@@ -99,7 +100,7 @@ import {
99
100
  updateContentCategory,
100
101
  updateContentTitle,
101
102
  writeStoredCollapsedCategories
102
- } from "./chunk-TDVJP4KY.js";
103
+ } from "./chunk-SJNMVC4C.js";
103
104
  import {
104
105
  getCurrentSpaceId,
105
106
  getCurrentSpaceIdRaw,
@@ -122,14 +123,14 @@ import {
122
123
  selectMsgById,
123
124
  uiAskChoiceFunc,
124
125
  uiAskChoiceFunctionSchema
125
- } from "./chunk-RJVYCYLQ.js";
126
+ } from "./chunk-7UVMTDNQ.js";
126
127
  import {
127
128
  createAgent,
128
129
  deleteServerSyncedCredential,
129
130
  runLlm,
130
131
  streamAgentChatTurn,
131
132
  updateAgent
132
- } from "./chunk-E7B4CR5M.js";
133
+ } from "./chunk-CJTDTUBE.js";
133
134
  import {
134
135
  buildMediaToolConfirmation,
135
136
  normalizeMediaConfirmExecutionRevision
@@ -199,7 +200,7 @@ import {
199
200
  import {
200
201
  listBuiltinSkills,
201
202
  resolveBuiltinSkillByName
202
- } from "./chunk-O2H2Z7U4.js";
203
+ } from "./chunk-O5V7QQAF.js";
203
204
  import {
204
205
  CAPABILITY_PACKS
205
206
  } from "./chunk-6OEPWZV7.js";
@@ -230,6 +231,10 @@ import {
230
231
  resolveReadOnlyToolConstraints,
231
232
  verifyNoloDialogSubjectRefQuery
232
233
  } from "./chunk-NABJEYPJ.js";
234
+ import {
235
+ mergeAvailabilityDeadline,
236
+ resolveCredentialKeyWithFallback
237
+ } from "./chunk-RXX262QX.js";
233
238
  import {
234
239
  clipCompactText
235
240
  } from "./chunk-5MMAK75Q.js";
@@ -3524,7 +3529,14 @@ var jsonPreview = (value, maxLength = 1800) => {
3524
3529
  };
3525
3530
  var getRuntime2 = (thunkApi) => {
3526
3531
  const state2 = thunkApi?.getState?.();
3527
- return state2 ? selectRuntimeSnapshot(state2) : null;
3532
+ if (!state2) return null;
3533
+ const snapshot = selectRuntimeSnapshot(state2);
3534
+ return {
3535
+ ...snapshot,
3536
+ currentUserId: snapshot?.currentUserId ?? state2.currentUserId ?? state2.userId ?? state2.auth?.userId ?? state2.auth?.currentUser?.userId,
3537
+ currentToken: snapshot?.currentToken ?? state2.currentToken ?? state2.auth?.currentToken,
3538
+ currentServer: snapshot?.currentServer ?? state2.currentServer ?? state2.settings?.currentServer
3539
+ };
3528
3540
  };
3529
3541
  var authHeaders2 = (token) => token ? { Authorization: `Bearer ${token}` } : {};
3530
3542
  var DrainExhaustedError = class extends Error {
@@ -3884,7 +3896,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3884
3896
  const deletedDialogIds = [];
3885
3897
  const deletedDialogKeys = [];
3886
3898
  const failures = [];
3887
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-7MTH65XY.js");
3899
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-UYSJR5HB.js");
3888
3900
  for (const target of targets) {
3889
3901
  try {
3890
3902
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -4008,18 +4020,66 @@ async function listAgentsFunc(args, thunkApi) {
4008
4020
  }
4009
4021
  }
4010
4022
  const userId = runtime?.currentUserId ?? void 0;
4011
- const discovery = assembleAgentDiscoveryResult({
4012
- records: [...Array.from(recordsMap.values()), ...publicRecords],
4013
- summaryOptions: (record) => ({
4023
+ const now = typeof args?.now === "number" ? args.now : Date.now();
4024
+ const env = args?.env ?? process.env;
4025
+ let localCooldowns = {};
4026
+ let resolveCooldownFn;
4027
+ try {
4028
+ const credModulePath = "../../agent-runtime/credentialAvailability";
4029
+ const credMod = await import(credModulePath);
4030
+ if (credMod?.readCredentialAvailability && credMod?.resolveEffectiveCredentialCooldown) {
4031
+ localCooldowns = await credMod.readCredentialAvailability(env, now).catch(() => ({}));
4032
+ resolveCooldownFn = credMod.resolveEffectiveCredentialCooldown;
4033
+ }
4034
+ } catch {
4035
+ }
4036
+ const allRecords = [...Array.from(recordsMap.values()), ...publicRecords];
4037
+ const agents = allRecords.map((record) => {
4038
+ const summary = toDiscoverySafeAgentSummary(record, {
4014
4039
  favoritesMap,
4015
4040
  userId,
4016
4041
  publicRecordExists: publicRecords.includes(record) ? true : void 0
4017
- }),
4042
+ });
4043
+ if (Object.keys(localCooldowns).length > 0) {
4044
+ let localDeadline;
4045
+ const credKey = resolveCredentialKeyWithFallback(record);
4046
+ if (credKey && resolveCooldownFn) {
4047
+ const at = resolveCooldownFn(credKey, localCooldowns, now);
4048
+ if (typeof at === "number") {
4049
+ localDeadline = mergeAvailabilityDeadline(localDeadline, at);
4050
+ }
4051
+ }
4052
+ for (const ref of [record?.apiKeyRef, record?.credentialRef]) {
4053
+ if (typeof ref === "string" && ref.trim()) {
4054
+ const at = localCooldowns[ref.trim()];
4055
+ if (typeof at === "number" && at > now) {
4056
+ localDeadline = mergeAvailabilityDeadline(localDeadline, at);
4057
+ }
4058
+ }
4059
+ }
4060
+ if (summary.credentialGroup && summary.isOwned !== false) {
4061
+ const at = localCooldowns[summary.credentialGroup];
4062
+ if (typeof at === "number" && at > now) {
4063
+ localDeadline = mergeAvailabilityDeadline(localDeadline, at);
4064
+ }
4065
+ }
4066
+ if (typeof localDeadline === "number") {
4067
+ const merged = mergeAvailabilityDeadline(summary.nextAvailableAt, localDeadline);
4068
+ if (typeof merged === "number") {
4069
+ summary.nextAvailableAt = merged;
4070
+ }
4071
+ }
4072
+ }
4073
+ return summary;
4074
+ });
4075
+ const discovery = buildAgentDiscoveryResult({
4076
+ agents,
4018
4077
  scope: args?.scope,
4019
4078
  query: args?.query,
4020
4079
  publicOnly: args?.publicOnly,
4021
4080
  showUnavailable: args?.showUnavailable,
4022
- verbose: args?.verbose
4081
+ verbose: args?.verbose,
4082
+ now
4023
4083
  });
4024
4084
  return {
4025
4085
  rawData: {
@@ -18590,7 +18650,7 @@ async function updateDocFunc(args, thunkApi) {
18590
18650
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
18591
18651
  };
18592
18652
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
18593
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-GUGX22ZK.js");
18653
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-3IQO66KQ.js");
18594
18654
  if (getDocState().pageKey === id) {
18595
18655
  applyExternalDocUpdate({
18596
18656
  slateData: finalSlateData,
@@ -18615,7 +18675,7 @@ async function updateDocFunc(args, thunkApi) {
18615
18675
  // packages/ai/tools/updateUserPreferenceProfileTool.ts
18616
18676
  async function dispatchSetSettings(thunkApi, changes) {
18617
18677
  const injectedSetSettings = thunkApi?.extra?.setSettings;
18618
- const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-MH2OF52M.js")).setSettings;
18678
+ const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-YRYNPWJM.js")).setSettings;
18619
18679
  await thunkApi.dispatch(setSettings(changes)).unwrap();
18620
18680
  }
18621
18681
  var updateUserPreferenceProfileFunctionSchema = {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-SYGZQMC2.js";
4
+ } from "./chunk-QHISAEGJ.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-DEOPS4PJ.js";
7
+ } from "./chunk-BUCI6WU4.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-4BBAP7E4.js";
10
+ } from "./chunk-57IPIXV6.js";
11
11
  import {
12
12
  applyToolSurfaceConstraints
13
13
  } from "./chunk-NABJEYPJ.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-6WZQGT5X.js";
17
17
  import {
18
18
  clearCliLocalRuntimePreparedAgentCache
19
- } from "./chunk-SYGZQMC2.js";
19
+ } from "./chunk-QHISAEGJ.js";
20
20
  import {
21
21
  readCredentialAvailability
22
22
  } from "./chunk-HAB2UDLT.js";