MCPcopy Create free account
hub / github.com/dailydotdev/apps / resolve

Function resolve

packages/shared/src/features/interests/monitorItems.ts:97–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 !!agent.lastRunFindings && !!agent.lastRunAt && now - ran < freshMs;
96
97 const resolve = (): AgentMonitorState => {
98 // Checked before the run status: its setup runs are not hunting runs.
99 if (agent.status === UserInterestStatus.Onboarding) {
100 return 'onboarding';
101 }
102
103 if (
104 agent.lastRunStatus === InterestRunStatus.Queued ||
105 agent.lastRunStatus === InterestRunStatus.Running
106 ) {
107 return 'running';
108 }
109
110 if (agent.status === UserInterestStatus.Stopped) {
111 return 'stopped';
112 }
113
114 if (agent.status !== UserInterestStatus.Active) {
115 return 'paused';
116 }
117
118 if (agent.lastRunStatus === InterestRunStatus.Failed) {
119 return 'failed';
120 }
121
122 if (!agent.lastRunAt) {
123 return 'starting';
124 }
125
126 return isFresh ? 'waiting' : 'watching';
127 };
128
129 const state = resolve();
130

Callers 15

sendToClientFunction · 0.85
startDevFunction · 0.85
runCheckFunction · 0.85
runCreateFunction · 0.85
runDevFunction · 0.85
createDeferredFunction · 0.85
pauseMsFunction · 0.85
tickFunction · 0.85
eventListenerFunction · 0.85
cropImageFileFunction · 0.85
blobToBase64Function · 0.85

Calls

no outgoing calls

Tested by 1

createDeferredFunction · 0.68