nolo-cli 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/agent-runtime/dialogWritePlan.ts +39 -0
- package/agent-runtime/hostAdapter.ts +4 -0
- package/agent-runtime/hybridRecordStore.ts +5 -3
- package/agent-runtime/index.ts +15 -0
- package/agent-runtime/localLoop.ts +87 -7
- package/agent-runtime/localToolPolicy.ts +2 -13
- package/agent-runtime/localWorkspaceTools.ts +42 -110
- package/agent-runtime/runtimeToolPolicy.ts +2 -11
- package/agent-runtime/runtimeToolSurface.ts +198 -0
- package/agent-runtime/types.ts +1 -0
- package/agentAliases.ts +2 -1
- package/agentRunCommand.ts +10 -32
- package/agentRuntimeLocal.ts +1 -0
- package/ai/agent/_executeModel.ts +146 -0
- package/ai/agent/agentSlice.ts +556 -1
- package/ai/agent/appWorkingMemory.ts +126 -0
- package/ai/agent/buildEditingContext.ts +378 -0
- package/ai/agent/buildSystemPrompt.ts +585 -0
- package/ai/agent/canvasEditingContext.ts +49 -0
- package/ai/agent/cleanAgentMessages.ts +140 -0
- package/ai/agent/cliChatClient.ts +153 -0
- package/ai/agent/cliExecutor.ts +314 -40
- package/ai/agent/contextCompiler.ts +107 -0
- package/ai/agent/contextLayerContract.ts +44 -0
- package/ai/agent/createAgentSchema.ts +272 -0
- package/ai/agent/currentTimeContext.ts +65 -0
- package/ai/agent/executeToolCall.ts +58 -0
- package/ai/agent/fetchAgentContexts.ts +42 -0
- package/ai/agent/generatePrompt.ts +3 -0
- package/ai/agent/getFullChatContextKeys.ts +168 -0
- package/ai/agent/guidedCreation/capabilities.ts +84 -0
- package/ai/agent/guidedCreation/types.ts +38 -0
- package/ai/agent/isLiveAudioOnlyAgent.ts +26 -0
- package/ai/agent/liveAudioModel.ts +2 -0
- package/ai/agent/pageBuilderHandoffRules.ts +75 -0
- package/ai/agent/persistMessageWithFixedId.ts +37 -0
- package/ai/agent/planSlice.ts +259 -0
- package/ai/agent/referenceUtils.ts +229 -0
- package/ai/agent/runAgentBackground.ts +310 -0
- package/ai/agent/runAgentClientLoop.ts +164 -0
- package/ai/agent/runtimeGuidance.ts +116 -0
- package/ai/agent/serverOrigin.ts +7 -0
- package/ai/agent/startParallelAgentStreams.ts +424 -0
- package/ai/agent/startupProtocol.ts +53 -0
- package/ai/agent/streamAgentChatTurn.ts +2001 -0
- package/ai/agent/streamAgentChatTurnUtils.ts +860 -0
- package/ai/agent/toolFailureGuard.ts +99 -0
- package/ai/agent/types.ts +73 -0
- package/ai/agent/utils/imageOutput.ts +37 -0
- package/ai/agent/utils/publicImageAgentMode.ts +26 -0
- package/ai/ai.locale.ts +1095 -0
- package/ai/chat/accumulateToolCallChunks.ts +126 -0
- package/ai/chat/fetchUtils.ts +143 -0
- package/ai/chat/inlineImageUrlsForCustomProvider.ts +117 -0
- package/ai/chat/parseApiError.ts +67 -0
- package/ai/chat/parseMultilineSSE.ts +95 -0
- package/ai/chat/sendOpenAICompletionsRequest.ts +897 -0
- package/ai/chat/sendOpenAIResponseRequest.ts +720 -0
- package/ai/chat/serverProxyRetry.ts +102 -0
- package/ai/chat/shouldUseServerProxy.ts +18 -0
- package/ai/chat/streamRetry.ts +46 -0
- package/ai/chat/updateTotalUsage.ts +89 -0
- package/ai/context/buildReferenceContext.ts +437 -0
- package/ai/context/retention.ts +165 -0
- package/ai/context/tokenUtils.ts +78 -0
- package/ai/llm/agentCapabilities.ts +74 -0
- package/ai/llm/deepinfra.ts +79 -0
- package/ai/llm/fireworks.ts +68 -0
- package/ai/llm/generateRequestBody.ts +165 -0
- package/ai/llm/getModelContextWindow.ts +93 -0
- package/ai/llm/getPricing.ts +252 -0
- package/ai/llm/imagePricing.ts +66 -0
- package/ai/llm/isResponseAPIModel.ts +13 -0
- package/ai/llm/kimi.ts +23 -0
- package/ai/llm/mimo.ts +99 -0
- package/ai/llm/mistral.ts +21 -0
- package/ai/llm/models.ts +45 -0
- package/ai/llm/openrouterModels.ts +6 -0
- package/ai/llm/providers.ts +313 -0
- package/ai/llm/reasoningModels.ts +27 -0
- package/ai/llm/types.ts +82 -0
- package/ai/llm/usageRequestOptions.ts +59 -0
- package/ai/memory/queryShared.ts +161 -0
- package/ai/memory/recentRelationshipRecap.ts +247 -0
- package/ai/memory/remember.ts +167 -0
- package/ai/memory/store.ts +20 -0
- package/ai/memory/storeShared.ts +76 -0
- package/ai/memory/types.ts +46 -0
- package/ai/memory/understanding.ts +349 -0
- package/ai/memory/understandingGreeting.ts +264 -0
- package/ai/policy/personalizationDialog.ts +333 -0
- package/ai/policy/runtimePolicy.ts +454 -0
- package/ai/policy/selfUpdateFields.ts +48 -0
- package/ai/policy/types.ts +64 -0
- package/ai/skills/referenceRuntime.ts +274 -0
- package/ai/skills/skillDiagnostics.ts +251 -0
- package/ai/skills/skillDocBuilder.ts +139 -0
- package/ai/skills/skillSummaryMarker.ts +26 -0
- package/ai/token/calculatePrice.ts +576 -0
- package/ai/token/missingUsageEstimate.ts +42 -0
- package/ai/token/normalizeUsage.ts +124 -0
- package/ai/token/openaiImageGenerationUsage.ts +56 -0
- package/ai/token/prepareTokenUsageData.ts +93 -0
- package/ai/token/resolveBillingTarget.ts +52 -0
- package/ai/token/saveTokenRecord.ts +53 -0
- package/ai/token/types.ts +103 -0
- package/ai/tools/agent/agentTools.ts +235 -0
- package/ai/tools/agent/agentUpdateShared.ts +311 -0
- package/ai/tools/agent/callAgentTool.ts +139 -0
- package/ai/tools/agent/createAgentTool.ts +512 -0
- package/ai/tools/agent/createDialogTool.ts +69 -0
- package/ai/tools/agent/createSkillAgentTool.ts +62 -0
- package/ai/tools/agent/parallelBudget.ts +221 -0
- package/ai/tools/agent/prepareAgentDraftTool.ts +159 -0
- package/ai/tools/agent/presets/appBuilderPreset.ts +154 -0
- package/ai/tools/agent/runLlmTool.ts +96 -0
- package/ai/tools/agent/runStreamingAgentTool.ts +73 -0
- package/ai/tools/agent/skillAgentArgs.ts +106 -0
- package/ai/tools/agent/startAgentDialogTool.ts +53 -0
- package/ai/tools/agent/streamParallelAgentsTool.ts +123 -0
- package/ai/tools/agent/updateAgentTool.ts +96 -0
- package/ai/tools/agent/updateSelfTool.ts +113 -0
- package/ai/tools/amazonProductScraperTool.ts +86 -0
- package/ai/tools/apifyActorClient.ts +45 -0
- package/ai/tools/appEditGuard.ts +372 -0
- package/ai/tools/appReadSnapshot.ts +153 -0
- package/ai/tools/appTools.ts +1549 -0
- package/ai/tools/applyEditTool.ts +259 -0
- package/ai/tools/applyLineEditsTool.ts +315 -0
- package/ai/tools/browserTools/click.ts +33 -0
- package/ai/tools/browserTools/closeSession.ts +29 -0
- package/ai/tools/browserTools/common.ts +27 -0
- package/ai/tools/browserTools/openSession.ts +48 -0
- package/ai/tools/browserTools/readContent.ts +38 -0
- package/ai/tools/browserTools/selectOption.ts +46 -0
- package/ai/tools/browserTools/typeText.ts +42 -0
- package/ai/tools/category/createCategoryTool.ts +66 -0
- package/ai/tools/category/queryContentsByCategoryTool.ts +69 -0
- package/ai/tools/category/updateContentCategoryTool.ts +75 -0
- package/ai/tools/cfBrowserTools.ts +319 -0
- package/ai/tools/cfSpeechToTextTool.ts +49 -0
- package/ai/tools/checkEnvTool.ts +102 -0
- package/ai/tools/cloudflareCrawlTool.ts +289 -0
- package/ai/tools/codeSearchTool.ts +123 -0
- package/ai/tools/codeTools.ts +101 -0
- package/ai/tools/convertMarxistsBookTool.ts +103 -0
- package/ai/tools/createDocTool.ts +132 -0
- package/ai/tools/createSkillDocTool.ts +155 -0
- package/ai/tools/createWorkflowTool.ts +154 -0
- package/ai/tools/delayTool.ts +31 -0
- package/ai/tools/deleteSpacesTool.ts +325 -0
- package/ai/tools/deleteSpacesToolModel.ts +159 -0
- package/ai/tools/devReloadUtils.ts +29 -0
- package/ai/tools/dialogMessageSearch.ts +137 -0
- package/ai/tools/doctorSkillTool.ts +72 -0
- package/ai/tools/ecommerceScraperTool.ts +86 -0
- package/ai/tools/emailTools.ts +549 -0
- package/ai/tools/evalSkillTool.ts +92 -0
- package/ai/tools/exaSearchTool.ts +63 -0
- package/ai/tools/execShellTool.ts +266 -0
- package/ai/tools/executeSqlTool.ts +192 -0
- package/ai/tools/fetchWebpageSupport.ts +333 -0
- package/ai/tools/fetchWebpageTool.ts +97 -0
- package/ai/tools/geminiImagePreviewTool.ts +386 -0
- package/ai/tools/generateDocxTool.ts +215 -0
- package/ai/tools/googleSearchScraperTool.ts +106 -0
- package/ai/tools/importDataTool.ts +133 -0
- package/ai/tools/importSkillTool.ts +162 -0
- package/ai/tools/index.ts +2308 -0
- package/ai/tools/jdProductScraperTool.ts +821 -0
- package/ai/tools/listUserSpacesTool.ts +113 -0
- package/ai/tools/localFilesTool.ts +276 -0
- package/ai/tools/marxistsOfflineBook.ts +253 -0
- package/ai/tools/modelUsageTools.ts +206 -0
- package/ai/tools/noloWorkspaceReadTools.ts +467 -0
- package/ai/tools/olmOcrTool.ts +33 -0
- package/ai/tools/openaiImageTool.ts +267 -0
- package/ai/tools/prepareTools.ts +23 -0
- package/ai/tools/readDocTool.ts +88 -0
- package/ai/tools/readFileTool.ts +214 -0
- package/ai/tools/readTool.ts +194 -0
- package/ai/tools/readXPostTool.ts +229 -0
- package/ai/tools/readXhsProfileTool.ts +627 -0
- package/ai/tools/rememberMemoryTool.ts +84 -0
- package/ai/tools/remotionVideoTool.ts +151 -0
- package/ai/tools/searchDialogMessagesTool.ts +222 -0
- package/ai/tools/searchWorkspaceTool.ts +259 -0
- package/ai/tools/skillFollowup.ts +86 -0
- package/ai/tools/surfWeatherTool.ts +169 -0
- package/ai/tools/table/addTableRowTool.ts +217 -0
- package/ai/tools/table/createTableTool.ts +315 -0
- package/ai/tools/table/rowTools.ts +386 -0
- package/ai/tools/table/schemaTools.ts +244 -0
- package/ai/tools/table/shareTableTool.ts +148 -0
- package/ai/tools/table/toolShared.ts +129 -0
- package/ai/tools/taobaoTmallProductScraperTool.ts +49 -0
- package/ai/tools/toolApiClient.ts +279 -0
- package/ai/tools/toolResultError.ts +42 -0
- package/ai/tools/toolRunSlice.ts +303 -0
- package/ai/tools/toolSchemaCompatibility.ts +53 -0
- package/ai/tools/uiAskChoiceTool.ts +104 -0
- package/ai/tools/updateContentTitleTool.ts +84 -0
- package/ai/tools/updateDocTool.ts +105 -0
- package/ai/tools/updateUserPreferenceProfileTool.ts +153 -0
- package/ai/tools/wereadGatewayTool.ts +152 -0
- package/ai/tools/whisperTool.ts +76 -0
- package/ai/tools/writeFileTool.ts +213 -0
- package/ai/tools/youtubeScraperTool.ts +116 -0
- package/ai/tools/ziweiChartTool.ts +678 -0
- package/ai/types.ts +55 -0
- package/ai/workflow/workflowExecutor.ts +323 -0
- package/ai/workflow/workflowSlice.ts +73 -0
- package/ai/workflow/workflowTypes.ts +106 -0
- package/app/actions/syncAppRecord.ts +73 -0
- package/app/constants/animationSets.ts +21 -0
- package/app/constants/appEditor.ts +99 -0
- package/app/favorite/favoriteSlice.ts +690 -0
- package/app/favorite/type.ts +43 -0
- package/app/hooks/deleteDbKey.ts +233 -0
- package/app/i18n/client.ts +13 -0
- package/app/i18n/i18n.base.ts +14 -0
- package/app/i18n/i18n.config.ts +77 -0
- package/app/i18n/index.ts +15 -0
- package/app/i18n/mapLanguage.ts +11 -0
- package/app/i18n/translations/appBuilder.locale.ts +453 -0
- package/app/i18n/translations/error.locale.ts +246 -0
- package/app/i18n/translations/interface.locale.ts +2174 -0
- package/app/i18n/translations/pricing.locale.ts +397 -0
- package/app/i18n/translations/privacy.locale.ts +168 -0
- package/app/i18n/translations/seo.locale.ts +129 -0
- package/app/i18n/translations/terms.locale.ts +124 -0
- package/app/i18n/types.ts +6 -0
- package/app/notifications/model.ts +77 -0
- package/app/notifications/notificationSlice.ts +141 -0
- package/app/reducer.ts +36 -0
- package/app/settings/dbActionThunks.ts +34 -0
- package/app/settings/defaultSpacePreference.ts +87 -0
- package/app/settings/settingSlice.tsx +1212 -0
- package/app/settings/settingsRecord.ts +8 -0
- package/app/stateViews/runtime.ts +90 -0
- package/app/store.ts +55 -0
- package/app/theme/colors.ts +280 -0
- package/app/theme/fontPreference.ts +77 -0
- package/app/theme/theme.config.ts +120 -0
- package/app/theme/themeModeBootstrap.ts +123 -0
- package/app/types/appSummary.ts +114 -0
- package/app/types.ts +358 -0
- package/app/utils/appKeys.ts +55 -0
- package/app/utils/async.ts +28 -0
- package/app/utils/desktopAgentRuntimeTurnClient.ts +73 -0
- package/app/utils/env.ts +17 -0
- package/app/utils/fileUtils.ts +229 -0
- package/app/utils/imageUtils.ts +274 -0
- package/app/utils/myContentItems.ts +289 -0
- package/app/utils/retryAfter.ts +36 -0
- package/app/utils/retryFetch.ts +61 -0
- package/app/utils/toast.ts +3 -0
- package/auth/action/signUpAction.ts +227 -0
- package/auth/adminPermissions.ts +18 -0
- package/auth/authSlice.ts +531 -0
- package/auth/client/loginRequest.ts +14 -0
- package/auth/resetAuthScopedClientState.ts +27 -0
- package/auth/routes.ts +178 -0
- package/auth/token.ts +63 -0
- package/auth/types.ts +40 -0
- package/chat/chat.locale.ts +813 -0
- package/chat/dialog/actions/addCybotAction.ts +52 -0
- package/chat/dialog/actions/addReferenceKeysAction.ts +62 -0
- package/chat/dialog/actions/builtinDialogLlm.ts +35 -0
- package/chat/dialog/actions/cleanupCliSession.ts +40 -0
- package/chat/dialog/actions/createDialogAction.ts +379 -0
- package/chat/dialog/actions/createScheduledTaskAction.ts +78 -0
- package/chat/dialog/actions/handleSendMessageAction.ts +197 -0
- package/chat/dialog/actions/handleSendMessageResolver.ts +27 -0
- package/chat/dialog/actions/removeCybotAction.ts +6 -0
- package/chat/dialog/actions/removeDialogAgentAction.ts +44 -0
- package/chat/dialog/actions/replacePrimaryCybotAction.ts +6 -0
- package/chat/dialog/actions/setPrimaryDialogAgentAction.ts +52 -0
- package/chat/dialog/actions/updateDialogSummaryAction.ts +430 -0
- package/chat/dialog/actions/updateDialogTitleAction.ts +151 -0
- package/chat/dialog/actions/updateDialogTitlePolicy.ts +30 -0
- package/chat/dialog/actions/updateTokensAction.ts +233 -0
- package/chat/dialog/dialogAgents.ts +72 -0
- package/chat/dialog/dialogSlice.ts +872 -0
- package/chat/dialog/dialogTitle.ts +81 -0
- package/chat/dialog/dialogTokenStats.ts +12 -0
- package/chat/dialog/dialogUrl.ts +6 -0
- package/chat/dialog/goal.ts +108 -0
- package/chat/dialog/objectAssistantRegistry.ts +286 -0
- package/chat/dialog/schedule.ts +17 -0
- package/chat/messages/fetchAndCacheMessages.ts +119 -0
- package/chat/messages/fetchConvMsgs.ts +51 -0
- package/chat/messages/fileUrl.ts +13 -0
- package/chat/messages/messageAgent.ts +8 -0
- package/chat/messages/messageContent.ts +199 -0
- package/chat/messages/messageContract.ts +88 -0
- package/chat/messages/messageSlice.ts +1367 -0
- package/chat/messages/toolThunks.ts +625 -0
- package/cli/agentAliases.ts +2 -1
- package/cli/agentRunCommand.ts +10 -32
- package/cli/agentRuntimeLocal.ts +1 -0
- package/cli/client/agentRun.ts +67 -95
- package/cli/client/localRuntimeAdapter.ts +323 -54
- package/cli/commandRegistry.ts +2 -2
- package/cli/machineWsRunDispatch.ts +51 -6
- package/cli/offlineMarxistsAgentCommand.ts +6 -4
- package/client/agentConfigResolver.test.ts +2 -2
- package/client/agentRun.test.ts +175 -57
- package/client/agentRun.ts +67 -95
- package/client/localRuntimeAdapter.test.ts +682 -37
- package/client/localRuntimeAdapter.ts +323 -54
- package/client/localRuntimeDryRun.test.ts +23 -9
- package/client/localToolPolicy.test.ts +4 -4
- package/commandRegistry.ts +2 -2
- package/core/builtinAgents.ts +209 -0
- package/core/config.ts +15 -0
- package/core/crypto.ts +51 -0
- package/core/generateKeyPairFromSeedV1.ts +15 -0
- package/core/generateMainKey.ts +22 -0
- package/core/init.ts +41 -0
- package/core/localOrigins.ts +8 -0
- package/core/password.ts +13 -0
- package/core/prefix.ts +23 -0
- package/create/editor/transforms/fromMarkdown/index.ts +260 -0
- package/create/editor/transforms/fromMarkdown/inline.ts +285 -0
- package/create/editor/transforms/fromMarkdown/table.ts +130 -0
- package/create/editor/transforms/markdownToSlate.ts +24 -0
- package/create/editor/transforms/slateToRenderMarkdown.ts +218 -0
- package/create/editor/transforms/slateToSimplifiedMarkdown.ts +224 -0
- package/create/editor/transforms/slateToText.ts +33 -0
- package/create/editor/utils/slateUtils.ts +233 -0
- package/create/space/addSpaceAction.ts +193 -0
- package/create/space/category/categoryActions.ts +427 -0
- package/create/space/changeSpaceAction.ts +36 -0
- package/create/space/constants.ts +8 -0
- package/create/space/content/addContentAction.ts +116 -0
- package/create/space/content/contentThunks.ts +90 -0
- package/create/space/content/deleteContentFromSpaceAction.ts +187 -0
- package/create/space/content/deleteMultipleContentAction.ts +112 -0
- package/create/space/content/moveContentAction.ts +285 -0
- package/create/space/content/updateContentCategoryAction.ts +154 -0
- package/create/space/content/updateContentTitleAction.ts +151 -0
- package/create/space/content/uploadAndAddFileToSpaceAction.ts +98 -0
- package/create/space/contentKeyUtils.ts +117 -0
- package/create/space/deleteSpaceAction.ts +276 -0
- package/create/space/fetchSpaceAction.ts +70 -0
- package/create/space/fetchSpaceSidebarStateAction.ts +26 -0
- package/create/space/loadDefaultSpaceAction.ts +57 -0
- package/create/space/member/addMemberAction.ts +79 -0
- package/create/space/member/fetchUserSpaceMembershipsAction.ts +386 -0
- package/create/space/member/memberThunks.ts +47 -0
- package/create/space/member/removeMemberAction.ts +67 -0
- package/create/space/resolvePreferredSpaceId.ts +113 -0
- package/create/space/sidebarVisibleTypes.ts +241 -0
- package/create/space/space.locale.ts +1087 -0
- package/create/space/spaceAccess.ts +182 -0
- package/create/space/spaceCollapsedState.ts +54 -0
- package/create/space/spaceKeys.ts +65 -0
- package/create/space/spaceSlice.ts +328 -0
- package/create/space/spaceThunks.ts +410 -0
- package/create/space/types.ts +27 -0
- package/create/space/updateSpaceAction.ts +107 -0
- package/create/space/utils/permissions.ts +47 -0
- package/create/types.ts +21 -0
- package/database/actions/agentReadResolution.ts +33 -0
- package/database/actions/common.ts +243 -0
- package/database/actions/deleteFile.ts +40 -0
- package/database/actions/fileContent.ts +125 -0
- package/database/actions/patch.ts +155 -0
- package/database/actions/read.ts +358 -0
- package/database/actions/readAndWait.ts +260 -0
- package/database/actions/readRequestManager.ts +120 -0
- package/database/actions/readResolution.ts +125 -0
- package/database/actions/remove.ts +94 -0
- package/database/actions/replication.ts +477 -0
- package/database/actions/upload.ts +186 -0
- package/database/actions/upsert.ts +56 -0
- package/database/actions/write.ts +146 -0
- package/database/authority/ownerKey.ts +80 -0
- package/database/authority/recordAuthority.ts +67 -0
- package/database/authority/userAuthorityRegistry.ts +54 -0
- package/database/client/fetchUserData.ts +61 -0
- package/database/dbActionThunks.ts +1 -0
- package/database/dbSlice.ts +149 -0
- package/database/fileRing.ts +51 -0
- package/database/fileStorage.ts +232 -0
- package/database/fileUrl.ts +34 -0
- package/database/keys.ts +767 -0
- package/database/queryPrefixes.ts +14 -0
- package/database/requests.ts +443 -0
- package/database/runtimeServerContext.ts +54 -0
- package/database/server/levelAuthorityStore.ts +20 -1
- package/database/tenantPlacement.ts +57 -0
- package/database/userPreferenceRegister.ts +131 -0
- package/database/utils/ulid.ts +1 -0
- package/integrations/anthropic/anthropicModels.ts +47 -0
- package/integrations/deepseek/models.ts +37 -0
- package/integrations/google/models.ts +341 -0
- package/integrations/openai/chatCompletionStreamMode.ts +10 -0
- package/integrations/openai/filterAndCleanMessages.ts +284 -0
- package/integrations/openai/flexTier.ts +102 -0
- package/integrations/openai/generateOpenAIRequestBody.ts +274 -0
- package/integrations/openai/generateResponseRequestBody.ts +77 -0
- package/integrations/openai/models.ts +271 -0
- package/integrations/openai/providerBodyCompatibility.ts +23 -0
- package/integrations/openai/responsesHelpers.ts +297 -0
- package/integrations/x-reader/types.ts +109 -0
- package/integrations/xai/models.ts +13 -0
- package/integrations/xhs-reader/analyze/profileAnalyzer.ts +205 -0
- package/integrations/xhs-reader/backends/playwrightProfileCollector.ts +624 -0
- package/integrations/xhs-reader/bridge/readXhsProfileWithBridge.ts +227 -0
- package/integrations/xhs-reader/client/xhsWebApiClient.ts +229 -0
- package/integrations/xhs-reader/normalize.ts +390 -0
- package/integrations/xhs-reader/orchestrator.ts +178 -0
- package/integrations/xhs-reader/redaction.ts +68 -0
- package/integrations/xhs-reader/types.ts +244 -0
- package/integrations/xhs-reader/url.ts +57 -0
- package/machineWsRunDispatch.ts +51 -6
- package/offlineMarxistsAgentCommand.ts +6 -4
- package/package.json +430 -3
- package/render/page/createPageAction.ts +183 -0
- package/render/page/docSlice.ts +468 -0
- package/render/page/types.ts +17 -0
- package/render/table/createTableAction.ts +270 -0
- package/render/table/deleteTableAction.ts +193 -0
- package/render/table/fetchAndCacheTableRows.ts +174 -0
- package/render/table/tableSlice.ts +1106 -0
- package/render/table/toolValueUtils.ts +363 -0
- package/render/table/types.ts +252 -0
- package/render/table/utils/tableSerialization.ts +50 -0
- package/server/handlers/agentRun/types.ts +104 -0
- package/share/action.ts +225 -0
- package/share/helpers.ts +302 -0
- package/share/keys.ts +243 -0
- package/share/publicSharePolicy.ts +27 -0
- package/share/shareSlice.ts +53 -0
- package/share/types.ts +100 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nolo-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-first terminal workspace for Nolo",
|
|
6
6
|
"bin": {
|
|
@@ -156,6 +156,7 @@
|
|
|
156
156
|
"agent-runtime/runtimeToolPolicy.ts",
|
|
157
157
|
"agent-runtime/hostAdapter.ts",
|
|
158
158
|
"agent-runtime/types.ts",
|
|
159
|
+
"agent-runtime/runtimeToolSurface.ts",
|
|
159
160
|
"agent-runtime/agentConfigOptions.ts",
|
|
160
161
|
"agent-runtime/openAiCompatibleProvider.ts",
|
|
161
162
|
"agent-runtime/openAiCompatibleProviderConfig.ts",
|
|
@@ -183,18 +184,420 @@
|
|
|
183
184
|
"database/server/levelAuthorityStore.ts",
|
|
184
185
|
"database/server/legacyServerDb.ts",
|
|
185
186
|
"database/server/cliAuthorityBrokerTypes.ts",
|
|
187
|
+
"database/actions/common.ts",
|
|
188
|
+
"database/keys.ts",
|
|
189
|
+
"database/userPreferenceRegister.ts",
|
|
190
|
+
"database/dbActionThunks.ts",
|
|
191
|
+
"database/dbSlice.ts",
|
|
192
|
+
"database/actions/remove.ts",
|
|
193
|
+
"database/actions/read.ts",
|
|
194
|
+
"database/actions/readAndWait.ts",
|
|
195
|
+
"database/actions/write.ts",
|
|
196
|
+
"database/actions/patch.ts",
|
|
197
|
+
"database/actions/upsert.ts",
|
|
198
|
+
"database/actions/upload.ts",
|
|
199
|
+
"database/actions/fileContent.ts",
|
|
200
|
+
"database/requests.ts",
|
|
201
|
+
"database/runtimeServerContext.ts",
|
|
202
|
+
"database/fileStorage.ts",
|
|
203
|
+
"database/authority/userAuthorityRegistry.ts",
|
|
204
|
+
"database/utils/ulid.ts",
|
|
205
|
+
"database/actions/replication.ts",
|
|
206
|
+
"database/tenantPlacement.ts",
|
|
207
|
+
"database/authority/recordAuthority.ts",
|
|
208
|
+
"database/actions/readResolution.ts",
|
|
209
|
+
"database/authority/ownerKey.ts",
|
|
210
|
+
"database/fileRing.ts",
|
|
211
|
+
"database/actions/readRequestManager.ts",
|
|
212
|
+
"database/actions/agentReadResolution.ts",
|
|
213
|
+
"database/fileUrl.ts",
|
|
214
|
+
"database/client/fetchUserData.ts",
|
|
215
|
+
"database/queryPrefixes.ts",
|
|
216
|
+
"database/actions/deleteFile.ts",
|
|
186
217
|
"database/server/db.ts",
|
|
187
218
|
"database/server/ensureDbOpen.ts",
|
|
188
219
|
"database/server/serverStoreFactory.ts",
|
|
189
220
|
"database/server/memoryAuthorityStore.ts",
|
|
190
221
|
"ai/agent/cliExecutor.ts",
|
|
191
222
|
"ai/skills/skillDocProtocol.ts",
|
|
223
|
+
"ai/policy/runtimePolicy.ts",
|
|
224
|
+
"ai/tools/prepareTools.ts",
|
|
192
225
|
"ai/tools/agent/taskRunTool.ts",
|
|
193
226
|
"ai/agent/cliPrompt.ts",
|
|
227
|
+
"ai/tools/readXhsProfileTool.ts",
|
|
228
|
+
"ai/tools/toolApiClient.ts",
|
|
229
|
+
"ai/tools/index.ts",
|
|
194
230
|
"ai/tools/toolNameAliases.ts",
|
|
231
|
+
"ai/tools/toolSchemaCompatibility.ts",
|
|
232
|
+
"ai/tools/createWorkflowTool.ts",
|
|
233
|
+
"ai/tools/delayTool.ts",
|
|
234
|
+
"ai/tools/modelUsageTools.ts",
|
|
235
|
+
"ai/tools/agent/createAgentTool.ts",
|
|
236
|
+
"ai/tools/agent/updateAgentTool.ts",
|
|
237
|
+
"ai/tools/createDocTool.ts",
|
|
238
|
+
"ai/tools/createSkillDocTool.ts",
|
|
239
|
+
"ai/tools/doctorSkillTool.ts",
|
|
240
|
+
"ai/tools/evalSkillTool.ts",
|
|
241
|
+
"ai/tools/importSkillTool.ts",
|
|
242
|
+
"ai/tools/readDocTool.ts",
|
|
243
|
+
"ai/tools/category/createCategoryTool.ts",
|
|
244
|
+
"ai/tools/category/updateContentCategoryTool.ts",
|
|
245
|
+
"ai/tools/category/queryContentsByCategoryTool.ts",
|
|
246
|
+
"ai/tools/importDataTool.ts",
|
|
247
|
+
"ai/tools/executeSqlTool.ts",
|
|
248
|
+
"ai/tools/readTool.ts",
|
|
249
|
+
"ai/tools/listUserSpacesTool.ts",
|
|
250
|
+
"ai/tools/noloWorkspaceReadTools.ts",
|
|
251
|
+
"ai/tools/deleteSpacesTool.ts",
|
|
252
|
+
"ai/tools/localFilesTool.ts",
|
|
253
|
+
"ai/tools/emailTools.ts",
|
|
254
|
+
"ai/tools/table/addTableRowTool.ts",
|
|
255
|
+
"ai/tools/table/createTableTool.ts",
|
|
256
|
+
"ai/tools/table/shareTableTool.ts",
|
|
257
|
+
"ai/tools/table/rowTools.ts",
|
|
258
|
+
"ai/tools/table/schemaTools.ts",
|
|
259
|
+
"ai/tools/fetchWebpageTool.ts",
|
|
260
|
+
"ai/tools/convertMarxistsBookTool.ts",
|
|
261
|
+
"ai/tools/readXPostTool.ts",
|
|
262
|
+
"ai/tools/surfWeatherTool.ts",
|
|
263
|
+
"ai/tools/wereadGatewayTool.ts",
|
|
264
|
+
"ai/tools/browserTools/closeSession.ts",
|
|
265
|
+
"ai/tools/browserTools/openSession.ts",
|
|
266
|
+
"ai/tools/browserTools/selectOption.ts",
|
|
267
|
+
"ai/tools/browserTools/click.ts",
|
|
268
|
+
"ai/tools/browserTools/typeText.ts",
|
|
269
|
+
"ai/tools/browserTools/readContent.ts",
|
|
270
|
+
"ai/tools/exaSearchTool.ts",
|
|
271
|
+
"ai/tools/olmOcrTool.ts",
|
|
272
|
+
"ai/tools/whisperTool.ts",
|
|
273
|
+
"ai/tools/generateDocxTool.ts",
|
|
274
|
+
"ai/tools/googleSearchScraperTool.ts",
|
|
275
|
+
"ai/tools/cloudflareCrawlTool.ts",
|
|
276
|
+
"ai/tools/youtubeScraperTool.ts",
|
|
277
|
+
"ai/tools/ecommerceScraperTool.ts",
|
|
278
|
+
"ai/tools/amazonProductScraperTool.ts",
|
|
279
|
+
"ai/tools/taobaoTmallProductScraperTool.ts",
|
|
280
|
+
"ai/tools/jdProductScraperTool.ts",
|
|
281
|
+
"ai/tools/geminiImagePreviewTool.ts",
|
|
282
|
+
"ai/tools/openaiImageTool.ts",
|
|
283
|
+
"ai/tools/remotionVideoTool.ts",
|
|
284
|
+
"ai/tools/uiAskChoiceTool.ts",
|
|
285
|
+
"ai/tools/rememberMemoryTool.ts",
|
|
286
|
+
"ai/tools/execShellTool.ts",
|
|
287
|
+
"ai/tools/checkEnvTool.ts",
|
|
288
|
+
"ai/tools/agent/agentTools.ts",
|
|
289
|
+
"ai/tools/codeTools.ts",
|
|
290
|
+
"ai/tools/cfBrowserTools.ts",
|
|
291
|
+
"ai/tools/appTools.ts",
|
|
292
|
+
"ai/tools/cfSpeechToTextTool.ts",
|
|
293
|
+
"ai/tools/updateContentTitleTool.ts",
|
|
294
|
+
"ai/tools/searchWorkspaceTool.ts",
|
|
295
|
+
"ai/tools/searchDialogMessagesTool.ts",
|
|
296
|
+
"ai/tools/updateDocTool.ts",
|
|
297
|
+
"ai/tools/updateUserPreferenceProfileTool.ts",
|
|
298
|
+
"ai/tools/ziweiChartTool.ts",
|
|
299
|
+
"ai/policy/types.ts",
|
|
300
|
+
"ai/policy/selfUpdateFields.ts",
|
|
301
|
+
"ai/tools/agent/presets/appBuilderPreset.ts",
|
|
302
|
+
"ai/llm/kimi.ts",
|
|
303
|
+
"ai/agent/planSlice.ts",
|
|
304
|
+
"ai/workflow/workflowSlice.ts",
|
|
305
|
+
"ai/token/missingUsageEstimate.ts",
|
|
306
|
+
"ai/token/openaiImageGenerationUsage.ts",
|
|
307
|
+
"ai/memory/understanding.ts",
|
|
308
|
+
"ai/agent/createAgentSchema.ts",
|
|
309
|
+
"ai/agent/_executeModel.ts",
|
|
310
|
+
"ai/agent/runAgentClientLoop.ts",
|
|
311
|
+
"ai/agent/streamAgentChatTurn.ts",
|
|
312
|
+
"ai/agent/isLiveAudioOnlyAgent.ts",
|
|
313
|
+
"ai/llm/generateRequestBody.ts",
|
|
314
|
+
"ai/agent/getFullChatContextKeys.ts",
|
|
315
|
+
"ai/llm/isResponseAPIModel.ts",
|
|
316
|
+
"ai/llm/getModelContextWindow.ts",
|
|
317
|
+
"ai/llm/agentCapabilities.ts",
|
|
318
|
+
"ai/chat/sendOpenAICompletionsRequest.ts",
|
|
319
|
+
"ai/chat/sendOpenAIResponseRequest.ts",
|
|
320
|
+
"ai/agent/types.ts",
|
|
321
|
+
"ai/agent/cleanAgentMessages.ts",
|
|
322
|
+
"ai/agent/referenceUtils.ts",
|
|
323
|
+
"ai/context/tokenUtils.ts",
|
|
324
|
+
"ai/agent/streamAgentChatTurnUtils.ts",
|
|
325
|
+
"ai/agent/cliChatClient.ts",
|
|
326
|
+
"ai/agent/persistMessageWithFixedId.ts",
|
|
327
|
+
"ai/chat/updateTotalUsage.ts",
|
|
328
|
+
"ai/chat/parseMultilineSSE.ts",
|
|
329
|
+
"ai/chat/serverProxyRetry.ts",
|
|
330
|
+
"ai/agent/serverOrigin.ts",
|
|
331
|
+
"ai/context/buildReferenceContext.ts",
|
|
332
|
+
"ai/types.ts",
|
|
333
|
+
"ai/llm/getPricing.ts",
|
|
334
|
+
"ai/policy/personalizationDialog.ts",
|
|
335
|
+
"ai/agent/buildEditingContext.ts",
|
|
336
|
+
"ai/context/retention.ts",
|
|
337
|
+
"ai/tools/toolRunSlice.ts",
|
|
338
|
+
"ai/agent/appWorkingMemory.ts",
|
|
339
|
+
"ai/llm/providers.ts",
|
|
340
|
+
"ai/llm/openrouterModels.ts",
|
|
341
|
+
"ai/llm/deepinfra.ts",
|
|
342
|
+
"ai/llm/fireworks.ts",
|
|
343
|
+
"ai/llm/types.ts",
|
|
344
|
+
"ai/llm/mistral.ts",
|
|
345
|
+
"ai/llm/mimo.ts",
|
|
346
|
+
"ai/llm/reasoningModels.ts",
|
|
347
|
+
"ai/llm/imagePricing.ts",
|
|
348
|
+
"ai/agent/liveAudioModel.ts",
|
|
349
|
+
"ai/tools/toolResultError.ts",
|
|
350
|
+
"ai/agent/canvasEditingContext.ts",
|
|
351
|
+
"ai/skills/skillSummaryMarker.ts",
|
|
352
|
+
"ai/agent/utils/publicImageAgentMode.ts",
|
|
353
|
+
"ai/skills/referenceRuntime.ts",
|
|
354
|
+
"ai/chat/fetchUtils.ts",
|
|
355
|
+
"ai/chat/parseApiError.ts",
|
|
356
|
+
"ai/chat/streamRetry.ts",
|
|
357
|
+
"ai/chat/shouldUseServerProxy.ts",
|
|
358
|
+
"ai/agent/startParallelAgentStreams.ts",
|
|
359
|
+
"ai/tools/agent/parallelBudget.ts",
|
|
360
|
+
"ai/token/prepareTokenUsageData.ts",
|
|
361
|
+
"ai/token/types.ts",
|
|
362
|
+
"ai/token/calculatePrice.ts",
|
|
363
|
+
"ai/token/normalizeUsage.ts",
|
|
364
|
+
"ai/token/resolveBillingTarget.ts",
|
|
365
|
+
"ai/chat/accumulateToolCallChunks.ts",
|
|
366
|
+
"ai/chat/inlineImageUrlsForCustomProvider.ts",
|
|
367
|
+
"ai/agent/utils/imageOutput.ts",
|
|
368
|
+
"ai/llm/models.ts",
|
|
369
|
+
"ai/agent/generatePrompt.ts",
|
|
370
|
+
"ai/llm/usageRequestOptions.ts",
|
|
371
|
+
"ai/agent/buildSystemPrompt.ts",
|
|
372
|
+
"ai/agent/runtimeGuidance.ts",
|
|
373
|
+
"ai/agent/pageBuilderHandoffRules.ts",
|
|
374
|
+
"ai/agent/contextCompiler.ts",
|
|
375
|
+
"ai/agent/currentTimeContext.ts",
|
|
376
|
+
"ai/agent/contextLayerContract.ts",
|
|
377
|
+
"ai/agent/startupProtocol.ts",
|
|
378
|
+
"ai/agent/fetchAgentContexts.ts",
|
|
379
|
+
"ai/agent/executeToolCall.ts",
|
|
380
|
+
"ai/agent/toolFailureGuard.ts",
|
|
381
|
+
"ai/token/saveTokenRecord.ts",
|
|
382
|
+
"ai/memory/storeShared.ts",
|
|
383
|
+
"ai/memory/queryShared.ts",
|
|
384
|
+
"ai/memory/types.ts",
|
|
385
|
+
"ai/memory/recentRelationshipRecap.ts",
|
|
386
|
+
"ai/memory/understandingGreeting.ts",
|
|
387
|
+
"ai/workflow/workflowTypes.ts",
|
|
388
|
+
"ai/tools/dialogMessageSearch.ts",
|
|
389
|
+
"ai/tools/appReadSnapshot.ts",
|
|
390
|
+
"ai/tools/appEditGuard.ts",
|
|
391
|
+
"ai/tools/fetchWebpageSupport.ts",
|
|
392
|
+
"ai/tools/readFileTool.ts",
|
|
393
|
+
"ai/tools/writeFileTool.ts",
|
|
394
|
+
"ai/tools/codeSearchTool.ts",
|
|
395
|
+
"ai/tools/applyEditTool.ts",
|
|
396
|
+
"ai/tools/applyLineEditsTool.ts",
|
|
397
|
+
"ai/tools/devReloadUtils.ts",
|
|
398
|
+
"ai/tools/agent/callAgentTool.ts",
|
|
399
|
+
"ai/tools/agent/prepareAgentDraftTool.ts",
|
|
400
|
+
"ai/tools/agent/createSkillAgentTool.ts",
|
|
401
|
+
"ai/tools/agent/updateSelfTool.ts",
|
|
402
|
+
"ai/tools/agent/runStreamingAgentTool.ts",
|
|
403
|
+
"ai/tools/agent/streamParallelAgentsTool.ts",
|
|
404
|
+
"ai/tools/agent/startAgentDialogTool.ts",
|
|
405
|
+
"ai/tools/agent/createDialogTool.ts",
|
|
406
|
+
"ai/tools/agent/runLlmTool.ts",
|
|
407
|
+
"ai/tools/agent/agentUpdateShared.ts",
|
|
408
|
+
"ai/tools/agent/skillAgentArgs.ts",
|
|
409
|
+
"ai/agent/guidedCreation/capabilities.ts",
|
|
410
|
+
"ai/agent/guidedCreation/types.ts",
|
|
411
|
+
"ai/agent/runAgentBackground.ts",
|
|
412
|
+
"ai/memory/remember.ts",
|
|
413
|
+
"ai/memory/store.ts",
|
|
414
|
+
"ai/tools/apifyActorClient.ts",
|
|
415
|
+
"ai/tools/browserTools/common.ts",
|
|
416
|
+
"ai/tools/marxistsOfflineBook.ts",
|
|
417
|
+
"ai/tools/table/toolShared.ts",
|
|
418
|
+
"ai/tools/deleteSpacesToolModel.ts",
|
|
419
|
+
"ai/tools/skillFollowup.ts",
|
|
420
|
+
"ai/skills/skillDiagnostics.ts",
|
|
421
|
+
"ai/skills/skillDocBuilder.ts",
|
|
422
|
+
"ai/ai.locale.ts",
|
|
423
|
+
"ai/workflow/workflowExecutor.ts",
|
|
195
424
|
"render/table/activityColumns.ts",
|
|
425
|
+
"render/table/tableSlice.ts",
|
|
426
|
+
"render/page/docSlice.ts",
|
|
427
|
+
"render/page/types.ts",
|
|
428
|
+
"render/page/createPageAction.ts",
|
|
429
|
+
"render/table/fetchAndCacheTableRows.ts",
|
|
430
|
+
"render/table/createTableAction.ts",
|
|
431
|
+
"render/table/deleteTableAction.ts",
|
|
432
|
+
"render/table/types.ts",
|
|
433
|
+
"render/table/utils/tableSerialization.ts",
|
|
434
|
+
"render/table/toolValueUtils.ts",
|
|
435
|
+
"integrations/xhs-reader/bridge/readXhsProfileWithBridge.ts",
|
|
436
|
+
"integrations/xhs-reader/orchestrator.ts",
|
|
437
|
+
"integrations/xhs-reader/types.ts",
|
|
438
|
+
"integrations/xhs-reader/redaction.ts",
|
|
439
|
+
"integrations/xhs-reader/backends/playwrightProfileCollector.ts",
|
|
440
|
+
"integrations/xhs-reader/client/xhsWebApiClient.ts",
|
|
441
|
+
"integrations/xhs-reader/analyze/profileAnalyzer.ts",
|
|
442
|
+
"integrations/xhs-reader/normalize.ts",
|
|
443
|
+
"integrations/xhs-reader/url.ts",
|
|
444
|
+
"integrations/openai/filterAndCleanMessages.ts",
|
|
445
|
+
"integrations/anthropic/anthropicModels.ts",
|
|
446
|
+
"integrations/deepseek/models.ts",
|
|
447
|
+
"integrations/google/models.ts",
|
|
448
|
+
"integrations/openai/models.ts",
|
|
449
|
+
"integrations/xai/models.ts",
|
|
450
|
+
"integrations/openai/flexTier.ts",
|
|
451
|
+
"integrations/openai/responsesHelpers.ts",
|
|
452
|
+
"integrations/openai/generateOpenAIRequestBody.ts",
|
|
453
|
+
"integrations/openai/generateResponseRequestBody.ts",
|
|
454
|
+
"integrations/openai/providerBodyCompatibility.ts",
|
|
455
|
+
"integrations/openai/chatCompletionStreamMode.ts",
|
|
456
|
+
"integrations/x-reader/types.ts",
|
|
457
|
+
"core/prefix.ts",
|
|
458
|
+
"core/init.ts",
|
|
459
|
+
"core/builtinAgents.ts",
|
|
460
|
+
"core/generateMainKey.ts",
|
|
461
|
+
"core/generateKeyPairFromSeedV1.ts",
|
|
462
|
+
"core/password.ts",
|
|
463
|
+
"core/crypto.ts",
|
|
464
|
+
"core/config.ts",
|
|
465
|
+
"core/localOrigins.ts",
|
|
466
|
+
"app/settings/settingSlice.tsx",
|
|
467
|
+
"app/store.ts",
|
|
468
|
+
"app/utils/env.ts",
|
|
469
|
+
"app/theme/theme.config.ts",
|
|
470
|
+
"app/theme/themeModeBootstrap.ts",
|
|
471
|
+
"app/theme/fontPreference.ts",
|
|
472
|
+
"app/constants/animationSets.ts",
|
|
473
|
+
"app/settings/dbActionThunks.ts",
|
|
474
|
+
"app/settings/defaultSpacePreference.ts",
|
|
475
|
+
"app/settings/settingsRecord.ts",
|
|
476
|
+
"app/stateViews/runtime.ts",
|
|
477
|
+
"app/utils/toast.ts",
|
|
478
|
+
"app/utils/fileUtils.ts",
|
|
479
|
+
"app/types.ts",
|
|
480
|
+
"app/theme/colors.ts",
|
|
481
|
+
"app/utils/retryFetch.ts",
|
|
482
|
+
"app/favorite/favoriteSlice.ts",
|
|
483
|
+
"app/utils/desktopAgentRuntimeTurnClient.ts",
|
|
484
|
+
"app/i18n/client.ts",
|
|
485
|
+
"app/i18n/types.ts",
|
|
486
|
+
"app/i18n/i18n.base.ts",
|
|
487
|
+
"app/constants/appEditor.ts",
|
|
488
|
+
"app/i18n/mapLanguage.ts",
|
|
489
|
+
"app/utils/imageUtils.ts",
|
|
490
|
+
"app/utils/async.ts",
|
|
491
|
+
"app/favorite/type.ts",
|
|
492
|
+
"app/hooks/deleteDbKey.ts",
|
|
493
|
+
"app/reducer.ts",
|
|
494
|
+
"app/notifications/notificationSlice.ts",
|
|
495
|
+
"app/notifications/model.ts",
|
|
496
|
+
"app/utils/myContentItems.ts",
|
|
497
|
+
"app/types/appSummary.ts",
|
|
498
|
+
"app/utils/appKeys.ts",
|
|
499
|
+
"app/actions/syncAppRecord.ts",
|
|
500
|
+
"app/utils/retryAfter.ts",
|
|
501
|
+
"app/i18n/index.ts",
|
|
502
|
+
"app/i18n/i18n.config.ts",
|
|
503
|
+
"app/i18n/translations/interface.locale.ts",
|
|
504
|
+
"app/i18n/translations/error.locale.ts",
|
|
505
|
+
"app/i18n/translations/seo.locale.ts",
|
|
506
|
+
"app/i18n/translations/appBuilder.locale.ts",
|
|
507
|
+
"app/i18n/translations/pricing.locale.ts",
|
|
508
|
+
"app/i18n/translations/privacy.locale.ts",
|
|
509
|
+
"app/i18n/translations/terms.locale.ts",
|
|
510
|
+
"auth/authSlice.ts",
|
|
511
|
+
"auth/action/signUpAction.ts",
|
|
512
|
+
"auth/client/loginRequest.ts",
|
|
513
|
+
"auth/resetAuthScopedClientState.ts",
|
|
514
|
+
"auth/token.ts",
|
|
515
|
+
"auth/routes.ts",
|
|
516
|
+
"auth/types.ts",
|
|
517
|
+
"auth/adminPermissions.ts",
|
|
518
|
+
"create/space/sidebarVisibleTypes.ts",
|
|
519
|
+
"create/space/spaceKeys.ts",
|
|
520
|
+
"create/types.ts",
|
|
521
|
+
"create/space/spaceSlice.ts",
|
|
522
|
+
"create/editor/utils/slateUtils.ts",
|
|
523
|
+
"create/editor/transforms/slateToRenderMarkdown.ts",
|
|
524
|
+
"create/editor/transforms/markdownToSlate.ts",
|
|
525
|
+
"create/editor/transforms/fromMarkdown/index.ts",
|
|
526
|
+
"create/editor/transforms/fromMarkdown/inline.ts",
|
|
527
|
+
"create/editor/transforms/fromMarkdown/table.ts",
|
|
528
|
+
"create/space/contentKeyUtils.ts",
|
|
529
|
+
"create/editor/transforms/slateToText.ts",
|
|
530
|
+
"create/editor/transforms/slateToSimplifiedMarkdown.ts",
|
|
531
|
+
"create/space/content/addContentAction.ts",
|
|
532
|
+
"create/space/types.ts",
|
|
533
|
+
"create/space/utils/permissions.ts",
|
|
534
|
+
"create/space/constants.ts",
|
|
535
|
+
"create/space/category/categoryActions.ts",
|
|
536
|
+
"create/space/content/contentThunks.ts",
|
|
537
|
+
"create/space/member/memberThunks.ts",
|
|
538
|
+
"create/space/spaceThunks.ts",
|
|
539
|
+
"create/space/addSpaceAction.ts",
|
|
540
|
+
"create/space/deleteSpaceAction.ts",
|
|
541
|
+
"create/space/fetchSpaceAction.ts",
|
|
542
|
+
"create/space/loadDefaultSpaceAction.ts",
|
|
543
|
+
"create/space/updateSpaceAction.ts",
|
|
544
|
+
"create/space/fetchSpaceSidebarStateAction.ts",
|
|
545
|
+
"create/space/changeSpaceAction.ts",
|
|
546
|
+
"create/space/spaceCollapsedState.ts",
|
|
547
|
+
"create/space/resolvePreferredSpaceId.ts",
|
|
548
|
+
"create/space/spaceAccess.ts",
|
|
549
|
+
"create/space/member/fetchUserSpaceMembershipsAction.ts",
|
|
550
|
+
"create/space/member/addMemberAction.ts",
|
|
551
|
+
"create/space/member/removeMemberAction.ts",
|
|
552
|
+
"create/space/content/deleteContentFromSpaceAction.ts",
|
|
553
|
+
"create/space/content/moveContentAction.ts",
|
|
554
|
+
"create/space/content/updateContentTitleAction.ts",
|
|
555
|
+
"create/space/content/updateContentCategoryAction.ts",
|
|
556
|
+
"create/space/content/deleteMultipleContentAction.ts",
|
|
557
|
+
"create/space/content/uploadAndAddFileToSpaceAction.ts",
|
|
558
|
+
"create/space/space.locale.ts",
|
|
559
|
+
"share/action.ts",
|
|
560
|
+
"share/types.ts",
|
|
561
|
+
"share/keys.ts",
|
|
562
|
+
"share/helpers.ts",
|
|
563
|
+
"share/shareSlice.ts",
|
|
564
|
+
"share/publicSharePolicy.ts",
|
|
565
|
+
"chat/messages/types.ts",
|
|
566
|
+
"chat/dialog/dialogSlice.ts",
|
|
567
|
+
"chat/messages/messageSlice.ts",
|
|
568
|
+
"chat/dialog/actions/addReferenceKeysAction.ts",
|
|
569
|
+
"chat/messages/fetchAndCacheMessages.ts",
|
|
570
|
+
"chat/dialog/actions/updateDialogSummaryAction.ts",
|
|
571
|
+
"chat/messages/messageContent.ts",
|
|
572
|
+
"chat/messages/messageContract.ts",
|
|
573
|
+
"chat/dialog/actions/handleSendMessageResolver.ts",
|
|
574
|
+
"chat/dialog/dialogUrl.ts",
|
|
575
|
+
"chat/messages/toolThunks.ts",
|
|
576
|
+
"chat/dialog/actions/updateTokensAction.ts",
|
|
577
|
+
"chat/dialog/dialogAgents.ts",
|
|
578
|
+
"chat/messages/fileUrl.ts",
|
|
579
|
+
"chat/dialog/actions/builtinDialogLlm.ts",
|
|
196
580
|
"chat/messages/fetchMessages.ts",
|
|
197
|
-
"chat/messages/
|
|
581
|
+
"chat/messages/fetchConvMsgs.ts",
|
|
582
|
+
"chat/dialog/actions/cleanupCliSession.ts",
|
|
583
|
+
"chat/dialog/dialogTokenStats.ts",
|
|
584
|
+
"chat/dialog/goal.ts",
|
|
585
|
+
"chat/dialog/actions/createDialogAction.ts",
|
|
586
|
+
"chat/dialog/actions/createScheduledTaskAction.ts",
|
|
587
|
+
"chat/dialog/actions/updateDialogTitleAction.ts",
|
|
588
|
+
"chat/dialog/actions/addCybotAction.ts",
|
|
589
|
+
"chat/dialog/actions/removeCybotAction.ts",
|
|
590
|
+
"chat/dialog/actions/replacePrimaryCybotAction.ts",
|
|
591
|
+
"chat/dialog/actions/removeDialogAgentAction.ts",
|
|
592
|
+
"chat/dialog/actions/setPrimaryDialogAgentAction.ts",
|
|
593
|
+
"chat/dialog/actions/handleSendMessageAction.ts",
|
|
594
|
+
"chat/dialog/actions/updateDialogTitlePolicy.ts",
|
|
595
|
+
"chat/dialog/dialogTitle.ts",
|
|
596
|
+
"chat/dialog/schedule.ts",
|
|
597
|
+
"chat/dialog/objectAssistantRegistry.ts",
|
|
598
|
+
"chat/messages/messageAgent.ts",
|
|
599
|
+
"chat/chat.locale.ts",
|
|
600
|
+
"server/handlers/agentRun/types.ts"
|
|
198
601
|
],
|
|
199
602
|
"publishConfig": {
|
|
200
603
|
"access": "public"
|
|
@@ -208,6 +611,30 @@
|
|
|
208
611
|
"dependencies": {
|
|
209
612
|
"ulid": "^2.3.0",
|
|
210
613
|
"level": "^10.0.0",
|
|
211
|
-
"
|
|
614
|
+
"pino": "^9.9.0",
|
|
615
|
+
"@react-native-community/netinfo": "^11.5.0",
|
|
616
|
+
"rambda": "^8.6.0",
|
|
617
|
+
"@reduxjs/toolkit": "^2.5.0",
|
|
618
|
+
"react-native-blob-util": "^0.24.7",
|
|
619
|
+
"js-yaml": "^4.1.0",
|
|
620
|
+
"pizzip": "^3.2.0",
|
|
621
|
+
"docxtemplater": "^3.67.5",
|
|
622
|
+
"iztro": "^2.5.8",
|
|
623
|
+
"i18next": "^23.11.5",
|
|
624
|
+
"zod": "^3.25.20",
|
|
625
|
+
"date-fns": "^2.30.0",
|
|
626
|
+
"playwright": "^1.59.1",
|
|
627
|
+
"tweetnacl": "^1.0.3",
|
|
628
|
+
"js-base64": "^3.7.7",
|
|
629
|
+
"crypto-js": "^4.1.1",
|
|
630
|
+
"react-redux": "^9.2.0",
|
|
631
|
+
"react-hot-toast": "^2.4.1",
|
|
632
|
+
"react-i18next": "^14.1.2",
|
|
633
|
+
"browser-image-compression": "^2.0.2",
|
|
634
|
+
"slate": "^0.112.0",
|
|
635
|
+
"mdast-util-from-markdown": "^2.0.2",
|
|
636
|
+
"mdast-util-gfm": "^3.0.0",
|
|
637
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
638
|
+
"croner": "^8.0.1"
|
|
212
639
|
}
|
|
213
640
|
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// 文件路径: render/page/createPageAction.ts
|
|
2
|
+
import { selectUserId } from "../../auth/authSlice";
|
|
3
|
+
import {
|
|
4
|
+
addContentToSpace,
|
|
5
|
+
selectCurrentSpaceId,
|
|
6
|
+
} from "../../create/space/spaceSlice";
|
|
7
|
+
import { createPageKey } from "../../database/keys";
|
|
8
|
+
import i18n from "../../app/i18n/client";
|
|
9
|
+
import { DataType } from "../../create/types";
|
|
10
|
+
import type { RootState, AppDispatch } from "../../app/store";
|
|
11
|
+
import { write } from "../../database/dbSlice";
|
|
12
|
+
import type { PageData } from "./types";
|
|
13
|
+
import { format } from "date-fns";
|
|
14
|
+
|
|
15
|
+
// 新增:把 markdown 转为 Slate 的工具 & 类型
|
|
16
|
+
import { markdownToSlate } from "../../create/editor/transforms/markdownToSlate";
|
|
17
|
+
import {
|
|
18
|
+
createEmptyParagraph,
|
|
19
|
+
splitSlateTitleAndBody,
|
|
20
|
+
type EditorContent,
|
|
21
|
+
} from "../../create/editor/utils/slateUtils";
|
|
22
|
+
import { slateToRenderMarkdown } from "../../create/editor/transforms/slateToRenderMarkdown";
|
|
23
|
+
import { parseSkillDocProtocol } from "../../ai/skills/skillDocProtocol";
|
|
24
|
+
import { buildSkillSummaryMarker } from "../../ai/skills/skillSummaryMarker";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 归一化 / 过滤 categoryId
|
|
28
|
+
*
|
|
29
|
+
* 设计目标:
|
|
30
|
+
* - 允许正常的、看起来像 ID 的字符串通过;
|
|
31
|
+
* - 对 AI 乱编的 “读书笔记分类” / “分类一” / 超短数字 等,直接当成 undefined。
|
|
32
|
+
*
|
|
33
|
+
* 注意:这里的规则可以按你实际的 ID 生成规则调整。
|
|
34
|
+
*/
|
|
35
|
+
const normalizeCategoryId = (raw?: string): string | undefined => {
|
|
36
|
+
const trimmed = raw?.trim();
|
|
37
|
+
if (!trimmed) return undefined;
|
|
38
|
+
|
|
39
|
+
// 1) 过滤掉包含空格或非 ASCII 字符的情况
|
|
40
|
+
// 比如 “读书笔记分类” 会被直接判为无效
|
|
41
|
+
const asciiNoSpace = /^[\x20-\x7E]+$/; // 可见 ASCII 字符
|
|
42
|
+
if (!asciiNoSpace.test(trimmed)) return undefined;
|
|
43
|
+
|
|
44
|
+
// 2) 简单做个长度下限,避免 "1"、"abc" 这种明显不是 ID 的值
|
|
45
|
+
// 如果你的真实 ID 很短,可以把 8 调小一点
|
|
46
|
+
if (trimmed.length < 8) return undefined;
|
|
47
|
+
|
|
48
|
+
// 3) 如果你有更具体规则(如 UUID / nanoid),可以在这里再加一层匹配
|
|
49
|
+
// const idLike = /^[0-9a-zA-Z_-]{10,64}$/;
|
|
50
|
+
// if (!idLike.test(trimmed)) return undefined;
|
|
51
|
+
|
|
52
|
+
return trimmed;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const createPageAction = async (
|
|
56
|
+
{
|
|
57
|
+
categoryId,
|
|
58
|
+
spaceId: customSpaceId,
|
|
59
|
+
title: initialTitle,
|
|
60
|
+
addMomentTag,
|
|
61
|
+
content,
|
|
62
|
+
slateData,
|
|
63
|
+
}: {
|
|
64
|
+
categoryId?: string;
|
|
65
|
+
spaceId?: string;
|
|
66
|
+
title?: string;
|
|
67
|
+
addMomentTag?: boolean;
|
|
68
|
+
content?: string; // 这里仍然接收 markdown 文本
|
|
69
|
+
slateData?: any; // 如果外部已经算好 Slate,可以直接传进来
|
|
70
|
+
} = {},
|
|
71
|
+
{ dispatch, getState }: { dispatch: AppDispatch; getState: () => RootState }
|
|
72
|
+
): Promise<string> => {
|
|
73
|
+
const state = getState();
|
|
74
|
+
const userId = selectUserId(state);
|
|
75
|
+
if (!userId) throw new Error("User ID not found.");
|
|
76
|
+
|
|
77
|
+
// Important:
|
|
78
|
+
// View-mode-based "create into current space vs no space" is decided by the UI entry
|
|
79
|
+
// that triggers creation (currently the sidebar-top create button).
|
|
80
|
+
// This action must preserve explicit caller intent:
|
|
81
|
+
// - if `spaceId` is provided, use it;
|
|
82
|
+
// - otherwise only fall back to the current selected space.
|
|
83
|
+
const spaceId = customSpaceId ?? selectCurrentSpaceId(state);
|
|
84
|
+
const { dbKey, id } = createPageKey.create(userId);
|
|
85
|
+
|
|
86
|
+
const now = new Date();
|
|
87
|
+
const dateStr = format(now, "yyyy-MM-dd HH:mm");
|
|
88
|
+
const defaultTitle = i18n.t("page:defaultTitleFormat", {
|
|
89
|
+
defaultValue: "{{date}} 的笔记",
|
|
90
|
+
date: dateStr,
|
|
91
|
+
});
|
|
92
|
+
let title = initialTitle?.trim() || defaultTitle;
|
|
93
|
+
|
|
94
|
+
const tags = addMomentTag ? ["moment"] : undefined;
|
|
95
|
+
let pageMeta: PageData["meta"] | undefined;
|
|
96
|
+
|
|
97
|
+
// ====== 根据 slateData / content 决定真正写入的 Slate 结构 ======
|
|
98
|
+
let initialSlateData: EditorContent;
|
|
99
|
+
|
|
100
|
+
if (slateData) {
|
|
101
|
+
// 1. 如果外部已经传了 Slate,直接使用(兼容旧调用)
|
|
102
|
+
initialSlateData = slateData as EditorContent;
|
|
103
|
+
} else if (content) {
|
|
104
|
+
const parsedProtocol = parseSkillDocProtocol(content);
|
|
105
|
+
const normalizedContent = parsedProtocol.content;
|
|
106
|
+
pageMeta = parsedProtocol.meta;
|
|
107
|
+
console.log("content", content);
|
|
108
|
+
// 2. 如果有 markdown content,优先尝试用 markdownToSlate 转成结构化 Slate
|
|
109
|
+
try {
|
|
110
|
+
const parsed = markdownToSlate(normalizedContent);
|
|
111
|
+
console.log("parsed", parsed);
|
|
112
|
+
|
|
113
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
114
|
+
const split = splitSlateTitleAndBody(parsed, initialTitle);
|
|
115
|
+
title = initialTitle?.trim() || split.title || defaultTitle;
|
|
116
|
+
initialSlateData = split.body;
|
|
117
|
+
} else {
|
|
118
|
+
// 解析结果为空时,退回到简单的纯文本段落
|
|
119
|
+
initialSlateData = [
|
|
120
|
+
{ type: "paragraph", children: [{ text: normalizedContent }] },
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
} catch (e) {
|
|
124
|
+
// 解析失败兜底:仍然保留原始文本,但当成普通段落
|
|
125
|
+
console.error(
|
|
126
|
+
"[createPageAction] markdownToSlate failed, fallback to plain text:",
|
|
127
|
+
e
|
|
128
|
+
);
|
|
129
|
+
initialSlateData = [
|
|
130
|
+
{ type: "paragraph", children: [{ text: normalizedContent }] },
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
// 3. 完全没有内容,创建一个空白页面
|
|
135
|
+
initialSlateData = [createEmptyParagraph()];
|
|
136
|
+
}
|
|
137
|
+
// ====== 关键改动结束 ======
|
|
138
|
+
|
|
139
|
+
// 关键防御:对传入的 categoryId 做归一化 / 过滤
|
|
140
|
+
const safeCategoryId = normalizeCategoryId(categoryId);
|
|
141
|
+
|
|
142
|
+
const pageData: PageData = {
|
|
143
|
+
dbKey,
|
|
144
|
+
id,
|
|
145
|
+
type: DataType.DOC,
|
|
146
|
+
title,
|
|
147
|
+
spaceId,
|
|
148
|
+
slateData: initialSlateData,
|
|
149
|
+
// `content` 只作为只读展示缓存 / legacy bridge,真源仍是 `slateData`。
|
|
150
|
+
content:
|
|
151
|
+
typeof content === "string"
|
|
152
|
+
? parseSkillDocProtocol(content, pageMeta).content ||
|
|
153
|
+
slateToRenderMarkdown(initialSlateData)
|
|
154
|
+
: slateToRenderMarkdown(initialSlateData),
|
|
155
|
+
tags,
|
|
156
|
+
created: now.toISOString(),
|
|
157
|
+
...(pageMeta ? { meta: pageMeta } : {}),
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const skillSummary = buildSkillSummaryMarker(pageMeta);
|
|
161
|
+
|
|
162
|
+
await dispatch(write({ data: pageData, customKey: dbKey })).unwrap();
|
|
163
|
+
|
|
164
|
+
if (spaceId) {
|
|
165
|
+
(dispatch as any)(
|
|
166
|
+
(addContentToSpace as any)({
|
|
167
|
+
contentKey: dbKey,
|
|
168
|
+
type: DataType.DOC,
|
|
169
|
+
spaceId,
|
|
170
|
+
title,
|
|
171
|
+
// 只使用经过 normalize 的 safeCategoryId
|
|
172
|
+
categoryId: safeCategoryId,
|
|
173
|
+
...(skillSummary ? { skillSummary } : {}),
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (typeof window !== "undefined") {
|
|
179
|
+
window.dispatchEvent(new Event("nolo-user-data-updated"));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return dbKey;
|
|
183
|
+
};
|