nolo-cli 0.199.0-alpha.5 → 0.200.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 (63) hide show
  1. package/{_executeModel-PACAYSHL.js → _executeModel-HSRCREYE.js} +14 -14
  2. package/{agentDeleteCommand-UVYX5GQW.js → agentDeleteCommand-WD4L6CHD.js} +13 -14
  3. package/{agentEmailCommands-T4SMCD7B.js → agentEmailCommands-RCRARCX6.js} +15 -16
  4. package/{agentListCommands-IDKMCTFZ.js → agentListCommands-AW4KBRKW.js} +1 -1
  5. package/{agentMachineCommands-CEWOXRZG.js → agentMachineCommands-DG75JJMT.js} +2 -2
  6. package/{agentRecordCommands-QPT6XNWL.js → agentRecordCommands-DBJ7PFHU.js} +14 -15
  7. package/{agentRunCommand-WWWLS7AJ.js → agentRunCommand-LW4STOVS.js} +15 -16
  8. package/{agentRuntimeLocal-FZQTLBN6.js → agentRuntimeLocal-HEDYPH5T.js} +1 -1
  9. package/{agentSlice-3MHPRAGD.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-OJGZ2YQA.js → chunk-26FOK6BM.js} +8 -8
  17. package/{chunk-TS2LLPTD.js → chunk-2SHLT6JB.js} +55 -3
  18. package/{chunk-ORBOSTB6.js → chunk-2WWLRUH6.js} +15 -19
  19. package/{chunk-ZPLNQ247.js → chunk-4JJTTYHM.js} +3 -3
  20. package/{chunk-PFT6XFSE.js → chunk-54CGZKEH.js} +2 -2
  21. package/{chunk-4BBAP7E4.js → chunk-57IPIXV6.js} +1 -1
  22. package/{chunk-VPYPZFTW.js → chunk-7UVMTDNQ.js} +8 -8
  23. package/{chunk-NFJRJUXP.js → chunk-BUCI6WU4.js} +18 -4
  24. package/{chunk-UXKMBX4C.js → chunk-CJTDTUBE.js} +3 -3
  25. package/{chunk-XFM4TX77.js → chunk-D3G4IT62.js} +1 -1
  26. package/{chunk-ZONJXJ5S.js → chunk-DDIAU5M2.js} +3 -3
  27. package/{chunk-X6LEAM54.js → chunk-JXR5T3IY.js} +7 -7
  28. package/{chunk-O2H2Z7U4.js → chunk-O5V7QQAF.js} +74 -26
  29. package/{chunk-CF7YHEB7.js → chunk-PIIXNP43.js} +2 -2
  30. package/{chunk-BROD7MPO.js → chunk-PMKV3GBE.js} +2 -2
  31. package/{chunk-5JFLYKNV.js → chunk-QHISAEGJ.js} +35 -24
  32. package/{chunk-76OXA55E.js → chunk-QYOB7RVA.js} +80 -2
  33. package/{chunk-KTM3RYQE.js → chunk-SJNMVC4C.js} +1 -1
  34. package/{chunk-INBKVXYL.js → chunk-WOIO46PT.js} +2 -2
  35. package/{chunk-FRRAM6QM.js → chunk-WOKS3DR3.js} +11 -11
  36. package/{chunk-S4PLQODI.js → chunk-XU3J27U3.js} +3 -3
  37. package/{chunk-RHUYPTQX.js → chunk-XXA3W2BH.js} +1 -1
  38. package/{commandRegistry-N7ILYIWH.js → commandRegistry-4LBX2PFC.js} +40 -40
  39. package/{contentThunks-DNE7T3BJ.js → contentThunks-XICRS36V.js} +3 -3
  40. package/{createAgentAutomationAction-WW2P2SDU.js → createAgentAutomationAction-BBUBGJYJ.js} +3 -3
  41. package/{createDialogAction-TWA3N246.js → createDialogAction-B2CBYLGL.js} +4 -4
  42. package/{createPageAction-X6X6CCZC.js → createPageAction-QUJICPHK.js} +3 -3
  43. package/{dialogCommands-VPPMDS7O.js → dialogCommands-W5ONKM73.js} +1 -1
  44. package/{dialogSlice-7ILOCV7V.js → dialogSlice-UYSJR5HB.js} +2 -2
  45. package/{docCreateCommands-RBSXLMXE.js → docCreateCommands-CALJFHEG.js} +1 -1
  46. package/{docDeleteCommands-KNDHZJ5P.js → docDeleteCommands-BY3XHNKC.js} +1 -1
  47. package/{docReadCommands-WOPIYED3.js → docReadCommands-VCYVD633.js} +1 -1
  48. package/{docStore-VTS7RTIZ.js → docStore-3IQO66KQ.js} +1 -1
  49. package/{docUpdateCommands-4QEUPC27.js → docUpdateCommands-7VYCALGI.js} +1 -1
  50. package/{handleSendMessageAction-S725V5PQ.js → handleSendMessageAction-VYVYTTSM.js} +17 -13
  51. package/index.js +3 -3
  52. package/{localRuntimeAdapter-HNFTR3ER.js → localRuntimeAdapter-5PR2IUYX.js} +13 -14
  53. package/{machineCommands-4O3RCS2B.js → machineCommands-5GTYQIF5.js} +14 -15
  54. package/{machineWsRunDispatch-DQCUOPTO.js → machineWsRunDispatch-R4ECVI3J.js} +14 -15
  55. package/package.json +1 -1
  56. package/{readlineWorkspace-KFLQTF4B.js → readlineWorkspace-OEMBKJGV.js} +15 -16
  57. package/{runAgentClientLoop-J2INBHIC.js → runAgentClientLoop-DEL7A5UI.js} +12 -12
  58. package/{settingThunks-MH2OF52M.js → settingThunks-YRYNPWJM.js} +17 -5
  59. package/{spaceCommands-E7DW3KLI.js → spaceCommands-QEZXY2QU.js} +1 -1
  60. package/{streamAgentChatTurn-J3G5PF4P.js → streamAgentChatTurn-HXJLARMT.js} +27 -21
  61. package/{tools-U4K7BZDP.js → tools-SHEXSRPR.js} +9 -9
  62. package/{updateDialogTitleAction-354326I3.js → updateDialogTitleAction-44JI43PI.js} +3 -3
  63. package/chunk-TYQAGKPR.js +0 -57
@@ -1,16 +1,13 @@
1
1
  import {
2
2
  buildStaticUserPolicyContext,
3
3
  resolveSpaceContextPreloadPlan
4
- } from "./chunk-TS2LLPTD.js";
5
- import {
6
- resolveUserPromptSkillPatches
7
- } from "./chunk-TYQAGKPR.js";
4
+ } from "./chunk-2SHLT6JB.js";
8
5
  import {
9
6
  fetchReferenceContents,
10
7
  mergeReferences,
11
8
  resolveReferenceAssets,
12
9
  resolveToolsFromKeys
13
- } from "./chunk-ZONJXJ5S.js";
10
+ } from "./chunk-DDIAU5M2.js";
14
11
  import {
15
12
  UI_CARD_ENVELOPE_MAX_BYTES,
16
13
  getAllToolRuns,
@@ -21,14 +18,14 @@ import {
21
18
  selectSpaceContextLevel,
22
19
  selectUserTonePreset,
23
20
  uiCardFallback
24
- } from "./chunk-NFJRJUXP.js";
21
+ } from "./chunk-BUCI6WU4.js";
25
22
  import {
26
23
  resolveAgentRecommendedSkillNames,
27
24
  resolveAgentRequiredPackIds
28
- } from "./chunk-76OXA55E.js";
25
+ } from "./chunk-QYOB7RVA.js";
29
26
  import {
30
27
  getDocState
31
- } from "./chunk-BROD7MPO.js";
28
+ } from "./chunk-PMKV3GBE.js";
32
29
  import {
33
30
  resolveToolBaseUrl
34
31
  } from "./chunk-MYOH447Z.js";
@@ -40,7 +37,7 @@ import {
40
37
  } from "./chunk-ZBCBFOWC.js";
41
38
  import {
42
39
  getTableState
43
- } from "./chunk-KTM3RYQE.js";
40
+ } from "./chunk-SJNMVC4C.js";
44
41
  import {
45
42
  getCurrentSpaceIdRaw,
46
43
  getViewMode
@@ -49,7 +46,7 @@ import {
49
46
  PERSONALIZATION_DIALOG_CATEGORY,
50
47
  buildPersonalizationDialogPolicyContext,
51
48
  selectAllMsgs
52
- } from "./chunk-VPYPZFTW.js";
49
+ } from "./chunk-7UVMTDNQ.js";
53
50
  import {
54
51
  selectPendingFiles
55
52
  } from "./chunk-OWYYDMGJ.js";
@@ -1482,7 +1479,9 @@ var mergeContexts = (staticCtx, dynamicCtx) => ({
1482
1479
  dialogSummary: dynamicCtx.dialogSummary,
1483
1480
  referenceKeys: dynamicCtx.referenceKeys
1484
1481
  });
1485
- var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools, runtimeOptions, state) => {
1482
+ var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools, runtimeOptions, state, accountSkillRuntime) => {
1483
+ const userSkills = agentConfig.runtimePromptAlreadyInMessages ? null : accountSkillRuntime;
1484
+ const userSkillPromptPatches = userSkills?.skillPromptPatches ?? [];
1486
1485
  const rawBaseTools = Array.isArray(agentConfig.tools) ? agentConfig.tools : [];
1487
1486
  const agentEnabledPacks = resolveAgentRequiredPackIds(agentConfig);
1488
1487
  const isInlineArtifact = isInlineVisualArtifactAgent(agentConfig);
@@ -1496,25 +1495,22 @@ var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools,
1496
1495
  );
1497
1496
  const baseTools = canonicalizeToolNames(expandedPackTools);
1498
1497
  const requiredSkillTools = canonicalizeToolNames(
1499
- agentConfig.referencedTools ?? []
1498
+ [...agentConfig.referencedTools ?? [], ...userSkills?.requiredTools ?? []]
1500
1499
  );
1501
1500
  const recommendedSkillTools = canonicalizeToolNames(
1502
- agentConfig.recommendedSkillTools ?? []
1501
+ [...agentConfig.recommendedSkillTools ?? [], ...userSkills?.recommendedTools ?? []]
1503
1502
  );
1504
1503
  const recommendedSkillHints = [
1505
1504
  .../* @__PURE__ */ new Set([
1506
1505
  ...asNonEmptyStringArray(agentConfig.recommendedSkillHints),
1507
- ...resolveAgentRecommendedSkillNames(agentConfig)
1506
+ ...resolveAgentRecommendedSkillNames(agentConfig),
1507
+ ...userSkills?.recommendedSkillHints ?? []
1508
1508
  ])
1509
1509
  ];
1510
1510
  const skillPromptPatches = [
1511
1511
  .../* @__PURE__ */ new Set([
1512
1512
  ...asNonEmptyStringArray(agentConfig.skillPromptPatches),
1513
- // Server-prepared messages already contain the authenticated preference.
1514
- ...agentConfig.runtimePromptAlreadyInMessages ? [] : resolveUserPromptSkillPatches(
1515
- agentConfig,
1516
- state?.settings?.enabledPromptSkills
1517
- ),
1513
+ ...userSkillPromptPatches,
1518
1514
  // 能力包的 promptPatch(方法论文档)与 skill reference 的 patch 走同一条
1519
1515
  // 注入链(buildSkillGuidanceBlock → buildSkillGuidancePromptBlock),
1520
1516
  // 让「工具 + 配套纪律」作为一个能力包整体注入 system prompt。
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-HS7MLR74.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-ZONJXJ5S.js";
6
+ } from "./chunk-DDIAU5M2.js";
7
7
  import {
8
8
  fetchServerSyncedCredential
9
- } from "./chunk-UXKMBX4C.js";
9
+ } from "./chunk-CJTDTUBE.js";
10
10
  import {
11
11
  buildSkillGuidancePromptBlock
12
- } from "./chunk-O2H2Z7U4.js";
12
+ } from "./chunk-O5V7QQAF.js";
13
13
  import {
14
14
  CREDENTIAL_HYGIENE_RULE,
15
15
  DELETE_SAFETY_RED_LINE,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-FRRAM6QM.js";
3
+ } from "./chunk-WOKS3DR3.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-VPYPZFTW.js";
6
+ } from "./chunk-7UVMTDNQ.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-AKE53VMW.js";
@@ -23152,7 +23152,7 @@ function buildLoadSkillExecutor(args2) {
23152
23152
  const { resolveSkillByName } = await import("./skillDiscovery-F3TMVQOJ.js");
23153
23153
  const resolved = resolveSkillByName(args2.cwd, name);
23154
23154
  if (!resolved) {
23155
- const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-36WIAYXB.js");
23155
+ const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-7RAJP7FD.js");
23156
23156
  const builtin = resolveBuiltinSkillByName(name);
23157
23157
  if (builtin) {
23158
23158
  return {
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-523DITKR.js";
12
12
  import {
13
13
  runLlm
14
- } from "./chunk-UXKMBX4C.js";
14
+ } from "./chunk-CJTDTUBE.js";
15
15
  import {
16
16
  isMediaToolConfirmation
17
17
  } from "./chunk-QYPE3TS3.js";
@@ -11073,7 +11073,7 @@ var messageSlice = createSliceWithThunks({
11073
11073
  runtimeOptions: args.runtimeOptions
11074
11074
  });
11075
11075
  if (agentKeyToUse) {
11076
- const { streamAgentChatTurn } = await import("./agentSlice-3MHPRAGD.js");
11076
+ const { streamAgentChatTurn } = await import("./agentSlice-AKONYC2X.js");
11077
11077
  await dispatch(
11078
11078
  streamAgentChatTurn({
11079
11079
  agentKey: agentKeyToUse,
@@ -13887,7 +13887,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13887
13887
  }
13888
13888
  if (isCurrentDialog) {
13889
13889
  await thunkApi.dispatch(resetMsgs());
13890
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-7ILOCV7V.js");
13890
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-UYSJR5HB.js");
13891
13891
  dispatch(clearPendingAttachments2());
13892
13892
  }
13893
13893
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -13895,15 +13895,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13895
13895
 
13896
13896
  // packages/chat/dialog/dialogSlice.ts
13897
13897
  var runCreateDialogAction = async (args, thunkApi) => {
13898
- const { createDialogAction } = await import("./createDialogAction-TWA3N246.js");
13898
+ const { createDialogAction } = await import("./createDialogAction-B2CBYLGL.js");
13899
13899
  return createDialogAction(args, thunkApi);
13900
13900
  };
13901
13901
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
13902
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-WW2P2SDU.js");
13902
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-BBUBGJYJ.js");
13903
13903
  return createAgentAutomationAction(args, thunkApi);
13904
13904
  };
13905
13905
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
13906
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-354326I3.js");
13906
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-44JI43PI.js");
13907
13907
  return updateDialogTitleAction(args, thunkApi);
13908
13908
  };
13909
13909
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -13927,7 +13927,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
13927
13927
  return setDialogExtraReferencesAction(args, thunkApi);
13928
13928
  };
13929
13929
  var runHandleSendMessageAction = async (args, thunkApi) => {
13930
- const { handleSendMessageAction } = await import("./handleSendMessageAction-S725V5PQ.js");
13930
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-VYVYTTSM.js");
13931
13931
  return handleSendMessageAction(args, thunkApi);
13932
13932
  };
13933
13933
  function clearDialogState() {
@@ -13940,7 +13940,7 @@ var createPageAndAddReference = createAsyncThunk(
13940
13940
  async (payload, { dispatch, getState, rejectWithValue }) => {
13941
13941
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
13942
13942
  try {
13943
- const { createDocState } = await import("./docStore-VTS7RTIZ.js");
13943
+ const { createDocState } = await import("./docStore-3IQO66KQ.js");
13944
13944
  const pageKey = await createDocState(
13945
13945
  { slateData, title },
13946
13946
  { dispatch, getState }
@@ -4,11 +4,12 @@ import {
4
4
  normalizeAgentUpdateFieldList,
5
5
  normalizePolicyLevelSetting,
6
6
  normalizeSystemBuiltinSkills,
7
- normalizeTonePresetSetting
8
- } from "./chunk-76OXA55E.js";
7
+ normalizeTonePresetSetting,
8
+ resolveUserEnabledSkills
9
+ } from "./chunk-QYOB7RVA.js";
9
10
  import {
10
11
  fetchAndCacheTableRows
11
- } from "./chunk-KTM3RYQE.js";
12
+ } from "./chunk-SJNMVC4C.js";
12
13
  import {
13
14
  require_react
14
15
  } from "./chunk-YDH3FDFQ.js";
@@ -114,6 +115,19 @@ function waitForAbortableDelay(ms, signal) {
114
115
  // packages/app/settings/fieldSelectors.ts
115
116
  var selectMaxExecutionTime = (state) => state.settings.maxExecutionTime;
116
117
  var selectGlobalPrompt = (state) => state.settings.globalPrompt;
118
+ var selectEnabledSkills = createSelector(
119
+ [
120
+ (state) => Boolean(
121
+ state.settings && Object.prototype.hasOwnProperty.call(state.settings, "enabledSkills")
122
+ ),
123
+ (state) => state.settings?.enabledSkills,
124
+ (state) => state.settings?.enabledPromptSkills
125
+ ],
126
+ (hasOwnEnabledSkills, enabledSkills, enabledPromptSkills) => {
127
+ const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
128
+ return resolveUserEnabledSkills(preferences);
129
+ }
130
+ );
117
131
  var selectUserTonePreset = (state) => normalizeTonePresetSetting(state.settings.userTonePreset);
118
132
  var selectKnowledgeCaptureLevel = (state) => normalizePolicyLevelSetting(
119
133
  state.settings.knowledgeCaptureLevel,
@@ -449,7 +463,7 @@ var executeToolRun = createAsyncThunk(
449
463
  if (!executionInput) {
450
464
  throw new Error(`ToolRun ${id} has no input to execute with.`);
451
465
  }
452
- const { findToolExecutor } = await import("./tools-U4K7BZDP.js");
466
+ const { findToolExecutor } = await import("./tools-SHEXSRPR.js");
453
467
  const { executor } = findToolExecutor(run.toolName);
454
468
  toolRunStarted({
455
469
  id: run.id,
@@ -458,7 +458,7 @@ var slice = createSliceWithThunks({
458
458
  const overrides = {};
459
459
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
460
460
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
461
- const { _executeModel } = await import("./_executeModel-PACAYSHL.js");
461
+ const { _executeModel } = await import("./_executeModel-HSRCREYE.js");
462
462
  return _executeModel(
463
463
  {
464
464
  isStreaming: args.isStreaming ?? false,
@@ -479,7 +479,7 @@ var slice = createSliceWithThunks({
479
479
  * - 循环直到无工具调用或触发其他运行时停止条件
480
480
  */
481
481
  runAgent: create.asyncThunk(async (args, thunkApi) => {
482
- const { runAgentClientLoop } = await import("./runAgentClientLoop-J2INBHIC.js");
482
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-DEL7A5UI.js");
483
483
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
484
484
  {
485
485
  agentKey: args.agentKey,
@@ -495,7 +495,7 @@ var slice = createSliceWithThunks({
495
495
  * 聊天轮次流式 Agent 调用
496
496
  */
497
497
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
498
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-J3G5PF4P.js");
498
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-HXJLARMT.js");
499
499
  return streamAgentChatTurnHandler(args, thunkApi);
500
500
  }),
501
501
  /**
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-NBTY7YJF.js";
6
6
  import {
7
7
  resolveCliLocalRuntimeKeyCapability
8
- } from "./chunk-FRRAM6QM.js";
8
+ } from "./chunk-WOKS3DR3.js";
9
9
  import {
10
10
  HIGH_RISK_MUTATION_TOOL_NAMES
11
11
  } from "./chunk-NABJEYPJ.js";
@@ -2,7 +2,7 @@ import {
2
2
  clipMultilineText,
3
3
  fetchAndSerializeTable,
4
4
  waitForAbortableDelay
5
- } from "./chunk-NFJRJUXP.js";
5
+ } from "./chunk-BUCI6WU4.js";
6
6
  import {
7
7
  isGatewayHttpStatus
8
8
  } from "./chunk-NF64D32W.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-AGIM7IMJ.js";
22
22
  import {
23
23
  fetchAndCacheMessages
24
- } from "./chunk-VPYPZFTW.js";
24
+ } from "./chunk-7UVMTDNQ.js";
25
25
  import {
26
26
  createSpaceKey
27
27
  } from "./chunk-UAD2WT54.js";
@@ -35,7 +35,7 @@ import {
35
35
  extractRuntimePageCapabilities,
36
36
  resolveBuiltinSkillPage,
37
37
  resolveSkillGraphFromRoots
38
- } from "./chunk-O2H2Z7U4.js";
38
+ } from "./chunk-O5V7QQAF.js";
39
39
  import {
40
40
  isAbortError
41
41
  } from "./chunk-7DPNBQSV.js";
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-PFT6XFSE.js";
8
+ } from "./chunk-54CGZKEH.js";
9
9
  import {
10
10
  CONFIRMATION_INPUT_KEYS,
11
11
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -14,16 +14,16 @@ import {
14
14
  performFetchRequest,
15
15
  sanitizeOutboundMessages,
16
16
  stripModelToolArgs
17
- } from "./chunk-ZPLNQ247.js";
17
+ } from "./chunk-4JJTTYHM.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-FRRAM6QM.js";
21
+ } from "./chunk-WOKS3DR3.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-ZONJXJ5S.js";
26
+ } from "./chunk-DDIAU5M2.js";
27
27
  import {
28
28
  createSSEParser,
29
29
  createToolRunId,
@@ -32,7 +32,7 @@ import {
32
32
  toolRunSetPending,
33
33
  toolRunStarted,
34
34
  toolRunSucceeded
35
- } from "./chunk-NFJRJUXP.js";
35
+ } from "./chunk-BUCI6WU4.js";
36
36
  import {
37
37
  getPublicImageAgentMode
38
38
  } from "./chunk-VIDPVFP3.js";
@@ -45,10 +45,10 @@ import {
45
45
  messageStreaming,
46
46
  toolResultNeedsUserConfirmation,
47
47
  updateToolMessage
48
- } from "./chunk-VPYPZFTW.js";
48
+ } from "./chunk-7UVMTDNQ.js";
49
49
  import {
50
50
  streamAgentChatTurn
51
- } from "./chunk-UXKMBX4C.js";
51
+ } from "./chunk-CJTDTUBE.js";
52
52
  import {
53
53
  addActiveController,
54
54
  removeActiveController,
@@ -76,12 +76,28 @@ var buildIdentifierCandidates = (identifier, contentByKey) => {
76
76
  };
77
77
  async function resolveSkillGraphFromRoots(options) {
78
78
  const contentByKey = new Map(options.contentByKey ?? []);
79
- const requiredTools = /* @__PURE__ */ new Set();
80
- const recommendedTools = /* @__PURE__ */ new Set();
81
- const recommendedSkillHints = /* @__PURE__ */ new Set();
82
- const skillPromptPatches = /* @__PURE__ */ new Set();
83
- const visits = [];
84
- const visited = /* @__PURE__ */ new Set();
79
+ const createContribution = (ancestors) => ({
80
+ requiredTools: /* @__PURE__ */ new Set(),
81
+ recommendedTools: /* @__PURE__ */ new Set(),
82
+ recommendedSkillHints: /* @__PURE__ */ new Set(),
83
+ skillPromptPatches: /* @__PURE__ */ new Set(),
84
+ visits: [],
85
+ visited: new Set(ancestors)
86
+ });
87
+ const contribution = createContribution();
88
+ const strict = options.strictRequiredDependencies === true;
89
+ const blockedRoots = [];
90
+ const mergeContribution = (target, source) => {
91
+ source.requiredTools.forEach((value) => target.requiredTools.add(value));
92
+ source.recommendedTools.forEach((value) => target.recommendedTools.add(value));
93
+ source.recommendedSkillHints.forEach((value) => target.recommendedSkillHints.add(value));
94
+ source.skillPromptPatches.forEach((value) => target.skillPromptPatches.add(value));
95
+ for (const visit2 of source.visits) {
96
+ const key = `${visit2.mode}:${visit2.dbKey}`;
97
+ if (!target.visited.has(key)) target.visits.push(visit2);
98
+ target.visited.add(key);
99
+ }
100
+ };
85
101
  const loadPageCached = async (identifier) => {
86
102
  const resolvedIdentifier = buildIdentifierCandidates(identifier, contentByKey);
87
103
  if (!resolvedIdentifier) return null;
@@ -97,17 +113,22 @@ async function resolveSkillGraphFromRoots(options) {
97
113
  }
98
114
  return page ?? null;
99
115
  };
100
- const visit = async (identifier, mode, sourceLabel) => {
116
+ const visit = async (identifier, mode, sourceLabel, target, path = []) => {
101
117
  const page = await loadPageCached(identifier);
102
- if (!page?.dbKey) return;
103
- const visitKey = `${mode}:${page.dbKey}`;
104
- if (visited.has(visitKey)) return;
105
- visited.add(visitKey);
118
+ if (!page?.dbKey) return strict ? [{ path: [...path, identifier], reason: "missing" }] : [];
106
119
  const meta = resolvePageSkillMetadata(page);
120
+ const canonicalIdentifier = asOptionalTrimmedString(meta?.skillConfig?.id) ?? page.dbKey;
121
+ const nextPath = [...path, canonicalIdentifier];
122
+ if (options.admitSkill && !await options.admitSkill(page, canonicalIdentifier)) {
123
+ return strict ? [{ path: nextPath, reason: "denied" }] : [];
124
+ }
125
+ const visitKey = `${mode}:${page.dbKey}`;
126
+ if (target.visited.has(visitKey)) return [];
127
+ target.visited.add(visitKey);
107
128
  const directTools = canonicalizeToolNames(page.tools ?? []);
108
129
  const skillTools = canonicalizeToolNames(meta?.skillConfig?.toolNames ?? []);
109
130
  const mergedTools = joinUniqueStrings(directTools, skillTools);
110
- visits.push({
131
+ target.visits.push({
111
132
  dbKey: page.dbKey,
112
133
  title: page.title,
113
134
  mode,
@@ -115,33 +136,60 @@ async function resolveSkillGraphFromRoots(options) {
115
136
  meta
116
137
  });
117
138
  if (mode === "required") {
118
- mergedTools.forEach((toolName) => requiredTools.add(toolName));
139
+ mergedTools.forEach((toolName) => target.requiredTools.add(toolName));
119
140
  if (meta?.skillConfig?.promptPatch) {
120
- skillPromptPatches.add(meta.skillConfig.promptPatch);
141
+ target.skillPromptPatches.add(meta.skillConfig.promptPatch);
121
142
  }
122
143
  } else {
123
- mergedTools.forEach((toolName) => recommendedTools.add(toolName));
144
+ mergedTools.forEach((toolName) => target.recommendedTools.add(toolName));
124
145
  if (meta?.skillConfig?.name) {
125
- recommendedSkillHints.add(meta.skillConfig.name);
146
+ target.recommendedSkillHints.add(meta.skillConfig.name);
126
147
  }
127
148
  }
128
149
  const nextHard = meta?.requiredSkills ?? meta?.skillConfig?.requiredSkills ?? [];
129
150
  const nextSoft = meta?.recommendedSkills ?? meta?.skillConfig?.recommendedSkills ?? [];
151
+ if (strict) {
152
+ const failures = (await Promise.all(nextHard.map(
153
+ (childKey) => visit(childKey, mode, page.dbKey, target, nextPath)
154
+ ))).flat();
155
+ await Promise.all(nextSoft.map(async (childKey) => {
156
+ const branch = createContribution(target.visited);
157
+ const branchFailures = await visit(childKey, "recommended", page.dbKey, branch, nextPath);
158
+ if (branchFailures.length === 0) mergeContribution(target, branch);
159
+ }));
160
+ return failures;
161
+ }
130
162
  if (mode === "required") {
131
- await Promise.all(nextHard.map((childKey) => visit(childKey, "required", page.dbKey)));
132
- await Promise.all(nextSoft.map((childKey) => visit(childKey, "recommended", page.dbKey)));
133
- return;
163
+ await Promise.all(nextHard.map((childKey) => visit(childKey, "required", page.dbKey, target)));
164
+ await Promise.all(nextSoft.map((childKey) => visit(childKey, "recommended", page.dbKey, target)));
165
+ return [];
134
166
  }
135
- await Promise.all([...nextHard, ...nextSoft].map((childKey) => visit(childKey, "recommended", page.dbKey)));
167
+ await Promise.all([...nextHard, ...nextSoft].map((childKey) => visit(childKey, "recommended", page.dbKey, target)));
168
+ return [];
136
169
  };
137
- await Promise.all(options.roots.map((root) => visit(root.identifier, root.mode, root.sourceLabel)));
170
+ if (strict) {
171
+ const results = await Promise.all(options.roots.map(async (root) => {
172
+ const target = createContribution();
173
+ const failures = await visit(root.identifier, root.mode, root.sourceLabel, target);
174
+ return { root, target, failures };
175
+ }));
176
+ for (const { root, target, failures } of results) {
177
+ if (failures.length > 0) blockedRoots.push(...failures.map((failure) => ({ root, ...failure })));
178
+ else mergeContribution(contribution, target);
179
+ }
180
+ } else {
181
+ await Promise.all(options.roots.map(
182
+ (root) => visit(root.identifier, root.mode, root.sourceLabel, contribution)
183
+ ));
184
+ }
138
185
  return {
139
- requiredTools: Array.from(requiredTools),
140
- recommendedTools: Array.from(recommendedTools),
141
- recommendedSkillHints: Array.from(recommendedSkillHints),
142
- skillPromptPatches: Array.from(skillPromptPatches),
186
+ requiredTools: Array.from(contribution.requiredTools),
187
+ recommendedTools: Array.from(contribution.recommendedTools),
188
+ recommendedSkillHints: Array.from(contribution.recommendedSkillHints),
189
+ skillPromptPatches: Array.from(contribution.skillPromptPatches),
143
190
  contentByKey,
144
- visits
191
+ visits: contribution.visits,
192
+ ...strict ? { blockedRoots } : {}
145
193
  };
146
194
  }
147
195
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-ZONJXJ5S.js";
4
+ } from "./chunk-DDIAU5M2.js";
5
5
  import {
6
6
  updateTokensAction
7
- } from "./chunk-VPYPZFTW.js";
7
+ } from "./chunk-7UVMTDNQ.js";
8
8
  import {
9
9
  applyUpdateTokensFulfilled
10
10
  } from "./chunk-OWYYDMGJ.js";
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
333
333
  ).unwrap();
334
334
  if (dbSpaceId) {
335
335
  try {
336
- const { updateContentTitle } = await import("./contentThunks-DNE7T3BJ.js");
336
+ const { updateContentTitle } = await import("./contentThunks-XICRS36V.js");
337
337
  await dispatch(
338
338
  updateContentTitle({
339
339
  spaceId: dbSpaceId,
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
372
372
  }
373
373
  }
374
374
  async function createDocState(args, thunkApi) {
375
- const { createPageAction } = await import("./createPageAction-X6X6CCZC.js");
375
+ const { createPageAction } = await import("./createPageAction-QUJICPHK.js");
376
376
  return createPageAction(args, thunkApi);
377
377
  }
378
378
  function subscribe(listener) {