From 5ae0e7a301b22ffd491bba2a100e273b87e89f6d Mon Sep 17 00:00:00 2001 From: Erik Jespersen Date: Tue, 12 Nov 2024 00:38:31 -0500 Subject: [PATCH] 20241111 @Mookse - halt LLM call on functions for updateSummary and changeTitle - frontend console.log fixes - backend console.log fixes --- inc/js/agents/system/asset-agent.mjs | 1 - inc/js/agents/system/bot-agent.mjs | 3 - inc/js/agents/system/evolution-agent.mjs | 1 - inc/js/api-functions.mjs | 5 - inc/js/core.mjs | 3 +- .../class-extenders.mjs | 5 +- inc/js/mylife-avatar.mjs | 3 - inc/js/mylife-datamanager.mjs | 1 - inc/js/mylife-dataservices.mjs | 7 +- inc/js/mylife-factory.mjs | 4 - inc/js/mylife-llm-services.mjs | 91 +++++++++++-------- inc/js/session.mjs | 14 +-- server.js | 12 +-- views/assets/js/bots.mjs | 18 +--- views/assets/js/experience.mjs | 8 +- views/assets/js/globals.mjs | 3 - views/assets/js/members.mjs | 3 - 17 files changed, 69 insertions(+), 113 deletions(-) diff --git a/inc/js/agents/system/asset-agent.mjs b/inc/js/agents/system/asset-agent.mjs index ec15956f..1d142795 100644 --- a/inc/js/agents/system/asset-agent.mjs +++ b/inc/js/agents/system/asset-agent.mjs @@ -63,7 +63,6 @@ class AssetAgent { uploadFiles.push(this.#extractFile(file)) }) if(uploadFiles.length){ // only upload new files - console.log('upload::uploadFiles', uploadFiles) const fileStreams = uploadFiles.map(file=>fs.createReadStream(file.filepath)) const dataRecord = await this.#llm.upload(this.#vectorstoreId, fileStreams, this.mbr_id) const { response, success } = dataRecord diff --git a/inc/js/agents/system/bot-agent.mjs b/inc/js/agents/system/bot-agent.mjs index 7a6e8d45..a41555a3 100644 --- a/inc/js/agents/system/bot-agent.mjs +++ b/inc/js/agents/system/bot-agent.mjs @@ -36,7 +36,6 @@ class Bot { #llm #type constructor(botData, llm, factory){ - console.log(`bot pre-created`, this.feedback) this.#factory = factory this.#llm = llm const { feedback=[], greeting=mDefaultGreeting, greetings=mDefaultGreetings, type=mDefaultBotType, ..._botData } = botData @@ -141,7 +140,6 @@ class Bot { const { bot_id: _llm_id, id, type, } = this let { llm_id=_llm_id, thread_id, } = this // @stub - deprecate bot_id this.#conversation = await mConversationStart('chat', type, id, thread_id, llm_id, this.#llm, this.#factory, message) - console.log(`getConversation::thread_id`, thread_id, this.#conversation.thread_id) if(!thread_id?.length){ thread_id = this.#conversation.thread_id this.update({ @@ -1042,7 +1040,6 @@ async function mConversationDelete(Conversation, factory, llm){ }) await factory.deleteItem(Conversation.id) /* delete conversation from Cosmos */ await llm.deleteThread(thread_id) /* delete thread from LLM */ - console.log('mDeleteConversation', Conversation.id, thread_id) return true } /** diff --git a/inc/js/agents/system/evolution-agent.mjs b/inc/js/agents/system/evolution-agent.mjs index 453e18fc..4a4b1f3a 100644 --- a/inc/js/agents/system/evolution-agent.mjs +++ b/inc/js/agents/system/evolution-agent.mjs @@ -280,7 +280,6 @@ function mSetContribution(evoAgent, _current, _proposed) { /* @todo: verify that categories are changing */ const _currentContribution = evoAgent.contributions .find(_contribution => _contribution.id === _current.contributionId) - console.log('evolution-assistant:mSetContribution():320', _currentContribution.inspect(true)) if(_currentContribution.stage === 'prepared'){ // ready to process // join array and submit for gpt-summarization mSubmitContribution(evoAgent, _contributions.responses.join('\n')) diff --git a/inc/js/api-functions.mjs b/inc/js/api-functions.mjs index 2bc235b4..ca16dd43 100644 --- a/inc/js/api-functions.mjs +++ b/inc/js/api-functions.mjs @@ -25,14 +25,12 @@ async function entry(ctx){ const { assistantType, mbr_id } = ctx.state if(!ctx.request.body?.summary?.length) throw new Error('No entry summary provided. Use `summary` field.') - console.log(chalk.yellowBright('entry()::entry attempted:'), ctx.request.body) const summary = { ...ctx.request.body, assistantType, mbr_id, } const entry = await ctx.MyLife.entry(summary) - console.log(chalk.yellowBright('entry()::entry submitted:'), entry, summary) ctx.status = 200 ctx.body = { id: entry.id, @@ -48,7 +46,6 @@ async function experienceBuilder(ctx){ const { assistantType, mbr_id } = ctx.state const { eid, sid } = ctx.params const { experience } = ctx.request.body?.experience - console.log(chalk.yellowBright('experienceBuilder()'), { assistantType, mbr_id, eid, sid, experience }) if(!experience) ctx.throw(400, 'No experience provided for builder. Use `experience` field.') } @@ -231,14 +228,12 @@ async function memory(ctx){ const { assistantType, mbr_id } = ctx.state if(!ctx.request.body?.summary?.length) throw new Error('No memory summary provided. Use `summary` field.') - console.log(chalk.yellowBright('memory()::memory attempted:'), ctx.request.body) const summary = { ...ctx.request.body, assistantType, mbr_id, } const memory = await ctx.MyLife.memory(summary) - console.log(chalk.yellowBright('memory()::memory submitted:'), memory, summary) ctx.status = 200 ctx.body = { id: memory.id, diff --git a/inc/js/core.mjs b/inc/js/core.mjs index b3c086f9..0b454f35 100644 --- a/inc/js/core.mjs +++ b/inc/js/core.mjs @@ -158,7 +158,7 @@ class Member extends EventEmitter { async testEmitters(){ // test emitters with callbacks this.emit('testEmitter',_response=>{ - console.log('callback emitters enabled:',_response) + }) } } @@ -335,7 +335,6 @@ class MyLife extends Organization { // form=server let isValidated = false if(isHosted) isValidated = await this.testPartitionKey(memberId) - console.log('isMemberHosted:', isHosted, isValidated, memberId) return isValidated } /** diff --git a/inc/js/factory-class-extenders/class-extenders.mjs b/inc/js/factory-class-extenders/class-extenders.mjs index a40b2f75..1f3319e6 100644 --- a/inc/js/factory-class-extenders/class-extenders.mjs +++ b/inc/js/factory-class-extenders/class-extenders.mjs @@ -432,7 +432,6 @@ function extendClass_message(originClass, referencesObject) { try{ this.#content = assignContent(content ?? obj) } catch(e){ - console.log('Message::constructor::ERROR', e) this.#content = '' } } @@ -443,9 +442,7 @@ function extendClass_message(originClass, referencesObject) { set content(_content){ try{ this.#content = assignContent(_content) - } catch(e){ - console.log('Message::content::ERROR', e) - } + } catch(e){} } get message(){ return this diff --git a/inc/js/mylife-avatar.mjs b/inc/js/mylife-avatar.mjs index 774294b2..f1ac5c24 100644 --- a/inc/js/mylife-avatar.mjs +++ b/inc/js/mylife-avatar.mjs @@ -1444,7 +1444,6 @@ class Q extends Avatar { if(!this.globals.isValidGuid(key) || key!==this.hosting_key) throw new Error('Invalid key for hosted members.') if(!this.#hostedMembers.length){ // on-demand creation - console.log('hostedMembers', this.#hostedMembers) const hostedMembers = await this.#factory.hostedMembers() if(!hostedMembers.length) throw new Error('No hosted members found.') @@ -2020,7 +2019,6 @@ async function mExperienceStart(avatar, factory, experienceId, avatarExperienceV if(id!==experienceId) throw new Error('Experience failure, unexpected id mismatch.') experience.cast = await mCast(factory, experience.cast) // hydrates cast data - console.log('mExperienceStart::experience', experience.cast[0].inspect(true)) experience.events = [] experience.location = { experienceId: experience.id, @@ -2312,7 +2310,6 @@ function mValidateMode(_requestedMode, _currentMode){ throw new Error('Invalid interface mode request. Mode not altered.') switch(_requestedMode){ case 'admin': - console.log('Admin interface not currently implemented. Mode not altered.') return _currentMode case 'experience': case 'standard': diff --git a/inc/js/mylife-datamanager.mjs b/inc/js/mylife-datamanager.mjs index aad75896..b6a08ba5 100644 --- a/inc/js/mylife-datamanager.mjs +++ b/inc/js/mylife-datamanager.mjs @@ -44,7 +44,6 @@ class Datamanager { this.#partitionId ) .read() - console.log(chalk.yellowBright('database, container, core initialized:',chalk.bgYellowBright(`${this.#containers['members'].id} :: ${this.database.id} :: ${this.#core.resource.id}`) )) return this } /* public functions */ diff --git a/inc/js/mylife-dataservices.mjs b/inc/js/mylife-dataservices.mjs index 0598badb..dcca76ed 100644 --- a/inc/js/mylife-dataservices.mjs +++ b/inc/js/mylife-dataservices.mjs @@ -118,7 +118,6 @@ class Dataservices { throw new Error('`core` must be a pre-formed object with id and mbr_id') const extantCore = await this.getItem(id, undefined, mbr_id) if(extantCore){ - console.log(`core already exists for ${mbr_id} with id ${id}`) // `core` already exists return { core: extantCore, success: false, } // no alterations, failure } core = { // enforce core data structure @@ -519,10 +518,8 @@ class Dataservices { populateQuotaInfo: false, // set this to true to include quota information in the response headers }, ) - } - catch(_error){ - console.log('mylife-data-service::getItems() error') - console.log(_error, being, query, paramsArray, container_id,) + } catch(_error){ + console.log('mylife-data-service::getItems() error', _error, being, query, paramsArray, container_id,) } } /** diff --git a/inc/js/mylife-factory.mjs b/inc/js/mylife-factory.mjs index 708b3924..77e3410d 100644 --- a/inc/js/mylife-factory.mjs +++ b/inc/js/mylife-factory.mjs @@ -149,8 +149,6 @@ class BotFactory extends EventEmitter{ throw new Error('MyLife server cannot be accessed as a BotFactory alone') else if(mIsMyLife(this.mbr_id)) this.#dataservices = mDataservices - else if(directHydration) - console.log(chalk.blueBright('BotFactory class instance for hydration request'), chalk.bgRed(this.mbr_id)) } /* public functions */ /** @@ -996,8 +994,6 @@ function mExtractClassesFromSchema(_schema){ function mExtendClass(_class) { const _className = _class.name.toLowerCase() if (typeof mExtensionFunctions?.[`extendClass_${_className}`]==='function'){ - console.log(`Extension function found for ${_className}`) - // add extension decorations const _references = { openai: mLLMServices } _class = mExtensionFunctions[`extendClass_${_className}`](_class, _references) } diff --git a/inc/js/mylife-llm-services.mjs b/inc/js/mylife-llm-services.mjs index 903aa3a8..bb61ce2f 100644 --- a/inc/js/mylife-llm-services.mjs +++ b/inc/js/mylife-llm-services.mjs @@ -148,7 +148,6 @@ class LLMServices { try{ if(error.status==400){ const cancelRun = await mRunCancel(this.openai, thread_id, llm_id) - console.log('LLMServices::getLLMResponse()::cancelRun', cancelRun) if(!!cancelRun) await mAssignRequestToThread(this.openai, thread_id, prompt) else { @@ -333,8 +332,10 @@ async function mRunFinish(llmServices, run, factory, avatar){ const checkInterval = setInterval(async ()=>{ try { const functionRun = await mRunStatus(llmServices, run, factory, avatar) - if(functionRun?.status ?? functionRun ?? false){ - console.log('mRunFinish::functionRun()', functionRun.status) + const functionRunStatus = functionRun?.status + ?? functionRun + ?? false + if(functionRunStatus){ clearInterval(checkInterval) resolve(functionRun) } @@ -385,7 +386,7 @@ async function mRunFunctions(openai, run, factory, avatar){ if(typeof toolArguments==='string') toolArguments = await JSON.parse(toolArguments) ?? {} - toolArguments.thread_id = thread_id + toolArguments.thread_id = thread_id // deprecate? const { itemId, } = toolArguments switch(name.toLowerCase()){ case 'changetitle': @@ -393,26 +394,27 @@ async function mRunFunctions(openai, run, factory, avatar){ case 'change title': const { title, } = toolArguments console.log('mRunFunctions()::changeTitle::begin', itemId, title) - if(!itemId?.length || !title?.length) + if(!itemId?.length || !title?.length){ action = 'apologize for lack of clarity - member should click on the collection item (like a memory, story, etc) to make it active so I can use the `changeTitle` tool' - else { - let item = { id: itemId, title, } - await avatar.item(item, 'put') - action = `Title change successful: "${ title }"` - avatar.frontendInstruction = { - command: 'updateItemTitle', - itemId, - title, - } - success = true - avatar.backupResponse = { - message: `I was able to change the title to: "${ title }"`, - type: 'system', - } + confirmation.output = JSON.stringify({ action, success, }) + return confirmation + } + item = { id: itemId, title, } + await avatar.item(item, 'put') + avatar.frontendInstruction = { + command: 'updateItemTitle', + itemId, + title, + } + success = true + avatar.backupResponse = { + message: `I was able to change our title to: ${ title }`, + type: 'system', } - confirmation.output = JSON.stringify({ action, itemId, success, }) + console.log('mRunFunctions()::changeTitle::end', success, itemId, title.substring(0, 32)) - return confirmation + await mRunCancel(openai, thread_id, runId) + throw new Error('changeTitle successful, and aborted') case 'confirmregistration': case 'confirm_registration': case 'confirm registration': @@ -529,15 +531,28 @@ async function mRunFunctions(openai, run, factory, avatar){ } const updateSummaryResponse = await avatar.item(update, 'PUT') success = updateSummaryResponse?.success - action = success - ? `Summary update was successful` - : `Error updating ${ itemId }, halt any other processing and tell member to ensure the right memory is active and try again` - confirmation.output = JSON.stringify({ - action, - success, - }) - console.log('mRunFunctions()::updatesummary::end', success, action.substring(0, 32)) - return confirmation + if(!success || !updateSummaryResponse?.item){ + action = `Error updating ${ itemId }, halt processing to tell member to ensure the correct memory is active and then try again` + confirmation.output = JSON.stringify({ + action, + success, + }) + console.log('mRunFunctions()::updatesummary::fail', success, action.substring(0, 32)) + return confirmation + } + item = updateSummaryResponse.item + avatar.frontendInstruction = { + command: 'updateItem', + item, + itemId, + } + avatar.backupResponse = { + message: `I made the requested update to: ${ item.title }`, + type: 'system', + } + await mRunCancel(openai, thread_id, runId) + console.log('mRunFunctions()::updatesummary::end', success, runId, item.title.substring(0, 32)) + throw new Error('updateSummary successful, and aborted') default: console.log(`ERROR::mRunFunctions()::toolFunction not found: ${ name }`, toolFunction) action = `toolFunction not found: ${ name }, apologize for the error and continue on with the conversation; system notified to fix` @@ -553,10 +568,10 @@ async function mRunFunctions(openai, run, factory, avatar){ ) return finalOutput /* undefined indicates to ping again */ } - } - catch(error){ - console.log('mRunFunctions()::error::canceling-run', error.message, error.stack) - rethrow(error) + } catch(error){ + console.log('mRunFunctions()::error', error.message.substring(0, 64)) + if(error.status!==400) + throw error } } /** @@ -589,8 +604,12 @@ async function mRunStatus(openai, run, factory, avatar){ ) switch(run.status){ case 'requires_action': - const completedRun = await mRunFunctions(openai, run, factory, avatar) - return completedRun /* if undefined, will ping again */ + try { + const completedRun = await mRunFunctions(openai, run, factory, avatar) + return completedRun /* if undefined, will ping again */ + } catch(error){ + return run + } case 'completed': return run // run case 'failed': diff --git a/inc/js/session.mjs b/inc/js/session.mjs index 600f9540..d0b480d9 100644 --- a/inc/js/session.mjs +++ b/inc/js/session.mjs @@ -15,10 +15,6 @@ class MylifeMemberSession extends EventEmitter { super() this.#factory = factory this.#mbr_id = this.isMyLife ? this.factory.mbr_id : false - console.log( - chalk.bgGray('MylifeMemberSession:constructor(factory):generic-mbr_id::end'), - chalk.bgYellowBright(this.factory.mbr_id), - ) } /** * Initializes the member session. If `isMyLife`, then session requires chat thread unique to visitor; session has singleton System Avatar who maintains all running Conversations. @@ -73,7 +69,6 @@ class MylifeMemberSession extends EventEmitter { events = eventSequence } } catch (error){ - console.log(chalk.redBright('experience() error'), error, avatar.experience) const { experience } = avatar if(experience){ // embed error in experience experience.errors = experience.errors ?? [] @@ -89,10 +84,8 @@ class MylifeMemberSession extends EventEmitter { title, } this.#experienceLocked = false - if(events.find(event=>{ return event.action==='end' && event.type==='experience' })){ - if(!this.experienceEnd(experienceId)) - console.log(chalk.redBright('experienceEnd() failed')) - } + if(events.find(event=>{ return event.action==='end' && event.type==='experience' })) + this.experienceEnd(experienceId) return frontendExperience } /** @@ -152,7 +145,6 @@ class MylifeMemberSession extends EventEmitter { const _object_id = ctx.request.header?.referer?.split('/').pop() // not guid, not consent request, no blocking if(!this.globals.isValidGuid(_object_id)) return true - console.log('session.requestConsent()', 'mbr_id', this.mbr_id) // ultimately, applying a disposable agent of intelligence to consent request might be the answer let _consent = this.consents .filter(_=>{ return _.id==_object_id }) @@ -178,7 +170,6 @@ class MylifeMemberSession extends EventEmitter { _consent = (_consent_id) ? {} // retrieve from Cosmos : new (this.schemas.consent)(_request, this) // generate new consent - console.log('_consent', _consent) // manipulate session through ctx (although won't exist in initial test case) await (this.ctx.session.MemberSession.consents = _consent) // will add consent to session list return _consent @@ -191,7 +182,6 @@ class MylifeMemberSession extends EventEmitter { * @param {boolean} outcome - The challenge outcome; `true` was successful */ set challengeOutcome(outcome){ - console.log('challengeOutcome', outcome) if(outcome) this.#sessionLocked = false } diff --git a/server.js b/server.js index 7ec64aa4..3c7249c8 100644 --- a/server.js +++ b/server.js @@ -23,7 +23,6 @@ const _Maht = await MyLife // Mylife is the pre-instantiated exported version of if(!process.env.MYLIFE_HOSTING_KEY || process.env.MYLIFE_HOSTING_KEY !== _Maht.avatar.hosting_key) throw new Error('Invalid hosting key. Server will not start.') _Maht.version = version -console.log(chalk.bgBlue('created-core-entity:'), _Maht.version) const MemoryStore = new session.MemoryStore() const mimeTypesToExtensions = { /* text formats */ @@ -74,7 +73,7 @@ const mimeTypesToExtensions = { 'video/quicktime': ['.mov'], } const serverRouter = await _Maht.router -console.log(chalk.bgBlue('created-core-entity:', chalk.bgRedBright('MAHT'))) +console.log(chalk.bgBlue('created-core-entity:', chalk.bgRedBright('MAHT'), chalk.bgGreenBright(_Maht.version))) /** RESERVED: test harness **/ /** application startup **/ render(app, { @@ -124,7 +123,6 @@ app.use(koaBody({ /* @stub - create temp user sub-dir? */ file.newFilename = safeName file.filepath = path.join(uploadDir, safeName) - console.log(chalk.bgBlue('file-upload', chalk.yellowBright(file.filepath))) } }, })) @@ -184,10 +182,10 @@ app.use(koaBody({ .use(serverRouter.routes()) // enable system routes .use(serverRouter.allowedMethods()) // enable system routes .listen(port, () => { // start the server - console.log(chalk.bgGreenBright('server available')+chalk.yellow(`\nlistening on port ${port}`)) + console.log(chalk.greenBright('server available')) + console.log(chalk.yellow(`listening on port ${port}`)) }) /** server functions **/ -function checkForLiveAlerts() { - console.log("Checking for live alerts...") - _Maht.getAlerts() +function checkForLiveAlerts(){ + _Maht.getAlerts() } \ No newline at end of file diff --git a/views/assets/js/bots.mjs b/views/assets/js/bots.mjs index 277b8c0e..b4f50d5f 100644 --- a/views/assets/js/bots.mjs +++ b/views/assets/js/bots.mjs @@ -255,7 +255,6 @@ function updateItem(item){ * @param {String} title - The title to set for the item */ async function updateItemTitle(itemId, title){ - console.log('updateItemTitle', itemId, title) const titleSpan = document.getElementById(`collection-item-title_${ itemId }`) const titleInput = document.getElementById(`collection-item-title-input__${ itemId }`) const popupTitle = document.getElementById(`popup-header-title_${ itemId }`) @@ -499,7 +498,6 @@ async function mSummarize(event){ event.preventDefault() event.stopPropagation() const { dataset, } = this - console.log('mSummarize::dataset', dataset, this) if(!dataset) throw new Error(`No dataset found for summary request.`) const { fileId, fileName, type, } = dataset @@ -727,7 +725,6 @@ function mCreateCollectionPopup(collectionItem){ emoticonButton.textContent = emoticon emoticonButton.addEventListener('click', (event)=>{ event.stopPropagation() - console.log('Emoticon:write', emoticon, popupContent.readOnly, popupContent) const { lastCursorPosition, } = popupContent.dataset const insert = ` ${ emoticon }` if(lastCursorPosition){ @@ -876,10 +873,6 @@ function mCreateMemoryShadows(itemId){ shadowBox.dataset.itemId = itemId shadowBox.id = `memory-shadow_${ itemId }` shadowBox.name = 'memory-shadow' - // @stub - add mousewheel event listener to scroll through shadows - // shadowBox.addEventListener('wheel', _=>console.log('wheel', _.deltaMode)) // no scroll - /* shadow vertical carousel */ - // @stub - include vertical carousel with more visible prompts, as if on a cylinder /* single shadow text */ const { categories, id, text, type, } = shadow const shadowText = document.createElement('div') @@ -1012,7 +1005,6 @@ function mCreateTeamPopup(type, clickX=0, clickY=0, showPopup=true){ popup = memberSelect break case 'selectTeam': - console.log('Create team select popup:', mTeams, mActiveTeam) const teamSelect = document.createElement('select') teamSelect.id = `team-select` teamSelect.name = `team-select` @@ -1742,7 +1734,6 @@ function mToggleSwitchPrivacy(event){ let { id, } = this id = id.replace('-toggle', '') // remove toggle const type = mGlobals.HTMLIdToType(id) - console.log('mToggleSwitchPrivacy', type) const publicityCheckbox = document.getElementById(`${ type }-publicity-input`) const viewIcon = document.getElementById(`${ type }-publicity-toggle-view-icon`) const { checked=false, } = publicityCheckbox @@ -2009,7 +2000,6 @@ function mUpdateCollectionItemTitle(event){ let idType = id.split('_') const itemId = idType.pop() idType = idType.join('_') - console.log('mUpdateCollectionItemTitle', itemId, idType) /* create input */ const input = document.createElement('input') const inputName = `${ idType }-input` @@ -2018,7 +2008,6 @@ function mUpdateCollectionItemTitle(event){ input.type = 'text' input.value = textContent input.className = inputName - console.log('mUpdateCollectionItemTitle', input.id, inputName) /* replace span with input */ span.replaceWith(input) /* add listeners */ @@ -2164,8 +2153,7 @@ async function mUploadFiles(event){ if(!mAvailableUploaderTypes.includes(type)) throw new Error(`Uploader "${ type }" not found, upload function unavailable for this bot.`) let fileInput - try{ - console.log('mUploadFiles()::uploader', document.activeElement) + try { mCollectionsUpload.disabled = true fileInput = document.createElement('input') fileInput.id = `file-input-${ type }` @@ -2178,9 +2166,8 @@ async function mUploadFiles(event){ window.addEventListener('focus', async event=>{ await mUploadFilesInput(fileInput, uploadParent, mCollectionsUpload) }, { once: true }) - } catch(error) { + } catch(error){ mUploadFilesInputRemove(fileInput, uploadParent, mCollectionsUpload) - console.log('mUploadFiles()::ERROR uploading files:', error) } } async function mUploadFilesInput(fileInput, uploadParent, uploadButton){ @@ -2196,7 +2183,6 @@ async function mUploadFilesInput(fileInput, uploadParent, uploadButton){ const type = 'file' const itemList = document.getElementById(`collection-list-${ type }`) mUpdateCollection(type, itemList, files) - console.log('mUploadFilesInput()::files', files, uploads, type) } }, { once: true }) mUploadFilesInputRemove(fileInput, uploadParent, uploadButton) diff --git a/views/assets/js/experience.mjs b/views/assets/js/experience.mjs index 78b33139..b7a35c06 100644 --- a/views/assets/js/experience.mjs +++ b/views/assets/js/experience.mjs @@ -157,7 +157,6 @@ async function experiencePlay(memberInput){ break } /* play experience */ - console.log('experiencePlay::animationSequence', animationSequence) if(!await mAnimateEvents(animationSequence)) throw new Error("Animation sequence failed!") mExperience.currentScene = mExperience.events?.[mExperience.events.length-1]?.sceneId @@ -227,7 +226,7 @@ function submitInput(event){ if(value?.length){ const memberInput = { [inputVariableName ?? variable ?? 'input']: value } experiencePlay(memberInput) - .catch(err=> console.log('submitInput::experiencePlay independent fire ERROR', err.stack, err, memberInput)) + .catch(error=>console.log('submitInput::experiencePlay independent fire ERROR', error.message, memberInput)) } } /* private functions */ @@ -326,14 +325,11 @@ async function mAnimateEvents(animationSequence){ const { action, dismissable, elementId, halt, sceneId, type, } = animationEvent /* special case: end-scene/act stage animation */ if(action==='end'){ - console.log('mAnimateEvents::end', action, type, sceneId,) await waitForUserAction() if(type==='experience'){ /* close show */ - console.log('experienceEnd', animationEvent) experienceEnd() return true } else { /* scene */ - console.log('sceneEnd', animationEvent) mMainstagePrepared = false // @todo - check for backdrop differences here experiencePlay() return true @@ -341,7 +337,6 @@ async function mAnimateEvents(animationSequence){ } const element = document.getElementById(elementId) if(!element){ - console.log('experiencePlay::ERROR::element not found', elementId) continue } try { @@ -350,7 +345,6 @@ async function mAnimateEvents(animationSequence){ || animationEvent.action==='disappear' && !element.classList.contains('show') ) continue - console.log('experiencePlay::animationEvent', animationEvent, element) if( ['interface', 'chat'].includes(mBackdrop) && type==='character' diff --git a/views/assets/js/globals.mjs b/views/assets/js/globals.mjs index edcab5f0..cf5112d7 100644 --- a/views/assets/js/globals.mjs +++ b/views/assets/js/globals.mjs @@ -677,7 +677,6 @@ class Globals { endMemory(itemId) return case 'error': - console.log('enactInstruction::error', instruction, functions) return case 'removeBot': // retireBot in Avatar return @@ -815,7 +814,6 @@ class Globals { */ removeDisappearingElements(){ const dynamicInputs = document.getElementsByClassName('input-disappear') - console.log('mRemoveDynamicInputs', dynamicInputs) Array.from(dynamicInputs) .forEach(inputElement=>this.retract(inputElement)) } @@ -1239,7 +1237,6 @@ async function mSubmitHelp(event){ try{ response = await mSubmitHelpToServer(value, type) } catch(error){ - console.log('mSubmitHelp()::error', error) mHelpErrorText.innerHTML = `There was an error submitting your help request.
${error.message}` mHelpErrorClose.addEventListener('click', ()=>mHide(mHelpError), { once: true }) response = { diff --git a/views/assets/js/members.mjs b/views/assets/js/members.mjs index 36a88c2c..254e8b39 100644 --- a/views/assets/js/members.mjs +++ b/views/assets/js/members.mjs @@ -272,7 +272,6 @@ function replaceElement(element, newType, retainValue=true, onEvent, listenerFun element.parentNode.replaceChild(newElement, element) return newElement } catch(error){ - console.log('replaceElement::Error()', error) return element } } @@ -928,8 +927,6 @@ function mToggleItemPopup(event){ event.stopPropagation() event.preventDefault() const { itemId, } = event.target.dataset - if(!itemId) - console.log('mToggleItemPopup::Error()::`itemId` is required', event.target.dataset, itemId) togglePopup(itemId, true) } function mToggleSubmitButtonState() {